rivet-design 0.14.17 → 0.14.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,422 @@
1
+ var SO=Object.defineProperty;var XS=t=>{throw TypeError(t)};var EO=(t,e,n)=>e in t?SO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Do=(t,e,n)=>EO(t,typeof e!="symbol"?e+"":e,n),dv=(t,e,n)=>e.has(t)||XS("Cannot "+n);var z=(t,e,n)=>(dv(t,e,"read from private field"),n?n.call(t):e.get(t)),He=(t,e,n)=>e.has(t)?XS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ke=(t,e,n,r)=>(dv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),lt=(t,e,n)=>(dv(t,e,"access private method"),n);var zh=(t,e,n,r)=>({set _(s){ke(t,e,s,n)},get _(){return z(t,e,r)}});function CO(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Jm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fv={exports:{}},Zu={},hv={exports:{}},it={};/**
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 QS;function kO(){if(QS)return it;QS=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(j){return j===null||typeof j!="object"?null:(j=p&&j[p]||j["@@iterator"],typeof j=="function"?j:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function w(j,Y,ne){this.props=j,this.context=Y,this.refs=y,this.updater=ne||_}w.prototype.isReactComponent={},w.prototype.setState=function(j,Y){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,Y,"setState")},w.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function S(){}S.prototype=w.prototype;function T(j,Y,ne){this.props=j,this.context=Y,this.refs=y,this.updater=ne||_}var P=T.prototype=new S;P.constructor=T,x(P,w.prototype),P.isPureReactComponent=!0;var k=Array.isArray,A=Object.prototype.hasOwnProperty,O={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function R(j,Y,ne){var ie,J={},ce=null,we=null;if(Y!=null)for(ie in Y.ref!==void 0&&(we=Y.ref),Y.key!==void 0&&(ce=""+Y.key),Y)A.call(Y,ie)&&!L.hasOwnProperty(ie)&&(J[ie]=Y[ie]);var oe=arguments.length-2;if(oe===1)J.children=ne;else if(1<oe){for(var le=Array(oe),Fe=0;Fe<oe;Fe++)le[Fe]=arguments[Fe+2];J.children=le}if(j&&j.defaultProps)for(ie in oe=j.defaultProps,oe)J[ie]===void 0&&(J[ie]=oe[ie]);return{$$typeof:t,type:j,key:ce,ref:we,props:J,_owner:O.current}}function M(j,Y){return{$$typeof:t,type:j.type,key:Y,ref:j.ref,props:j.props,_owner:j._owner}}function N(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function D(j){var Y={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ne){return Y[ne]})}var F=/\/+/g;function q(j,Y){return typeof j=="object"&&j!==null&&j.key!=null?D(""+j.key):Y.toString(36)}function X(j,Y,ne,ie,J){var ce=typeof j;(ce==="undefined"||ce==="boolean")&&(j=null);var we=!1;if(j===null)we=!0;else switch(ce){case"string":case"number":we=!0;break;case"object":switch(j.$$typeof){case t:case e:we=!0}}if(we)return we=j,J=J(we),j=ie===""?"."+q(we,0):ie,k(J)?(ne="",j!=null&&(ne=j.replace(F,"$&/")+"/"),X(J,Y,ne,"",function(Fe){return Fe})):J!=null&&(N(J)&&(J=M(J,ne+(!J.key||we&&we.key===J.key?"":(""+J.key).replace(F,"$&/")+"/")+j)),Y.push(J)),1;if(we=0,ie=ie===""?".":ie+":",k(j))for(var oe=0;oe<j.length;oe++){ce=j[oe];var le=ie+q(ce,oe);we+=X(ce,Y,ne,le,J)}else if(le=m(j),typeof le=="function")for(j=le.call(j),oe=0;!(ce=j.next()).done;)ce=ce.value,le=ie+q(ce,oe++),we+=X(ce,Y,ne,le,J);else if(ce==="object")throw Y=String(j),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return we}function W(j,Y,ne){if(j==null)return j;var ie=[],J=0;return X(j,ie,"","",function(ce){return Y.call(ne,ce,J++)}),ie}function G(j){if(j._status===-1){var Y=j._result;Y=Y(),Y.then(function(ne){(j._status===0||j._status===-1)&&(j._status=1,j._result=ne)},function(ne){(j._status===0||j._status===-1)&&(j._status=2,j._result=ne)}),j._status===-1&&(j._status=0,j._result=Y)}if(j._status===1)return j._result.default;throw j._result}var K={current:null},$={transition:null},te={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:$,ReactCurrentOwner:O};function H(){throw Error("act(...) is not supported in production builds of React.")}return it.Children={map:W,forEach:function(j,Y,ne){W(j,function(){Y.apply(this,arguments)},ne)},count:function(j){var Y=0;return W(j,function(){Y++}),Y},toArray:function(j){return W(j,function(Y){return Y})||[]},only:function(j){if(!N(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},it.Component=w,it.Fragment=n,it.Profiler=s,it.PureComponent=T,it.StrictMode=r,it.Suspense=u,it.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,it.act=H,it.cloneElement=function(j,Y,ne){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var ie=x({},j.props),J=j.key,ce=j.ref,we=j._owner;if(Y!=null){if(Y.ref!==void 0&&(ce=Y.ref,we=O.current),Y.key!==void 0&&(J=""+Y.key),j.type&&j.type.defaultProps)var oe=j.type.defaultProps;for(le in Y)A.call(Y,le)&&!L.hasOwnProperty(le)&&(ie[le]=Y[le]===void 0&&oe!==void 0?oe[le]:Y[le])}var le=arguments.length-2;if(le===1)ie.children=ne;else if(1<le){oe=Array(le);for(var Fe=0;Fe<le;Fe++)oe[Fe]=arguments[Fe+2];ie.children=oe}return{$$typeof:t,type:j.type,key:J,ref:ce,props:ie,_owner:we}},it.createContext=function(j){return j={$$typeof:a,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:i,_context:j},j.Consumer=j},it.createElement=R,it.createFactory=function(j){var Y=R.bind(null,j);return Y.type=j,Y},it.createRef=function(){return{current:null}},it.forwardRef=function(j){return{$$typeof:c,render:j}},it.isValidElement=N,it.lazy=function(j){return{$$typeof:h,_payload:{_status:-1,_result:j},_init:G}},it.memo=function(j,Y){return{$$typeof:f,type:j,compare:Y===void 0?null:Y}},it.startTransition=function(j){var Y=$.transition;$.transition={};try{j()}finally{$.transition=Y}},it.unstable_act=H,it.useCallback=function(j,Y){return K.current.useCallback(j,Y)},it.useContext=function(j){return K.current.useContext(j)},it.useDebugValue=function(){},it.useDeferredValue=function(j){return K.current.useDeferredValue(j)},it.useEffect=function(j,Y){return K.current.useEffect(j,Y)},it.useId=function(){return K.current.useId()},it.useImperativeHandle=function(j,Y,ne){return K.current.useImperativeHandle(j,Y,ne)},it.useInsertionEffect=function(j,Y){return K.current.useInsertionEffect(j,Y)},it.useLayoutEffect=function(j,Y){return K.current.useLayoutEffect(j,Y)},it.useMemo=function(j,Y){return K.current.useMemo(j,Y)},it.useReducer=function(j,Y,ne){return K.current.useReducer(j,Y,ne)},it.useRef=function(j){return K.current.useRef(j)},it.useState=function(j){return K.current.useState(j)},it.useSyncExternalStore=function(j,Y,ne){return K.current.useSyncExternalStore(j,Y,ne)},it.useTransition=function(){return K.current.useTransition()},it.version="18.3.1",it}var JS;function h2(){return JS||(JS=1,hv.exports=kO()),hv.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var eE;function PO(){if(eE)return Zu;eE=1;var t=h2(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(c,u,f){var h,p={},m=null,_=null;f!==void 0&&(m=""+f),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(_=u.ref);for(h in u)r.call(u,h)&&!i.hasOwnProperty(h)&&(p[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)p[h]===void 0&&(p[h]=u[h]);return{$$typeof:e,type:c,key:m,ref:_,props:p,_owner:s.current}}return Zu.Fragment=n,Zu.jsx=a,Zu.jsxs=a,Zu}var tE;function TO(){return tE||(tE=1,fv.exports=PO()),fv.exports}var E=TO(),v=h2();const ve=Jm(v),xf=CO({__proto__:null,default:ve},[v]);var wf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ll,$o,Nc,P8,RO=(P8=class extends wf{constructor(){super();He(this,ll);He(this,$o);He(this,Nc);ke(this,Nc,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){z(this,$o)||this.setEventListener(z(this,Nc))}onUnsubscribe(){var e;this.hasListeners()||((e=z(this,$o))==null||e.call(this),ke(this,$o,void 0))}setEventListener(e){var n;ke(this,Nc,e),(n=z(this,$o))==null||n.call(this),ke(this,$o,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){z(this,ll)!==e&&(ke(this,ll,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof z(this,ll)=="boolean"?z(this,ll):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ll=new WeakMap,$o=new WeakMap,Nc=new WeakMap,P8),p2=new RO,AO={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ho,f2,T8,IO=(T8=class{constructor(){He(this,Ho,AO);He(this,f2,!1)}setTimeoutProvider(t){ke(this,Ho,t)}setTimeout(t,e){return z(this,Ho).setTimeout(t,e)}clearTimeout(t){z(this,Ho).clearTimeout(t)}setInterval(t,e){return z(this,Ho).setInterval(t,e)}clearInterval(t){z(this,Ho).clearInterval(t)}},Ho=new WeakMap,f2=new WeakMap,T8),rl=new IO;function MO(t){setTimeout(t,0)}var OO=typeof window>"u"||"Deno"in globalThis;function Er(){}function LO(t,e){return typeof t=="function"?t(e):t}function B1(t){return typeof t=="number"&&t>=0&&t!==1/0}function j8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Jo(t,e){return typeof t=="function"?t(e):t}function Wr(t,e){return typeof t=="function"?t(e):t}function nE(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:c}=t;if(a){if(r){if(e.queryHash!==m2(a,e.options))return!1}else if(!Zc(e.queryKey,a))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||s&&s!==e.state.fetchStatus||i&&!i(e))}function rE(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Dd(e.options.mutationKey)!==Dd(i))return!1}else if(!Zc(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function m2(t,e){return((e==null?void 0:e.queryKeyHashFn)||Dd)(t)}function Dd(t){return JSON.stringify(t,(e,n)=>G1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Zc(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){for(let r=0;r<e.length;r++)if(!Zc(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Zc(t[r],e[r]))return!1;return!0}return!1}var NO=Object.prototype.hasOwnProperty;function F8(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=sE(t)&&sE(e);if(!r&&!(G1(t)&&G1(e)))return e;const i=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),c=a.length,u=r?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=r?h:a[h],m=t[p],_=e[p];if(m===_){u[p]=m,(r?h<i:NO.call(t,p))&&f++;continue}if(m===null||_===null||typeof m!="object"||typeof _!="object"){u[p]=_;continue}const x=F8(m,_,n+1);u[p]=x,x===m&&f++}return i===c&&f===i?t:u}function 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 sE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function G1(t){if(!iE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!iE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function iE(t){return Object.prototype.toString.call(t)==="[object Object]"}function DO(t){return new Promise(e=>{rl.setTimeout(e,t)})}function K1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?F8(t,e):e}function jO(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function FO(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var g2=Symbol();function V8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===g2?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function $8(t,e){return typeof t=="function"?t(...e):!!t}function VO(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}var jd=(()=>{let t=()=>OO;return{isServer(){return t()},setIsServer(e){t=e}}})();function Z1(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var $O=MO;function HO(){let t=[],e=0,n=c=>{c()},r=c=>{c()},s=$O;const i=c=>{e?t.push(c):s(()=>{n(c)})},a=()=>{const c=t;t=[],c.length&&s(()=>{r(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;e++;try{u=c()}finally{e--,e||a()}return u},batchCalls:c=>(...u)=>{i(()=>{c(...u)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{s=c}}}var Vn=HO(),Dc,zo,jc,R8,zO=(R8=class extends wf{constructor(){super();He(this,Dc,!0);He(this,zo);He(this,jc);ke(this,jc,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(){z(this,zo)||this.setEventListener(z(this,jc))}onUnsubscribe(){var e;this.hasListeners()||((e=z(this,zo))==null||e.call(this),ke(this,zo,void 0))}setEventListener(e){var n;ke(this,jc,e),(n=z(this,zo))==null||n.call(this),ke(this,zo,e(this.setOnline.bind(this)))}setOnline(e){z(this,Dc)!==e&&(ke(this,Dc,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return z(this,Dc)}},Dc=new WeakMap,zo=new WeakMap,jc=new WeakMap,R8),Qp=new zO;function UO(t){return Math.min(1e3*2**t,3e4)}function H8(t){return(t??"online")==="online"?Qp.isOnline():!0}var q1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function z8(t){let e=!1,n=0,r;const s=Z1(),i=()=>s.status!=="pending",a=y=>{var w;if(!i()){const S=new q1(y);m(S),(w=t.onCancel)==null||w.call(t,S)}},c=()=>{e=!0},u=()=>{e=!1},f=()=>p2.isFocused()&&(t.networkMode==="always"||Qp.isOnline())&&t.canRun(),h=()=>H8(t.networkMode)&&t.canRun(),p=y=>{i()||(r==null||r(),s.resolve(y))},m=y=>{i()||(r==null||r(),s.reject(y))},_=()=>new Promise(y=>{var w;r=S=>{(i()||f())&&y(S)},(w=t.onPause)==null||w.call(t)}).then(()=>{var y;r=void 0,i()||(y=t.onContinue)==null||y.call(t)}),x=()=>{if(i())return;let y;const w=n===0?t.initialPromise:void 0;try{y=w??t.fn()}catch(S){y=Promise.reject(S)}Promise.resolve(y).then(p).catch(S=>{var O;if(i())return;const T=t.retry??(jd.isServer()?0:3),P=t.retryDelay??UO,k=typeof P=="function"?P(n,S):P,A=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,S);if(e||!A){m(S);return}n++,(O=t.onFail)==null||O.call(t,n,S),DO(k).then(()=>f()?void 0:_()).then(()=>{e?m(S):x()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:c,continueRetry:u,canStart:h,start:()=>(h()?x():_().then(x),s)}}var cl,A8,U8=(A8=class{constructor(){He(this,cl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),B1(this.gcTime)&&ke(this,cl,rl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(jd.isServer()?1/0:300*1e3))}clearGcTimeout(){z(this,cl)!==void 0&&(rl.clearTimeout(z(this,cl)),ke(this,cl,void 0))}},cl=new WeakMap,A8);function BO(t){return{onFetch:(e,n)=>{var h,p,m,_,x;const r=e.options,s=(m=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((_=e.state.data)==null?void 0:_.pages)||[],a=((x=e.state.data)==null?void 0:x.pageParams)||[];let c={pages:[],pageParams:[]},u=0;const f=async()=>{let y=!1;const w=P=>{VO(P,()=>e.signal,()=>y=!0)},S=V8(e.options,e.fetchOptions),T=async(P,k,A)=>{if(y)return Promise.reject(e.signal.reason);if(k==null&&P.pages.length)return Promise.resolve(P);const L=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:k,direction:A?"backward":"forward",meta:e.options.meta};return w(D),D})(),R=await S(L),{maxPages:M}=e.options,N=A?FO:jO;return{pages:N(P.pages,R,M),pageParams:N(P.pageParams,k,M)}};if(s&&i.length){const P=s==="backward",k=P?WO:oE,A={pages:i,pageParams:a},O=k(r,A);c=await T(A,O,P)}else{const P=t??i.length;do{const k=u===0?a[0]??r.initialPageParam:oE(r,c);if(u>0&&k==null)break;c=await T(c,k),u++}while(u<P)}return c};e.options.persister?e.fetchFn=()=>{var y,w;return(w=(y=e.options).persister)==null?void 0:w.call(y,f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=f}}}function oE(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 WO(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 Fc,ul,Vc,ms,dl,kn,mf,fl,Ur,B8,$i,I8,GO=(I8=class extends U8{constructor(e){super();He(this,Ur);He(this,Fc);He(this,ul);He(this,Vc);He(this,ms);He(this,dl);He(this,kn);He(this,mf);He(this,fl);ke(this,fl,!1),ke(this,mf,e.defaultOptions),this.setOptions(e.options),this.observers=[],ke(this,dl,e.client),ke(this,ms,z(this,dl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ke(this,ul,lE(this.options)),this.state=e.state??z(this,ul),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return z(this,Fc)}get promise(){var e;return(e=z(this,kn))==null?void 0:e.promise}setOptions(e){if(this.options={...z(this,mf),...e},e!=null&&e._type&&ke(this,Fc,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=lE(this.options);n.data!==void 0&&(this.setState(aE(n.data,n.dataUpdatedAt)),ke(this,ul,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,ms).remove(this)}setData(e,n){const r=K1(this.state.data,e,this.options);return lt(this,Ur,$i).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){lt(this,Ur,$i).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=z(this,kn))==null?void 0:r.promise;return(s=z(this,kn))==null||s.cancel(e),n?n.then(Er).catch(Er):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return z(this,ul)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Wr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===g2||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Jo(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!j8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=z(this,kn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=z(this,kn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),z(this,ms).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(z(this,kn)&&(z(this,fl)||lt(this,Ur,B8).call(this)?z(this,kn).cancel({revert:!0}):z(this,kn).cancelRetry()),this.scheduleGc()),z(this,ms).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||lt(this,Ur,$i).call(this,{type:"invalidate"})}async fetch(e,n){var f,h,p,m,_,x,y,w,S,T,P;if(this.state.fetchStatus!=="idle"&&((f=z(this,kn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(z(this,kn))return z(this,kn).continueRetry(),z(this,kn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const k=this.observers.find(A=>A.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(ke(this,fl,!0),r.signal)})},i=()=>{const k=V8(this.options,n),O=(()=>{const L={client:z(this,dl),queryKey:this.queryKey,meta:this.meta};return s(L),L})();return ke(this,fl,!1),this.options.persister?this.options.persister(k,O,this):k(O)},c=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:z(this,dl),state:this.state,fetchFn:i};return s(k),k})(),u=z(this,Fc)==="infinite"?BO(this.options.pages):this.options.behavior;u==null||u.onFetch(c,this),ke(this,Vc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=c.fetchOptions)==null?void 0:h.meta))&&lt(this,Ur,$i).call(this,{type:"fetch",meta:(p=c.fetchOptions)==null?void 0:p.meta}),ke(this,kn,z8({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:k=>{k instanceof q1&&k.revert&&this.setState({...z(this,Vc),fetchStatus:"idle"}),r.abort()},onFail:(k,A)=>{lt(this,Ur,$i).call(this,{type:"failed",failureCount:k,error:A})},onPause:()=>{lt(this,Ur,$i).call(this,{type:"pause"})},onContinue:()=>{lt(this,Ur,$i).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const k=await z(this,kn).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(_=(m=z(this,ms).config).onSuccess)==null||_.call(m,k,this),(y=(x=z(this,ms).config).onSettled)==null||y.call(x,k,this.state.error,this),k}catch(k){if(k instanceof q1){if(k.silent)return z(this,kn).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw lt(this,Ur,$i).call(this,{type:"error",error:k}),(S=(w=z(this,ms).config).onError)==null||S.call(w,k,this),(P=(T=z(this,ms).config).onSettled)==null||P.call(T,this.state.data,k,this),k}finally{this.scheduleGc()}}},Fc=new WeakMap,ul=new WeakMap,Vc=new WeakMap,ms=new WeakMap,dl=new WeakMap,kn=new WeakMap,mf=new WeakMap,fl=new WeakMap,Ur=new WeakSet,B8=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},$i=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...W8(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...aE(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ke(this,Vc,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),Vn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),z(this,ms).notify({query:this,type:"updated",action:e})})},I8);function W8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:H8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function aE(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function lE(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var wr,ct,gf,sr,hl,$c,qi,Uo,vf,Hc,zc,pl,ml,Bo,Uc,vt,dd,Y1,X1,Q1,J1,ey,ty,ny,G8,M8,KO=(M8=class extends wf{constructor(e,n){super();He(this,vt);He(this,wr);He(this,ct);He(this,gf);He(this,sr);He(this,hl);He(this,$c);He(this,qi);He(this,Uo);He(this,vf);He(this,Hc);He(this,zc);He(this,pl);He(this,ml);He(this,Bo);He(this,Uc,new Set);this.options=n,ke(this,wr,e),ke(this,Uo,null),ke(this,qi,Z1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,ct).addObserver(this),cE(z(this,ct),this.options)?lt(this,vt,dd).call(this):this.updateResult(),lt(this,vt,J1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ry(z(this,ct),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ry(z(this,ct),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,lt(this,vt,ey).call(this),lt(this,vt,ty).call(this),z(this,ct).removeObserver(this)}setOptions(e){const n=this.options,r=z(this,ct);if(this.options=z(this,wr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wr(this.options.enabled,z(this,ct))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");lt(this,vt,ny).call(this),z(this,ct).setOptions(this.options),n._defaulted&&!W1(this.options,n)&&z(this,wr).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,ct),observer:this});const s=this.hasListeners();s&&uE(z(this,ct),r,this.options,n)&&lt(this,vt,dd).call(this),this.updateResult(),s&&(z(this,ct)!==r||Wr(this.options.enabled,z(this,ct))!==Wr(n.enabled,z(this,ct))||Jo(this.options.staleTime,z(this,ct))!==Jo(n.staleTime,z(this,ct)))&&lt(this,vt,Y1).call(this);const i=lt(this,vt,X1).call(this);s&&(z(this,ct)!==r||Wr(this.options.enabled,z(this,ct))!==Wr(n.enabled,z(this,ct))||i!==z(this,Bo))&&lt(this,vt,Q1).call(this,i)}getOptimisticResult(e){const n=z(this,wr).getQueryCache().build(z(this,wr),e),r=this.createResult(n,e);return qO(this,r)&&(ke(this,sr,r),ke(this,$c,this.options),ke(this,hl,z(this,ct).state)),r}getCurrentResult(){return z(this,sr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&z(this,qi).status==="pending"&&z(this,qi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){z(this,Uc).add(e)}getCurrentQuery(){return z(this,ct)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=z(this,wr).defaultQueryOptions(e),r=z(this,wr).getQueryCache().build(z(this,wr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return lt(this,vt,dd).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,sr)))}createResult(e,n){var M;const r=z(this,ct),s=this.options,i=z(this,sr),a=z(this,hl),c=z(this,$c),f=e!==r?e.state:z(this,gf),{state:h}=e;let p={...h},m=!1,_;if(n._optimisticResults){const N=this.hasListeners(),D=!N&&cE(e,n),F=N&&uE(e,r,n,s);(D||F)&&(p={...p,...W8(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:y,status:w}=p;_=p.data;let S=!1;if(n.placeholderData!==void 0&&_===void 0&&w==="pending"){let N;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(N=i.data,S=!0):N=typeof n.placeholderData=="function"?n.placeholderData((M=z(this,zc))==null?void 0:M.state.data,z(this,zc)):n.placeholderData,N!==void 0&&(w="success",_=K1(i==null?void 0:i.data,N,n),m=!0)}if(n.select&&_!==void 0&&!S)if(i&&_===(a==null?void 0:a.data)&&n.select===z(this,vf))_=z(this,Hc);else try{ke(this,vf,n.select),_=n.select(_),_=K1(i==null?void 0:i.data,_,n),ke(this,Hc,_),ke(this,Uo,null)}catch(N){ke(this,Uo,N)}z(this,Uo)&&(x=z(this,Uo),_=z(this,Hc),y=Date.now(),w="error");const T=p.fetchStatus==="fetching",P=w==="pending",k=w==="error",A=P&&T,O=_!==void 0,R={status:w,fetchStatus:p.fetchStatus,isPending:P,isSuccess:w==="success",isError:k,isInitialLoading:A,isLoading:A,data:_,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:y,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:T,isRefetching:T&&!P,isLoadingError:k&&!O,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:k&&O,isStale:v2(e,n),refetch:this.refetch,promise:z(this,qi),isEnabled:Wr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const N=R.data!==void 0,D=R.status==="error"&&!N,F=W=>{D?W.reject(R.error):N&&W.resolve(R.data)},q=()=>{const W=ke(this,qi,R.promise=Z1());F(W)},X=z(this,qi);switch(X.status){case"pending":e.queryHash===r.queryHash&&F(X);break;case"fulfilled":(D||R.data!==X.value)&&q();break;case"rejected":(!D||R.error!==X.reason)&&q();break}}return R}updateResult(){const e=z(this,sr),n=this.createResult(z(this,ct),this.options);if(ke(this,hl,z(this,ct).state),ke(this,$c,this.options),z(this,hl).data!==void 0&&ke(this,zc,z(this,ct)),W1(n,e))return;ke(this,sr,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!z(this,Uc).size)return!0;const a=new Set(i??z(this,Uc));return this.options.throwOnError&&a.add("error"),Object.keys(z(this,sr)).some(c=>{const u=c;return z(this,sr)[u]!==e[u]&&a.has(u)})};lt(this,vt,G8).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&lt(this,vt,J1).call(this)}},wr=new WeakMap,ct=new WeakMap,gf=new WeakMap,sr=new WeakMap,hl=new WeakMap,$c=new WeakMap,qi=new WeakMap,Uo=new WeakMap,vf=new WeakMap,Hc=new WeakMap,zc=new WeakMap,pl=new WeakMap,ml=new WeakMap,Bo=new WeakMap,Uc=new WeakMap,vt=new WeakSet,dd=function(e){lt(this,vt,ny).call(this);let n=z(this,ct).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Er)),n},Y1=function(){lt(this,vt,ey).call(this);const e=Jo(this.options.staleTime,z(this,ct));if(jd.isServer()||z(this,sr).isStale||!B1(e))return;const r=j8(z(this,sr).dataUpdatedAt,e)+1;ke(this,pl,rl.setTimeout(()=>{z(this,sr).isStale||this.updateResult()},r))},X1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,ct)):this.options.refetchInterval)??!1},Q1=function(e){lt(this,vt,ty).call(this),ke(this,Bo,e),!(jd.isServer()||Wr(this.options.enabled,z(this,ct))===!1||!B1(z(this,Bo))||z(this,Bo)===0)&&ke(this,ml,rl.setInterval(()=>{(this.options.refetchIntervalInBackground||p2.isFocused())&&lt(this,vt,dd).call(this)},z(this,Bo)))},J1=function(){lt(this,vt,Y1).call(this),lt(this,vt,Q1).call(this,lt(this,vt,X1).call(this))},ey=function(){z(this,pl)!==void 0&&(rl.clearTimeout(z(this,pl)),ke(this,pl,void 0))},ty=function(){z(this,ml)!==void 0&&(rl.clearInterval(z(this,ml)),ke(this,ml,void 0))},ny=function(){const e=z(this,wr).getQueryCache().build(z(this,wr),this.options);if(e===z(this,ct))return;const n=z(this,ct);ke(this,ct,e),ke(this,gf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},G8=function(e){Vn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(z(this,sr))}),z(this,wr).getQueryCache().notify({query:z(this,ct),type:"observerResultsUpdated"})})},M8);function ZO(t,e){return Wr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Wr(e.retryOnMount,t)===!1)}function cE(t,e){return ZO(t,e)||t.state.data!==void 0&&ry(t,e,e.refetchOnMount)}function ry(t,e,n){if(Wr(e.enabled,t)!==!1&&Jo(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&v2(t,e)}return!1}function uE(t,e,n,r){return(t!==e||Wr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&v2(t,n)}function v2(t,e){return Wr(e.enabled,t)!==!1&&t.isStaleByTime(Jo(e.staleTime,t))}function qO(t,e){return!W1(t.getCurrentResult(),e)}var yf,oi,Xn,gl,ai,Fo,O8,YO=(O8=class extends U8{constructor(e){super();He(this,ai);He(this,yf);He(this,oi);He(this,Xn);He(this,gl);ke(this,yf,e.client),this.mutationId=e.mutationId,ke(this,Xn,e.mutationCache),ke(this,oi,[]),this.state=e.state||XO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){z(this,oi).includes(e)||(z(this,oi).push(e),this.clearGcTimeout(),z(this,Xn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ke(this,oi,z(this,oi).filter(n=>n!==e)),this.scheduleGc(),z(this,Xn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){z(this,oi).length||(this.state.status==="pending"?this.scheduleGc():z(this,Xn).remove(this))}continue(){var e;return((e=z(this,gl))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,c,u,f,h,p,m,_,x,y,w,S,T,P,k,A,O,L;const n=()=>{lt(this,ai,Fo).call(this,{type:"continue"})},r={client:z(this,yf),meta:this.options.meta,mutationKey:this.options.mutationKey};ke(this,gl,z8({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,M)=>{lt(this,ai,Fo).call(this,{type:"failed",failureCount:R,error:M})},onPause:()=>{lt(this,ai,Fo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,Xn).canRun(this)}));const s=this.state.status==="pending",i=!z(this,gl).canStart();try{if(s)n();else{lt(this,ai,Fo).call(this,{type:"pending",variables:e,isPaused:i}),z(this,Xn).config.onMutate&&await z(this,Xn).config.onMutate(e,this,r);const M=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,e,r));M!==this.state.context&&lt(this,ai,Fo).call(this,{type:"pending",context:M,variables:e,isPaused:i})}const R=await z(this,gl).start();return await((f=(u=z(this,Xn).config).onSuccess)==null?void 0:f.call(u,R,e,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,R,e,this.state.context,r)),await((_=(m=z(this,Xn).config).onSettled)==null?void 0:_.call(m,R,null,this.state.variables,this.state.context,this,r)),await((y=(x=this.options).onSettled)==null?void 0:y.call(x,R,null,e,this.state.context,r)),lt(this,ai,Fo).call(this,{type:"success",data:R}),R}catch(R){try{await((S=(w=z(this,Xn).config).onError)==null?void 0:S.call(w,R,e,this.state.context,this,r))}catch(M){Promise.reject(M)}try{await((P=(T=this.options).onError)==null?void 0:P.call(T,R,e,this.state.context,r))}catch(M){Promise.reject(M)}try{await((A=(k=z(this,Xn).config).onSettled)==null?void 0:A.call(k,void 0,R,this.state.variables,this.state.context,this,r))}catch(M){Promise.reject(M)}try{await((L=(O=this.options).onSettled)==null?void 0:L.call(O,void 0,R,e,this.state.context,r))}catch(M){Promise.reject(M)}throw lt(this,ai,Fo).call(this,{type:"error",error:R}),R}finally{z(this,Xn).runNext(this)}}},yf=new WeakMap,oi=new WeakMap,Xn=new WeakMap,gl=new WeakMap,ai=new WeakSet,Fo=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),Vn.batch(()=>{z(this,oi).forEach(r=>{r.onMutationUpdate(e)}),z(this,Xn).notify({mutation:this,type:"updated",action:e})})},O8);function XO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yi,$s,_f,L8,QO=(L8=class extends wf{constructor(e={}){super();He(this,Yi);He(this,$s);He(this,_f);this.config=e,ke(this,Yi,new Set),ke(this,$s,new Map),ke(this,_f,0)}build(e,n,r){const s=new YO({client:e,mutationCache:this,mutationId:++zh(this,_f)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){z(this,Yi).add(e);const n=Uh(e);if(typeof n=="string"){const r=z(this,$s).get(n);r?r.push(e):z(this,$s).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(z(this,Yi).delete(e)){const n=Uh(e);if(typeof n=="string"){const r=z(this,$s).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&z(this,$s).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Uh(e);if(typeof n=="string"){const r=z(this,$s).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=Uh(e);if(typeof n=="string"){const s=(r=z(this,$s).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vn.batch(()=>{z(this,Yi).forEach(e=>{this.notify({type:"removed",mutation:e})}),z(this,Yi).clear(),z(this,$s).clear()})}getAll(){return Array.from(z(this,Yi))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>rE(n,r))}findAll(e={}){return this.getAll().filter(n=>rE(e,n))}notify(e){Vn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Vn.batch(()=>Promise.all(e.map(n=>n.continue().catch(Er))))}},Yi=new WeakMap,$s=new WeakMap,_f=new WeakMap,L8);function Uh(t){var e;return(e=t.options.scope)==null?void 0:e.id}var li,N8,JO=(N8=class extends wf{constructor(e={}){super();He(this,li);this.config=e,ke(this,li,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??m2(s,n);let a=this.get(i);return a||(a=new GO({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){z(this,li).has(e.queryHash)||(z(this,li).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=z(this,li).get(e.queryHash);n&&(e.destroy(),n===e&&z(this,li).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Vn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return z(this,li).get(e)}getAll(){return[...z(this,li).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>nE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>nE(e,r)):n}notify(e){Vn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Vn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Vn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},li=new WeakMap,N8),Qt,Wo,Go,Bc,Wc,Ko,Gc,Kc,D8,eL=(D8=class{constructor(t={}){He(this,Qt);He(this,Wo);He(this,Go);He(this,Bc);He(this,Wc);He(this,Ko);He(this,Gc);He(this,Kc);ke(this,Qt,t.queryCache||new JO),ke(this,Wo,t.mutationCache||new QO),ke(this,Go,t.defaultOptions||{}),ke(this,Bc,new Map),ke(this,Wc,new Map),ke(this,Ko,0)}mount(){zh(this,Ko)._++,z(this,Ko)===1&&(ke(this,Gc,p2.subscribe(async t=>{t&&(await this.resumePausedMutations(),z(this,Qt).onFocus())})),ke(this,Kc,Qp.subscribe(async t=>{t&&(await this.resumePausedMutations(),z(this,Qt).onOnline())})))}unmount(){var t,e;zh(this,Ko)._--,z(this,Ko)===0&&((t=z(this,Gc))==null||t.call(this),ke(this,Gc,void 0),(e=z(this,Kc))==null||e.call(this),ke(this,Kc,void 0))}isFetching(t){return z(this,Qt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return z(this,Wo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=z(this,Qt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=z(this,Qt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Jo(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return z(this,Qt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=z(this,Qt).get(r.queryHash),i=s==null?void 0:s.state.data,a=LO(e,i);if(a!==void 0)return z(this,Qt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Vn.batch(()=>z(this,Qt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=z(this,Qt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=z(this,Qt);Vn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=z(this,Qt);return Vn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Vn.batch(()=>z(this,Qt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Er).catch(Er)}invalidateQueries(t,e={}){return Vn.batch(()=>(z(this,Qt).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=Vn.batch(()=>z(this,Qt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Er)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Er)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=z(this,Qt).build(this,e);return n.isStaleByTime(Jo(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Er).catch(Er)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Er).catch(Er)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Qp.isOnline()?z(this,Wo).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,Qt)}getMutationCache(){return z(this,Wo)}getDefaultOptions(){return z(this,Go)}setDefaultOptions(t){ke(this,Go,t)}setQueryDefaults(t,e){z(this,Bc).set(Dd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...z(this,Bc).values()],n={};return e.forEach(r=>{Zc(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){z(this,Wc).set(Dd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...z(this,Wc).values()],n={};return e.forEach(r=>{Zc(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...z(this,Go).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=m2(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===g2&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...z(this,Go).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){z(this,Qt).clear(),z(this,Wo).clear()}},Qt=new WeakMap,Wo=new WeakMap,Go=new WeakMap,Bc=new WeakMap,Wc=new WeakMap,Ko=new WeakMap,Gc=new WeakMap,Kc=new WeakMap,D8),K8=v.createContext(void 0),Z8=t=>{const e=v.useContext(K8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},tL=({client:t,children:e})=>(v.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),E.jsx(K8.Provider,{value:t,children:e})),q8=v.createContext(!1),nL=()=>v.useContext(q8);q8.Provider;function rL(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var sL=v.createContext(rL()),iL=()=>v.useContext(sL),oL=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?$8(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},aL=t=>{v.useEffect(()=>{t.clearReset()},[t])},lL=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||$8(n,[t.error,r])),cL=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))}},uL=(t,e)=>t.isLoading&&t.isFetching&&!e,dL=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,dE=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function fL(t,e,n){var _,x,y,w;const r=nL(),s=iL(),i=Z8(),a=i.defaultQueryOptions(t);(x=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||x.call(_,a);const c=i.getQueryCache().get(a.queryHash),u=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":u?"optimistic":void 0,cL(a),oL(a,s,c),aL(s);const f=!i.getQueryCache().get(a.queryHash),[h]=v.useState(()=>new e(i,a)),p=h.getOptimisticResult(a),m=!r&&u;if(v.useSyncExternalStore(v.useCallback(S=>{const T=m?h.subscribe(Vn.batchCalls(S)):Er;return h.updateResult(),T},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),v.useEffect(()=>{h.setOptions(a)},[a,h]),dL(a,p))throw dE(a,h,s);if(lL({result:p,errorResetBoundary:s,throwOnError:a.throwOnError,query:c,suspense:a.suspense}))throw p.error;if((w=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||w.call(y,a,p),a.experimental_prefetchInRender&&!jd.isServer()&&uL(p,r)){const S=f?dE(a,h,s):c==null?void 0:c.promise;S==null||S.catch(Er).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?p:h.trackResult(p)}function sy(t,e){return fL(t,KO)}var re=typeof window<"u"?window:void 0,Jn=typeof globalThis<"u"?globalThis:re,or=Jn==null?void 0:Jn.navigator,be=Jn==null?void 0:Jn.document,rn=Jn==null?void 0:Jn.location,y2=Jn==null?void 0:Jn.fetch,iy=Jn!=null&&Jn.XMLHttpRequest&&"withCredentials"in new Jn.XMLHttpRequest?Jn.XMLHttpRequest:void 0,fE=Jn==null?void 0:Jn.AbortController,hL=Jn==null?void 0:Jn.CompressionStream,br=or==null?void 0:or.userAgent;function Y8(){return!(!re||re.navigator.onLine===!1)}var qu=typeof globalThis<"u"?globalThis:re;qu&&typeof self>"u"&&(qu.self=qu),qu&&typeof File>"u"&&(qu.File=function(){});var Ve=re??{},gt={DEBUG:!1,LIB_VERSION:"0.2.5",LIB_NAME:"browser-common"};function hE(t,e,n,r,s,i,a){try{var c=t[i](a),u=c.value}catch(f){return void n(f)}c.done?e(u):Promise.resolve(u).then(r,s)}function en(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(u){hE(i,r,s,a,c,"next",u)}function c(u){hE(i,r,s,a,c,"throw",u)}a(void 0)}))}}function ue(){return ue=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ue.apply(null,arguments)}function X8(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var pE=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function mE(t){return typeof t=="string"||t}function gE(t){return typeof t=="string"?t:void 0}var Yu,pL=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Bi=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),vE=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),mL=["$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"],gL=["token"],Q8="NativeGzipValidationError",oy=t=>t.length>=2&&t[0]===31&&t[1]===139,yE=(t,e)=>t===vE.GZipJS||e===vE.GZipJS||e==="gzip",_E=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Bh=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Q8,e},vL=(function(){var t=en((function*(e,n){18>e.size&&Bh("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());oy(r)&&r[2]===8||Bh("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var c=(()=>{if(Yu)return Yu;Yu=[];for(var h=0;256>h;h++){for(var p=h,m=0;8>m;m++)p=1&p?3988292384^p>>>1:p>>>1;Yu[h]=p>>>0}return Yu})(),u=4294967295,f=0;a.length>f;f++)u=c[255&(u^a[f])]^u>>>8;return(4294967295^u)>>>0})(n)&&Bh("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Bh("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function ay(){return ay=en((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),i=s.writable.getWriter(),a=i.write(r).then((()=>i.close())).catch((function(){var f=en((function*(h){try{yield i.abort(h)}catch{}throw h}));return function(h){return f.apply(this,arguments)}})()),c=new Response(s.readable).blob(),u=(yield Promise.all([c,a]))[0];return yield vL(u,r),u}catch(f){if(n!=null&&n.rethrow)throw f;return e&&console.error("Failed to gzip compress data",f),null}})),ay.apply(this,arguments)}var yL=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],xE=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return yL.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Ge(t,e){return t.indexOf(e)!==-1}var e0=function(t){return t.trim()},ly=function(t){return t.replace(/^\$/,"")};function J8(t){var e,n=[];return(e=JSON.stringify(t,(function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}})))!==null&&e!==void 0?e:"null"}var e6=Object.prototype,t6=e6.hasOwnProperty,t0=e6.toString,Xe=Array.isArray||function(t){return t0.call(t)==="[object Array]"},Hs=t=>typeof t=="function",Lt=t=>t===Object(t)&&!Xe(t),Zo=t=>{if(Lt(t)){for(var e in t)if(t6.call(t,e))return!1;return!0}return!1},ge=t=>t===void 0,xt=t=>t0.call(t)=="[object String]",cy=t=>xt(t)&&t.trim().length===0,ur=t=>t===null,Je=t=>ge(t)||ur(t),Hn=t=>t0.call(t)=="[object Number]"&&t==t,Hi=t=>Hn(t)&&t>0,zs=t=>t0.call(t)==="[object Boolean]",_L=t=>t instanceof FormData,xL=t=>Ge(mL,t),wL=t=>Ge(gL,t);function n6(t){return t===null||typeof t!="object"}function Jp(t,e){return{}.toString.call(t)==="[object "+e+"]"}function _2(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var bL=[!0,"true",1,"1","yes"],pv=t=>Ge(bL,t),SL=[!1,"false",0,"0","no"];function fi(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Hn(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),fi(s||n,e,n,r))}class EL{constructor(e){this.$e={},this.ze=e.ze,this.Ze=fi(e.bucketSize,0,100,e.Ge),this.Qe=fi(e.refillRate,0,this.Ze,e.Ge),this.Je=fi(e.refillInterval,0,864e5,e.Ge)}Ke(e,n){var r=Math.floor((n-e.lastAccess)/this.Je);r>0&&(e.tokens=Math.min(e.tokens+r*this.Qe,this.Ze),e.lastAccess=e.lastAccess+r*this.Je)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.$e[s];return i?this.Ke(i,r):this.$e[s]=i={tokens:this.Ze,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.ze)==null||n.call(this,e)),i.tokens===0)}stop(){this.$e={}}}var Xr="Mobile",em="iOS",no="Android",qc="Tablet",r6=no+" "+qc,s6="iPad",i6="Apple",o6=i6+" Watch",xd="Safari",Yc="BlackBerry",a6="Samsung",l6=a6+"Browser",c6=a6+" Internet",vl="Chrome",CL=vl+" OS",u6=vl+" "+em,x2="Internet Explorer",d6=x2+" "+Xr,w2="Opera",kL=w2+" Mini",b2="Edge",f6="Microsoft "+b2,Cc="Firefox",h6=Cc+" "+em,Fd="Nintendo",Vd="PlayStation",kc="Xbox",p6=no+" "+Xr,m6=Xr+" "+xd,fd="Windows",uy=fd+" Phone",wE="Nokia",dy="Ouya",g6="Generic",PL=g6+" "+Xr.toLowerCase(),v6=g6+" "+qc.toLowerCase(),fy="Konqueror",y6="Oculus Browser",tm="Vivaldi",_6="Yandex",nm="Whale",hy="DuckDuckGo",x6="Pale Moon",rm="Waterfox",wd="Brave",w6="Google Search App",$t="(\\d+(\\.\\d+)?)",mv=new RegExp("Version/"+$t),TL=new RegExp(kc,"i"),RL=new RegExp(Vd+" \\w+","i"),AL=new RegExp(Fd+" \\w+","i"),S2=new RegExp(Yc+"|PlayBook|BB10","i"),IL={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},b6=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?wd:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Ge(t,"GSA/")?w6:Ge(t," OPR/")&&Ge(t,"Mini")?kL:Ge(t," OPR/")?w2:S2.test(t)?Yc:Ge(t,"IE"+Xr)||Ge(t,"WPDesktop")?d6:Ge(t,"OculusBrowser")?y6:Ge(t,l6)?c6:Ge(t,b2)||Ge(t,"Edg/")?f6:Ge(t,tm+"/")?tm:Ge(t,"YaBrowser/")?_6:Ge(t,nm+"/")?nm:Ge(t,hy+"/")||Ge(t,"Ddg/")?hy:Ge(t,"FBIOS")?"Facebook "+Xr:Ge(t,"UCWEB")||Ge(t,"UCBrowser")?"UC Browser":Ge(t,"CriOS")?u6:Ge(t,"CrMo")||Ge(t,vl)?vl:Ge(t,no)&&Ge(t,xd)?p6:Ge(t,"FxiOS")?h6:Ge(t.toLowerCase(),fy.toLowerCase())?fy:Ge(t,wd+"/")?wd:((i,a)=>a&&Ge(a,i6)||(function(c){return Ge(c,xd)&&!Ge(c,vl)&&!Ge(c,no)})(i))(t,e)?Ge(t,Xr)?m6:xd:Ge(t,"PaleMoon/")?x6:Ge(t,rm+"/")?rm:Ge(t,Cc)?Cc:Ge(t,"MSIE")||Ge(t,"Trident/")?x2:Ge(t,"Gecko")?Cc:"")},ML={[d6]:[new RegExp("rv:"+$t)],[f6]:[new RegExp(b2+"?\\/"+$t)],[vl]:[new RegExp("("+vl+"|CrMo)\\/"+$t)],[u6]:[new RegExp("CriOS\\/"+$t)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+$t)],[xd]:[mv],[m6]:[mv],[w2]:[new RegExp("(Opera|OPR)\\/"+$t)],[Cc]:[new RegExp(Cc+"\\/"+$t)],[h6]:[new RegExp("FxiOS\\/"+$t)],[fy]:[new RegExp("Konqueror[:/]?"+$t,"i")],[Yc]:[new RegExp(Yc+" "+$t),mv],[p6]:[new RegExp("android\\s"+$t,"i")],[c6]:[new RegExp(l6+"\\/"+$t)],[y6]:[new RegExp("OculusBrowser\\/"+$t)],[tm]:[new RegExp(tm+"\\/"+$t)],[_6]:[new RegExp("YaBrowser\\/"+$t)],[nm]:[new RegExp(nm+"\\/"+$t)],[wd]:[new RegExp(wd+"\\/"+$t)],[hy]:[new RegExp("(DuckDuckGo|Ddg)\\/"+$t)],[x6]:[new RegExp("PaleMoon\\/"+$t)],[rm]:[new RegExp(rm+"\\/"+$t)],[w6]:[new RegExp("GSA\\/"+$t)],[x2]:[new RegExp("(rv:|MSIE )"+$t)],Mozilla:[new RegExp("rv:"+$t)]},OL=function(t,e,n,r){var s=b6(t,e,n,r),i=ML[s];if(ge(i))return null;for(var a=0;i.length>a;a++){var c=t.match(i[a]);if(c)return parseFloat(c[c.length-2])}return null},bE=[[new RegExp(kc+"; "+kc+" (.*?)[);]","i"),t=>[kc,t&&t[1]||""]],[new RegExp(Fd,"i"),[Fd,""]],[new RegExp(Vd,"i"),[Vd,""]],[S2,[Yc,""]],[new RegExp(fd,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[uy,""];if(new RegExp(Xr).test(e)&&!/IEMobile\b/.test(e))return[fd+" "+Xr,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=IL[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[fd,r]}return[fd,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[em,[t[3],t[4],t[5]||"0"].join(".")]:[em,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ge(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+no+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+no+")","i"),t=>t&&t[2]?[no,[t[2],t[3],t[4]||"0"].join(".")]:[no,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[CL,""]],[/Linux|debian/i,["Linux",""]]],SE=function(t){return AL.test(t)?Fd:RL.test(t)?Vd:TL.test(t)?kc:new RegExp(dy,"i").test(t)?dy:new RegExp("("+uy+"|WPDesktop)","i").test(t)?uy:/iPad/.test(t)?s6:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?o6:S2.test(t)?Yc:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(wE,"i").test(t)?wE:/(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(Xr).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)?no:r6:new RegExp("(pda|"+Xr+")","i").test(t)?PL:new RegExp(qc,"i").test(t)&&!new RegExp(qc+" pc","i").test(t)?v6:""},LL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function EE(t,e){return typeof(n=t)=="string"&&LL.test(n)?t:e();var n}function sa(t){return t&&t.split("#")[0]}function Sp(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}var NL=t=>t instanceof Error,S6={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},DL=S6.info;function E6(t){if(zs(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(Xe(t))return{arrayValue:{values:t.map((e=>E6(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function sm(t){var e=[];for(var n in t){var r=t[n];ur(r)||ge(r)||e.push({key:n,value:E6(r)})}return e}function jL(t,e){var n=S6[t.level||"info"]||DL,r=n.text,s=n.number,i=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Je(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Je(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var c=ue({},a,t.attributes||{}),u={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:sm(c)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),ge(t.trace_flags)||(u.flags=t.trace_flags),u}function C6(t,e,n){return ue({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function k6(t,e,n,r){return{resourceLogs:[{resource:{attributes:sm(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let FL=class{constructor(t,e,n,r,s,i,a){var c;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.Te=e,this.Ge=n,this.Ye=r,this.Xe=s,this.et=i,this.tt=a,this.rt=null,this.it=0,this.nt=0,this.st=0,this.ot=0,this.ut=!1,this.ht=e.maxBufferSize,this.dt=Math.max((c=e.maxQueueSize)!==null&&c!==void 0?c:e.maxBufferSize,e.maxBufferSize),this.ct=e.flushIntervalMs,this.vt=e.maxBatchRecordsPerPost,this.ft=e.rateCapWindowMs,this.yt=e.maxLogsPerInterval}reset(){this.bt(),this.rt=null,this.st=0,this.ot=0,this.ut=!1,this.it=0,this.nt=0,this.vt=this.Te.maxBatchRecordsPerPost}onReconnect(){this.nt=0,this._t()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.wt(t);if(e!==null)if(e.body){if(this.xt()){var n={record:jL(e,this.Ye())};this.Xe((()=>this.kt(n)))}}else this.Ge.info("Log was rejected in beforeSend function")}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var n=Xe(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ge.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.Ge.error("Error in beforeSend function for log:",a),null}return r}xt(){if(this.yt===void 0)return!0;var t=Date.now(),e=t-this.st;return this.ft>e&&e>=0||(this.st=t,this.ot=0,this.ut=!1),this.yt>this.ot?(this.ot++,!0):(this.ut||(this.Ge.warn("captureLog dropping logs: exceeded "+this.yt+" logs per "+this.ft+"ms"),this.ut=!0),!1)}flush(){var t=this;return en((function*(){if(!t._instance.isDisabled)return t.rt||(t.rt=t.St().finally((()=>{t.rt=null}))),t.rt}))()}St(){var t=this;return en((function*(){var e;t.bt();var n=(e=t._instance.getPersistedProperty(Bi.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var r=n.length,s=0;n.length>0&&r>s;){var i,a;t.it=0;var c=Math.min(n.length,t.vt),u=n.slice(0,c),f=k6(u.map((p=>p.record)),t.Ct(),(i=t.tt)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.Mt(f);if(h.kind==="too-large"&&u.length>1)t.vt=Math.max(1,Math.floor(u.length/2)),t.Ge.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.vt);else if(h.kind==="retry-later"||(h.kind==="too-large"?t.Ge.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Te.maxBatchRecordsPerPost>t.vt&&(t.vt=Math.min(t.Te.maxBatchRecordsPerPost,t.vt+1)),yield t.It(u.length),n=(a=t._instance.getPersistedProperty(Bi.LogsQueue))!==null&&a!==void 0?a:[],s+=u.length,h.kind==="fatal"))throw h.error}}))()}It(t){var e=this;return en((function*(){var n,r=Math.max(0,t-e.it),s=(n=e._instance.getPersistedProperty(Bi.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Bi.LogsQueue,s.slice(r)),yield e.et()}))()}Ct(){return C6(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}kt(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Bi.LogsQueue))!==null&&e!==void 0?e:[];this.dt>n.length||(n.shift(),this.it++,this.Ge.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Bi.LogsQueue,n),this.ht>n.length?this.Tt():this._t()}}Tt(t){t===void 0&&(t=this.ct),this.Et||(this.Et=Sp((()=>{this.Et=void 0,this._t()}),t))}Rt(){var t=Math.min(Math.max(0,this.nt-1),6);return this.ct*Math.pow(2,t)}Pt(){var t=this._instance.getPersistedProperty(Bi.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return en((function*(){e.bt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((r=>Sp(r,t)))]):yield n}))()}flushWithTimeout(t){var e=this;return en((function*(){var n=!1,r=e.flush(),s=new Promise((i=>Sp((()=>{n=!0,i()}),t)));try{yield Promise.race([r,s])}finally{n&&r.catch((()=>{}))}}))()}_t(){this.flush().then((()=>{this.nt=0}),(t=>{this.nt++,this.Ge.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.Pt()&&this.Tt(this.Rt())}))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}};var gv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function CE(t){return String(t)+"000000"}function kE(t,e,n,r){var s="";return r&&(s=Object.keys(r).sort().map((i=>JSON.stringify(i)+":"+JSON.stringify(r[i]))).join(",")),t+"\0"+e+"\0"+(n??"")+"\0"+s}let VL=class{constructor(t,e,n){this._instance=t,this.Te=e,this.Ge=n,this.Ot=new Map,this.rt=null,this.Ft=!1,this.At=new Map,this.$t=new Set,this.Lt=0}count(t,e,n){e===void 0&&(e=1),this.Nt({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Nt({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Nt({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this,e=this.rt,n=(function(){var s=en((function*(){e&&(yield e.catch((()=>{}))),yield t.Dt()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.rt===r&&(this.rt=null)}));return this.rt=r,r}drainWindow(){if(this.Ot.size===0)return null;var t=this.Ot;return this.Ot=new Map,this.Ft=!1,this.At=new Map,this.$t=new Set,this.qt(t)}reset(){this.Lt++,this.bt(),this.Ot=new Map,this.rt=null,this.Ft=!1,this.At=new Map,this.$t=new Set}Nt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.wt(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.Ge.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?ue({},e.attributes):void 0,r=kE(e.type,e.name,e.unit,n)}catch(a){return void this.Ge.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var s=this.Ot.get(r);if(!s){if(!this.jt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Ot.set(r,s)}var i=this.At.get(e.name);i===void 0?this.At.set(e.name,e.type):i===e.type||this.$t.has(e.name)||(this.$t.add(e.name),this.Ge.warn("Metric name '"+e.name+"' is already used as a "+i+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Ht(s,e.value),this.Tt()}else this.Ge.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.Ge.warn("Dropping metric with empty name")}}jt(){return this.Te.maxSeriesPerFlush>this.Ot.size||(this.Ft||(this.Ft=!0,this.Ge.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ht(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(gv.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(var a=0;i.length>a;a++)if(i[a]>=s)return a;return i.length})(e,gv)]+=1}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var n=Xe(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ge.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.Ge.error("Error in beforeSend function for metric:",a),null}return r}Tt(){this.Et||(this.Et=Sp((()=>{this.Et=void 0,this.flush().catch((t=>{this.Ge.error("Metrics flush failed:",t)}))}),this.Te.flushIntervalMs))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}Dt(){var t=this;return en((function*(){if(t.Ot.size!==0){var e=t.Ot;t.Ot=new Map,t.Ft=!1,t.At=new Map,t.$t=new Set;var n=t.Lt,r=yield t._instance.Bt(t.qt(e));if(n===t.Lt)switch(r.kind){case"ok":return;case"retry-later":return t.Ut(e),void t.Tt();case"too-large":return void t.Ge.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.Ge.error("Failed to send metrics batch:",r.error)}}}))()}qt(t){return e=this.zt(t),n=(function(i,a,c){return ue({},i.resourceAttributes,{"service.name":i.serviceName||"unknown_service"},i.environment&&{"deployment.environment":i.environment},i.serviceVersion&&{"service.version":i.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":c})})(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:sm(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}zt(t){var e=CE(Date.now()),n=new Map;for(var r of t.values()){var s,i=kE(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=ue({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,a));var c=sm((s=r.attributes)!==null&&s!==void 0?s:{}),u=CE(r.windowStartMs);if(r.type==="count"){var f,h={attributes:c,startTimeUnixNano:u,timeUnixNano:e,asDouble:(f=r.total)!==null&&f!==void 0?f:0};a.sum.dataPoints.push(h)}else if(r.type==="gauge"){var p,m={attributes:c,timeUnixNano:e,asDouble:(p=r.last)!==null&&p!==void 0?p:0};a.gauge.dataPoints.push(m)}else r.hist&&a.histogram.dataPoints.push({attributes:c,startTimeUnixNano:u,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:gv})}return Array.from(n.values())}Ut(t){var e,n;for(var r of t){var s=r[0],i=r[1],a=this.Ot.get(s);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,i.windowStartMs),a.type){case"count":a.total=((e=a.total)!==null&&e!==void 0?e:0)+((n=i.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(i.hist)if(a.hist){a.hist.count+=i.hist.count,a.hist.sum+=i.hist.sum,a.hist.min=Math.min(a.hist.min,i.hist.min),a.hist.max=Math.max(a.hist.max,i.hist.max);for(var c=0;a.hist.bucketCounts.length>c;c++)a.hist.bucketCounts[c]+=i.hist.bucketCounts[c]}else a.hist=i.hist}else this.jt()&&this.Ot.set(s,i)}}};var Wh,PE,vv;function $L(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return vv&&n.length===PE||(PE=n.length,vv=n.reduce(((r,s)=>{Wh||(Wh={});var i=Wh[s];if(i)r[i[0]]=i[1];else for(var a=t(s),c=a.length-1;c>=0;c--){var u=a[c],f=u==null?void 0:u.filename,h=e[s];if(f&&h){r[f]=h,Wh[s]=[f,h];break}}return r}),{})),vv}}class HL{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),i=this.buildParsingContext(n),a=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var n=this;return en((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Xe(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),ue({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return en((function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r}))()}convertToExceptionList(e,n){var r,s,i,a={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var c=[a];return e.cause!=null&&c.push(...this.convertToExceptionList(e.cause,ue({},n,{handled:!0}))),c}buildParsingContext(e){var n;return{chunkIdMap:$L(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(i,a)=>{if(4>=a){var c=this.buildCoercingContext(e,n,a);return this.applyCoercers(i,c)}};return ue({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Xc="?";function py(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?Xc:n,in_app:!0};return ge(r)||(i.lineno=r),ge(s)||(i.colno=s),i}var P6=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Xc,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},zL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,UL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,BL=/\((\S*)(?::(\d+))(?::(\d+))\)/,WL=(t,e)=>{var n=zL.exec(t);if(n)return py(e,n[1],Xc,+n[2],+n[3]);var r=UL.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=BL.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=P6(r[1]||Xc,r[2]);return py(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},GL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,KL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ZL=(t,e)=>{var n=GL.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=KL.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||Xc,a=P6(i,s);return py(e,s=a[1],i=a[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},TE=/\(error: (.*)\)/;class qL{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=xt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return Jp(e,"DOMException")}isDOMError(e){return Jp(e,"DOMError")}}class YL{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class XL{constructor(){}match(e){return Jp(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r;return n.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var QL=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class JL{match(e){return typeof e=="string"}coerce(e,n){var r,s=this.getInfos(e),i=s[0],a=s[1];return{type:i??"Error",value:a??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(QL);return s&&(n=s[1],r=s[2]),[n,r]}}var eN=["fatal","error","warning","log","info","debug"];function T6(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class tN{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s=this.getErrorPropertyFromObject(e);return s?n.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return _2(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+T6(e)}isSeverityLevel(e){return xt(e)&&!cy(e)&&eN.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(NL(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class nN{match(e){return _2(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+T6(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class rN{match(e){return n6(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class sN{match(e){return Jp(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!_2(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return n6(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var im="$message",om="$timestamp",iN=new Set([im,om]),yv={enabled:!0,max_bytes:32768};function am(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:yv.enabled,max_bytes:aN(t.max_bytes,yv.max_bytes)}:ue({},yv)}class oN{constructor(e){this.Vt=[],this.Wt=0,this.Te=am(e)}setConfig(e){this.Te=am(e),this.Zt()}add(e){var n=(function(s){var i;try{i=J8(s)}catch{return}try{var a=JSON.parse(i);if(!Lt(a))return;var c=a,u=c[im],f=c[om];return!xt(u)||u.trim().length===0||!xt(f)&&!Hn(f)?void 0:{step:c,json:i}}catch{return}})(e);if(n){var r=(function(s){if(typeof TextEncoder<"u")return new TextEncoder().encode(s).length;for(var i=encodeURIComponent(s),a=0,c=0;i.length>c;c++)i[c]==="%"?(a+=1,c+=2):a+=1;return a})(n.json);r>this.Te.max_bytes||(this.Vt.push({step:n.step,bytes:r}),this.Wt+=r,this.Zt())}}getAttachable(){return this.Vt.map((e=>e.step))}clear(){this.Vt=[],this.Wt=0}size(){return this.Vt.length}Zt(){for(;this.Wt>this.Te.max_bytes&&this.Vt.length>0;){var e=this.Vt.shift();e&&(this.Wt-=e.bytes)}}}function aN(t,e){if(!Hn(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var R6=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={k(s){if(re&&(gt.DEBUG||re.POSTHOG_DEBUG||n)&&!ge(re.console)&&re.console){for(var i=("__rrweb_original__"in re.console[s])?re.console[s].__rrweb_original__:re.console[s],a=arguments.length,c=new Array(a>1?a-1:0),u=1;a>u;u++)c[u-1]=arguments[u];i(t,...c)}},debug(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];console.error(t,...i)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>R6(t+" "+s,i)};return r},_e=R6("[PostHog.js]"),Ft=_e.createLogger,lN=Ft("[ExternalScriptsLoader]"),_v=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return lN.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=be==null?void 0:be.querySelectorAll("script");if(r){for(var s,i=function(){if(r[a].src===e){var u=r[a];return u.__posthog_loading_callback_fired?{v:n()}:(u.addEventListener("load",(f=>{u.__posthog_loading_callback_fired=!0,n(void 0,f)})),u.onerror=f=>n(f),{v:void 0})}},a=0;r.length>a;a++)if(s=i())return s.v}var c=()=>{if(!be)return n("document not found");var u=be.createElement("script");if(u.type="text/javascript",u.crossOrigin="anonymous",u.src=e,u.onload=p=>{u.__posthog_loading_callback_fired=!0,n(void 0,p)},u.onerror=p=>n(p),t.config.prepare_external_dependency_script&&(u=t.config.prepare_external_dependency_script(u)),!u)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")be.head.appendChild(u);else{var f,h=be.querySelectorAll("body > script");h.length>0?(f=h[0].parentNode)==null||f.insertBefore(u,h[0]):be.body.appendChild(u)}};be!=null&&be.body?c():be==null||be.addEventListener("DOMContentLoaded",c)};Ve.__PosthogExtensions__=Ve.__PosthogExtensions__||{},Ve.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var i=3e5;s=s+"&t="+Math.floor(Date.now()/i)*i}r=t.requestRouter.endpointFor("assets",s)}_v(t,r,n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");_v(t,a,n)}},Ve.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);_v(t,r,n)};gt.DEBUG=!1,gt.LIB_VERSION="1.409.0",gt.LIB_NAME="web";var A6="$people_distinct_id",lm="$device_id",xv="$device_model",hd="__alias",pd="__timers",my="$autocapture_disabled_server_side",gy="$heatmaps_enabled_server_side",vy="$exception_capture_enabled_server_side",yy="$error_tracking_suppression_rules",_y="$error_tracking_capture_extension_exceptions",xy="$web_vitals_enabled_server_side",E2="$dead_clicks_enabled_server_side",C2="$product_tours_enabled_server_side",wy="$web_vitals_allowed_metrics",sl="$session_recording_remote_config",I6="$replay_sample_rate",M6="$replay_override_sampling",O6="$replay_override_linked_flag",L6="$replay_override_url_trigger",N6="$replay_override_event_trigger",yc="$sesid",k2="$session_is_sampled",nl="$enabled_feature_flags",Ep="$active_feature_flags",md="$early_access_features",by="$feature_flag_details",Cp="$feature_flag_payloads",Sy="$feature_flag_request_id",cm="$minimal_flag_called_events",zi="$override_feature_flags",hc="$override_feature_flag_payloads",Xa="$stored_person_properties",Qa="$stored_group_properties",Ey="$surveys",um="$surveys_loaded_at",Cy="$surveys_activated",kp="$surveys_activated_session",gd="ph_product_tours",bd="$flag_call_reported",ky="$flag_call_reported_session_id",Py="$feature_flag_errors",$d="$feature_flag_evaluated_at",hs="$user_state",Ty="$client_session_props",Ry="$capture_rate_limit",Ay="$initial_campaign_params",Iy="$initial_referrer_info",dm="$initial_person_info",fm="$epp",Gh="$posthog_cookieless",D6="$cookieless_mode",j6="$sdk_debug_extensions_init_method",F6="$sdk_debug_extensions_init_time_ms",V6="$sdk_debug_recording_script_not_loaded",P2="PostHog loadExternalDependency extension not found.",Ja="on_reject",Xi="always",rc="anonymous",ja="identified",My="identified_only",hm="visibilitychange",pm="beforeunload",pc="$pageview",wv="$pageleave",bv="$identify",RE="$groupidentify";function Kh(t,e){Xe(t)&&t.forEach(e)}function wt(t,e){if(!Je(t))if(Xe(t))t.forEach(e);else if(_L(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)t6.call(t,n)&&e(t[n],n)}var Rt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];for(var s of n)for(var i in s)s[i]!==void 0&&(t[i]=s[i]);return t};function Pp(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var AE=function(t){try{return t()}catch{return}},cN=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){_e.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),_e.critical(s)}}},T2=function(t){var e={};return wt(t,(function(n,r){(xt(n)&&n.length>0||Hn(n))&&(e[r]=n)})),e},uN=["herokuapp.com","vercel.app","netlify.app"];function dN(t){var e=t==null?void 0:t.hostname;if(!xt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of uN)if(n===r)return!1;return!0}function Ht(t,e,n,r){var s=r??{},i=s.capture,a=s.passive;t==null||t.addEventListener(e,n,{capture:i!==void 0&&i,passive:a===void 0||a})}function $6(t){return t.name==="ph_toolbar_internal"}var H6=t=>{if(be){try{for(var e=t+"=",n=be.cookie.split(";").filter((i=>i.length)),r=0;n.length>r;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Hn(t)&&isFinite(t)&&Math.floor(t)===t});class mm{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new mm(i)}toString(){for(var e="",n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new mm(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class fN{generate(){var e=this.generateOrAbort();if(!ge(e))return e;this.S=0;var n=this.generateOrAbort();if(ge(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.M++,this.M>4398046511103&&(this.S++,this.C())}return mm.fromFieldsV7(this.S,Math.trunc(this.M/Math.pow(2,30)),this.M&Math.pow(2,30)-1,this.I.nextUint32())}C(){this.M=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}constructor(){this.S=0,this.M=0,this.I=new hN}}var IE,z6=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};re&&!ge(re.crypto)&&crypto.getRandomValues&&(z6=t=>crypto.getRandomValues(t));class hN{nextUint32(){return this.R.length>this.O||(z6(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var Ki=()=>pN().toString(),pN=()=>(IE||(IE=new fN)).generate(),Xu="",mN=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Qi={N:()=>!!be,D(t){_e.error("cookieStore error: "+t)},A:H6,F(t){var e;try{e=JSON.parse(Qi.A(t))||{}}catch{}return e},q(t,e,n,r,s){if(!be)return!1;try{var i="",a="",c=(function(h,p){if(p){var m=(function(x,y){if(y===void 0&&(y=be),Xu)return Xu;if(!y||["localhost","127.0.0.1"].includes(x))return"";for(var w=x.split("."),S=Math.min(w.length,8),T="dmn_chk_"+Ki();!Xu&&S--;){var P=w.slice(S).join("."),k=T+"=1;domain=."+P+";path=/";y.cookie=k+";max-age=3",y.cookie.includes(T)&&(y.cookie=k+";max-age=0",Xu=P)}return Xu})(h);if(!m){var _=(x=>{var y=x.match(mN);return y?y[0]:""})(h);_!==m&&_e.info("Warning: cookie subdomain discovery mismatch",_,m),m=_}return m?"; domain=."+m:""}return""})(be.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),i="; expires="+u.toUTCString()}s&&(a="; secure");var f=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+c+a;return f.length>3686.4&&_e.warn("cookieStore warning: large cookie, len="+f.length),be.cookie=f,!0}catch{return!1}},P(t,e){if(be!=null&&be.cookie)try{Qi.q(t,"",-1,e)}catch{return}}},Sv=null,St={N(){if(!ur(Sv))return Sv;var t=!0;if(ge(re))t=!1;else try{var e="__mplssupport__";St.q(e,"xyz"),St.A(e)!=='"xyz"'&&(t=!1),St.P(e)}catch{t=!1}return t||_e.error("localStorage unsupported; falling back to cookie store"),Sv=t,t},D(t){_e.error("localStorage error: "+t)},A(t){try{return re==null?void 0:re.localStorage.getItem(t)}catch(e){St.D(e)}return null},F(t){try{return JSON.parse(St.A(t))||{}}catch{}return null},q(t,e){try{return re==null||re.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){St.D(n)}return!1},P(t){try{re==null||re.localStorage.removeItem(t)}catch(e){St.D(e)}}},gN=[lm,"distinct_id",yc,k2,fm,dm,hs],Zh={},vN={N:()=>!0,D(t){_e.error("memoryStorage error: "+t)},A:t=>Zh[t]||null,F:t=>Zh[t]||null,q:(t,e)=>(Zh[t]=e,!0),P(t){delete Zh[t]}},Fa=null,Fn={N(){if(!ur(Fa))return Fa;if(Fa=!0,ge(re))Fa=!1;else try{var t="__support__";Fn.q(t,"xyz"),Fn.A(t)!=='"xyz"'&&(Fa=!1),Fn.P(t)}catch{Fa=!1}return Fa},D(t){_e.error("sessionStorage error: ",t)},A(t){try{return re==null?void 0:re.sessionStorage.getItem(t)}catch(e){Fn.D(e)}return null},F(t){try{return JSON.parse(Fn.A(t))||null}catch{}return null},q(t,e){try{return re==null||re.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Fn.D(n)}return!1},P(t){try{re==null||re.sessionStorage.removeItem(t)}catch(e){Fn.D(e)}}};class yN{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Gt()?0:this.Qt}isOptedOut(){return this.Te.cookieless_mode===Xi||this.isRejected()||this.consent===-1&&this.Te.cookieless_mode===Ja}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Jt.q(this.Kt,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Jt.P(this.Kt,this.Te.cross_subdomain_cookie)}get Kt(){var e=this._instance.config,n=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get Qt(){var e=this.Jt.A(this.Kt);return pv(e)?1:Ge(SL,e)?0:-1}get Jt(){var e=this.Te.opt_out_capturing_persistence_type,n=e==="localStorage"?St:Qi;if(!this.Yt||this.Yt!==n){this.Yt=n;var r=e==="localStorage"?Qi:St;r.A(this.Kt)&&(this.Yt.A(this.Kt)||this.optInOut(pv(r.A(this.Kt))),r.P(this.Kt,this.Te.cross_subdomain_cookie))}return this.Yt}Gt(){return!!this.Te.respect_dnt&&[or==null?void 0:or.doNotTrack,or==null?void 0:or.msDoNotTrack,Ve.doNotTrack].some((e=>pv(e)))}}function U6(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!Hs(r))return e;try{var s=r(e);return xt(s)&&s?s:e}catch(i){return _e.error("Error in get_current_url, falling back to window.location.href",i),e}}var B6="__POSTHOG_TOOLBAR__",_N=1,xN=3,wN=11;function ME(t){return t instanceof Element&&(t.id===B6||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function ia(t){return!!t&&t.nodeType===_N}function Zr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function W6(t){return!!t&&t.nodeType===xN}function G6(t){return!!t&&t.nodeType===wN&&ia(t.host)}var K6=1e3;function R2(t){return t?e0(t).split(/\s+/):[]}function OE(t,e){var n=(function(r){var s,i=re==null||(s=re.location)==null?void 0:s.href;return ge(i)?void 0:U6(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function gm(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return R2(e)}function Z6(t){return Je(t)?null:e0(t).split(/(\s+)/).filter((e=>Sd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Hd(t){var e="";return Ly(t)&&!Q6(t)&&t.childNodes&&t.childNodes.length&&wt(t.childNodes,(function(n){var r;W6(n)&&n.textContent&&(e+=(r=Z6(n.textContent))!==null&&r!==void 0?r:"")})),e0(e)}function Ev(t){var e;return ge(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var A2=["a","button","form","input","select","textarea","label"];function Oy(t,e){if(ge(e))return!0;var n,r=function(i){if(e.some((a=>(function(c,u){var f=c.matches||c.matchesSelector||c.msMatchesSelector||c.mozMatchesSelector||c.webkitMatchesSelector||c.oMatchesSelector;try{return!!f&&f.call(c,u)}catch{return!1}})(i,a))))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function q6(t){var e=t.parentNode;return!(!e||!ia(e))&&e}var bN=[".ph-no-autocapture","[data-ph-no-autocapture]"],Y6=["next","previous","prev",">","<"],SN=[...Y6,"+","-","−","–"],LE=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,NE=[".ph-no-rageclick",".ph-no-capture"],EN=["","text","search","email","password","url","tel","number"];function DE(t,e){if(!re||I2(t))return!1;var n,r,s,i,a;if(zs(e)?(n=!!e&&NE,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:NE,r=e==null?void 0:e.content_ignorelist,s=(a=e==null?void 0:e.ignore_text_selection)!==null&&a!==void 0&&a),n===!1||s&&(function(u){return!(!u||!ia(u))&&(!!Zr(u,"textarea")||(Zr(u,"input")?Ge(EN,(u.getAttribute("type")||"").toLowerCase()):(function(f){if(f.isContentEditable)return!0;var h=f.getAttribute==null?void 0:f.getAttribute("contenteditable");return h==="true"||h===""})(u)))})(t))return!1;var c=X6(t,!1).targetElementList;return!(function(u,f){if(u===!1||ge(u))return!1;var h;if(u===!0)h=Y6;else{if(!Xe(u))return!1;if(u.length>10)return _e.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;h=u.map((p=>p.toLowerCase()))}return f.some((p=>{var m=p.safeText,_=p.ariaLabel;return h.some((x=>LE(m,x)||LE(_,x)))}))})(r,c.map((u=>{var f;return{safeText:Hd(u).toLowerCase(),ariaLabel:((f=u.getAttribute("aria-label"))==null?void 0:f.toLowerCase().trim())||""}})))&&!Oy(c,n)}var I2=t=>!t||Zr(t,"html")||!ia(t),X6=(t,e)=>{if(!re||I2(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Zr(s,"body");)if(G6(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=q6(s);if(!i)break;if(e||A2.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var a=re.getComputedStyle(i);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function Ly(t){for(var e=new Set,n=0,r=t;r.parentNode&&!Zr(r,"body");r=r.parentNode){if(n++>=K6||e.has(r))return!1;e.add(r);var s=gm(r);if(Ge(s,"ph-sensitive")||Ge(s,"ph-no-capture"))return!1}if(Ge(gm(t),"ph-include"))return!0;var i=t.type||"";if(xt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!xt(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function Q6(t){return!!(Zr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Zr(t,"select")||Zr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var J6="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",CN=new RegExp("^(?:"+J6+")$"),kN=new RegExp(J6),eP="\\d{3}-?\\d{2}-?\\d{4}",PN=new RegExp("^("+eP+")$"),TN=new RegExp("("+eP+")");function Sd(t,e){return e===void 0&&(e=!0),!(Je(t)||xt(t)&&(t=e0(t),(e?CN:kN).test((t||"").replace(/[- ]/g,""))||(e?PN:TN).test(t)))}function jE(t){var e=Hd(t);return Sd(e=(e+" "+tP(t)).trim())?e:""}function tP(t){var e="";return t&&t.childNodes&&t.childNodes.length&&wt(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Hd(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+tP(n)).trim())}catch(i){_e.error("[AutoCapture]",i)}})),e}function FE(t){return t.replace(/"|\\"/g,'\\"')}function RN(t){var e=t.attr__class;if(e)return Xe(e)?e:R2(e)}var qh=Ft("[Dead Clicks]"),AN=()=>!0,IN=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(E2)),r=t.instance.config.capture_dead_clicks;return zs(r)?r:!!Lt(r)||n};class VE{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[E2]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.er((()=>{this.tr()})):this.stop()}er(e){var n,r;(n=Ve.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=Ve.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?qh.error("failed to load script",s):e()}))}tr(){var e;if(be){if(!this.Xt&&(e=Ve.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Lt(this.instance.config.capture_dead_clicks)?ue({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Xt=Ve.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Xt.start(be),qh.info("starting...")}}else qh.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,qh.info("stopping..."))}}var Cv=Ft("[SegmentIntegration]"),nP="posthog-js";function rP(t,e){var n=e===void 0?{}:e,r=n.organization,s=n.projectId,i=n.prefix,a=n.severityAllowList,c=a===void 0?["error"]:a,u=n.sendExceptionsToPostHog,f=u===void 0||u;return h=>{var p,m,_,x,y;if(c!=="*"&&!c.includes(h.level)||!t.__loaded)return h;h.tags||(h.tags={});var w=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());h.tags["PostHog Person URL"]=w,t.sessionRecordingStarted()&&(h.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S,T=((p=h.exception)==null?void 0:p.values)||[],P=T.map((A=>ue({},A,{stacktrace:A.stacktrace?ue({},A.stacktrace,{type:"raw",frames:(A.stacktrace.frames||[]).map((O=>ue({},O,{platform:"web:javascript"})))}):void 0}))),k={$exception_message:((m=T[0])==null?void 0:m.value)||h.message,$exception_type:(_=T[0])==null?void 0:_.type,$exception_level:h.level,$exception_list:P,$sentry_event_id:h.event_id,$sentry_exception:h.exception,$sentry_exception_message:((x=T[0])==null?void 0:x.value)||h.message,$sentry_exception_type:(y=T[0])==null?void 0:y.type,$sentry_tags:h.tags};return r&&s&&(k.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+h.event_id),f&&((S=t.exceptions)==null||S.sendExceptionEvent(k)),h}}class MN{constructor(e,n,r,s,i,a){this.name=nP,this.setupOnce=function(c){c(rP(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}class $E{constructor(e){this.rr=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(_e.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.rr)}destroy(){var e;(e=this.sr)==null||e.call(this),this.sr=void 0}doPageView(e,n){var r,s=this.ar(e,n);return this.ir={pathname:(r=re==null?void 0:re.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.ar(e,(n=this.ir)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ir)==null?void 0:e.pageViewId}}ar(e,n){var r=this.ir;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var a=i.maxScrollHeight,c=i.lastScrollY,u=i.maxScrollY,f=i.maxContentHeight,h=i.lastContentY,p=i.maxContentY;if(!(ge(a)||ge(c)||ge(u)||ge(f)||ge(h)||ge(p))){a=Math.ceil(a),c=Math.ceil(c),u=Math.ceil(u),f=Math.ceil(f),h=Math.ceil(h),p=Math.ceil(p);var m=a>1?fi(c/a,0,1,_e):1,_=a>1?fi(u/a,0,1,_e):1,x=f>1?fi(h/f,0,1,_e):1,y=f>1?fi(p/f,0,1,_e):1;s=Rt(s,{$prev_pageview_last_scroll:c,$prev_pageview_last_scroll_percentage:m,$prev_pageview_max_scroll:u,$prev_pageview_max_scroll_percentage:_,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:x,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:y})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var kv=["flags","surveys"],ON={[A6]:{exposure:"hidden"},[hd]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[pd]:{exposure:"hidden"},[my]:{exposure:"event"},[gy]:{exposure:"hidden"},[vy]:{exposure:"event"},[yy]:{exposure:"hidden"},[_y]:{exposure:"event"},[xy]:{exposure:"event"},[E2]:{exposure:"event"},[C2]:{exposure:"hidden"},[wy]:{exposure:"event"},[sl]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[yc]:{exposure:"hidden"},[k2]:{exposure:"event"},[I6]:{exposure:"event",shouldSkipFromEventProperties:t=>ur(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[nl]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Lt(t))return{};for(var e={},n=Object.keys(t),r=0;n.length>r;r++)e["$feature/"+n[r]]=t[n[r]];return e}},[Ep]:{exposure:"event",storageGroup:"flags"},[md]:{exposure:"hidden"},[by]:{exposure:"hidden",storageGroup:"flags"},[Cp]:{exposure:"event",storageGroup:"flags"},[Sy]:{exposure:"event",storageGroup:"flags",volatile:!0},[cm]:{exposure:"hidden",storageGroup:"flags"},[zi]:{exposure:"event"},[hc]:{exposure:"hidden"},[Xa]:{exposure:"hidden"},[Qa]:{exposure:"hidden"},[Ey]:{exposure:"hidden",storageGroup:"surveys"},[um]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Cy]:{exposure:"event"},[kp]:{exposure:"hidden"},[gd]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[bd]:{exposure:"hidden"},[ky]:{exposure:"hidden"},[Py]:{exposure:"hidden"},[$d]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[hs]:{exposure:"hidden"},[Ty]:{exposure:"hidden"},[Ry]:{exposure:"hidden"},[Ay]:{exposure:"hidden"},[Iy]:{exposure:"hidden"},[dm]:{exposure:"hidden"},[fm]:{exposure:"hidden"},[M6]:{exposure:"event"},[O6]:{exposure:"event"},[L6]:{exposure:"event"},[N6]:{exposure:"event"},[j6]:{exposure:"event"},[F6]:{exposure:"event"},[V6]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},LN=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Va=t=>{var e=ON[t];if(e)return e;for(var n of LN){var r=n[1];if(t.indexOf(n[0])===0)return r}},_c=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return J8(t)}},vm=t=>{var e=be==null?void 0:be.createElement("a");return ge(e)?null:(e.href=t,e)},Qc=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var i=r[s].split("=");if(i[0]===e){n=i;break}}if(!Xe(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{_e.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},zd=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),a=i[1],c=i[0],u=(a||"").split("&"),f=[],h=0;u.length>h;h++){var p=u[h].split("=");Xe(p)&&(e.includes(p[0])?f.push(p[0]+"="+n):f.push(u[h]))}var m=c;return a!=null&&(m+="?"+f.join("&")),s!=null&&(m+="#"+s),m},ym=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},sP=(t,e)=>t>=e&&Y8(),iP=(t,e,n,r)=>{if(t===0){if(Y8()){var s=e+1;return s===n&&r(),s}return e}return 0},Yh="https?://(.*)",Jc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],NN=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Jc],Ud="<masked>",DN=["li_fat_id"];function oP(t,e,n){if(!be)return{};var r,s=e?[...Jc,...n||[]]:[],i=aP(zd(be.URL,s,Ud),t),a=(r={},wt(DN,(function(c){var u=H6(c);r[c]=u||null})),r);return Rt(a,i)}function aP(t,e){var n=NN.concat(e||[]),r={};return wt(n,(function(s){var i=Qc(t,s);r[s]=i||null})),r}function lP(t){var e=(function(i){return i?i.search(Yh+"google.([^/?]*)")===0?"google":i.search(Yh+"bing.com")===0?"bing":i.search(Yh+"yahoo.com")===0?"yahoo":i.search(Yh+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!ur(e)){r.$search_engine=e;var s=be?Qc(be.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function HE(){return navigator.language||navigator.userLanguage}var _m="$direct";function cP(){return(be==null?void 0:be.referrer)||_m}function uP(t,e,n){n===void 0&&(n=!1);var r=t?[...Jc,...e||[]]:[],s=n?sa(rn==null?void 0:rn.href):rn==null?void 0:rn.href,i=s==null?void 0:s.substring(0,1e3);return{r:cP().substring(0,1e3),u:i?zd(i,r,Ud):void 0}}function dP(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?sa(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==_m?_m:(n=vm(r))==null?void 0:n.host};if(i){a.$current_url=i;var c=vm(i);a.$host=c==null?void 0:c.host,a.$pathname=c==null?void 0:c.pathname;var u=aP(i);Rt(a,u)}if(r){var f=lP(r);Rt(a,f)}return a}function fP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function jN(){try{return new Date().getTimezoneOffset()}catch{return}}var FN={flags:$d,surveys:um},VN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sc="main";class Pv{constructor(e,n,r){if(r===void 0&&(r=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=r,this.props={},this.cr=void 0,this.vr=(i=>{var a="";return i.token&&(a=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+a+"_posthog"})(e),this.Jt=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&_e.info("Persistence loaded",e.persistence,ue({},this.props)),this.update_config(e,e,n),this.save(),re){var s=()=>this.flush();Ht(re,"beforeunload",s,{capture:!1}),Ht(re,"pagehide",s,{capture:!1})}}mr(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Hn(n)&&n>0?n:0}isDisabled(){return!!this.yr}pr(e){VN.indexOf(e.persistence.toLowerCase())===-1&&(_e.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=(function(a,c){a===void 0&&(a=[]),c===void 0&&(c=!1);var u=[...gN,...a];return ue({},St,{F(f){try{var h={};try{h=Qi.F(f)||{}}catch{}var p,m=JSON.parse(St.A(f)||"{}");if(c){var _={};for(var x in h){var y=h[x];ur(y)||y===""||(_[x]=y)}p=Rt(m,_)}else p=Rt(h,m);return St.q(f,p),p}catch{}return null},q(f,h,p,m,_,x){var y=St.q(f,h,void 0,void 0,x);try{var w={};u.forEach((S=>{h[S]&&(w[S]=h[S])})),Object.keys(w).length&&Qi.q(f,w,p,m,_,x)}catch(S){St.D(S)}return y},P(f,h){try{re==null||re.localStorage.removeItem(f),Qi.P(f,h)}catch(p){St.D(p)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&St.N()?(n=St,s=!0):i==="localstorage+cookie"&&r.N()?(n=r,s=!0):i==="sessionstorage"&&Fn.N()?n=Fn:i==="memory"?n=vN:i==="cookie"?n=Qi:r.N()?(n=r,s=!0):n=Qi,this.ur=s,n}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var n=e??this.Te.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[$d];return!r||typeof r!="number"||Date.now()-r>n}properties(){var e={};return wt(this.props,((n,r)=>{var s=Va(r);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,r===nl?()=>this._r():()=>!1))return;s.transformToEventProperties&&Rt(e,s.transformToEventProperties(n))}else if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,(()=>!1)))return;e[r]=n}})),e}load(){if(!this.yr){var e=this.Jt.F(this.vr);e&&(this.props=Rt({},e)),this.hr&&this.wr()}}wr(){for(var e of kv){var n=St.F(this.br(e));if(n&&!Zo(n)){var r=this.kr(e);r.persisted=!0,this.Sr(e)||(r.fingerprint=this.Cr(n,e)),this.Mr(e,n)||Rt(this.props,n)}}}Sr(e){return Object.keys(this.props).some((n=>{var r;return((r=Va(n))==null?void 0:r.storageGroup)===e}))}Mr(e,n){var r=FN[e];if(!r)return!1;var s=n[r],i=this.props[r];return Hn(s)&&Hn(i)&&i>s}refreshKey(e){var n;if(!this.yr){var r=this.hr?(n=Va(e))==null?void 0:n.storageGroup:void 0,s=r?St.F(this.br(r)):this.Jt.F(this.vr);if(s&&e in s)this.Ir(e,s[e]);else{if(r){var i=this.Jt.F(this.vr);if(i&&e in i)return void this.Ir(e,i[e])}this.Tr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?ge(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),e)):this.Rr()}}flush(){ge(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Jt,this.vr,this.props,sc))}Pr(){var e=this.Fr(),n=e.main,r=e.groups;for(var s of(this.Or(this.Jt,this.vr,n,sc),kv)){var i,a=r[s];(!Zo(a)||(i=this.lr[s])!=null&&i.persisted)&&this.Or(St,this.br(s),a,s)}}Fr(){var e={},n={flags:{},surveys:{}};return wt(this.props,((r,s)=>{var i,a=(i=Va(s))==null?void 0:i.storageGroup;a?n[a][s]=r:e[s]=r})),{main:e,groups:n}}Cr(e,n){if(n===sc)return JSON.stringify(e)+"|"+this.Ar+"|"+this.$r+"|"+this.Lr;var r={};return wt(e,((s,i)=>{var a;r[i]=(a=Va(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}Or(e,n,r,s){var i=this.kr(s);if(s===sc||i.dirty||ge(i.fingerprint)){var a;try{if((a=this.Cr(r,s))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(n,r,this.Ar,this.$r,this.Lr,this.Te.debug)?(i.dirty=!1,s!==sc&&(i.persisted=!0),ge(a)||(i.fingerprint=a)):this.Te.debug&&_e.warn('failed to persist storage entry "'+n+'"; will retry on next save')}}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(ge(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Jt.P(this.vr,!1),this.Jt.P(this.vr,!0),!r&&this.dr)for(var s of kv)St.P(this.br(s));r?delete this.lr[sc]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Lt(e)){ge(n)&&(n="None"),this.Ar=ge(r)?this.Nr:r;var s=!1;if(wt(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.Ir(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(Lt(e)){this.Ar=ge(n)?this.Nr:n;var r=!1;if(wt(e,((s,i)=>{e.hasOwnProperty(i)&&this.props[i]!==s&&(this.Ir(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Tr(e),this.save())}update_campaign_params(){var e=be==null?void 0:be.URL;if(e!==this.cr){var n=oP(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Zo(T2(n))||this.register(n),this.cr=e}}update_search_keyword(){var e;this.register((e=be==null?void 0:be.referrer)?lP(e):{})}update_referrer_info(){var e;this.register_once({$referrer:cP(),$referring_domain:be!=null&&be.referrer&&((e=vm(be.referrer))==null?void 0:e.host)||_m},void 0)}set_initial_person_info(){this.props[Ay]||this.props[Iy]||this.register_once({[dm]:uP(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};wt([Iy,Ay],(s=>{var i=this.props[s];i&&wt(i,(function(a,c){e["$initial_"+ly(c)]=a}))}));var n=this.props[dm];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=dP(s,i),c={};return wt(a,(function(u,f){c["$initial_"+ly(f)]=u})),c})(n,this.Te.disable_capture_url_hashes);Rt(e,r)}return e}safe_merge(e){return wt(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){this.Nr=this.Ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==n.persistence||!((u,f)=>{if(u.length!==f.length)return!1;var h=[...u].sort(),p=[...f].sort();return h.every(((m,_)=>m===p[_]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),i=s?this.pr(e):this.Jt,a=this.gr(e);if(s||a!==this.hr){var c=this.props;this.clear(),this.Jt=i,this.hr=a,this.props=c,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Lr&&(this.Lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[pd]||{};r[e]=n,this.Ir(pd,r),this.save()}remove_event_timer(e){var n=this.props[pd]||{},r=n[e];return ge(r)||(delete n[e],this.Ir(pd,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.Ir(e,n),this.save()}Ir(e,n){var r;this.props[e]=n,(r=Va(e))!=null&&r.volatile||this.Dr(e)}Tr(e){delete this.props[e],this.Dr(e)}Dr(e){var n,r=(n=Va(e))==null?void 0:n.storageGroup;r&&(this.kr(r).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var ir={GZipJS:"gzip-js",Base64:"base64"},Qu={Activation:"events",Cancellation:"cancelEvents"},Tv={Popover:"popover",API:"api",Widget:"widget"},Ji={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Rv={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Ny={Popover:"popover",Inline:"inline"},$N={SHOWN:"product tour shown"},zE={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},UE=Ft("[RateLimiter]");class HN{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((s=>{UE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void UE.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,s;e===void 0&&(e=!1);var i=this.captureEventsBurstLimit,a=this.captureEventsPerSecond,c=new Date().getTime(),u=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Ry))!==null&&n!==void 0?n:{tokens:i,last:c};u.tokens+=(c-u.last)/1e3*a,u.last=c,u.tokens>i&&(u.tokens=i);var f=1>u.tokens;return f||e||(u.tokens=Math.max(0,u.tokens-1)),!f||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=f,(s=this.instance.persistence)==null||s.set_property(Ry,u),{isRateLimited:f,remainingTokens:u.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Ju=Ft("[RemoteConfig]");class hP{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Ve._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}qr(e){var n,r;(n=Ve.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=Ve.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}jr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){e(n.json)}})}load(){try{if(this.remoteConfig)return Ju.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void Ju.warn("Remote config is disabled. Falling back to local config.");this.qr((e=>{if(!e)return Ju.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((n=>{this.Hr(n),this.Br()}));this.Hr(e),this.Br()}))}catch(e){Ju.error("Error loading remote config",e)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&be&&be.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.zr=setInterval((()=>{this.refresh()}),n))}}Hr(e){var n;e||Ju.error("Failed to fetch remote config from PostHog."),this._instance.Hr(e?{ok:!0,config:e}:{ok:!1}),(e==null?void 0:e.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var ws=Uint8Array,kr=Uint16Array,eu=Uint32Array,M2=new ws([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]),O2=new ws([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]),BE=new ws([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pP=function(t,e){for(var n=new kr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new eu(n[30]);for(r=1;30>r;++r)for(var i=n[r];n[r+1]>i;++i)s[i]=i-n[r]<<5|r;return[n,s]},mP=pP(M2,2),Dy=mP[1];mP[0][28]=258,Dy[258]=28;for(var WE=pP(O2,0)[1],gP=new kr(32768),Dt=0;32768>Dt;++Dt){var ic=(43690&Dt)>>>1|(21845&Dt)<<1;gP[Dt]=((65280&(ic=(61680&(ic=(52428&ic)>>>2|(13107&ic)<<2))>>>4|(3855&ic)<<4))>>>8|(255&ic)<<8)>>>1}var Ed=function(t,e,n){for(var r=t.length,s=0,i=new kr(e);r>s;++s)++i[t[s]-1];var a,c=new kr(e);for(s=0;e>s;++s)c[s]=c[s-1]+i[s-1]<<1;for(a=new kr(r),s=0;r>s;++s)a[s]=gP[c[t[s]-1]++]>>>15-t[s];return a},Cl=new ws(288);for(Dt=0;144>Dt;++Dt)Cl[Dt]=8;for(Dt=144;256>Dt;++Dt)Cl[Dt]=9;for(Dt=256;280>Dt;++Dt)Cl[Dt]=7;for(Dt=280;288>Dt;++Dt)Cl[Dt]=8;var xm=new ws(32);for(Dt=0;32>Dt;++Dt)xm[Dt]=5;var zN=Ed(Cl,9),UN=Ed(xm,5),vP=function(t){return(t/8>>0)+(7&t&&1)},yP=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof kr?kr:t instanceof eu?eu:ws)(n-e);return r.set(t.subarray(e,n)),r},Oi=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},ed=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Av=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,i=n.slice();if(!s)return[new ws(0),0];if(s==1){var a=new ws(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(A,O){return A.f-O.f})),n.push({s:-1,f:25001});var c=n[0],u=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:c.f+u.f,l:c,r:u};h!=s-1;)c=n[n[p].f>n[f].f?f++:p++],u=n[f!=h&&n[p].f>n[f].f?f++:p++],n[h++]={s:-1,f:c.f+u.f,l:c,r:u};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var _=new kr(m+1),x=jy(n[h-1],_,0);if(x>e){r=0;var y=0,w=x-e,S=1<<w;for(i.sort((function(A,O){return _[O.s]-_[A.s]||A.f-O.f}));s>r;++r){var T=i[r].s;if(e>=_[T])break;y+=S-(1<<x-_[T]),_[T]=e}for(y>>>=w;y>0;){var P=i[r].s;e>_[P]?y-=1<<e-_[P]++-1:++r}for(;r>=0&&y;--r){var k=i[r].s;_[k]==e&&(--_[k],++y)}x=e}return[new ws(_),x]},jy=function(t,e,n){return t.s==-1?Math.max(jy(t.l,e,n+1),jy(t.r,e,n+1)):e[t.s]=n},GE=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new kr(++e),r=0,s=t[0],i=1,a=function(u){n[r++]=u},c=1;e>=c;++c)if(t[c]==s&&c!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(s),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(s);i=1,s=t[c]}return[n.subarray(0,r),e]},td=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},Fy=function(t,e,n){var r=n.length,s=vP(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;r>i;++i)t[s+i+4]=n[i];return 8*(s+4+r)},KE=function(t,e,n,r,s,i,a,c,u,f,h){Oi(e,h++,n),++s[256];for(var p=Av(s,15),m=p[0],_=p[1],x=Av(i,15),y=x[0],w=x[1],S=GE(m),T=S[0],P=S[1],k=GE(y),A=k[0],O=k[1],L=new kr(19),R=0;T.length>R;++R)L[31&T[R]]++;for(R=0;A.length>R;++R)L[31&A[R]]++;for(var M=Av(L,7),N=M[0],D=M[1],F=19;F>4&&!N[BE[F-1]];--F);var q,X,W,G,K=f+5<<3,$=td(s,Cl)+td(i,xm)+a,te=td(s,m)+td(i,y)+a+14+3*F+td(L,N)+(2*L[16]+3*L[17]+7*L[18]);if($>=K&&te>=K)return Fy(e,h,t.subarray(u,u+f));if(Oi(e,h,1+($>te)),h+=2,$>te){q=Ed(m,_),X=m,W=Ed(y,w),G=y;var H=Ed(N,D);for(Oi(e,h,P-257),Oi(e,h+5,O-1),Oi(e,h+10,F-4),h+=14,R=0;F>R;++R)Oi(e,h+3*R,N[BE[R]]);h+=3*F;for(var j=[T,A],Y=0;2>Y;++Y){var ne=j[Y];for(R=0;ne.length>R;++R)Oi(e,h,H[ie=31&ne[R]]),h+=N[ie],ie>15&&(Oi(e,h,ne[R]>>>5&127),h+=ne[R]>>>12)}}else q=zN,X=Cl,W=UN,G=xm;for(R=0;c>R;++R)if(r[R]>255){var ie;ed(e,h,q[257+(ie=r[R]>>>18&31)]),h+=X[ie+257],ie>7&&(Oi(e,h,r[R]>>>23&31),h+=M2[ie]);var J=31&r[R];ed(e,h,W[J]),h+=G[J],J>3&&(ed(e,h,r[R]>>>5&8191),h+=O2[J])}else ed(e,h,q[r[R]]),h+=X[r[R]];return ed(e,h,q[256]),h+X[256]},BN=new eu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),WN=(function(){for(var t=new eu(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),Iv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function GN(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(m){for(var _=p,x=0;m.length>x;++x)_=WN[255&_^m[x]]^_>>>8;p=_},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,a,c,u,f=(c=10+((s=e).filename&&s.filename.length+1||0),u=8,(function(p,m,_,x,y,w){var S=p.length,T=new ws(x+S+5*(1+Math.floor(S/7e3))+y),P=T.subarray(x,T.length-y),k=0;if(!m||8>S)for(var A=0;S>=A;A+=65535){var O=A+65535;S>O?k=Fy(P,k,p.subarray(A,O)):(P[A]=!0,k=Fy(P,k,p.subarray(A,S)))}else{for(var L=BN[m-1],R=L>>>13,M=8191&L,N=(1<<_)-1,D=new kr(32768),F=new kr(N+1),q=Math.ceil(_/3),X=2*q,W=function(At){return(p[At]^p[At+1]<<q^p[At+2]<<X)&N},G=new eu(25e3),K=new kr(288),$=new kr(32),te=0,H=0,j=(A=0,0),Y=0,ne=0;S>A;++A){var ie=W(A),J=32767&A,ce=F[ie];if(D[J]=ce,F[ie]=J,A>=Y){var we=S-A;if((te>7e3||j>24576)&&we>423){k=KE(p,P,0,G,K,$,H,j,ne,A-ne,k),j=te=H=0,ne=A;for(var oe=0;286>oe;++oe)K[oe]=0;for(oe=0;30>oe;++oe)$[oe]=0}var le=2,Fe=0,De=M,Pe=J-ce&32767;if(we>2&&ie==W(A-Pe))for(var Qe=Math.min(R,we)-1,dt=Math.min(32767,A),qt=Math.min(258,we);dt>=Pe&&--De&&J!=ce;){if(p[A+le]==p[A+le-Pe]){for(var xe=0;qt>xe&&p[A+xe]==p[A+xe-Pe];++xe);if(xe>le){if(le=xe,Fe=Pe,xe>Qe)break;var $e=Math.min(Pe,xe-2),Be=0;for(oe=0;$e>oe;++oe){var ot=A-Pe+oe+32768&32767,Pt=ot-D[ot]+32768&32767;Pt>Be&&(Be=Pt,ce=ot)}}}Pe+=(J=ce)-(ce=D[J])+32768&32767}if(Fe){G[j++]=268435456|Dy[le]<<18|WE[Fe];var tt=31&Dy[le],Ye=31&WE[Fe];H+=M2[tt]+O2[Ye],++K[257+tt],++$[Ye],Y=A+le,++te}else G[j++]=p[A],++K[p[A]]}}k=KE(p,P,!0,G,K,$,H,j,ne,A-ne,k)}return yP(T,0,x+vP(k)+y)})(i=t,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+a.mem,c,u)),h=f.length;return(function(p,m){var _=m.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>m.level?4:m.level==9?2:0,p[9]=3,m.mtime!=0&&Iv(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),_){p[3]=8;for(var x=0;_.length>=x;++x)p[x+10]=_.charCodeAt(x)}})(f,e),Iv(f,h-8,n.d()),Iv(f,h-4,r),f}var KN=!!iy||!!y2,_P="text/plain",Tp=!1,xP=(t,e)=>{var n=t.split("#"),r=n[1],s=n[0].split("?"),i=s[0],a=s[1];if(!a)return t;var c=a.split("&").filter((u=>u.split("=")[0]!==e)).join("&");return i+(c?"?"+c:"")+(r?"#"+r:"")},L2=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],a=s[1],c=ue({},e),u=(r=a==null?void 0:a.split("&").map((h=>{var p,m=h.split("="),_=m[0],x=n&&(p=c[_])!==null&&p!==void 0?p:m[1];return delete c[_],_+"="+x})))!==null&&r!==void 0?r:[],f=(function(h,p){var m,_;p===void 0&&(p="&");var x=[];return wt(h,(function(y,w){ge(y)||ge(w)||w==="undefined"||(m=encodeURIComponent((S=>S instanceof File)(y)?y.name:y.toString()),_=encodeURIComponent(w),x[x.length]=_+"="+m)})),x.join(p)})(c);return f&&u.push(f),u.length>0?i+"?"+u.join("&"):i},Mv=t=>{if(t.Vr)return t.Vr;var e=t.data,n=t.compression;if(e){if(n===ir.GZipJS){var r=GN((function(c,u){var f=c.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(c);for(var h=new ws(c.length+(c.length>>>1)),p=0,m=function(w){h[p++]=w},_=0;f>_;++_){if(p+5>h.length){var x=new ws(p+8+(f-_<<1));x.set(h),h=x}var y=c.charCodeAt(_);128>y?m(y):2048>y?(m(192|y>>>6),m(128|63&y)):y>55295&&57344>y?(m(240|(y=65536+(1047552&y)|1023&c.charCodeAt(++_))>>>18),m(128|y>>>12&63),m(128|y>>>6&63),m(128|63&y)):(m(224|y>>>12),m(128|y>>>6&63),m(128|63&y))}return yP(h,0,p)})(_c(e)),{mtime:0});return{contentType:_P,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===ir.Base64){var s=(function(c){return c&&btoa(encodeURIComponent(c).replace(/%([0-9A-F]{2})/g,((u,f)=>String.fromCharCode(parseInt(f,16)))))})(_c(e)),i=(c=>"data="+encodeURIComponent(typeof c=="string"?c:_c(c)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=_c(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},wP=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:L2(t.url,{compression:ir.Base64}),encodedBody:Mv(ue({},t,{compression:ir.Base64,Vr:void 0}))}:{url:xP(t.url,"compression"),encodedBody:Mv(ue({},t,{compression:void 0,Vr:void 0}))};try{e=Mv(t)}catch(s){if(yE(t.compression,Qc(t.url,"compression")))return _e.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&yE(t.compression,Qc(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?oy(new Uint8Array(n)):ArrayBuffer.isView(n)&&oy(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Tp=!0,r()):{url:t.url,encodedBody:e}},bP=t=>{try{return wP(t)}catch(e){return _e.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},ZN=(function(){var t=en((function*(e){var n=_c(e.data),r=yield(function(i,a,c){return ay.apply(this,arguments)})(n,gt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return ue({},e,{Vr:{contentType:_P,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),qN=/Failed to fetch|NetworkError|Load failed/i,SP=t=>{var e=bP(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},i=s.contentType,a=s.body,c=s.estimatedSize,u=new Headers;wt(t.headers,(function(x,y){u.append(y,x)})),i&&u.append("Content-Type",i);var f=null,h=!1;if(fE){var p=new fE;f={signal:p.signal,timeout:setTimeout((()=>{var x,y;h=!0,p.abort((x=t.timeout,(y=new Error("PostHog request timed out"+(x?" after "+x+"ms":""))).name="AbortError",y))}),t.timeout)}}var m=x=>{h&&(x==null?void 0:x.name)==="AbortError"||(y=>(y==null?void 0:y.name)==="TypeError"&&qN.test((y==null?void 0:y.message)||""))(x)?_e.warn(x):_e.error(x),t.callback==null||t.callback({statusCode:0,error:x})};try{var _;y2(n,ue({method:(t==null?void 0:t.method)||"GET",headers:u,keepalive:t.method==="POST"&&!t.Wr&&52428.8>(c||0),body:a,signal:(_=f)==null?void 0:_.signal},t.fetchOptions)).then((x=>x.text().then((y=>{var w={statusCode:x.status,text:y};if(x.status===200)try{w.json=JSON.parse(y)}catch(S){_e.error(S)}t.callback==null||t.callback(w)})))).catch(m).finally((()=>f?clearTimeout(f.timeout):null))}catch(x){f&&clearTimeout(f.timeout),m(x)}}},Vy=t=>{try{var e,n=wP(t),r=n.url,s=n.encodedBody,i=s??{},a=i.body,c=i.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:i.contentType});if(or.sendBeacon(r,u))return;var f=Xe(t.data)?t.data:(e=t.data)==null?void 0:e.batch;if(Xe(f)&&f.length>1&&(c??0)>16384){var h=Math.ceil(f.length/2),p=m=>Xe(t.data)?m:ue({},t.data,{batch:m});return Vy(ue({},t,{data:p(f.slice(0,h))})),void Vy(ue({},t,{data:p(f.slice(h))}))}_e.warn("Beacon of ~"+(c??0)+" bytes was rejected by the browser, falling back to fetch"),SP(ue({},t,{Wr:!0}))}catch(m){_e.warn("Beacon send failed",m)}},ZE=(t,e,n,r)=>{var s=r==="query"?e==="POST"?"sent_at":"_":void 0;return L2(n===ir.GZipJS?xP(t,"compression"):t,ue({},s?{[s]:Date.now().toString()}:{},n===ir.GZipJS?{}:{compression:n}))},Rp=[];y2&&Rp.push({transport:"fetch",method:SP}),iy&&Rp.push({transport:"XHR",method(t){var e=bP(t);if(e){var n=new iy,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,a=s.body;wt(t.headers,(function(c,u){n.setRequestHeader(u,c)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var c={statusCode:n.status,text:n.responseText};if(n.status===200)try{c.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(c)}},n.send(a)}}}),or!=null&&or.sendBeacon&&Rp.push({transport:"sendBeacon",method:Vy});var $y=3e3;class YN{constructor(e,n){this.Zr=!0,this.Gr=[],this.Qr=fi((n==null?void 0:n.flush_interval_ms)||$y,250,5e3,_e.createLogger("flush interval"),$y),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}unload(){this.Xr();var e=this.Gr.length>0?this.ei():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ti(ue({},r,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var n=this.ei(),r=function(){var i=n[s],a=new Date().getTime();i.data&&Xe(i.data)&&wt(i.data,(c=>{c.offset=Math.abs(c.timestamp-a),delete c.timestamp})),e.ti(i)};for(var s in n)r()}}),this.Qr))}ti(e){try{this.Jr(e)}catch(n){_e.error(n)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ei(){var e={};return wt(this.Gr,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;ge(e[i])&&(e[i]=ue({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.Gr=[],e}}var XN=["retriesPerformedSoFar"];class QN{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!ge(re)&&"onLine"in re.navigator&&(this.ni=re.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},Ht(re,"online",this.si),Ht(re,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=X8(e,XN);Hi(n)&&(r.url=L2(r.url,{retry_count:n})),this._instance._send_request(ue({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.kt(ue({retriesPerformedSoFar:n},r));s.statusCode===0&&_e.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}r.callback==null||r.callback(s)}}))}kt(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(a){var c=3e3*Math.pow(2,a),u=c/2,f=Math.min(18e5,c),h=Math.random()-.5;return Math.ceil(f+h*(f-u))})(n),s=Date.now()+r;this.Gr.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),_e.warn(i),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),this.Gr.length===0)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout((()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()}),this.ii)}oi(){var e=Date.now(),n=[],r=this.Gr.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.Gr=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,ge(re)||(this.si&&(re.removeEventListener("online",this.si),this.si=void 0),this.ai&&(re.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var n=e.requestOptions;try{this._instance._send_request(ue({},n,{transport:"sendBeacon"}))}catch(r){_e.error(r)}}this.Gr=[]}}class JN{constructor(e){this.hi=()=>{var n,r,s,i;this.di||(this.di={});var a=this.scrollElement(),c=this.scrollY(),u=a?Math.max(0,a.scrollHeight-a.clientHeight):0,f=c+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this.di.lastScrollY=Math.ceil(c),this.di.maxScrollY=Math.max(c,(n=this.di.maxScrollY)!==null&&n!==void 0?n:0),this.di.maxScrollHeight=Math.max(u,(r=this.di.maxScrollHeight)!==null&&r!==void 0?r:0),this.di.lastContentY=f,this.di.maxContentY=Math.max(f,(s=this.di.maxContentY)!==null&&s!==void 0?s:0),this.di.maxContentHeight=Math.max(h,(i=this.di.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){Ht(re,"scroll",this.hi,{capture:!0}),Ht(re,"scrollend",this.hi,{capture:!0}),Ht(re,"resize",this.hi)}scrollElement(){if(!this.ci)return re==null?void 0:re.document.documentElement;var e=Xe(this.ci)?this.ci:[this.ci];for(var n of e){var r=re==null?void 0:re.document.querySelector(n);if(r)return r}}vi(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[n]||0}return re?e==="y"?re.scrollY||re.pageYOffset||re.document.documentElement.scrollTop||0:re.scrollX||re.pageXOffset||re.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var eD=t=>uP(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);class qE{constructor(e,n,r,s){this.fi=i=>{var a=this.pi();if(!a||a.sessionId!==i){var c={sessionId:i,props:this.gi(this._instance)};this.mi.register({[Ty]:c})}},this._instance=e,this.yi=n,this.mi=r,this.gi=s||eD,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[Ty]}getSetOnceProps(){var e,n=(e=this.pi())==null?void 0:e.props;return n?"r"in n?dP(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return wt(T2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+ly(r)]=n})),e}}class N2{on(e,n){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(n),()=>{this.bi[e]=this.bi[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.bi[e]||[])r(n);for(var s of this.bi["*"]||[])s(e,n)}constructor(){this.bi={}}}var nd=Ft("[SessionId]");class YE{on(e,n){return this.wi.on(e,n)}constructor(e,n,r){var s;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new N2,this.Mi=(f,h)=>!(!Hi(f)||!Hi(h))&&Math.abs(f-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Xi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ii=void 0,this.Ti=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=n||Ki,this.Ri=r||Ki;var i=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*fi(this.Te.session_idle_timeout_seconds||1800,60,36e3,nd.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+i+"_window_id",this.Fi="ph_"+i+"_primary_window_exists",this.Ai()){var a=Fn.F(this.Oi),c=Fn.F(this.Fi);a&&!c?this.Ii=a:Fn.P(this.Oi),Fn.q(this.Fi,!0)}if((s=this.Te.bootstrap)!=null&&s.sessionID)try{var u=(f=>{var h=this.Te.bootstrap.sessionID.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,new Date().getTime(),u)}catch(f){nd.error("Invalid sessionID in bootstrap",f)}this.Li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ge(this.ki)&&(this.ki=[]),this.ki.push(e),this.Ti&&e(this.Ti,this.Ii),()=>{this.ki=this.ki.filter((n=>n!==e))}}Ai(){return this.Te.persistence!=="memory"&&!this.mi.yr&&Fn.N()}Ni(e){e!==this.Ii&&(this.Ii=e,this.Ai()&&Fn.q(this.Oi,e))}Di(){return this.Ii?this.Ii:this.Ai()?Fn.F(this.Oi):null}qi(e){var n=this.xi;return!ur(n)&&!ur(e)&&5e3>Math.abs(e-n)}$i(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this.Ti||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Ti=e,i&&!s||i&&this.qi(n)||(this.xi=n,this.mi.register({[yc]:[n,e,r]}))}ji(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Hi(n)&&n>0}Hi(){this.ji()?this.mi.refreshKey(yc):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!ur(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var n=this.Ui();n[1]===this.Ti&&n[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[yc]:[this._sessionActivityTimestamp,(e=this.Ti)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],n=Hi(e)?e:0,r=Hi(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}Vi(e){return this.Hi(),this.Mi(e,this.zi())}Ui(){var e=this.mi.props[yc];return Xe(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&re&&(re.removeEventListener(pm,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Li(){this.Si=()=>{this.Bi(),this.Ai()&&Fn.P(this.Fi)},Ht(re,pm,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Te.cookieless_mode===Xi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),s=this.Ui(),i=s[1],a=s[2],c=this.zi(),u=this.Di(),f=Hi(a)&&Math.abs(r-a)>864e5,h=!1,p=!1,m=!i,_=i,x=!m&&!e&&this.Mi(r,c);if(x){(x=this.Vi(r))||nd.info("cross-tab refresh kept the session alive",{sessionId:i});var y=this.Ui();i=y[1],a=y[2]}m||x||f?(i=this.Ei(),u=this.Ri(),nd.info("new session ID generated",{sessionId:i,windowId:u,changeReason:{noSessionId:m,activityTimeout:x,sessionPastMaximumLength:f}}),a=r,h=!0):(u||(u=this.Ri(),h=!0),(p=i!==_)&&(nd.info("adopted cross-tab session id",{sessionId:i,windowId:u}),h=!0));var w=Hi(c)&&e&&!f?c:r,S=Hi(a)?a:new Date().getTime();this.Ni(u),this.$i(i,w,S),e||this.Pi();var T={noSessionId:m,activityTimeout:x,sessionPastMaximumLength:f,crossTabAdoption:p};return h&&this.ki.forEach((P=>P(i,u,T))),{sessionId:i,windowId:u,sessionStartTimestamp:S,changeReason:h?T:void 0,lastActivityTimestamp:c}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout((()=>{if(!this.Ci)if(this.Vi(new Date().getTime())){var e=this.Ti;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var EP=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&xE(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>xE(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function CP(){return(CP=en((function*(){var t=or==null?void 0:or.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return xt(n)&&n.length>0?n:void 0}catch(r){return void _e.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var wm=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function Ov(t,e,n){return _c({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var kP={exact:(t,e)=>e.some((n=>t.some((r=>n===r)))),is_not:(t,e)=>e.every((n=>t.every((r=>n!==r)))),regex:(t,e)=>e.some((n=>t.some((r=>wm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!wm(n,r))))),icontains:(t,e)=>e.map(Xh).some((n=>t.map(Xh).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Xh).every((n=>t.map(Xh).every((r=>!n.includes(r))))),gt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r>parseFloat(s)))})),lt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r<parseFloat(s)))}))},Xh=t=>t.toLowerCase();function PP(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(ge(s)||ur(s))return!1;var i=[String(s)],a=kP[r.operator];return!!a&&a(r.values,i)}))}var Hy="custom",XE="i.posthog.com",tD=/^\/static\//;class nD{constructor(e){this.Zi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+XE,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Zi[this.apiHost]||(this.Zi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Hy),this.Zi[this.apiHost]}Gi(e){if(tD.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(e==="assets"){var r=this.Gi(n);if(r)return""+r+n}if(this.region===Hy)return this.apiHost+n;var s=XE+n;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}function TP(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var yt=Ft("[Surveys]"),RP="seenSurvey_",AP=t=>{try{var e=(n=>((r,s)=>""+RP+(function(i){return i.current_iteration&&i.current_iteration>0?i.id+"_"+i.current_iteration:i.id})(s))(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){yt.error("Failed to persist survey seen state",n)}},rD=[Tv.Popover,Tv.Widget,Tv.API],sD={ignoreConditions:!1,ignoreDelay:!1,displayType:Ny.Popover},iD=Ft("[PostHog ExternalIntegrations]"),oD={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class aD{constructor(e){this._instance=e}er(e,n){var r;(r=Ve.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return iD.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var i,a,c,u=r[0],f=r[1];!f||(i=Ve.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[u]||e.er(oD[u],(()=>{var h;(h=Ve.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[u])==null||h.start(e._instance)})),!f&&(a=Ve.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[u]&&((c=Ve.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[u])==null||c.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}var Cd={},Lv=0,bm=()=>{},QE='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',rd="Surveys module not available",JE="sanitize_properties is deprecated. Use before_send instead",IP="Invalid value for property_denylist config: ",lD=["token","distinct_id",D6],mc="posthog",MP=!KN&&(br==null?void 0:br.indexOf("MSIE"))===-1&&(br==null?void 0:br.indexOf("Mozilla"))===-1,Nv=t=>{var e;return ue({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:dN(be==null?void 0:be.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:bm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:rn&&xt(rn==null?void 0:rn.search)&&rn.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(re==null||(e=re.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){_e.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:My,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:$y},error_tracking:{},_onCapture:bm},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:SN,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n)}))(t))},cD=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],eC=t=>{var e={};for(var n of cD){var r=n[0],s=n[1];ge(t[r])||(e[s]=t[r])}var i=Rt({},e,t),a=t.__preview_external_dependency_versioned_paths;return ge(a)||(ge(t.strict_script_versioning)&&(i.strict_script_versioning=!!a),xt(a)&&ge(t.asset_host)&&(i.asset_host=a)),Xe(t.property_blacklist)&&(ge(t.property_denylist)?i.property_denylist=t.property_blacklist:Xe(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:_e.error(IP+t.property_denylist)),i};class uD{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){_e.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class gs{Ji(e,n){if(e){var r=this.Ki.indexOf(e);r!==-1&&this.Ki.splice(r,1)}return this.Ki.push(n),n.initialize==null||n.initialize(),n}Yi(){return this.config.cookieless_mode===Xi||this.config.cookieless_mode===Ja&&this.consent.isRejected()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new uD,this.Xi=!1,this.version=gt.LIB_VERSION,this.en=new N2,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Nv(),this.SentryIntegration=MN,this.sentryIntegration=r=>(function(s,i){var a=rP(s,i);return{name:nP,processEvent:c=>a(c)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tn=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new JN(this),this.pageViewManager=new $E(this),this.rateLimiter=new HN(this),this.requestRouter=new nD(this),this.consent=new yN(this),this.externalIntegrations=new aD(this);var n=(e=gs.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{var a=xt(r)?{[r]:s}:r;this.setPersonProperties(a),i==null||i({})},set_once:(r,s,i)=>{var a=xt(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),i==null||i({})}},this.on("eventCaptured",(r=>_e.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==mc){var s,i=(s=Cd[r])!==null&&s!==void 0?s:new gs;return i._init(e,n,r),Cd[r]=i,Cd[mc][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var a=xt(e)?e.trim():"";if(!a)return _e.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Nv(n.defaults),n.debug=this.an(n.debug),this.ln=n,this.un=[],n.person_profiles?this.nn=n.person_profiles:n.process_person&&(this.nn=n.process_person);var c=Nv(n.defaults),u=eC(n),f=Rt({},c,u,{name:r,token:a});Lt(c.rageclick)&&Lt(u.rageclick)&&(f.rageclick=Rt({},c.rageclick,u.rageclick)),Lt(c.session_recording)&&Lt(u.session_recording)&&(f.session_recording=Rt({},c.session_recording,u.session_recording)),this.set_config(f),this.config.on_xhr_error&&_e.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:ir.GZipJS;var h=this.hn();this.persistence=new Pv(this.config,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Pv(ue({},this.config,{persistence:"sessionStorage"}),h,!1);var p=ue({},this.persistence.props),m=ue({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.dn=new YN((k=>this.cn(k)),this.config.request_queue_config),this.vn=new QN(this),this.__request_queue=[];var _=this.Yi();if(_||(this.sessionManager=new YE(this),this.sessionPropsManager=new qE(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(_e.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.fn(_)}),0)):(_e.info("Initializing extensions synchronously"),this.fn(_)),gt.DEBUG=gt.DEBUG||this.config.debug,gt.DEBUG&&_e.info("Starting in debug mode",{this:this,config:n,thisC:ue({},this.config),p,s:m}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=ue({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var x=n.bootstrap.distinctID,y=this.get_distinct_id(),w=this.persistence.get_property(hs);if(n.bootstrap.isIdentifiedID&&y!=null&&y!==x&&w===rc)this.identify(x);else if(n.bootstrap.isIdentifiedID&&y!=null&&y!==x&&w===ja)_e.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var S=this.config.get_device_id(Ki()),T=n.bootstrap.isIdentifiedID?S:x;this.persistence.set_property(hs,n.bootstrap.isIdentifiedID?ja:rc),this.register({distinct_id:x,$device_id:T})}}if(_)this.register_once({distinct_id:Gh,$device_id:null},"");else if(!this.get_distinct_id()){var P=this.config.get_device_id(Ki());this.register_once({distinct_id:P,$device_id:P},""),this.persistence.set_property(hs,rc)}return Ht(re,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(k,A){var O=k.config.segment;if(!O)return A();(function(L,R){var M=L.config.segment;if(!M)return R();var N=F=>{var q=()=>F.anonymousId()||Ki();L.config.get_device_id=q,F.id()&&(L.register({distinct_id:F.id(),$device_id:q()}),L.persistence.set_property(hs,ja)),R()},D=M.user();"then"in D&&Hs(D.then)?D.then(N):N(D)})(k,(()=>{O.register((L=>{typeof Promise<"u"&&Promise.resolve||Cv.warn("This browser does not have Promise support, and can not use the segment integration");var R=(M,N)=>{if(!N)return M;M.event.userId||M.event.anonymousId===L.get_distinct_id()||(Cv.info("No userId set, resetting PostHog"),L.reset()),M.event.userId&&M.event.userId!==L.get_distinct_id()&&(Cv.info("UserId set, identifying with PostHog"),L.identify(M.event.userId));var D=L.calculateEventProperties(N,M.event.properties);return M.event.properties=Object.assign({},D,M.event.properties),M};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:M=>R(M,M.event.event),page:M=>R(M,pc),identify:M=>R(M,bv),screen:M=>R(M,"$screen")}})(k)).then((()=>{A()}))}))})(this,(()=>this.pn())):this.pn(),Hs(this.config._onCapture)&&this.config._onCapture!==bm&&(_e.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(k=>this.config._onCapture(k.event,k)))),this.config.ip&&_e.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return CP.apply(this,arguments)})().then((k=>{k&&this.register({[xv]:k})})).catch(bm),this}fn(e){var n,r,s,i,a,c,u,f,h=performance.now(),p=ue({},gs.__defaultExtensionClasses,this.config.__extensionClasses),m=[];p.featureFlags&&this.Ki.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.Ki.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.Ki.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.Ki.push(this.tracingHeaders=new p.tracingHeaders(this)),p.siteApps&&this.Ki.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||m.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.Ki.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.Ki.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new p.surveys(this)),p.logs&&this.Ki.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new p.logs(this)),p.metrics&&this.Ki.push(this.metrics=(a=this.metrics)!==null&&a!==void 0?a:new p.metrics(this)),p.conversations&&this.Ki.push(this.conversations=(c=this.conversations)!==null&&c!==void 0?c:new p.conversations(this)),p.productTours&&this.Ki.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.Ki.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.Ki.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,IN)),p.toolbar&&this.Ki.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new p.toolbar(this)),p.experiments&&this.Ki.push(this.experiments=(f=this.experiments)!==null&&f!==void 0?f:new p.experiments(this)),this.Ki.forEach((_=>{_.initialize&&m.push((()=>{_.initialize==null||_.initialize()}))})),m.push((()=>{if(this.gn){var _=this.gn;this.gn=void 0,this.Hr(_)}})),this.mn(m,h)}mn(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.mn(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){_e.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[j6]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[F6]:s}),this.config.__preview_deferred_init_extensions&&_e.info("PostHog extensions initialized ("+s+"ms)")}Hr(e){if(!be||!be.body)return _e.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.ok){var n,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Ge(r.supportedCompression,ir.GZipJS)?ir.GZipJS:Ge(r.supportedCompression,ir.Base64)?ir.Base64:void 0),(n=r.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:My}),this.Ki.forEach((s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e)))}pn(){try{this.config.loaded(this)}catch(r){_e.critical("`loaded` function failed",r)}if(this.bn(),this.config.internal_or_test_user_hostname&&rn!=null&&rn.hostname){var e=rn.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()}),1),this.wn=new hP(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.dn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Kh(this.__request_queue,(e=>this.cn(e))),this.__request_queue=[],this.bn()}_handle_unload(){var e,n,r,s,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(wv),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.dn)==null||s.unload(),(i=this.vn)==null||i.unload()):this.xn()&&this.capture(wv,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?MP?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=ue({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(ge(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,a=ue({},n);a.timeout=a.timeout||6e4;var c,u,f,h,p,m=(r=a.transport)!==null&&r!==void 0?r:"fetch";m==="sendBeacon"&&ge(a.compression)&&a.data&&(a.compression=ir.Base64),a.method==="POST"&&a.data&&(a.timestampMode==="capture-body"?a.data={api_key:(u=(p=(h=Xe(c=a.data)?c:[c])[0])==null||(f=p.properties)==null?void 0:f.token)!==null&&u!==void 0?u:p==null?void 0:p.token,batch:h,sent_at:new Date().toISOString()}:a.timestampMode==="body"&&(a.data=(function(y,w){return w===void 0&&(w=new Date().toISOString()),Xe(y)?y.map((S=>ue({},S,{sent_at:w}))):ue({},y,{sent_at:w})})(a.data))),a.url=ZE(a.url,a.method,a.compression,a.timestampMode);var _=Rp.filter((y=>!a.disableTransport||!y.transport||!a.disableTransport.includes(y.transport))),x=(s=(i=(function(y,w){for(var S=0;y.length>S;S++)if(y[S].transport===m)return y[S]})(_))==null?void 0:i.method)!==null&&s!==void 0?s:_[0].method;if(!x)throw new Error("No available transport method");m!=="sendBeacon"&&a.data&&a.compression===ir.GZipJS&&hL&&typeof Promise<"u"&&!Tp?ZN(a).then((y=>{x(y)})).catch((y=>{if(_E(y))return Tp=!0,void x(ue({},a,{compression:void 0,url:ZE(n.url,n.method,void 0,n.timestampMode)}));(w=>{if(!w||typeof w!="object")return!1;var S="name"in w?String(w.name):"";return _E(w)||S===Q8})(y)&&(Tp=!0),x(a)})):x(a)})(ue({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){Lv++;try{var n,r=[],s=[],i=[];Kh(e,(c=>{if(c)if(Xe(n=c[0]))i.push(c);else if(Hs(c))try{c.call(this)}catch(u){_e.error("Error executing queued PostHog call",c,u)}else Xe(c)&&n==="alias"?r.push(c):Xe(c)&&n.indexOf("capture")!==-1&&Hs(this[n])?i.push(c):s.push(c)}));var a=function(c,u){Kh(c,(function(f){try{if(Xe(f[0])){var h=u;wt(f,(function(p){h=h[p[0]].apply(h,p.slice(1))}))}else u[f[0]].apply(u,f.slice(1))}catch(p){_e.error("Error executing queued PostHog call",f,p)}}))};a(r,this),a(s,this),a(i,this)}finally{Lv--}}push(e){if(Lv>0&&Xe(e)&&xt(e[0])){var n=gs.prototype[e[0]];Hs(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s,i,a,c,u;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!ge(e)&&xt(e)){var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var h=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(h==null||!h.isRateLimited){n!=null&&n.$current_url&&!xt(n==null?void 0:n.$current_url)&&(_e.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.kn||_e.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var p=new Date,m=(r==null?void 0:r.timestamp)||p,_=EE(r==null?void 0:r.uuid,Ki),x={uuid:_,event:e,properties:this.calculateEventProperties(e,n||{},m,_)};e===pc&&this.config.__preview_capture_bot_pageviews&&f&&(x.event="$bot_pageview",x.properties.$browser_type="bot"),h&&(x.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens);var y=e==="$feature_flag_called"&&x.properties.$feature_flag_has_experiment===!1&&this.get_property(cm)===!0;r!=null&&r.$set&&!y&&(x.$set=r==null?void 0:r.$set);var w=r==null?void 0:r.$unset;w&&(x.$unset=w);var S,T,P,k=y?void 0:this.Sn(r==null?void 0:r.$set_once,e!==RE,e===bv);if(k&&(x.$set_once=k),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=x,c=F=>xt(F)?F.slice(0,i):F,u=new Set,x=(function F(q,X){if(q!==Object(q))return c?c(q):q;if(!u.has(q)){var W;if(u.add(q),Xe(q))W=[],Kh(q,(K=>{W.push(F(K))}));else{var G={};wt(q,((K,$)=>{u.has(K)||(G[$]=F(K))})),W=G}return W}})(a)),x.timestamp=m,ge(r==null?void 0:r.timestamp)||(x.properties.$event_time_override_provided=!0,x.properties.$event_time_override_system_time=p),y&&(x.properties=(function(F,q){q===void 0&&(q=[]);var X={},W=G=>{F[G]!==void 0&&(X[G]=F[G])};return pL.forEach(W),q.forEach(W),X})(x.properties,lD)),e===Ji.DISMISSED||e===Ji.SENT){var A=n==null?void 0:n[Rv.SURVEY_ID],O=n==null?void 0:n[Rv.SURVEY_ITERATION];AP({id:A,current_iteration:O}),x.$set=ue({},x.$set,{[(S={id:A,current_iteration:O},T=e===Ji.SENT?"responded":"dismissed",P="$survey_"+T+"/"+S.id,S.current_iteration&&S.current_iteration>0&&(P="$survey_"+T+"/"+S.id+"/"+S.current_iteration),P)]:!0})}else e===Ji.SHOWN&&(x.$set=ue({},x.$set,{[Rv.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===$N.SHOWN){var L=n==null?void 0:n[zE.TOUR_TYPE];L&&(x.$set=ue({},x.$set,{[zE.TOUR_LAST_SEEN_DATE+"/"+L]:new Date().toISOString()}))}var R=ue({},x.properties.$set,x.$set);if(Zo(R)||this.setPersonPropertiesForFlags(R),!Je(this.config.before_send)){var M=this.wt(x);if(!M)return;(x=M).uuid=EE(x.uuid,Ki)}this.en.emit("eventCaptured",x);var N=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),D={method:"POST",url:N,data:x,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(N)?"body":"capture-body",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.cn(D):this.dn.enqueue(D),x}_e.critical("This capture call is ignored due to client rate limiting.")}}else _e.error("No event name provided to posthog.capture")}else _e.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var a=i?void 0:this.persistence.remove_event_timer(e),c=ue({},n);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Yi()&&(c[D6]=!0),e==="$snapshot"){var u=ue({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=u.distinct_id,(!xt(c.distinct_id)&&!Hn(c.distinct_id)||cy(c.distinct_id))&&_e.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var f,h=(function(P,k,A,O){var L,R,M,N;if(O===void 0&&(O=!1),!br)return{};var D,F=P?[...Jc,...k||[]]:[],q=(function(Qe){for(var dt=0;bE.length>dt;dt++){var qt=bE[dt],xe=qt[1],$e=qt[0].exec(Qe),Be=$e&&(Hs(xe)?xe($e,Qe):xe);if(Be)return Be}return["",""]})(br),X=q[0],W=q[1],G=(D=typeof navigator<"u"?navigator:void 0)!=null&&D.brave?{brave:!0}:{},K={};ge(A)||(K.detectGoogleSearchApp=A);var $={},te=(L=navigator)==null||(L=L.userAgentData)==null?void 0:L.platform,H=(R=navigator)==null?void 0:R.maxTouchPoints,j=re==null||(M=re.screen)==null?void 0:M.width,Y=re==null||(N=re.screen)==null?void 0:N.height,ne=re==null?void 0:re.devicePixelRatio;ge(te)||($.userAgentDataPlatform=te),ge(H)||($.maxTouchPoints=H),ge(j)||($.screenWidth=j),ge(Y)||($.screenHeight=Y),ge(ne)||($.devicePixelRatio=ne);var ie,J,ce,we,oe,le,Fe,De,Pe=Rt(T2({$os:X,$os_version:W,$browser:b6(br,navigator.vendor,G,K),$device:SE(br),$device_type:(J=br,ce=$,De=SE(J),De===s6||De===r6||De==="Kobo"||De==="Kindle Fire"||De===v6?qc:De===Fd||De===kc||De===Vd||De===dy?"Console":De===o6?"Wearable":De?Xr:(ce==null?void 0:ce.userAgentDataPlatform)==="Android"&&((we=ce==null?void 0:ce.maxTouchPoints)!==null&&we!==void 0?we:0)>0?600>Math.min((oe=ce==null?void 0:ce.screenWidth)!==null&&oe!==void 0?oe:0,(le=ce==null?void 0:ce.screenHeight)!==null&&le!==void 0?le:0)/((Fe=ce==null?void 0:ce.devicePixelRatio)!==null&&Fe!==void 0?Fe:1)?Xr:qc:"Desktop"),$timezone:fP(),$timezone_offset:jN()}),{$current_url:zd(O?sa(rn==null?void 0:rn.href):rn==null?void 0:rn.href,F,Ud),$host:rn==null?void 0:rn.host,$pathname:rn==null?void 0:rn.pathname,$raw_user_agent:br.length>1e3?br.substring(0,997)+"...":br,$browser_version:OL(br,navigator.vendor,G,K),$browser_language:HE(),$browser_language_prefix:(ie=HE(),typeof ie=="string"?ie.split("-")[0]:void 0),$screen_height:re==null?void 0:re.screen.height,$screen_width:re==null?void 0:re.screen.width,$viewport_height:re==null?void 0:re.innerHeight,$viewport_width:re==null?void 0:re.innerWidth,$lib:gt.LIB_NAME,$lib_version:gt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return gt.SDK_DIST_CHANNEL&&(Pe.$sdk_dist_channel=gt.SDK_DIST_CHANNEL),Pe})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var p=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime()),m=p.windowId;c.$session_id=p.sessionId,c.$window_id=m}this.sessionPropsManager&&Rt(c,this.sessionPropsManager.getSessionProps());try{var _;this.sessionRecording&&Rt(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=(_=this.vn)==null?void 0:_.length}catch(P){c.$sdk_debug_error_capturing_properties=String(P)}if(this.requestRouter.region===Hy&&(c.$lib_custom_api_host=this.config.api_host),f=e!==pc||i?e!==wv||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),c=Rt(c,f),e===pc&&be&&(c.title=be.title),!ge(a)){var x=r.getTime()-a;c.$duration=parseFloat((x/1e3).toFixed(3))}br&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser");var y=this.persistence.properties(),w=this.sessionPersistence.properties();wt(["$referrer","$referring_domain"],(P=>{P in y&&delete w[P]})),(c=Rt({},h,y,w,c)).$is_identified=this._isIdentified(),Xe(this.config.property_denylist)?wt(this.config.property_denylist,(function(P){delete c[P]})):_e.error(IP+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(_e.error(JE),c=S(c,e));var T=this.Cn();return c.$process_person_profile=T,T&&!i&&this.Mn("_calculate_event_properties"),c}Sn(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.Cn()||this.Xi&&!r)return e;var i=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),c=Rt({},i,a||{},e||{}),u=this.config.sanitize_properties;return u&&(_e.error(JE),c=u(c,"$set_once")),n&&(this.Xi=!0),Zo(c)?void 0:c}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}In(e,n){this.register({[e]:n})}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.en.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:rd}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:rd})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:rd})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=sD),(r=this.surveys)==null||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:rd}}canRenderSurveyAsync(e,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:rd})}Tn(e){return!e||cy(e)?(_e.critical("Unique user id has not been set in posthog.identify"),!1):e===Gh?(_e.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(_e.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return _e.uninitializedWarning("posthog.identify");if(Hn(e)&&(e=e.toString(),_e.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Tn(e)&&this.Mn("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(lm)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(hd)&&(this.unregister(hd),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(hs)||rc)===rc,c=e!==s,u=!c&&a;if(c&&a)this.persistence.set_property(hs,ja),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(bv,{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.sn=Ov(e,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s);else if(u){this.persistence.set_property(hs,ja);var f=n||{},h=r||{};this.setPersonPropertiesForFlags({$set:f,$set_once:h},!1),this.capture("$set",{$set:f,$set_once:h}),this.sn=Ov(e,n,r)}else(n||r)&&this.setPersonProperties(n,r);c?(this.reloadFeatureFlags(),this.unregister(bd)):u&&(n||r)&&this.reloadFeatureFlags()}}setPersonProperties(e,n){if((e||n)&&this.Mn("posthog.setPersonProperties")){var r=Ov(this.get_distinct_id(),e,n);this.sn!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.sn=r):_e.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(Xe(e)?e:[e]).filter((s=>xt(s)&&s.length>0));r.length!==0&&this.Mn("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(e,n,r){if(e&&n){var s=this.getGroups(),i=s[e]!==n;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ue({},s,{[e]:n})}),i||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(RE,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),i&&!r&&this.reloadFeatureFlags()}else _e.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),this.Mn("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n,r,s,i,a,c,u,f,h,p;if(_e.info("reset"),!this.__loaded)return _e.uninitializedWarning("posthog.reset");var m,_=this.get_property(lm),x=this.get_property(xv),y=this.get_property(sl);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),ge(y)||(m=this.persistence)==null||m.register({[sl]:y}),(s=this.surveys)==null||s.reset(),(i=this.wn)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(c=this.conversations)==null||c.reset(),(u=this.logs)==null||u.reset(),(f=this.metrics)==null||f.reset(),(h=this.persistence)==null||h.set_property(hs,rc),(p=this.sessionManager)==null||p.resetSessionId(),this.sn=null,this.config.cookieless_mode===Xi)this.register_once({distinct_id:Gh,$device_id:null},"");else{var w=this.config.get_device_id(Ki());this.register_once({distinct_id:w,$device_id:e?w:_},""),e||ge(x)||this.register({[xv]:x})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var n=this;return en((function*(){var r,s,i,a,c;n.__loaded?((r=n.logs)==null||r.flushLogs("sendBeacon"),(s=n.metrics)==null||s.flush("sendBeacon"),(i=n.dn)==null||i.unload(),(a=n.vn)==null||a.unload(),(c=n.featureFlags)==null||c.destroy()):_e.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,n){var r;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)==null||r.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.Rn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&r){var i,a=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0)}return s}alias(e,n){return e===this.get_property(A6)?(_e.critical("Attempting to create alias for existing People user - aborting."),-2):this.Mn("posthog.alias")?(ge(n)&&(n=this.get_distinct_id()),e!==n?(this.In(hd,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(_e.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=ue({},this.config);if(Lt(e)){var r,s,i,a,c,u,f,h,p,m,_;Rt(this.config,eC(e));var x=this.hn();(r=this.persistence)==null||r.update_config(this.config,n,x),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Pv(ue({},this.config,{persistence:"sessionStorage"}),x,!1);var y=this.an(this.config.debug);zs(y)&&(this.config.debug=y),zs(this.config.debug)&&(this.config.debug?(gt.DEBUG=!0,St.N()&&St.q("ph_debug",!0),_e.info("set_config",{config:e,oldConfig:n,newConfig:ue({},this.config)})):(gt.DEBUG=!1,St.N()&&St.P("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(c=this.tracingHeaders)==null||c.startIfEnabledOrStop(),(u=this.autocapture)==null||u.startIfEnabled(),(f=this.heatmaps)==null||f.startIfEnabled(),(h=this.exceptionObserver)==null||h.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(m=this.surveys)==null||m.loadIfEnabled(),this.Pn(),(_=this.externalIntegrations)==null||_.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){gt.LIB_NAME=e,gt.LIB_VERSION=n}startSessionRecording(e){var n,r,s,i,a,c=e===!0,u={sampling:c||!(e==null||!e.sampling),linked_flag:c||!(e==null||!e.linked_flag),url_trigger:c||!(e==null||!e.url_trigger),event_trigger:c||!(e==null||!e.event_trigger)};Object.values(u).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),u.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),u.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),u.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),u.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(ue({},s,n))}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:gs.On}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:mc;return n!==mc&&(n=mc+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(hs))===ja||((n=this.sessionPersistence)==null?void 0:n.get_property(hs))===ja}Cn(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===My&&!this._isIdentified()&&Zo(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[hd])&&((n=this.persistence)==null||(n=n.props)==null||!n[fm]))}xn(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Cn()||this.Mn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Mn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Mn(e){return this.config.person_profiles==="never"?(_e.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.In(fm,!0),!0)}hn(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ja)}Pn(){var e,n,r,s,i=this.hn();return((e=this.persistence)==null?void 0:e.yr)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.yr)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==Xi){if(this.Yi()){var r,s,i,a,c;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new YE(this),this.pageViewManager=new $E(this),this.persistence&&(this.sessionPropsManager=new qE(this,this.sessionManager,this.persistence));var u,f=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(c=gs.__defaultExtensionClasses)==null?void 0:c.sessionRecording;f&&(this.sessionRecording=this.Ji(this.sessionRecording,new f(this)),this.yn&&((u=this.sessionRecording)==null||u.onRemoteConfig==null||u.onRemoteConfig(this.yn)))}var h,p;this.consent.optInOut(!0),this.Pn(),this.bn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Ja&&((h=this.surveys)==null||h.loadIfEnabled()),(ge(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((p=e==null?void 0:e.captureEventName)!==null&&p!==void 0?p:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else _e.warn(QE)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==Xi?(this.config.cookieless_mode===Ja&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===Ja&&(this.register({distinct_id:Gh,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._n(),this.bn())):_e.warn(QE)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Xi||(this.config.cookieless_mode===Ja?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return or?EP(or,this.config.custom_blocked_useragents):void 0}_n(){be&&(be.visibilityState==="visible"?this.tn||(this.tn=!0,this.capture(pc,{title:be.title},{send_instantly:!0}),this.rn&&(be.removeEventListener(hm,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),Ht(be,hm,this.rn)))}debug(e){e===!1?(re==null||re.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(re==null||re.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ur(){var e=this.ln||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(_e.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,r,s,i,a){var c=r in n&&!Je(n[r]),u=s in n&&!Je(n[s]);return c?n[r]:!!u&&(a&&a.warn("Config field '"+s+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,_e)}wt(e){var n;if(Je(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(wL),s=Xe(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s){if(i=a(i),Je(i)){var c="Event '"+e.event+"' was rejected in beforeSend function";return xL(e.event)?_e.warn(c+". This can cause unexpected behavior."):_e.info(c),null}i.properties&&!Zo(i.properties)||_e.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var u of r)if(i.properties&&Je(i.properties[u]))return _e.warn("Event '"+e.event+"' had its '"+u+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.ir)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}an(e){var n=zs(e)&&!e,r=St.N()&&St.A("ph_debug")==="true";return!n&&(!!r||e)}}gs.__defaultExtensionClasses={},gs.On=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=cN(t.prototype[e[n]])})(gs,["identify"]);class tC{constructor(e){this.disabled=e===!1;var n=Lt(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&this.timeoutMs>r-s.timestamp){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var Dv="$copy_autocapture",jv=Ft("[AutoCapture]");function Fv(t,e){return e.length>t?e.slice(0,t)+"...":e}function dD(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!ia(e));return e}function fD(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,a=e.maskAllText,c=e.elementAttributeIgnoreList,u=e.elementsChainAsString,f=e.disableCaptureUrlHashes;if(!ia(t))return{props:{}};for(var h=[t],p=new Set([t]),m=t;m.parentNode&&!Zr(m,"body")&&K6>h.length;)if(G6(m.parentNode)){var _=m.parentNode.host;if(p.has(_))break;p.add(_),h.push(_),m=_}else{if(!ia(m.parentNode)||p.has(m.parentNode))break;p.add(m.parentNode),h.push(m.parentNode),m=m.parentNode}var x,y,w=[],S={},T=!1,P=!1;if(wt(h,(R=>{var M=Ly(R);if(Zr(R,"a")){var N=R.getAttribute("href");T=!!(M&&N&&Sd(N))&&(f?sa(N):N)}Ge(gm(R),"ph-no-capture")&&(P=!0),w.push((function(F,q,X,W,G){G===void 0&&(G=!1);var K=F.tagName.toLowerCase(),$={tag_name:K};A2.indexOf(K)>-1&&!X&&($.$el_text=K.toLowerCase()==="a"||K.toLowerCase()==="button"?Fv(1024,jE(F)):Fv(1024,Hd(F)));var te=gm(F);te.length>0&&($.classes=te.filter((function(ne){return ne!==""}))),wt(F.attributes,(function(ne){var ie;if((!Q6(F)||["name","id","class","aria-label"].indexOf(ne.name)!==-1)&&(W==null||!W.includes(ne.name))&&!q&&Sd(ne.value)&&(!xt(ie=ne.name)||ie.substring(0,10)!=="_ngcontent"&&ie.substring(0,7)!=="_nghost")){var J=ne.value;ne.name==="class"&&(J=R2(J).join(" ")),$["attr__"+ne.name]=Fv(1024,ne.name==="href"&&G?sa(J):J)}}));for(var H=1,j=1,Y=F;Y=dD(Y);)H++,Y.tagName===F.tagName&&j++;return $.nth_child=H,$.nth_of_type=j,$})(R,i,a,c,f));var D=(function(F){if(!Ly(F))return{};var q={};return wt(F.attributes,(function(X){if(X.name&&X.name.indexOf("data-ph-capture-attribute")===0){var W=X.name.replace("data-ph-capture-attribute-",""),G=X.value;W&&G&&Sd(G)&&(q[W]=G)}})),q})(R);Rt(S,D)})),P)return{props:{},explicitNoCapture:P};if(a||(w[0].$el_text=Zr(t,"a")||Zr(t,"button")?jE(t):Hd(t)),T){var k,A;w[0].attr__href=T;var O=(k=vm(T))==null?void 0:k.host,L=re==null||(A=re.location)==null?void 0:A.host;O&&L&&O!==L&&(x=T)}return{props:Rt({$event_type:s.type,$ce_version:1},u?{}:{$elements:w},{$elements_chain:(y=w,(function(R){return R.map((M=>{var N,D,F="";if(M.tag_name&&(F+=M.tag_name),M.attr_class)for(var q of(M.attr_class.sort(),M.attr_class))F+="."+q.replace(/"/g,"");var X=ue({},M.text?{text:M.text}:{},{"nth-child":(N=M.nth_child)!==null&&N!==void 0?N:0,"nth-of-type":(D=M.nth_of_type)!==null&&D!==void 0?D:0},M.href?{href:M.href}:{},M.attr_id?{attr_id:M.attr_id}:{},M.attributes),W={};return Pp(X).sort(((G,K)=>G[0].localeCompare(K[0]))).forEach((G=>{var K=G[1];return W[FE(G[0].toString())]=FE(K.toString())})),(F+=":")+Pp(W).map((G=>G[0]+'="'+G[1]+'"')).join("")})).join(";")})((function(R){return R.map((M=>{var N,D,F={text:(N=M.$el_text)==null?void 0:N.slice(0,400),tag_name:M.tag_name,href:(D=M.attr__href)==null?void 0:D.slice(0,2048),attr_class:RN(M),attr_id:M.attr__id,nth_child:M.nth_child,nth_of_type:M.nth_of_type,attributes:{}};return Pp(M).filter((q=>q[0].indexOf("attr__")===0)).forEach((q=>F.attributes[q[0]]=q[1])),F}))})(y)))},(n=w[0])!=null&&n.$el_text?{$el_text:(r=w[0])==null?void 0:r.$el_text}:{},x&&s.type==="click"?{$external_click_url:x}:{},S)}}var sd=Ft("[ExceptionAutocapture]"),nC=()=>{},hD=Ft("[TracingHeaders]"),$a=Ft("[Web Vitals]"),rC=9e5,sC="disabled",iC="lazy_loading",id="awaiting_config",Qh="missing_config";Ft("[SessionRecording]"),Ft("[SessionRecording]");var zy="[SessionRecording]",Li=Ft(zy),pD=Ft("[Heatmaps]");function Vv(t){return Lt(t)&&"clientX"in t&&"clientY"in t&&Hn(t.clientX)&&Hn(t.clientY)}var $v=Ft("[Product Tours]"),Hv=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(C2))},mD=["$set_once","$set"],ei=Ft("[SiteApps]"),oC="Error while initializing PostHog app with config id ";function oc(t,e,n){if(Je(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class gD{constructor(e){this.Fn=new N2,this.An=(n,r)=>this.$n(n,r)&&this.Ln(n,r)&&this.Nn(n,r)&&this.Dn(n,r),this.$n=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,n;ge((e=this._instance)==null?void 0:e._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,s)=>{this.on(r,s)}))}register(e){var n,r;if(!ge((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var c,u;(c=this.jn)==null||c.add(a),(u=a.steps)==null||u.forEach((f=>{var h;(h=this.qn)==null||h.add((f==null?void 0:f.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;e.forEach((a=>{var c;(c=a.steps)==null||c.forEach((u=>{u!=null&&u.selector&&i.add(u==null?void 0:u.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(e,n){var r;n!=null&&e.length!=0&&(this.qn.has(e)||this.qn.has(n.event))&&this.jn&&((r=this.jn)==null?void 0:r.size)>0&&this.jn.forEach((s=>{this.Hn(n,s)&&this.Fn.emit("actionCaptured",s.name)}))}Bn(e){this.onAction("actionCaptured",(n=>e(n)))}Hn(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.An(e,r))return!0;return!1}onAction(e,n){return this.Fn.on(e,n)}Ln(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!oc(s,n.url,n.url_matching||"contains"))return!1}return!0}Nn(e,n){return!!this.Un(e,n)&&!!this.zn(e,n)&&!!this.Vn(e,n)}Un(e,n){var r;if(n==null||!n.href)return!0;var s=this.Wn(e);if(s.length>0)return s.some((c=>oc(c.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&oc((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}zn(e,n){var r;if(n==null||!n.text)return!0;var s=this.Wn(e);if(s.length>0)return s.some((f=>oc(f.text,n.text,n.text_matching||"exact")||oc(f.$el_text,n.text,n.text_matching||"exact")));var i,a,c,u=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!u&&(i=(function(f){for(var h,p=[],m=/(?::|")text="(.*?)"/g;!Je(h=m.exec(f));)p.includes(h[1])||p.push(h[1]);return p})(u),a=n.text,c=n.text_matching||"exact",i.some((f=>oc(f,a,c))))}Vn(e,n){var r,s;if(n==null||!n.selector)return!0;var i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}Wn(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}Dn(e,n){return n==null||!n.properties||n.properties.length===0||PP(n.properties.reduce(((r,s)=>{var i=Xe(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class vD{constructor(e){var n;this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,(n=this._instance)==null||n.onSessionId==null||n.onSessionId((r=>this.Kn(r)))}Yn(e,n){return!!e&&PP(e.propertyFilters,n==null?void 0:n.properties)}Xn(e,n){var r=new Map;return e.forEach((s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach((a=>{if(a!=null&&a.name){var c=r.get(a.name)||[];c.push(s.id),r.set(a.name,c)}}))})),r}es(e,n,r){var s=(r===Qu.Activation?this.Gn:this.Qn).get(e),i=[];return this.ts((a=>{i=a.filter((c=>s==null?void 0:s.includes(c.id)))})),i.filter((a=>{var c,u=(c=a.conditions)==null||(c=c[r])==null||(c=c.values)==null?void 0:c.find((f=>f.name===e));return this.Yn(u,n)}))}register(e){var n;ge((n=this._instance)==null?void 0:n._addCaptureHook)||(this.rs(e),this.ns(e))}ns(e){var n=e.filter((r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));n.length!==0&&(this.ss==null&&(this.ss=new gD(this._instance),this.ss.init(),this.ss.Bn((r=>{this.onAction(r)}))),n.forEach((r=>{var s,i,a,c,u;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((c=this.ss)==null||c.register(r.conditions.actions.values),(u=r.conditions)==null||(u=u.actions)==null||(u=u.values)==null||u.forEach((f=>{if(f&&f.name){var h=this.Jn.get(f.name);h&&h.push(r.id),this.Jn.set(f.name,h||[r.id])}})))})))}rs(e){var n,r=e.filter((i=>{var a,c;return((a=i.conditions)==null?void 0:a.events)&&((c=i.conditions)==null||(c=c.events)==null||(c=c.values)==null?void 0:c.length)>0})),s=e.filter((i=>{var a,c;return((a=i.conditions)==null?void 0:a.cancelEvents)&&((c=i.conditions)==null||(c=c.cancelEvents)==null||(c=c.values)==null?void 0:c.length)>0}));r.length===0&&s.length===0||((n=this._instance)==null||n._addCaptureHook(((i,a)=>{this.onEvent(i,a)})),this.Gn=this.Xn(e,Qu.Activation),this.Qn=this.Xn(e,Qu.Cancellation))}onEvent(e,n){var r,s,i=this.os(),a=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(s=n.properties)==null?void 0:s.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var c=this.ls(e,a);if(c==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.us([a]);if(c==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.hs(a)}if(this.Qn.has(e)){var u=this.es(e,n,Qu.Cancellation);u.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:u.map((h=>h.id))}),this.us(u.map((h=>h.id))),u.forEach((h=>this.ds(h.id))))}if(this.Gn.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.Gn.get(e)});var f=this.es(e,n,Qu.Activation);this.cs(f.map((h=>h.id)))}}onAction(e){this.Jn.has(e)&&this.cs(this.Jn.get(e)||[])}cs(e){e.length!==0&&(this.Zn=[...new Set([...this.Zn,...e])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(e){this.Zn=this.Zn.filter((r=>r!==e));var n=this.vs();n.includes(e)||(this.fs([...n,e]),this.ps())}us(e){var n=new Set(e);this.Zn=this.Zn.filter((i=>!n.has(i)));var r=this.gs(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&(this.fs(s),s.length===0&&this.ys())}gs(){var e,n=this.bs();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}vs(){var e,n,r=this.gs();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this._s()],i=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return i&&s===i?r:[]}ps(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.ws(n)}ys(){this.xs()}Kn(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this._s()];r&&r!==e&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter((e=>!this.ks(e)))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class yD extends vD{constructor(e){super(e)}bs(){return Cy}_s(){return kp}Cs(){return Ji.SHOWN}ts(e){var n;(n=this._instance)==null||n.getSurveys(e)}ds(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}os(){return yt}fs(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Cy]:e})}ws(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[kp]:e})}xs(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(kp)}ks(){return!1}ls(e,n){var r;this.ts((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a;return TP(i)&&!((a=i.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||i.schedule==="always"})(r);return s?e===Ji.SHOWN?"consume":"ignore":e===Ji.SHOWN?"persist":e===Ji.DISMISSED||e===Ji.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Jh="SDK is not enabled or survey functionality is not yet loaded",aC="Disabled. Not loading surveys.",_D=re!=null&&re.location?ym(re.location.hash,"__posthog")||ym(location.hash,"state"):null,lC="_postHogToolbarParams",cC=Ft("[Toolbar]"),dn=Ft("[FeatureFlags]"),Ha=Ft("[FeatureFlags]",{debugEnabled:!0}),zv=`" failed. Feature flags didn't load in time.`,uC=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},dC=t=>{var e={};for(var n of Pp(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},Ni=Ft("[Error tracking]"),fC="Refusing to render web experiment since the viewer is a likely bot",xD={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>wm(e,t),not_regex:(t,e)=>!wm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Yn{get Te(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{Yn.Ms("retrieved web experiments from the server"),n.Is=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n.Is&&(Yn.Ms("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.Is)==null||a.set(i.feature_flag_key,i));var c=n._instance.getFeatureFlag(i.feature_flag_key);xt(c)&&i.variants[c]&&n.Ts(i.name,c,i.variants[c].transforms)}else if(i.variants)for(var u in i.variants){var f=i.variants[u];Yn.Es(f,n._instance)&&n.Ts(i.name,u,f.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Yn.Ms(fC);else if(!this.Te.disable_web_experiments){if(Je(this.Is))return this.Is=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Yn.Ms("applying feature flags",e),e.forEach((n=>{var r;if(this.Is&&(r=this.Is)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this.Is)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.Ts(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=Yn.getWindowLocation();if(e!=null&&e.search){var n=Qc(e==null?void 0:e.search,"__experiment_id"),r=Qc(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Yn.Ms("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.Rs(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Te.disable_web_experiments&&!r)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}Rs(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(Yn.Ms("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Ts(s[0].name,n,s[0].variants[n].transforms))}static Es(e,n){return!Je(e.conditions)&&Yn.Ps(e,n)&&Yn.Os(e)}static Ps(e,n){var r;if(Je(e.conditions)||Je((r=e.conditions)==null?void 0:r.url))return!0;var s=Yn.getWindowLocation();if(s){var i,a,c,u=U6(n,s.href);return(i=e.conditions)==null||!i.url||xD[(a=(c=e.conditions)==null?void 0:c.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return re==null?void 0:re.location}static Os(e){var n;if(Je(e.conditions)||Je((n=e.conditions)==null?void 0:n.utm))return!0;var r=oP();if(r.utm_source){var s,i,a,c,u,f,h,p,m=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,_=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_source)==r.utm_source,x=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_medium||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_medium)==r.utm_medium,y=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return m&&x&&y&&_}return!1}static Ms(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];_e.info("[WebExperiments] "+e,r)}Ts(e,n,r){this._is_bot()?Yn.Ms(fC):n!=="control"?r.forEach((s=>{if(s.selector){var i;Yn.Ms("applying transform of variant "+n+" for experiment "+e+" ",s);var a=(i=document)==null?void 0:i.querySelectorAll(s.selector);a==null||a.forEach((c=>{var u=c;s.html&&(u.innerHTML=s.html),s.css&&u.setAttribute("style",s.css)}))}})):Yn.Ms("Control variants leave the page unmodified.")}_is_bot(){return or&&this._instance?EP(or,this.Te.custom_blocked_useragents):void 0}}var fs=Ft("[Conversations]"),za="Conversations not available yet.",hC="console",n0={featureFlags:class{constructor(t){this.Fs=!1,this.As=!1,this.$s=!1,this.Ls=!1,this.Ns=!1,this.Ds=!1,this.qs=!1,this.js=!1,this.Hs=0,this.Bs=()=>{var e=this.Us();this.Hs=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],re&&Ht(re,"online",this.Bs)}destroy(){re==null||re.removeEventListener("online",this.Bs)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}zs(t){return this._instance.get_property(t)}Vs(){var t,e;return(t=(e=this.mi)==null?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,dn.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var t,e=(t=this.Te.evaluation_contexts)!==null&&t!==void 0?t:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(dn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||dn.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}Gs(){return this.Zs().length>0}Qs(){var t=this.Te.flag_keys;if(!ge(t)){if(Xe(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||dn.error("Invalid flag key found:",e,"Expected non-empty string"),n}));dn.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,n=this._instance.config,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i,a=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},c=Object.keys(r).filter((f=>!!r[f])).reduce(((f,h)=>(f[h]=r[h]||!1,f)),{}),u=Object.keys(a).filter((f=>c[f])).reduce(((f,h)=>(a[h]&&(f[h]=a[h]),f)),{});this.receivedFeatureFlags({featureFlags:c,featureFlagPayloads:u})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.zs(nl))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.zs(Cp))!==null&&s!==void 0?s:{},c=ue({},i,t),u=ue({},a,e),f={};for(var h of Object.entries(c)){var p=h[0],m=h[1];f[p]={key:p,enabled:mE(m),variant:gE(m),reason:void 0,metadata:ge(u==null?void 0:u[p])?void 0:{id:0,version:void 0,description:void 0,payload:u[p]}}}this.receivedFeatureFlags({flags:f})}get hasLoadedFlags(){return this.As}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.zs(by),e=this.zs(zi),n=this.zs(hc);if(!n&&!e)return t||{};var r=Rt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var a,c,u=r[i],f=e==null?void 0:e[i],h=ge(f)?(a=u==null?void 0:u.enabled)!==null&&a!==void 0&&a:!!f,p=ge(f)?u.variant:typeof f=="string"?f:void 0,m=n==null?void 0:n[i],_=ue({},u,{enabled:h,variant:h?p??(u==null?void 0:u.variant):void 0});h!==(u==null?void 0:u.enabled)&&(_.original_enabled=u==null?void 0:u.enabled),p!==(u==null?void 0:u.variant)&&(_.original_variant=u==null?void 0:u.variant),m&&(_.metadata=ue({},u==null?void 0:u.metadata,{payload:m,original_payload:u==null||(c=u.metadata)==null?void 0:c.payload})),r[i]=_}return this.Fs||(dn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Fs=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:mE(r),variant:gE(r),payload:pE(e[n])}}))}getFlagVariants(){var t=this.zs(nl),e=this.zs(zi);if(!e)return t||{};for(var n=Rt({},t),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Fs||(dn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Fs=!0),n}getFlagPayloads(){var t=this.zs(Cp),e=this.zs(hc);if(!e)return t||{};for(var n=Rt({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Fs||(dn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Fs=!0),n}reloadFeatureFlags(){this.Ls||this.Te.advanced_disable_feature_flags||this.Us()||this.Js||(this._instance.en.emit("featureFlagsReloading",!0),this.Js=setTimeout((()=>{this.Ks()}),5))}Ys(){clearTimeout(this.Js),this.Js=void 0}ensureFlagsLoaded(){this.As||this.$s||this.Js||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Ls=t}Ks(t){var e;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var n=this.Te.token,r=this.zs(lm),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:ue({},((e=this.mi)==null?void 0:e.get_initial_props())||{},this.zs(Xa)||{},{$lib:gt.LIB_NAME,$lib_version:gt.LIB_VERSION}),group_properties:this.zs(Qa),timezone:fP()};ur(r)||ge(r)||(s.$device_id=r),(t!=null&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var i=this.Qs();ge(i)||(s.flag_keys=i);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,c=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$s=!0,this._instance._send_request({method:"POST",url:c,data:s,compression:this.Te.disable_compression?void 0:ir.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:u=>{var f,h,p,m=!0;if(this.Xs(u.statusCode),u.statusCode===200&&(this.Ns||(this.$anon_distinct_id=void 0),m=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!m;var _=[];u.error?u.error instanceof Error?_.push(u.error.name==="AbortError"?"timeout":"connection_error"):_.push("unknown_error"):u.statusCode!==200&&_.push("api_error_"+u.statusCode),(f=u.json)!=null&&f.errorsWhileComputingFlags&&_.push("errors_while_computing_flags");var x,y=!((h=u.json)==null||(h=h.quotaLimited)==null||!h.includes("feature_flags"));y&&_.push("quota_limited"),(p=this.mi)==null||p.register({[Py]:_}),y?dn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(s.disable_flags||this.receivedFeatureFlags((x=u.json)!==null&&x!==void 0?x:{},m,{partialResponse:a}),this.Ns&&(this.Ns=!1,this.Ks()))}}})}}Us(){return sP(this.Hs,3)}Xs(t){this.Hs=iP(t,this.Hs,3,(()=>dn.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var n;if(e===void 0&&(e={}),!e.fresh||this.Ds)if(this.As||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else dn.warn('getFeatureFlag for key "'+t+zv)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.Ds)if(this.As||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],a=String(s),c=this.zs(Sy)||void 0,u=this.zs($d)||void 0,f=this.zs(bd)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,p=this._instance.get_session_id(),m=this.zs(ky);p&&p!==m&&(f={},(h=this.mi)==null||h.register({[bd]:f,[ky]:p}))}if((e.send_event||!("send_event"in e))&&(!(t in f)||!f[t].includes(a))){var _,x,y,w,S,T,P,k,A,O,L;Xe(f[t])?f[t].push(a):f[t]=[a],(_=this.mi)==null||_.register({[bd]:f});var R=this.getFeatureFlagDetails(t),M=[...(x=this.zs(Py))!==null&&x!==void 0?x:[]];ge(s)&&M.push("flag_missing");var N={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((y=this.Te.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[t])||null,$feature_flag_bootstrapped_payload:((w=this.Te.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[t])||null,$used_bootstrap_value:!this.Ds};ge(R==null||(S=R.metadata)==null?void 0:S.has_experiment)||(N.$feature_flag_has_experiment=R.metadata.has_experiment),ge(R==null||(T=R.metadata)==null?void 0:T.version)||(N.$feature_flag_version=R.metadata.version);var D,F=(P=R==null||(k=R.reason)==null?void 0:k.description)!==null&&P!==void 0?P:R==null||(A=R.reason)==null?void 0:A.code;F&&(N.$feature_flag_reason=F),R!=null&&(O=R.metadata)!=null&&O.id&&(N.$feature_flag_id=R.metadata.id),ge(R==null?void 0:R.original_variant)&&ge(R==null?void 0:R.original_enabled)||(N.$feature_flag_original_response=ge(R.original_variant)?R.original_enabled:R.original_variant),R!=null&&(L=R.metadata)!=null&&L.original_payload&&(N.$feature_flag_original_payload=R==null||(D=R.metadata)==null?void 0:D.original_payload),M.length&&(N.$feature_flag_error=M.join(",")),this._instance.capture("$feature_flag_called",N)}if(r)return{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:pE(i)}}}else dn.warn('getFeatureFlagResult for key "'+t+zv)}getRemoteConfigPayload(t,e){var n=this.Te.token,r={distinct_id:this._instance.get_distinct_id(),token:n,person_properties:{$lib:gt.LIB_NAME,$lib_version:gt.LIB_VERSION}};this.Gs()&&(r.evaluation_contexts=this.Zs());var s=this.Qs();ge(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Te.disable_compression?void 0:ir.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(i){var a,c=(a=i.json)==null?void 0:a.featureFlagPayloads;e((c==null?void 0:c[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this.Ds)return e.defaultValue;if(!(this.As||this.getFlags()&&this.getFlags().length>0))return dn.warn('isFeatureEnabled for key "'+t+zv),e.defaultValue;var n=this.getFeatureFlag(t,e);return ge(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.mi){this.As=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(a,c,u,f,h,p){u===void 0&&(u={}),f===void 0&&(f={}),h===void 0&&(h={});var m=(R=>{var M=R.flags;return M?(R.featureFlags=Object.fromEntries(Object.keys(M).map((N=>{var D;return[N,(D=M[N].variant)!==null&&D!==void 0?D:M[N].enabled]}))),R.featureFlagPayloads=Object.fromEntries(Object.keys(M).filter((N=>M[N].enabled)).filter((N=>{var D;return(D=M[N].metadata)==null?void 0:D.payload})).map((N=>{var D;return[N,(D=M[N].metadata)==null?void 0:D.payload]})))):R.featureFlags&&dn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),R})(a),_=m.flags,x=m.featureFlags,y=m.featureFlagPayloads;if(x){var w=a.requestId,S=a.evaluatedAt;if(Xe(x)){dn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var T={};if(x)for(var P=0;x.length>P;P++)T[x[P]]=!0;c&&c.register({[Ep]:x,[nl]:T,[cm]:!1})}else{var k=x,A=y,O=_;if(p!=null&&p.partialResponse)k=ue({},u,k),A=ue({},f,A),O=ue({},h,O);else if(a.errorsWhileComputingFlags)if(_){var L=new Set(Object.keys(_).filter((R=>{var M;return!((M=_[R])!=null&&M.failed)})));k=ue({},u,Object.fromEntries(Object.entries(k).filter((R=>L.has(R[0]))))),A=ue({},f,Object.fromEntries(Object.entries(A||{}).filter((R=>L.has(R[0]))))),O=ue({},h,Object.fromEntries(Object.entries(O||{}).filter((R=>L.has(R[0])))))}else k=ue({},u,k),A=ue({},f,A),O=ue({},h,O);c&&c.register(ue({[Ep]:Object.keys(dC(k)),[nl]:k||{},[Cp]:A||{},[by]:O||{},[cm]:a.minimalFlagCalledEvents===!0},w?{[Sy]:w}:{},S?{[$d]:S}:{}))}}})(t,this.mi,r,s,i,n),e||(this.js=!1),this.eo(e)}}override(t,e){e===void 0&&(e=!1),dn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return dn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.mi.unregister(zi),this.mi.unregister(hc),this.eo(),Ha.info("All overrides cleared");if(Xe(t)){var e=uC(t);return this.mi.register({[zi]:e}),this.eo(),Ha.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.Fs=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.mi.unregister(zi),Ha.info("Flag overrides cleared");else if(r.flags){if(Xe(r.flags)){var s=uC(r.flags);this.mi.register({[zi]:s})}else this.mi.register({[zi]:r.flags});Ha.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.mi.unregister(hc),Ha.info("Payload overrides cleared")):r.payloads&&(this.mi.register({[hc]:r.payloads}),Ha.info("Payload overrides set",{payloads:r.payloads}))),void this.eo()}if(t&&typeof t=="object")return this.mi.register({[zi]:t}),this.eo(),Ha.info("Flag overrides set",{flags:t});dn.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.As){var e=this.ro(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){dn.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r,s=(this.zs(md)||[]).find((u=>u.flagKey===t)),i={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(a.$early_access_feature_name=s.name),n&&(a.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(i,!1);var c=ue({},this.getFlagVariants(),{[t]:e});(r=this.mi)==null||r.register({[Ep]:Object.keys(dC(c)),[nl]:c}),this.eo()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.zs(md),s=n?"&"+n.map((i=>"stage="+i)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+s),method:"GET",timestampMode:"query",callback:i=>{var a,c;if(i.json){var u=i.json.earlyAccessFeatures;return(a=this.mi)==null||a.unregister(md),(c=this.mi)==null||c.register({[md]:u}),t(u)}}})}ro(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((n=>e[n])),flagVariants:Object.keys(e).filter((n=>e[n])).reduce(((n,r)=>(n[r]=e[r],n)),{})}}eo(t){var e=this.ro(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){dn.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.zs(Xa)||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in n||(i[a]=s[a]));this._instance.register({[Xa]:ue({},n,i,r)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=ue({},this.zs(Xa)||{});t.forEach((r=>{delete n[r]})),this._instance.register({[Xa]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(Xa),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.zs(Qa)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=ue({},n[r],t[r]),delete t[r]})),this._instance.register({[Qa]:ue({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.zs(Qa)||{};this._instance.register({[Qa]:ue({},e,{[t]:{}})})}else this._instance.unregister(Qa)}reset(){this.As=!1,this.$s=!1,this.Ls=!1,this.Ns=!1,this.Ds=!1,this.$anon_distinct_id=void 0,this.Ys(),this.Fs=!1,this.Hs=0}}},wD={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!((t=this.io)==null||!t.isStarted)}get status(){var t,e;return this.no===id||this.no===Qh?this.no:(t=(e=this.io)==null?void 0:e.status)!==null&&t!==void 0?t:this.no}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=sC,this.so=void 0,this._instance=t,!this._instance.sessionManager)throw Li.error("started without valid sessionManager"),new Error(zy+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===Xi)throw new Error(zy+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var t,e=!((t=this._instance.get_property(sl))==null||!t.enabled),n=!this.Te.disable_session_recording,r=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return re&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this.oo||(e=this.io)==null||!e.isStarted){var n=!ge(Object.assign)&&!ge(Array.from);this.oo&&n?(this.ao(t),Li.info("starting")):(this.no=sC,this.stopRecording())}}ao(t){var e,n,r;this.oo&&(this.no!==id&&this.no!==Qh&&(this.no=iC),Ve!=null&&(e=Ve.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=Ve.__PosthogExtensions__)!=null&&n.initSessionRecording?this.lo(t):(r=Ve.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.uo,(s=>{if(s)return Li.error("could not load recorder",s);this.lo(t)})))}stopRecording(){var t,e;(t=this.so)==null||t.call(this),this.so=void 0,(e=this.io)==null||e.stop()}ho(){var t,e;(t=this.so)==null||t.call(this),this.so=void 0,(e=this.io)==null||e.discard()}do(){var t,e;(t=this.mi)==null||t.unregister(k2),(e=this.mi)==null||e.unregister(I6)}co(t,e){if(Je(t))return null;var n,r=Hn(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Li.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}vo(t){if(this.mi){var e,n,r=this.mi,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,c=this.co((i=this.Te.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.co(a==null?void 0:a.sampleRate,"remote config sampleRate"),f=c??u;Je(f)&&this.do();var h=a==null?void 0:a.minimumDurationMilliseconds;r.register({[sl]:ue({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:ue({capturePerformance:t.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:f,minimumDurationMilliseconds:ge(h)?null:h,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers,version:a==null?void 0:a.version,triggerGroups:a==null?void 0:a.triggerGroups})})};s(),(e=this.so)==null||e.call(this),this.so=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.vo(e),void this.ho()):(this.vo(e),void this.startIfEnabledOrStop()):(this.no===id&&(this.no=Qh,Li.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.io)!=null&&n.log?this.io.log(t,e):Li.warn("log called before recorder was ready")}get uo(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(sl);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}fo(){var t,e,n=this._instance.get_property(sl);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(s){return Li.warn("persisted remote config for session recording is invalid and will be ignored",s),!1}var r=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-r}lo(t){var e,n;if((e=Ve.__PosthogExtensions__)==null||!e.initSessionRecording)return Li.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[V6]:!0});if(this.io||(this.io=(n=Ve.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo())return this.no===Qh||this.no===id?void 0:(this.no=id,Li.info("persisted remote config is stale, requesting fresh config before starting"),void new hP(this._instance).load());this.no=iC,this.io.start(t)}onRRwebEmit(t){var e;(e=this.io)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.io||(e=this.mi)==null||e.register({[O6]:!0}),(t=this.io)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.io||(e=this.mi)==null||e.register({[M6]:!0}),(t=this.io)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.io||(n=this.mi)==null||n.register({[t==="url"?L6:N6]:!0}),(e=this.io)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.io)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.io)==null||!n.tryAddCustomEvent(t,e))}}},bD={autocapture:class{constructor(t){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=t,this.rageclicks=new tC(t.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var t,e,n=Lt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((r=>new RegExp(r))),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map((r=>new RegExp(r))),n}wo(){if(this.isBrowserSupported()){if(re&&be){var t=n=>{n=n||(re==null?void 0:re.event);try{this.xo(n)}catch(r){jv.error("Failed to capture event",r)}};if(Ht(be,"submit",t,{capture:!0}),Ht(be,"change",t,{capture:!0}),Ht(be,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=n=>{n=n||(re==null?void 0:re.event);try{this.xo(n,Dv)}catch(r){jv.error("Failed to capture copy/cut event",r)}};Ht(be,"copy",e,{capture:!0}),Ht(be,"cut",e,{capture:!0})}}}else jv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(t){if(this.yo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.bo=e.elementsChainAsString);var n=e.autocapture_opt_out;zs(n)&&(this.instance.persistence&&this.instance.persistence.register({[my]:n}),this.mo=n),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this._o=t}getElementSelectors(t){var e,n=[];return(e=this._o)==null||e.forEach((r=>{var s=be==null?void 0:be.querySelectorAll(r);s==null||s.forEach((i=>{t===i&&n.push(r)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[my],r=this.mo,s=this.instance.Ur()&&!this.yo;if(ur(r)&&!zs(n)&&!s)return!1;var i=(e=this.mo)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!i}xo(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=Ev(t);W6(r)&&(r=r.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&DE(r,this.instance.config.rageclick)&&this.xo(t,"$rageclick");var s=e===Dv;if(r&&(function(p,m,_,x,y,w){var S;if(!re||I2(p)||_!=null&&_.url_allowlist&&!OE(_.url_allowlist,w)||_!=null&&_.url_ignorelist&&OE(_.url_ignorelist,w))return!1;if(_!=null&&_.dom_event_allowlist){var T=_.dom_event_allowlist;if(T&&!T.some((R=>m.type===R)))return!1}var P=X6(p,x),k=P.parentIsUsefulElement,A=P.targetElementList;if(!(function(R,M){var N=M==null?void 0:M.element_allowlist;if(ge(N))return!0;var D,F=function(X){if(N.some((W=>X.tagName.toLowerCase()===W)))return{v:!0}};for(var q of R)if(D=F(q))return D.v;return!1})(A,_)||!Oy(A,_==null?void 0:_.css_selector_allowlist)||Oy(A,(S=_==null?void 0:_.css_selector_ignorelist)!==null&&S!==void 0?S:bN))return!1;try{var O=re.getComputedStyle(p);if(O&&O.getPropertyValue("cursor")==="pointer"&&m.type==="click")return!0}catch{}var L=p.tagName.toLowerCase();switch(L){case"html":return!1;case"form":return(y||["submit"]).indexOf(m.type)>=0;case"input":case"select":case"textarea":return(y||["change","click"]).indexOf(m.type)>=0;default:return k?(y||["click"]).indexOf(m.type)>=0:(y||["click"]).indexOf(m.type)>=0&&(A2.indexOf(L)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,this.Te,s,s?["copy","cut"]:void 0,this.instance)){var i=fD(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.bo,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=i.props;if(i.explicitNoCapture)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(a.$element_selectors=c),e===Dv){var u,f=Z6(re==null||(u=re.getSelection())==null?void 0:u.toString()),h=t.type||"clipboard";if(!f)return!1;a.$selected_content=f,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Hs(be==null?void 0:be.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.ko=(re==null||(e=re.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(_e.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.So&&this.So(),this.So=void 0,_e.info("History API monitoring stopped")}monitorHistoryChanges(){re&&re.history&&(this.Co("pushState"),this.Co("replaceState"),this.Mo())}Co(t){var e;if(re&&((e=re.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,i){try{if(!(s in r))return nC;var a={next:r[s]},c=i((function(){for(var u=arguments.length,f=new Array(u),h=0;u>h;h++)f[h]=arguments[h];return a.next.apply(this,f)}));return Hs(c)&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:a}})),r[s]=c,()=>{if(r[s]!==c)for(var u=r[s];Hs(u)&&u.__posthog_layer__;){var f=u.__posthog_layer__;if(f.next===c)return void(f.next=a.next);u=f.next}else r[s]=a.next}}catch{return nC}})(re.history,t,(r=>function(s,i,a){r.call(this,s,i,a),n.Io(t)}))}}Io(t){try{var e,n=re==null||(e=re.location)==null?void 0:e.pathname;if(!n)return;n!==this.ko&&this.isEnabled&&this._instance.capture(pc,{navigation_type:t}),this.ko=n}catch(r){_e.error("Error capturing "+t+" pageview",r)}}Mo(){if(!this.So){var t=()=>{this.Io("popstate")};Ht(re,"popstate",t),this.So=()=>{re&&re.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.To=!1,this.po=!1,this.Eo=null,this.instance=t,this.To=!((e=this.instance.persistence)==null||!e.props[gy]),this.rageclicks=new tC(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Lt(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Je(this.Te.capture_heatmaps)?Je(this.Te.enable_heatmaps)?this.To:this.Te.enable_heatmaps:this.Te.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.po)return;pD.info("starting..."),this.Ro(),this.xe()}else{var t;clearInterval((t=this.Eo)!==null&&t!==void 0?t:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[gy]:n}),this.To=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Oo(t){Vv(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}xe(){this.Eo&&clearInterval(this.Eo),this.Eo=(be==null?void 0:be.visibilityState)==="visible"?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){re&&be&&(this.Fo=this.oi.bind(this),Ht(re,pm,this.Fo),this.Ao=t=>this.pe(t||(re==null?void 0:re.event)),Ht(be,"click",this.Ao,{capture:!0}),this.$o=t=>this.Lo(t||(re==null?void 0:re.event)),Ht(be,"mousemove",this.$o,{capture:!0}),this.No=new VE(this.instance,AN,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.xe.bind(this),Ht(be,hm,this.Do),this.po=!0)}Po(){var t;re&&be&&(this.Fo&&re.removeEventListener(pm,this.Fo),this.Ao&&be.removeEventListener("click",this.Ao,{capture:!0}),this.$o&&be.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&be.removeEventListener(hm,this.Do),clearTimeout(this.qo),(t=this.No)==null||t.stop(),this.po=!1)}jo(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(a,c,u){for(var f=a;f&&ia(f)&&!Zr(f,"body");){if(f===u)return!1;var h=void 0;try{var p,m,_;h=(p=(m=(_=f.ownerDocument)==null?void 0:_.defaultView)!==null&&m!==void 0?m:re)==null?void 0:p.getComputedStyle(f).position}catch{return!1}if(Ge(c,h))return!0;f=q6(f)}return!1})(Ev(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}pe(t,e){var n;if(e===void 0&&(e="click"),!ME(t.target)&&Vv(t)){var r=this.jo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&DE(Ev(t),this.instance.config.rageclick)&&this.Nt(ue({},r,{type:"rageclick"})),this.Nt(r)}}Lo(t){!ME(t.target)&&Vv(t)&&(clearTimeout(this.qo),this.qo=setTimeout((()=>{this.Nt(this.jo(t,"mousemove"))}),500))}Nt(t){if(re){var e=this.Te.disable_capture_url_hashes?sa(re.location.href):re.location.href,n=this.Te.custom_personal_data_properties,r=this.Te.mask_personal_data_properties?[...Jc,...n||[]]:[],s=zd(e,r,Ud);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(t)}}oi(){this.R&&!Zo(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:VE,webVitalsAutocapture:class{constructor(t){var e;this.To=!1,this.po=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Bo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>ue({},n,{["$web_vitals_"+r.name+"_event"]:ue({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=n=>{var r;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.zo();if(!ge(s))if(Je(n==null?void 0:n.name)||Je(n==null?void 0:n.value))$a.error("Invalid metric received",n);else if(!this.Vo||this.Vo>n.value){this.R.url!==s&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),ge(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=ge(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var i=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),a=ue({},n,{$current_url:s,timestamp:Date.now()});ge(i)||(a.$session_id=i.sessionId,a.$window_id=i.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else $a.error("Ignoring metric with value >= "+this.Vo,n)},this.Wo=()=>{if(!this.po){var n,r,s,i,a=Ve.__PosthogExtensions__;if(!ge(a)&&!ge(a.postHogWebVitalsCallbacks)){var c=a.postHogWebVitalsCallbacks;n=c.onLCP,r=c.onCLS,s=c.onFCP,i=c.onINP}n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Uo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Uo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Uo.bind(this)),this.po=!0):$a.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.To=!((e=this._instance.persistence)==null||!e.props[xy]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=Lt(this.Zo)?(t=this.Zo)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Je(n)?((e=this._instance.persistence)==null?void 0:e.props[wy])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Lt(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Lt(this.Zo)?this.Zo.web_vitals_attribution:void 0;return t!=null&&t}get Vo(){var t=Lt(this.Zo)&&Hn(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:rC;return t>0&&6e4>=t?rC:t}get isEnabled(){var t=rn==null?void 0:rn.protocol;if(t!=="http:"&&t!=="https:")return $a.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Lt(this.Zo)?this.Zo.web_vitals:zs(this.Zo)?this.Zo:void 0;return zs(e)?e:this.To}startIfEnabled(){this.isEnabled&&!this.po&&($a.info("enabled, starting..."),this.er(this.Wo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=Lt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Lt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[xy]:n}),this._instance.persistence.register({[wy]:r})),this.To=n,this.startIfEnabled()}}}er(t){var e,n;(e=Ve.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(n=Ve.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?$a.error("failed to load script",r):t()}))}zo(){var t=re?this._instance.config.disable_capture_url_hashes?sa(re.location.href):re.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Jc,...e||[]]:[];return zd(t,n,Ud)}$a.error("Could not determine current URL")}}},SD={exceptionObserver:class{constructor(t){var e;this.Wo=()=>{var n;if(re&&this.isEnabled&&(n=Ve.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=Ve.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=Ve.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Ve.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=r(this.captureException.bind(this))),!this.Qo&&this.Te.capture_unhandled_rejections&&(this.Qo=s(this.captureException.bind(this))),!this.Jo&&this.Te.capture_console_errors&&(this.Jo=i(this.captureException.bind(this)))}catch(a){sd.error("failed to start",a),this.Ko()}}},this._instance=t,this.Yo=!((e=this._instance.persistence)==null||!e.props[vy]),this.Xo=new EL(ue({},(function(n){var r,s,i,a;return n===void 0&&(n={}),{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(a=n.exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking),{refillInterval:1e4,Ge:sd})),this.Te=this.ea(),this.startIfEnabledOrStop()}ea(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Lt(t)?e=ue({},e,t):(ge(t)?this.Yo:t)&&(e=ue({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(sd.info("enabled"),this.Ko(),this.er(this.Wo)):this.Ko()}er(t){var e,n;(e=Ve.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=Ve.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return sd.error("failed to load script",r);t()}))}Ko(){var t,e,n;(t=this.Go)==null||t.call(this),this.Go=void 0,(e=this.Qo)==null||e.call(this),this.Qo=void 0,(n=this.Jo)==null||n.call(this),this.Jo=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Yo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[vy]:this.Yo}),this.Te=this.ea(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ea()}captureException(t){var e,n,r,s=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.Xo.consumeRateLimit(s)?sd.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.ta=[],this.ra=new HL([new qL,new sN,new XL,new YL,new nN,new tN,new JL,new rN],(function(r){for(var s=arguments.length,i=new Array(s>1?s-1:0),a=1;s>a;a++)i[a-1]=arguments[a];return function(c,u){u===void 0&&(u=0);for(var f=[],h=c.split(`
18
+ `),p=u;h.length>p;p++){var m=h[p];if(1024>=m.length){var _=TE.test(m)?m.replace(TE,"$1"):m;if(!_.match(/\S*Error: /)){for(var x of i){var y=x(_,r);if(y){f.push(y);break}}if(f.length>=50)break}}}return(function(w){if(!w.length)return[];var S=Array.from(w);return S.reverse(),S.slice(0,50).map((T=>{return ue({},T,{filename:T.filename||(P=S,P[P.length-1]||{}).filename,function:T.function||Xc});var P}))})(f)}})("web:javascript",WL,ZL)),this._instance=t,this.ta=(e=(n=this._instance.persistence)==null?void 0:n.get_property(yy))!==null&&e!==void 0?e:[],this.ia=am(this.na()),this.sa=new oN(this.ia)}onConfigChange(){this.ia=am(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(t){var e,n,r;if(t.ok){var s=t.config;if("errorTracking"in s){var i=(e=(n=s.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],a=(r=s.errorTracking)==null?void 0:r.captureExtensionExceptions;this.ta=i,this._instance.persistence&&this._instance.persistence.register({[yy]:this.ta,[_y]:a})}}}get oa(){var t,e=!!this._instance.get_property(_y),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.ra.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.ia.enabled)try{if(!xt(t)||t.trim().length===0)return void Ni.warn("Ignoring exception step because message must be a non-empty string");var n=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(i).reduce(((c,u)=>iN.has(u)?(a.push(u),c):(c[u]=i[u],c)),{}),droppedKeys:a}})(this.aa(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&Ni.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(ue({[im]:t,[om]:new Date().toISOString()},r))}catch(i){Ni.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.la(e)){if(this.ua(e))return this.ha("Exception dropped: matched a suppression rule"),void Ni.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(e))return this.ha("Exception dropped: thrown by a browser extension"),void Ni.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(e))return this.ha("Exception dropped: thrown by the PostHog SDK"),void Ni.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.ia.enabled&&Je(t.$exception_steps)?this.va(t):t,r=typeof(i=globalThis._posthogReleaseId)=="string"&&i.length>0?i:void 0;r&&(n.$release_id=r);try{var s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return s&&this.sa.clear(),s}catch(a){return Ni.error("Failed to capture exception event. Dropping this exception.",a),void this.sa.clear()}}catch(a){return void Ni.error("Failed to process exception event. Ignoring this exception.",a)}var i}va(t){try{var e=this.sa.getAttachable();return e.length===0?t:ue({},t,{$exception_steps:e})}catch(n){return Ni.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}ha(t){this.ia.enabled&&this.sa.add({[im]:t,[om]:new Date().toISOString()})}aa(t){return Lt(t)?ue({},t):{}}na(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}ua(t){if(t.length===0)return!1;var e=t.reduce(((n,r)=>{var s=r.type,i=r.value;return xt(s)&&s.length>0&&n.$exception_types.push(s),xt(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.ta.some((n=>{var r=n.values.map((s=>{var i,a=kP[s.operator],c=Xe(s.value)?s.value:[s.value],u=(i=e[s.key])!==null&&i!==void 0?i:[];return c.length>0&&a(c,u)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}da(t){return t.flatMap((e=>{var n,r;return(n=(r=e.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}ca(t){if(t.length>0){var e,n,r,s,i=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],a=i[i.length-1];return(r=a==null||(s=a.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}la(t){return!Je(t)&&Xe(t)}}},ED=ue({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.fa=null,this.pa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var n,r;if(this.mi&&this.mi.register({[C2]:!!e.productTours}),!Hv(this._instance))return!this.fa&&Je((n=this.mi)==null?void 0:n.props[gd])||$v.info("product tours disabled; stopping and clearing cached tours"),(r=this.fa)==null||r.stop(),this.fa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fa&&Hv(this._instance)&&this.er((()=>this.ga()))}er(t){var e,n;(e=Ve.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=Ve.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?$v.error("Could not load product tours script",r):t()}))}ga(){var t;!this.fa&&(t=Ve.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.fa=Ve.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!Xe(this.pa)||e){var n=this.mi;if(n){var r=n.props[gd];if(Xe(r)&&!e)return this.pa=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:s=>{if(Hv(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return $v.error(a),void t([],{isLoaded:!1,error:a})}var c=Xe(s.json.product_tours)?s.json.product_tours:[];this.pa=c,n&&n.register({[gd]:c}),t(c,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.pa,{isLoaded:!0})}getActiveProductTours(t){Je(this.fa)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(t)}showProductTour(t){var e;(e=this.fa)==null||e.showTourById(t)}previewTour(t){this.fa?this.fa.previewTour(t):this.er((()=>{var e;this.ga(),(e=this.fa)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.fa)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.fa)==null||t.nextStep()}previousStep(){var t;(t=this.fa)==null||t.previousStep()}clearCache(){var t;this.pa=null,(t=this.mi)==null||t.unregister(gd)}resetTour(t){var e;(e=this.fa)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.fa)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.fa)==null||e.cancelPendingTour(t)}}},n0),CD={siteApps:class{constructor(t){this.ma=0,this._instance=t,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(t,e){if(e){var n=this.globalsForEvent(e);this.ya.push(n),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var t;return(t=Ve._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.ba.bind(this));this._a=()=>{t(),this.ya=[],this._a=void 0}}}globalsForEvent(t){var e,n,r,s,i,a,c;if(!t)throw new Error("Event payload is required");var u={},f=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(h)){var m=p[0];u[m]={id:f[m],type:m,properties:p[1]}}var _=t.$set_once,x=t.$set;return{event:ue({},X8(t,mD),{properties:ue({},t.properties,x?{$set:ue({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},x)}:{},_?{$set_once:ue({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},_)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(c=t.properties)==null?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}wa(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(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}xa(){var t,e,n,r,s,i,a,c;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=be==null?void 0:be.defaultView,f=u==null||(t=u.Node)==null?void 0:t.prototype;if(!u||!f)return()=>{};if(this.ma++,this.ka)return this.Sa();var h=[],p=this,m=new WeakSet,_=(w,S,T)=>{if(w!=null&&w[S]){var P=w[S];w[S]=T(P),h.push((()=>{w[S]=P}))}},x=w=>{if(m.has(w))return w;var S=p.wa(w);return S&&m.add(S),S},y=w=>w.map((S=>typeof S=="string"?S:x(S))).filter((S=>!ur(S)));return _(f,"appendChild",(w=>function(S){var T=x(S);return T?w.call(this,T):S})),_(f,"insertBefore",(w=>function(S,T){var P=x(S);return P?w.call(this,P,T):S})),_(f,"replaceChild",(w=>function(S,T){var P=x(S);return P?w.call(this,P,T):T})),[(e=u.Element)==null?void 0:e.prototype,(n=u.Document)==null?void 0:n.prototype,(r=u.DocumentFragment)==null?void 0:r.prototype].forEach((w=>{_(w,"append",(S=>function(){for(var T=arguments.length,P=new Array(T),k=0;T>k;k++)P[k]=arguments[k];return S.apply(this,y(P))})),_(w,"prepend",(S=>function(){for(var T=arguments.length,P=new Array(T),k=0;T>k;k++)P[k]=arguments[k];return S.apply(this,y(P))}))})),[(s=u.Element)==null?void 0:s.prototype,(i=u.CharacterData)==null?void 0:i.prototype,(a=u.DocumentType)==null?void 0:a.prototype].forEach((w=>{_(w,"before",(S=>function(){for(var T=arguments.length,P=new Array(T),k=0;T>k;k++)P[k]=arguments[k];return S.apply(this,y(P))})),_(w,"after",(S=>function(){for(var T=arguments.length,P=new Array(T),k=0;T>k;k++)P[k]=arguments[k];return S.apply(this,y(P))})),_(w,"replaceWith",(S=>function(){for(var T=arguments.length,P=new Array(T),k=0;T>k;k++)P[k]=arguments[k];var A=y(P);return P.length&&!A.length?void 0:S.apply(this,A)}))})),_((c=u.Element)==null?void 0:c.prototype,"insertAdjacentElement",(w=>function(S,T){var P=x(T);return P?w.call(this,S,P):null})),this.ka=()=>{h.forEach((w=>w())),this.ka=void 0},this.Sa()}Sa(){var t=!1;return()=>{var e;t||(t=!0,this.ma--,this.ma===0&&((e=this.ka)==null||e.call(this)))}}Ca(t,e){e===void 0&&(e=!0);var n=this.xa();try{var r=t(n);return e&&n(),r}catch(s){throw n(),s}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var a;!e.errored&&this.ya.length&&(ei.info("Processing "+this.ya.length+" events for site app with id "+t.id),this.ya.forEach((c=>this.Ca((()=>e.processEvent==null?void 0:e.processEvent(c))))),e.processedBuffer=!0),Object.values(this.apps).every((c=>c.processedBuffer||c.errored))&&((a=this._a)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,ei.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var i=this.Ca((a=>t.init({posthog:this._instance,callback(c){a(),s(c)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(a){ei.error(oC+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){ei.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}Ma(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}Ia(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.Ca((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){ei.error("Error while processing event "+t.event+" for site app "+i.id,a)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.Ma(),void this._instance.on("eventCaptured",(u=>this.Ia(u)))):void ei.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this._a)==null||n.call(this),t.ok){var i=t.config;if((r=i.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(){var u,f=c.id,h=c.url;Ve["__$$ph_site_app_"+f]=s._instance,(u=Ve.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,h,(p=>{if(p)return ei.error(oC+f,p)}))};for(var c of i.siteApps)a()}else ei.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},kD={tracingHeaders:class{constructor(t){this.Ta=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var e,n,r=this.Pa();r?(ge(this.Ta)&&(this.Ta=(e=Ve.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),ge(this.Ea)&&(this.Ea=(n=Ve.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ko()},this._instance=t}initialize(){this.startIfEnabledOrStop()}er(t){var e,n;(e=Ve.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=Ve.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return hD.error("failed to load script",r);t()}))}Oa(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}Pa(){var t=this.Oa();return Xe(t)?(Xe(this.Ra)?this.Ra.splice(0,this.Ra.length,...t):this.Ra=[...t],t.length>0?this.Ra:void 0):(Xe(this.Ra)&&this.Ra.splice(0),this.Ra=t||void 0,this.Ra)}Ko(){var t,e;(t=this.Ta)==null||t.call(this),(e=this.Ea)==null||e.call(this),this.Ta=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.er(this.Wo):this.Ko()}}},PD=ue({surveys:class{get Te(){return this._instance.config}constructor(t){this.Fa=void 0,this._surveyManager=null,this.Aa=!1,this.$a=[],this.La=null,this.Na=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){if(!t.ok)return yt.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Je(e))return yt.warn("Flags not loaded yet. Not loading surveys.");var n=Xe(e);this.Fa=n?e.length>0:e,yt.info("flags response received, isSurveysEnabled: "+this.Fa),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(RP)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.Aa)yt.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)yt.info(aC);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())yt.info("Not loading surveys in cookieless mode without consent.");else{var t=Ve==null?void 0:Ve.__PosthogExtensions__;if(t){if(!ge(this.Fa)||this.Te.advanced_enable_surveys){var e=this.Fa||this.Te.advanced_enable_surveys;this.Aa=!0;try{var n=t.generateSurveys;if(n)return void this.Da(n,e);var r=t.loadExternalDependency;if(!r)return void this.qa(P2);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.qa("Could not load surveys script",s):this.Da(t.generateSurveys,e)}))}catch(s){throw this.qa("Error initializing surveys",s),s}finally{this.Aa=!1}}}else yt.error("PostHog Extensions not found.")}}Da(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new yD(this._instance),yt.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(t,e){yt.error(t,e),this.ja({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.$a.push(t),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Te.disable_surveys)return yt.info(aC),t([]);var n,r=this._instance.get_property(Ey);if(r&&!e)return t(r,{isLoaded:!0}),void(this.Ha()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.La?this.La.then((s=>t(s.surveys,s.context))):(typeof Promise<"u"&&(this.La=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:s=>{var i;this.La=null;var a=s.statusCode;if(a!==200||!s.json){var c="Surveys API could not be loaded, status: "+a;yt.error(c),this.Na=Date.now();var u={isLoaded:!1,error:c};return t([],u),void(n==null||n({surveys:[],context:u}))}this.Na=null;var f,h=s.json.surveys||[],p=h.filter((_=>(function(x){return!(!x.start_date||x.end_date)})(_)&&(TP(_)||(function(x){var y;return!((y=x.conditions)==null||(y=y.actions)==null||(y=y.values)==null||!y.length)})(_))));p.length>0&&((f=this._surveyEventReceiver)==null||f.register(p)),(i=this._instance.persistence)==null||i.register({[Ey]:h,[um]:Date.now()});var m={isLoaded:!0};t(h,m),n==null||n({surveys:h,context:m})}}))}Ha(){return this.Ba()&&!this.La&&!this.Ua()}Ba(){var t=this._instance.get_property(um);return Hn(t)&&Date.now()-t>3e5}Ua(){return Hn(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};AP(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}ja(t){for(var e of this.$a)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){yt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!Je(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);yt.warn("init was not called")}za(t){var e=null;return this.getSurveys((n=>{var r;e=(r=n.find((s=>s.id===t)))!==null&&r!==void 0?r:null})),e}Va(t){if(Je(this._surveyManager))return{eligible:!1,reason:Jh};var e=typeof t=="string"?this.za(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Wa(t){if(Je(this._surveyManager))return{eligible:!1,reason:Jh};var e=typeof t=="string"?this.za(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Je(this._surveyManager))return yt.warn("init was not called"),{visible:!1,disabledReason:Jh};var e=this.Wa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Je(this._surveyManager)?(yt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Jh})):new Promise((n=>{this.getSurveys((r=>{var s,i=(s=r.find((c=>c.id===t)))!==null&&s!==void 0?s:null;if(i){var a=this.Wa(i);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(Je(this._surveyManager))yt.warn("init was not called");else{var s=typeof t=="string"?this.za(t):t;if(s!=null&&s.id)if(rD.includes(s.type)){var i=be==null?void 0:be.querySelector(e);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(yt.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,c;yt.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(c=this._surveyManager)==null||c.renderSurvey(s,i,n),yt.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);yt.warn("Survey element not found")}else yt.warn("Surveys of type "+s.type+" cannot be rendered in the app");else yt.warn("Survey not found")}}displaySurvey(t,e){var n;if(Je(this._surveyManager))yt.warn("init was not called");else{var r=this.za(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=ue({},r,{appearance:ue({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Ny.Popover&&e.initialResponses&&yt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.Va(r);if(!i.eligible)return void yt.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==Ny.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else yt.warn("Survey not found")}}cancelPendingSurvey(t){Je(this._surveyManager)?yt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},n0),TD={toolbar:class{constructor(t){this.instance=t}Za(t){Ve.ph_toolbar_state=t}Ga(){var t;return(t=Ve.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),$6(this.instance.config)||!re||!be)return!1;t=t??re.location,n=n??re.history;try{if(!e){try{re.localStorage.setItem("test","test"),re.localStorage.removeItem("test")}catch{return!1}e=re==null?void 0:re.localStorage}var r,s=_D||ym(t.hash,"__posthog")||ym(t.hash,"state"),i=s?AE((()=>JSON.parse(atob(decodeURIComponent(s)))))||AE((()=>JSON.parse(decodeURIComponent(s)))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?t.hash=i.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(lC)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Qa(t){var e=Ve.ph_load_toolbar||Ve.ph_load_editor;!Je(e)&&Hs(e)?e(t,this.instance):cC.warn("No toolbar load function found")}loadToolbar(t){var e=!(be==null||!be.getElementById(B6));if(!re||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=ue({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(re.localStorage.setItem(lC,JSON.stringify(ue({},r,{source:void 0}))),this.Ga()===2)this.Qa(r);else if(this.Ga()===0){var s;this.Za(1),(s=Ve.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return cC.error("[Toolbar] Failed to load",i),void this.Za(0);this.Za(2),this.Qa(r)})),Ht(re,"turbolinks:load",(()=>{this.Za(0),this.loadToolbar(r)}))}return!0}Ja(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},RD=ue({experiments:Yn},n0),AD={conversations:class{constructor(t){this.Ka=void 0,this._conversationsManager=null,this.Ya=!1,this.Xa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;Je(e)||(zs(e)?this.Ka=e:(this.Ka=e.enabled,this.Xa=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ka=void 0,this.Xa=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ya||this._instance.config.disable_conversations||$6(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=Ve==null?void 0:Ve.__PosthogExtensions__;if(t&&!ge(this.Ka)&&this.Ka)if(this.Xa&&this.Xa.token){this.Ya=!0;try{var e=t.initConversations;if(e)return this.el(e),void(this.Ya=!1);var n=t.loadExternalDependency;if(!n)return void this.tl(P2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.tl("Could not load conversations script",r):this.el(t.initConversations),this.Ya=!1}))}catch(r){this.tl("Error initializing conversations",r),this.Ya=!1}}else fs.error("Conversations enabled but missing token in remote config.")}}el(t){if(this.Xa)try{this._conversationsManager=t(this.Xa,this._instance),fs.info("Conversations loaded successfully")}catch(e){this.tl("Error completing conversations initialization",e)}else fs.error("Cannot complete initialization: remote config is null")}tl(t,e){fs.error(t,e),this._conversationsManager=null,this.Ya=!1}show(){this._conversationsManager?this._conversationsManager.show():fs.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ka===!0&&!ur(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return en((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(fs.warn(za),null)}))()}getMessages(t,e){var n=this;return en((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(fs.warn(za),null)}))()}markAsRead(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(fs.warn(za),null)}))()}getTickets(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(fs.warn(za),null)}))()}requestRestoreLink(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(fs.warn(za),null)}))()}restoreFromToken(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(fs.warn(za),null)}))()}restoreFromUrlToken(){var t=this;return en((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(fs.warn(za),null)}))()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}En(){var t;(t=this._conversationsManager)==null||t.setIdentity()}Rn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},ID={logs:class{constructor(t){var e;this.rl=!1,this.il=!1,this.Ge=Ft("[logs]"),this.Gr=[],this.nl=[],this.Hs=0,this.sl=()=>{var n,r;this.Hs=0,(n=this.ol)==null||n.onReconnect(),(r=this.al)==null||r.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.rl=!0),re&&Ht(re,"online",this.sl)}ll(t,e,n,r){var s,i=(function(a,c){var u,f,h,p,m,_,x,y=(u=a==null?void 0:a.flushIntervalMs)!==null&&u!==void 0?u:3e3,w=(f=a==null?void 0:a.maxBufferSize)!==null&&f!==void 0?f:100,S=c!=null&&c.consoleCapture?void 0:(h=a==null?void 0:a.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,T=ge(S)?Math.max(w,2048):Math.max(w,S),P=a==null?void 0:a.resourceAttributes;return{serviceName:(p=(m=P==null?void 0:P["service.name"])!==null&&m!==void 0?m:a==null?void 0:a.serviceName)!==null&&p!==void 0?p:c==null?void 0:c.serviceNameDefault,serviceVersion:(_=P==null?void 0:P["service.version"])!==null&&_!==void 0?_:a==null?void 0:a.serviceVersion,environment:(x=P==null?void 0:P["deployment.environment"])!==null&&x!==void 0?x:a==null?void 0:a.environment,resourceAttributes:P,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:y,maxBufferSize:w,maxQueueSize:T,maxBatchRecordsPerPost:100,rateCapWindowMs:y,maxLogsPerInterval:S,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new FL(this.ul(t,e),i,this.Ge,(()=>this.hl()),(a=>a()),void 0,r),i]}dl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.ol||this.cl!==e){var n;(n=this.ol)==null||n.reset(),this.cl=e;var r=this.ll((()=>this.Gr),(s=>{this.Gr=s}));this.ol=r[0],this.vl=r[1]}return this.ol}fl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.al||this.pl!==e){var n;(n=this.al)==null||n.reset(),this.pl=e;var r=this.ll((()=>this.nl),(s=>{this.nl=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},hC);this.al=r[0],this.gl=r[1]}return this.al}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!Je(n)&&n&&(this.rl=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],(t=this.ol)==null||t.reset(),this.nl=[],(e=this.al)==null||e.reset(),this.Hs=0}captureLog(t){this.dl().captureLog(t)}le(t){this.fl().captureLog(t)}get logger(){return this.ml||(this.ml={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.ml}flushLogs(t){t?this.yl(t):(this.ol&&this.ol.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))),this.al&&this.al.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.rl&&!this.il){var t=Ve==null?void 0:Ve.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.Ge.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.il=!0)})):this.Ge.error(P2)}else this.Ge.error("PostHog Extensions not found.")}}ul(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Bi.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Bi.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},Mt:r=>this.Mt(r),getLibraryId:()=>gt.LIB_NAME,getLibraryVersion:()=>gt.LIB_VERSION}}Mt(t){return new Promise((e=>{if(sP(this.Hs,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout((()=>r({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.bl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this._l(a),a>=200&&300>a)r({kind:"ok"});else if(a===413)r({kind:"too-large"});else if(a!==0&&a!==429&&500>a)r({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var c;r({kind:"retry-later",error:(c=i.error)!==null&&c!==void 0?c:new Error("logs request failed with status "+a)})}}})}}))}_l(t){(t!==0||this._instance.__loaded)&&(this.Hs=iP(t,this.Hs,3,(()=>this.Ge.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}yl(t){this.Gr.length>0&&this.wl(t,this.Gr,this.vl,gt.LIB_NAME,(e=>{this.Gr=e})),this.nl.length>0&&this.wl(t,this.nl,this.gl,hC,(e=>{this.nl=e}))}wl(t,e,n,r,s){if(e.length!==0){var i=e.map((c=>c.record));s([]);var a=k6(i,C6(n,gt.LIB_NAME,gt.LIB_VERSION),r,gt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.bl(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}bl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}hl(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,s=n.sessionStartTimestamp,i=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,Je(s)||(e.sessionStartTimestamp=s),Je(i)||(e.lastActivityTimestamp=i)}if(Ve!=null&&(t=Ve.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?sa(Ve.location.href):Ve.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},MD={metrics:class{constructor(t){this.Ge=Ft("[metrics]"),this._instance=t}initialize(){}dl(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.ol&&this.cl===n||((e=this.ol)==null||e.reset(),this.cl=n,this.ol=new VL(this.ul(),(function(r){var s,i,a,c,u,f=r==null?void 0:r.resourceAttributes;return{serviceName:(s=f==null?void 0:f["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=f==null?void 0:f["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(a=f==null?void 0:f["deployment.environment"])!==null&&a!==void 0?a:r==null?void 0:r.environment,resourceAttributes:f,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(c=r==null?void 0:r.flushIntervalMs)!==null&&c!==void 0?c:1e4,maxSeriesPerFlush:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(n),this.Ge)),this.ol}count(t,e,n){e===void 0&&(e=1),this.dl().count(t,e,n)}gauge(t,e,n){this.dl().gauge(t,e,n)}histogram(t,e,n){this.dl().histogram(t,e,n)}flush(t){if(!this.ol)return Promise.resolve();if(t){var e=this.ol.drainWindow();return e&&this.Bt(e,t),Promise.resolve()}return this.ol.flush().catch((n=>this.Ge.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.ol)==null||t.reset()}ul(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Bt:n=>e.Bt(n),getLibraryId:()=>gt.LIB_NAME,getLibraryVersion:()=>gt.LIB_VERSION}}Bt(t,e){return new Promise((n=>{var r=!1,s=a=>{r||(r=!0,clearTimeout(i),n(a))},i=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(ue({method:"POST",url:this.xl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(a){var c=a.statusCode;if(c>=200&&300>c)s({kind:"ok"});else if(c===413)s({kind:"too-large"});else if(c!==0&&c!==429&&500>c)s({kind:"fatal",error:new Error("metrics request failed with status "+c)});else{var u;s({kind:"retry-later",error:(u=a.error)!==null&&u!==void 0?u:new Error("metrics request failed with status "+c)})}}}))}))}xl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},OD=ue({},n0,wD,bD,SD,ED,CD,PD,kD,TD,RD,AD,ID,MD);gs.__defaultExtensionClasses=ue({},OD);var Se=(function(){gt.SDK_DIST_CHANNEL="npm";var t=Cd[mc]=new gs;return(function(){function e(){e.done||(e.done=!0,MP=!1,wt(Cd,(function(n){n._dom_loaded()})))}be!=null&&be.addEventListener?be.readyState==="complete"?e():Ht(be,"DOMContentLoaded",e,{capture:!1}):re&&_e.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),OP;function LD(t){OP=t}function Uy(){return OP}var D2=v.createContext({get client(){return Uy()},bootstrap:void 0});function LP(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var i=0,a=r;i<a.length;i++){var c=a[i];if(!s.includes(c)||!LP(t[c],e[c],n))return!1}return!0}function ND(t){var e,n,r=t.children,s=t.client,i=t.apiKey,a=t.options,c=v.useRef(null),u=v.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var f=Uy();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),f},[s,i,JSON.stringify(a)]);return v.useEffect(function(){if(!(s||!i)){var f=Uy(),h=c.current;h?(i!==h.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!LP(a,h.options)&&f.set_config(a),c.current={apiKey:i,options:a??{}}):(f.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),f.init(i,a),c.current={apiKey:i,options:a??{}})}},[s,i,JSON.stringify(a)]),ve.createElement(D2.Provider,{value:{client:u,bootstrap:(e=a==null?void 0:a.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var Uv=function(t){return typeof t=="function"},r0=function(){var t=v.useContext(D2).client;return t},By=function(t,e){return By=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},By(t,e)};function DD(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");By(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var jD={componentStack:null,exceptionEvent:null,error:null},FD={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},VD=(function(t){DD(e,t);function e(n){var r=t.call(this,n)||this;return r.state=jD,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Uv(s)?i=s(n):typeof s=="object"&&(i=s);var a=this.context.client,c=a.captureException(n,i),u=r.componentStack;this.setState({error:n,componentStack:u??null,exceptionEvent:c})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return Uv(r)?r():r;var a=Uv(s)?ve.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return ve.isValidElement(a)?a:(console.warn(FD.INVALID_FALLBACK),ve.createElement(ve.Fragment,null))},e.contextType=D2,e})(ve.Component);LD(Se);var ep={},Bv={exports:{}},xr={},Wv={exports:{}},Gv={};/**
19
+ * @license React
20
+ * scheduler.production.min.js
21
+ *
22
+ * Copyright (c) Facebook, Inc. and its affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var pC;function $D(){return pC||(pC=1,(function(t){function e($,te){var H=$.length;$.push(te);e:for(;0<H;){var j=H-1>>>1,Y=$[j];if(0<s(Y,te))$[j]=te,$[H]=Y,H=j;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var te=$[0],H=$.pop();if(H!==te){$[0]=H;e:for(var j=0,Y=$.length,ne=Y>>>1;j<ne;){var ie=2*(j+1)-1,J=$[ie],ce=ie+1,we=$[ce];if(0>s(J,H))ce<Y&&0>s(we,J)?($[j]=we,$[ce]=H,j=ce):($[j]=J,$[ie]=H,j=ie);else if(ce<Y&&0>s(we,H))$[j]=we,$[ce]=H,j=ce;else break e}}return te}function s($,te){var H=$.sortIndex-te.sortIndex;return H!==0?H:$.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,c=a.now();t.unstable_now=function(){return a.now()-c}}var u=[],f=[],h=1,p=null,m=3,_=!1,x=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P($){for(var te=n(f);te!==null;){if(te.callback===null)r(f);else if(te.startTime<=$)r(f),te.sortIndex=te.expirationTime,e(u,te);else break;te=n(f)}}function k($){if(y=!1,P($),!x)if(n(u)!==null)x=!0,G(A);else{var te=n(f);te!==null&&K(k,te.startTime-$)}}function A($,te){x=!1,y&&(y=!1,S(R),R=-1),_=!0;var H=m;try{for(P(te),p=n(u);p!==null&&(!(p.expirationTime>te)||$&&!D());){var j=p.callback;if(typeof j=="function"){p.callback=null,m=p.priorityLevel;var Y=j(p.expirationTime<=te);te=t.unstable_now(),typeof Y=="function"?p.callback=Y:p===n(u)&&r(u),P(te)}else r(u);p=n(u)}if(p!==null)var ne=!0;else{var ie=n(f);ie!==null&&K(k,ie.startTime-te),ne=!1}return ne}finally{p=null,m=H,_=!1}}var O=!1,L=null,R=-1,M=5,N=-1;function D(){return!(t.unstable_now()-N<M)}function F(){if(L!==null){var $=t.unstable_now();N=$;var te=!0;try{te=L(!0,$)}finally{te?q():(O=!1,L=null)}}else O=!1}var q;if(typeof T=="function")q=function(){T(F)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,W=X.port2;X.port1.onmessage=F,q=function(){W.postMessage(null)}}else q=function(){w(F,0)};function G($){L=$,O||(O=!0,q())}function K($,te){R=w(function(){$(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){x||_||(x=!0,G(A))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var te=3;break;default:te=m}var H=m;m=te;try{return $()}finally{m=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,te){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=m;m=$;try{return te()}finally{m=H}},t.unstable_scheduleCallback=function($,te,H){var j=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?j+H:j):H=j,$){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=H+Y,$={id:h++,callback:te,priorityLevel:$,startTime:H,expirationTime:Y,sortIndex:-1},H>j?($.sortIndex=H,e(f,$),n(u)===null&&$===n(f)&&(y?(S(R),R=-1):y=!0,K(k,H-j))):($.sortIndex=Y,e(u,$),x||_||(x=!0,G(A))),$},t.unstable_shouldYield=D,t.unstable_wrapCallback=function($){var te=m;return function(){var H=m;m=te;try{return $.apply(this,arguments)}finally{m=H}}}})(Gv)),Gv}var mC;function HD(){return mC||(mC=1,Wv.exports=$D()),Wv.exports}/**
27
+ * @license React
28
+ * react-dom.production.min.js
29
+ *
30
+ * Copyright (c) Facebook, Inc. and its affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var gC;function zD(){if(gC)return xr;gC=1;var t=h2(),e=HD();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(o,l){a(o,l),a(o+"Capture",l)}function a(o,l){for(s[o]=l,o=0;o<l.length;o++)r.add(l[o])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function m(o){return u.call(p,o)?!0:u.call(h,o)?!1:f.test(o)?p[o]=!0:(h[o]=!0,!1)}function _(o,l,d,g){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:d!==null?!d.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function x(o,l,d,g){if(l===null||typeof l>"u"||_(o,l,d,g))return!0;if(g)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function y(o,l,d,g,b,C,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=b,this.mustUseProperty=d,this.propertyName=o,this.type=l,this.sanitizeURL=C,this.removeEmptyString=I}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new y(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];w[l]=new y(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new y(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new y(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){w[o]=new y(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new y(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new y(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new y(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new y(o,5,!1,o.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function T(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var l=o.replace(S,T);w[l]=new y(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(S,T);w[l]=new y(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(S,T);w[l]=new y(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new y(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new y(o,1,!1,o.toLowerCase(),null,!0,!0)});function P(o,l,d,g){var b=w.hasOwnProperty(l)?w[l]:null;(b!==null?b.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(x(l,d,b,g)&&(d=null),g||b===null?m(l)&&(d===null?o.removeAttribute(l):o.setAttribute(l,""+d)):b.mustUseProperty?o[b.propertyName]=d===null?b.type===3?!1:"":d:(l=b.attributeName,g=b.attributeNamespace,d===null?o.removeAttribute(l):(b=b.type,d=b===3||b===4&&d===!0?"":""+d,g?o.setAttributeNS(g,l,d):o.setAttribute(l,d))))}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),O=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),D=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),$=Symbol.iterator;function te(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var H=Object.assign,j;function Y(o){if(j===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);j=l&&l[1]||""}return`
35
+ `+j+o}var ne=!1;function ie(o,l){if(!o||ne)return"";ne=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(se){var g=se}Reflect.construct(o,[],l)}else{try{l.call()}catch(se){g=se}o.call(l.prototype)}else{try{throw Error()}catch(se){g=se}o()}}catch(se){if(se&&g&&typeof se.stack=="string"){for(var b=se.stack.split(`
36
+ `),C=g.stack.split(`
37
+ `),I=b.length-1,V=C.length-1;1<=I&&0<=V&&b[I]!==C[V];)V--;for(;1<=I&&0<=V;I--,V--)if(b[I]!==C[V]){if(I!==1||V!==1)do if(I--,V--,0>V||b[I]!==C[V]){var B=`
38
+ `+b[I].replace(" at new "," at ");return o.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",o.displayName)),B}while(1<=I&&0<=V);break}}}finally{ne=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?Y(o):""}function J(o){switch(o.tag){case 5:return Y(o.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return o=ie(o.type,!1),o;case 11:return o=ie(o.type.render,!1),o;case 1:return o=ie(o.type,!0),o;default:return""}}function ce(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case L:return"Fragment";case O:return"Portal";case M:return"Profiler";case R:return"StrictMode";case q:return"Suspense";case X:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case D:return(o.displayName||"Context")+".Consumer";case N:return(o._context.displayName||"Context")+".Provider";case F:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case W:return l=o.displayName||null,l!==null?l:ce(o.type)||"Memo";case G:l=o._payload,o=o._init;try{return ce(o(l))}catch{}}return null}function we(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(l);case 8:return l===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function oe(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function le(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Fe(o){var l=le(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),g=""+o[l];if(!o.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var b=d.get,C=d.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return b.call(this)},set:function(I){g=""+I,C.call(this,I)}}),Object.defineProperty(o,l,{enumerable:d.enumerable}),{getValue:function(){return g},setValue:function(I){g=""+I},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function De(o){o._valueTracker||(o._valueTracker=Fe(o))}function Pe(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),g="";return o&&(g=le(o)?o.checked?"true":"false":o.value),o=g,o!==d?(l.setValue(o),!0):!1}function Qe(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function dt(o,l){var d=l.checked;return H({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??o._wrapperState.initialChecked})}function qt(o,l){var d=l.defaultValue==null?"":l.defaultValue,g=l.checked!=null?l.checked:l.defaultChecked;d=oe(l.value!=null?l.value:d),o._wrapperState={initialChecked:g,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function xe(o,l){l=l.checked,l!=null&&P(o,"checked",l,!1)}function $e(o,l){xe(o,l);var d=oe(l.value),g=l.type;if(d!=null)g==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+d):o.value!==""+d&&(o.value=""+d);else if(g==="submit"||g==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?ot(o,l.type,d):l.hasOwnProperty("defaultValue")&&ot(o,l.type,oe(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function Be(o,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var g=l.type;if(!(g!=="submit"&&g!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,d||l===o.value||(o.value=l),o.defaultValue=l}d=o.name,d!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,d!==""&&(o.name=d)}function ot(o,l,d){(l!=="number"||Qe(o.ownerDocument)!==o)&&(d==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+d&&(o.defaultValue=""+d))}var Pt=Array.isArray;function tt(o,l,d,g){if(o=o.options,l){l={};for(var b=0;b<d.length;b++)l["$"+d[b]]=!0;for(d=0;d<o.length;d++)b=l.hasOwnProperty("$"+o[d].value),o[d].selected!==b&&(o[d].selected=b),b&&g&&(o[d].defaultSelected=!0)}else{for(d=""+oe(d),l=null,b=0;b<o.length;b++){if(o[b].value===d){o[b].selected=!0,g&&(o[b].defaultSelected=!0);return}l!==null||o[b].disabled||(l=o[b])}l!==null&&(l.selected=!0)}}function Ye(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function At(o,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(n(92));if(Pt(d)){if(1<d.length)throw Error(n(93));d=d[0]}l=d}l==null&&(l=""),d=l}o._wrapperState={initialValue:oe(d)}}function Bn(o,l){var d=oe(l.value),g=oe(l.defaultValue);d!=null&&(d=""+d,d!==o.value&&(o.value=d),l.defaultValue==null&&o.defaultValue!==d&&(o.defaultValue=d)),g!=null&&(o.defaultValue=""+g)}function In(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function Es(o){switch(o){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Lr(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?Es(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Nr,tr=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,g,b){MSApp.execUnsafeLocalFunction(function(){return o(l,d,g,b)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(Nr=Nr||document.createElement("div"),Nr.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Nr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function wn(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var Gs={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},Ks=["Webkit","ms","Moz","O"];Object.keys(Gs).forEach(function(o){Ks.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Gs[l]=Gs[o]})});function Mn(o,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||Gs.hasOwnProperty(o)&&Gs[o]?(""+l).trim():l+"px"}function mo(o,l){o=o.style;for(var d in l)if(l.hasOwnProperty(d)){var g=d.indexOf("--")===0,b=Mn(d,l[d],g);d==="float"&&(d="cssFloat"),g?o.setProperty(d,b):o[d]=b}}var bi=H({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 Cs(o,l){if(l){if(bi[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Zs(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var rs=null;function gn(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var go=null,Dr=null,ss=null;function Si(o){if(o=Ou(o)){if(typeof go!="function")throw Error(n(280));var l=o.stateNode;l&&(l=rh(l),go(o.stateNode,o.type,l))}}function Ke(o){Dr?ss?ss.push(o):ss=[o]:Dr=o}function It(){if(Dr){var o=Dr,l=ss;if(ss=Dr=null,Si(o),l)for(o=0;o<l.length;o++)Si(l[o])}}function Ut(o,l){return o(l)}function bn(){}var jr=!1;function Yt(o,l,d){if(jr)return o(l,d);jr=!0;try{return Ut(o,l,d)}finally{jr=!1,(Dr!==null||ss!==null)&&(bn(),It())}}function an(o,l){var d=o.stateNode;if(d===null)return null;var g=rh(d);if(g===null)return null;d=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(n(231,l,typeof d));return d}var qs=!1;if(c)try{var ln={};Object.defineProperty(ln,"passive",{get:function(){qs=!0}}),window.addEventListener("test",ln,ln),window.removeEventListener("test",ln,ln)}catch{qs=!1}function Wn(o,l,d,g,b,C,I,V,B){var se=Array.prototype.slice.call(arguments,3);try{l.apply(d,se)}catch(fe){this.onError(fe)}}var ks=!1,fr=null,wa=!1,mu=null,Lf={onError:function(o){ks=!0,fr=o}};function I0(o,l,d,g,b,C,I,V,B){ks=!1,fr=null,Wn.apply(Lf,arguments)}function M0(o,l,d,g,b,C,I,V,B){if(I0.apply(this,arguments),ks){if(ks){var se=fr;ks=!1,fr=null}else throw Error(n(198));wa||(wa=!0,mu=se)}}function Ps(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function Nf(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function Df(o){if(Ps(o)!==o)throw Error(n(188))}function O0(o){var l=o.alternate;if(!l){if(l=Ps(o),l===null)throw Error(n(188));return l!==o?null:o}for(var d=o,g=l;;){var b=d.return;if(b===null)break;var C=b.alternate;if(C===null){if(g=b.return,g!==null){d=g;continue}break}if(b.child===C.child){for(C=b.child;C;){if(C===d)return Df(b),o;if(C===g)return Df(b),l;C=C.sibling}throw Error(n(188))}if(d.return!==g.return)d=b,g=C;else{for(var I=!1,V=b.child;V;){if(V===d){I=!0,d=b,g=C;break}if(V===g){I=!0,g=b,d=C;break}V=V.sibling}if(!I){for(V=C.child;V;){if(V===d){I=!0,d=C,g=b;break}if(V===g){I=!0,g=C,d=b;break}V=V.sibling}if(!I)throw Error(n(189))}}if(d.alternate!==g)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?o:l}function jf(o){return o=O0(o),o!==null?Il(o):null}function Il(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=Il(o);if(l!==null)return l;o=o.sibling}return null}var Ml=e.unstable_scheduleCallback,gu=e.unstable_cancelCallback,L0=e.unstable_shouldYield,Rw=e.unstable_requestPaint,_t=e.unstable_now,Ff=e.unstable_getCurrentPriorityLevel,ba=e.unstable_ImmediatePriority,Vf=e.unstable_UserBlockingPriority,Sa=e.unstable_NormalPriority,Ol=e.unstable_LowPriority,Ll=e.unstable_IdlePriority,Ea=null,Fr=null;function $f(o){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(Ea,o,void 0,(o.current.flags&128)===128)}catch{}}var hr=Math.clz32?Math.clz32:Te,U=Math.log,ae=Math.LN2;function Te(o){return o>>>=0,o===0?32:31-(U(o)/ae|0)|0}var he=64,pe=4194304;function Ee(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function We(o,l){var d=o.pendingLanes;if(d===0)return 0;var g=0,b=o.suspendedLanes,C=o.pingedLanes,I=d&268435455;if(I!==0){var V=I&~b;V!==0?g=Ee(V):(C&=I,C!==0&&(g=Ee(C)))}else I=d&~b,I!==0?g=Ee(I):C!==0&&(g=Ee(C));if(g===0)return 0;if(l!==0&&l!==g&&(l&b)===0&&(b=g&-g,C=l&-l,b>=C||b===16&&(C&4194240)!==0))return l;if((g&4)!==0&&(g|=d&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=g;0<l;)d=31-hr(l),b=1<<d,g|=o[d],l&=~b;return g}function Ce(o,l){switch(o){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function On(o,l){for(var d=o.suspendedLanes,g=o.pingedLanes,b=o.expirationTimes,C=o.pendingLanes;0<C;){var I=31-hr(C),V=1<<I,B=b[I];B===-1?((V&d)===0||(V&g)!==0)&&(b[I]=Ce(V,l)):B<=l&&(o.expiredLanes|=V),C&=~V}}function is(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Ts(){var o=he;return he<<=1,(he&4194240)===0&&(he=64),o}function Rs(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function pr(o,l,d){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-hr(l),o[l]=d}function cn(o,l){var d=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var g=o.eventTimes;for(o=o.expirationTimes;0<d;){var b=31-hr(d),C=1<<b;l[b]=0,g[b]=-1,o[b]=-1,d&=~C}}function Ei(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var g=31-hr(d),b=1<<g;b&l|o[g]&l&&(o[g]|=l),d&=~b}}var nt=0;function Hf(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Aw,N0,Iw,Mw,Ow,D0=!1,zf=[],vo=null,yo=null,_o=null,vu=new Map,yu=new Map,xo=[],WI="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 Lw(o,l){switch(o){case"focusin":case"focusout":vo=null;break;case"dragenter":case"dragleave":yo=null;break;case"mouseover":case"mouseout":_o=null;break;case"pointerover":case"pointerout":vu.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":yu.delete(l.pointerId)}}function _u(o,l,d,g,b,C){return o===null||o.nativeEvent!==C?(o={blockedOn:l,domEventName:d,eventSystemFlags:g,nativeEvent:C,targetContainers:[b]},l!==null&&(l=Ou(l),l!==null&&N0(l)),o):(o.eventSystemFlags|=g,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function GI(o,l,d,g,b){switch(l){case"focusin":return vo=_u(vo,o,l,d,g,b),!0;case"dragenter":return yo=_u(yo,o,l,d,g,b),!0;case"mouseover":return _o=_u(_o,o,l,d,g,b),!0;case"pointerover":var C=b.pointerId;return vu.set(C,_u(vu.get(C)||null,o,l,d,g,b)),!0;case"gotpointercapture":return C=b.pointerId,yu.set(C,_u(yu.get(C)||null,o,l,d,g,b)),!0}return!1}function Nw(o){var l=Ca(o.target);if(l!==null){var d=Ps(l);if(d!==null){if(l=d.tag,l===13){if(l=Nf(d),l!==null){o.blockedOn=l,Ow(o.priority,function(){Iw(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Uf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=F0(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(d===null){d=o.nativeEvent;var g=new d.constructor(d.type,d);rs=g,d.target.dispatchEvent(g),rs=null}else return l=Ou(d),l!==null&&N0(l),o.blockedOn=d,!1;l.shift()}return!0}function Dw(o,l,d){Uf(o)&&d.delete(l)}function KI(){D0=!1,vo!==null&&Uf(vo)&&(vo=null),yo!==null&&Uf(yo)&&(yo=null),_o!==null&&Uf(_o)&&(_o=null),vu.forEach(Dw),yu.forEach(Dw)}function xu(o,l){o.blockedOn===l&&(o.blockedOn=null,D0||(D0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,KI)))}function wu(o){function l(b){return xu(b,o)}if(0<zf.length){xu(zf[0],o);for(var d=1;d<zf.length;d++){var g=zf[d];g.blockedOn===o&&(g.blockedOn=null)}}for(vo!==null&&xu(vo,o),yo!==null&&xu(yo,o),_o!==null&&xu(_o,o),vu.forEach(l),yu.forEach(l),d=0;d<xo.length;d++)g=xo[d],g.blockedOn===o&&(g.blockedOn=null);for(;0<xo.length&&(d=xo[0],d.blockedOn===null);)Nw(d),d.blockedOn===null&&xo.shift()}var Nl=k.ReactCurrentBatchConfig,Bf=!0;function ZI(o,l,d,g){var b=nt,C=Nl.transition;Nl.transition=null;try{nt=1,j0(o,l,d,g)}finally{nt=b,Nl.transition=C}}function qI(o,l,d,g){var b=nt,C=Nl.transition;Nl.transition=null;try{nt=4,j0(o,l,d,g)}finally{nt=b,Nl.transition=C}}function j0(o,l,d,g){if(Bf){var b=F0(o,l,d,g);if(b===null)tg(o,l,g,Wf,d),Lw(o,g);else if(GI(b,o,l,d,g))g.stopPropagation();else if(Lw(o,g),l&4&&-1<WI.indexOf(o)){for(;b!==null;){var C=Ou(b);if(C!==null&&Aw(C),C=F0(o,l,d,g),C===null&&tg(o,l,g,Wf,d),C===b)break;b=C}b!==null&&g.stopPropagation()}else tg(o,l,g,null,d)}}var Wf=null;function F0(o,l,d,g){if(Wf=null,o=gn(g),o=Ca(o),o!==null)if(l=Ps(o),l===null)o=null;else if(d=l.tag,d===13){if(o=Nf(l),o!==null)return o;o=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Wf=o,null}function jw(o){switch(o){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ff()){case ba:return 1;case Vf:return 4;case Sa:case Ol:return 16;case Ll:return 536870912;default:return 16}default:return 16}}var wo=null,V0=null,Gf=null;function Fw(){if(Gf)return Gf;var o,l=V0,d=l.length,g,b="value"in wo?wo.value:wo.textContent,C=b.length;for(o=0;o<d&&l[o]===b[o];o++);var I=d-o;for(g=1;g<=I&&l[d-g]===b[C-g];g++);return Gf=b.slice(o,1<g?1-g:void 0)}function Kf(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Zf(){return!0}function Vw(){return!1}function Vr(o){function l(d,g,b,C,I){this._reactName=d,this._targetInst=b,this.type=g,this.nativeEvent=C,this.target=I,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(d=o[V],this[V]=d?d(C):C[V]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Zf:Vw,this.isPropagationStopped=Vw,this}return H(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Zf)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Zf)},persist:function(){},isPersistent:Zf}),l}var Dl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$0=Vr(Dl),bu=H({},Dl,{view:0,detail:0}),YI=Vr(bu),H0,z0,Su,qf=H({},bu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:B0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Su&&(Su&&o.type==="mousemove"?(H0=o.screenX-Su.screenX,z0=o.screenY-Su.screenY):z0=H0=0,Su=o),H0)},movementY:function(o){return"movementY"in o?o.movementY:z0}}),$w=Vr(qf),XI=H({},qf,{dataTransfer:0}),QI=Vr(XI),JI=H({},bu,{relatedTarget:0}),U0=Vr(JI),eM=H({},Dl,{animationName:0,elapsedTime:0,pseudoElement:0}),tM=Vr(eM),nM=H({},Dl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),rM=Vr(nM),sM=H({},Dl,{data:0}),Hw=Vr(sM),iM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oM={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"},aM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lM(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=aM[o])?!!l[o]:!1}function B0(){return lM}var cM=H({},bu,{key:function(o){if(o.key){var l=iM[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Kf(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?oM[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:B0,charCode:function(o){return o.type==="keypress"?Kf(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Kf(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),uM=Vr(cM),dM=H({},qf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zw=Vr(dM),fM=H({},bu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:B0}),hM=Vr(fM),pM=H({},Dl,{propertyName:0,elapsedTime:0,pseudoElement:0}),mM=Vr(pM),gM=H({},qf,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),vM=Vr(gM),yM=[9,13,27,32],W0=c&&"CompositionEvent"in window,Eu=null;c&&"documentMode"in document&&(Eu=document.documentMode);var _M=c&&"TextEvent"in window&&!Eu,Uw=c&&(!W0||Eu&&8<Eu&&11>=Eu),Bw=" ",Ww=!1;function Gw(o,l){switch(o){case"keyup":return yM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kw(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var jl=!1;function xM(o,l){switch(o){case"compositionend":return Kw(l);case"keypress":return l.which!==32?null:(Ww=!0,Bw);case"textInput":return o=l.data,o===Bw&&Ww?null:o;default:return null}}function wM(o,l){if(jl)return o==="compositionend"||!W0&&Gw(o,l)?(o=Fw(),Gf=V0=wo=null,jl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Uw&&l.locale!=="ko"?null:l.data;default:return null}}var bM={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 Zw(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!bM[o.type]:l==="textarea"}function qw(o,l,d,g){Ke(g),l=eh(l,"onChange"),0<l.length&&(d=new $0("onChange","change",null,d,g),o.push({event:d,listeners:l}))}var Cu=null,ku=null;function SM(o){hb(o,0)}function Yf(o){var l=zl(o);if(Pe(l))return o}function EM(o,l){if(o==="change")return l}var Yw=!1;if(c){var G0;if(c){var K0="oninput"in document;if(!K0){var Xw=document.createElement("div");Xw.setAttribute("oninput","return;"),K0=typeof Xw.oninput=="function"}G0=K0}else G0=!1;Yw=G0&&(!document.documentMode||9<document.documentMode)}function Qw(){Cu&&(Cu.detachEvent("onpropertychange",Jw),ku=Cu=null)}function Jw(o){if(o.propertyName==="value"&&Yf(ku)){var l=[];qw(l,ku,o,gn(o)),Yt(SM,l)}}function CM(o,l,d){o==="focusin"?(Qw(),Cu=l,ku=d,Cu.attachEvent("onpropertychange",Jw)):o==="focusout"&&Qw()}function kM(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Yf(ku)}function PM(o,l){if(o==="click")return Yf(l)}function TM(o,l){if(o==="input"||o==="change")return Yf(l)}function RM(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var As=typeof Object.is=="function"?Object.is:RM;function Pu(o,l){if(As(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),g=Object.keys(l);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var b=d[g];if(!u.call(l,b)||!As(o[b],l[b]))return!1}return!0}function eb(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function tb(o,l){var d=eb(o);o=0;for(var g;d;){if(d.nodeType===3){if(g=o+d.textContent.length,o<=l&&g>=l)return{node:d,offset:l-o};o=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=eb(d)}}function nb(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?nb(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function rb(){for(var o=window,l=Qe();l instanceof o.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)o=l.contentWindow;else break;l=Qe(o.document)}return l}function Z0(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function AM(o){var l=rb(),d=o.focusedElem,g=o.selectionRange;if(l!==d&&d&&d.ownerDocument&&nb(d.ownerDocument.documentElement,d)){if(g!==null&&Z0(d)){if(l=g.start,o=g.end,o===void 0&&(o=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(o,d.value.length);else if(o=(l=d.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var b=d.textContent.length,C=Math.min(g.start,b);g=g.end===void 0?C:Math.min(g.end,b),!o.extend&&C>g&&(b=g,g=C,C=b),b=tb(d,C);var I=tb(d,g);b&&I&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==I.node||o.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(b.node,b.offset),o.removeAllRanges(),C>g?(o.addRange(l),o.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),o.addRange(l)))}}for(l=[],o=d;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)o=l[d],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var IM=c&&"documentMode"in document&&11>=document.documentMode,Fl=null,q0=null,Tu=null,Y0=!1;function sb(o,l,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Y0||Fl==null||Fl!==Qe(g)||(g=Fl,"selectionStart"in g&&Z0(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Tu&&Pu(Tu,g)||(Tu=g,g=eh(q0,"onSelect"),0<g.length&&(l=new $0("onSelect","select",null,l,d),o.push({event:l,listeners:g}),l.target=Fl)))}function Xf(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var Vl={animationend:Xf("Animation","AnimationEnd"),animationiteration:Xf("Animation","AnimationIteration"),animationstart:Xf("Animation","AnimationStart"),transitionend:Xf("Transition","TransitionEnd")},X0={},ib={};c&&(ib=document.createElement("div").style,"AnimationEvent"in window||(delete Vl.animationend.animation,delete Vl.animationiteration.animation,delete Vl.animationstart.animation),"TransitionEvent"in window||delete Vl.transitionend.transition);function Qf(o){if(X0[o])return X0[o];if(!Vl[o])return o;var l=Vl[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in ib)return X0[o]=l[d];return o}var ob=Qf("animationend"),ab=Qf("animationiteration"),lb=Qf("animationstart"),cb=Qf("transitionend"),ub=new Map,db="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 bo(o,l){ub.set(o,l),i(l,[o])}for(var Q0=0;Q0<db.length;Q0++){var J0=db[Q0],MM=J0.toLowerCase(),OM=J0[0].toUpperCase()+J0.slice(1);bo(MM,"on"+OM)}bo(ob,"onAnimationEnd"),bo(ab,"onAnimationIteration"),bo(lb,"onAnimationStart"),bo("dblclick","onDoubleClick"),bo("focusin","onFocus"),bo("focusout","onBlur"),bo(cb,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ru="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(" "),LM=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ru));function fb(o,l,d){var g=o.type||"unknown-event";o.currentTarget=d,M0(g,l,void 0,o),o.currentTarget=null}function hb(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var g=o[d],b=g.event;g=g.listeners;e:{var C=void 0;if(l)for(var I=g.length-1;0<=I;I--){var V=g[I],B=V.instance,se=V.currentTarget;if(V=V.listener,B!==C&&b.isPropagationStopped())break e;fb(b,V,se),C=B}else for(I=0;I<g.length;I++){if(V=g[I],B=V.instance,se=V.currentTarget,V=V.listener,B!==C&&b.isPropagationStopped())break e;fb(b,V,se),C=B}}}if(wa)throw o=mu,wa=!1,mu=null,o}function Mt(o,l){var d=l[ag];d===void 0&&(d=l[ag]=new Set);var g=o+"__bubble";d.has(g)||(pb(l,o,2,!1),d.add(g))}function eg(o,l,d){var g=0;l&&(g|=4),pb(d,o,g,l)}var Jf="_reactListening"+Math.random().toString(36).slice(2);function Au(o){if(!o[Jf]){o[Jf]=!0,r.forEach(function(d){d!=="selectionchange"&&(LM.has(d)||eg(d,!1,o),eg(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Jf]||(l[Jf]=!0,eg("selectionchange",!1,l))}}function pb(o,l,d,g){switch(jw(l)){case 1:var b=ZI;break;case 4:b=qI;break;default:b=j0}d=b.bind(null,l,d,o),b=void 0,!qs||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),g?b!==void 0?o.addEventListener(l,d,{capture:!0,passive:b}):o.addEventListener(l,d,!0):b!==void 0?o.addEventListener(l,d,{passive:b}):o.addEventListener(l,d,!1)}function tg(o,l,d,g,b){var C=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var V=g.stateNode.containerInfo;if(V===b||V.nodeType===8&&V.parentNode===b)break;if(I===4)for(I=g.return;I!==null;){var B=I.tag;if((B===3||B===4)&&(B=I.stateNode.containerInfo,B===b||B.nodeType===8&&B.parentNode===b))return;I=I.return}for(;V!==null;){if(I=Ca(V),I===null)return;if(B=I.tag,B===5||B===6){g=C=I;continue e}V=V.parentNode}}g=g.return}Yt(function(){var se=C,fe=gn(d),me=[];e:{var de=ub.get(o);if(de!==void 0){var Re=$0,Oe=o;switch(o){case"keypress":if(Kf(d)===0)break e;case"keydown":case"keyup":Re=uM;break;case"focusin":Oe="focus",Re=U0;break;case"focusout":Oe="blur",Re=U0;break;case"beforeblur":case"afterblur":Re=U0;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Re=$w;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Re=QI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Re=hM;break;case ob:case ab:case lb:Re=tM;break;case cb:Re=mM;break;case"scroll":Re=YI;break;case"wheel":Re=vM;break;case"copy":case"cut":case"paste":Re=rM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Re=zw}var Ne=(l&4)!==0,nn=!Ne&&o==="scroll",Q=Ne?de!==null?de+"Capture":null:de;Ne=[];for(var Z=se,ee;Z!==null;){ee=Z;var ye=ee.stateNode;if(ee.tag===5&&ye!==null&&(ee=ye,Q!==null&&(ye=an(Z,Q),ye!=null&&Ne.push(Iu(Z,ye,ee)))),nn)break;Z=Z.return}0<Ne.length&&(de=new Re(de,Oe,null,d,fe),me.push({event:de,listeners:Ne}))}}if((l&7)===0){e:{if(de=o==="mouseover"||o==="pointerover",Re=o==="mouseout"||o==="pointerout",de&&d!==rs&&(Oe=d.relatedTarget||d.fromElement)&&(Ca(Oe)||Oe[Ci]))break e;if((Re||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,Re?(Oe=d.relatedTarget||d.toElement,Re=se,Oe=Oe?Ca(Oe):null,Oe!==null&&(nn=Ps(Oe),Oe!==nn||Oe.tag!==5&&Oe.tag!==6)&&(Oe=null)):(Re=null,Oe=se),Re!==Oe)){if(Ne=$w,ye="onMouseLeave",Q="onMouseEnter",Z="mouse",(o==="pointerout"||o==="pointerover")&&(Ne=zw,ye="onPointerLeave",Q="onPointerEnter",Z="pointer"),nn=Re==null?de:zl(Re),ee=Oe==null?de:zl(Oe),de=new Ne(ye,Z+"leave",Re,d,fe),de.target=nn,de.relatedTarget=ee,ye=null,Ca(fe)===se&&(Ne=new Ne(Q,Z+"enter",Oe,d,fe),Ne.target=ee,Ne.relatedTarget=nn,ye=Ne),nn=ye,Re&&Oe)t:{for(Ne=Re,Q=Oe,Z=0,ee=Ne;ee;ee=$l(ee))Z++;for(ee=0,ye=Q;ye;ye=$l(ye))ee++;for(;0<Z-ee;)Ne=$l(Ne),Z--;for(;0<ee-Z;)Q=$l(Q),ee--;for(;Z--;){if(Ne===Q||Q!==null&&Ne===Q.alternate)break t;Ne=$l(Ne),Q=$l(Q)}Ne=null}else Ne=null;Re!==null&&mb(me,de,Re,Ne,!1),Oe!==null&&nn!==null&&mb(me,nn,Oe,Ne,!0)}}e:{if(de=se?zl(se):window,Re=de.nodeName&&de.nodeName.toLowerCase(),Re==="select"||Re==="input"&&de.type==="file")var je=EM;else if(Zw(de))if(Yw)je=TM;else{je=kM;var ze=CM}else(Re=de.nodeName)&&Re.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(je=PM);if(je&&(je=je(o,se))){qw(me,je,d,fe);break e}ze&&ze(o,de,se),o==="focusout"&&(ze=de._wrapperState)&&ze.controlled&&de.type==="number"&&ot(de,"number",de.value)}switch(ze=se?zl(se):window,o){case"focusin":(Zw(ze)||ze.contentEditable==="true")&&(Fl=ze,q0=se,Tu=null);break;case"focusout":Tu=q0=Fl=null;break;case"mousedown":Y0=!0;break;case"contextmenu":case"mouseup":case"dragend":Y0=!1,sb(me,d,fe);break;case"selectionchange":if(IM)break;case"keydown":case"keyup":sb(me,d,fe)}var Ue;if(W0)e:{switch(o){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else jl?Gw(o,d)&&(Ze="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Ze="onCompositionStart");Ze&&(Uw&&d.locale!=="ko"&&(jl||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&jl&&(Ue=Fw()):(wo=fe,V0="value"in wo?wo.value:wo.textContent,jl=!0)),ze=eh(se,Ze),0<ze.length&&(Ze=new Hw(Ze,o,null,d,fe),me.push({event:Ze,listeners:ze}),Ue?Ze.data=Ue:(Ue=Kw(d),Ue!==null&&(Ze.data=Ue)))),(Ue=_M?xM(o,d):wM(o,d))&&(se=eh(se,"onBeforeInput"),0<se.length&&(fe=new Hw("onBeforeInput","beforeinput",null,d,fe),me.push({event:fe,listeners:se}),fe.data=Ue))}hb(me,l)})}function Iu(o,l,d){return{instance:o,listener:l,currentTarget:d}}function eh(o,l){for(var d=l+"Capture",g=[];o!==null;){var b=o,C=b.stateNode;b.tag===5&&C!==null&&(b=C,C=an(o,d),C!=null&&g.unshift(Iu(o,C,b)),C=an(o,l),C!=null&&g.push(Iu(o,C,b))),o=o.return}return g}function $l(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function mb(o,l,d,g,b){for(var C=l._reactName,I=[];d!==null&&d!==g;){var V=d,B=V.alternate,se=V.stateNode;if(B!==null&&B===g)break;V.tag===5&&se!==null&&(V=se,b?(B=an(d,C),B!=null&&I.unshift(Iu(d,B,V))):b||(B=an(d,C),B!=null&&I.push(Iu(d,B,V)))),d=d.return}I.length!==0&&o.push({event:l,listeners:I})}var NM=/\r\n?/g,DM=/\u0000|\uFFFD/g;function gb(o){return(typeof o=="string"?o:""+o).replace(NM,`
39
+ `).replace(DM,"")}function th(o,l,d){if(l=gb(l),gb(o)!==l&&d)throw Error(n(425))}function nh(){}var ng=null,rg=null;function sg(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var ig=typeof setTimeout=="function"?setTimeout:void 0,jM=typeof clearTimeout=="function"?clearTimeout:void 0,vb=typeof Promise=="function"?Promise:void 0,FM=typeof queueMicrotask=="function"?queueMicrotask:typeof vb<"u"?function(o){return vb.resolve(null).then(o).catch(VM)}:ig;function VM(o){setTimeout(function(){throw o})}function og(o,l){var d=l,g=0;do{var b=d.nextSibling;if(o.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"){if(g===0){o.removeChild(b),wu(l);return}g--}else d!=="$"&&d!=="$?"&&d!=="$!"||g++;d=b}while(d);wu(l)}function So(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return o}function yb(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return o;l--}else d==="/$"&&l++}o=o.previousSibling}return null}var Hl=Math.random().toString(36).slice(2),Ys="__reactFiber$"+Hl,Mu="__reactProps$"+Hl,Ci="__reactContainer$"+Hl,ag="__reactEvents$"+Hl,$M="__reactListeners$"+Hl,HM="__reactHandles$"+Hl;function Ca(o){var l=o[Ys];if(l)return l;for(var d=o.parentNode;d;){if(l=d[Ci]||d[Ys]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=yb(o);o!==null;){if(d=o[Ys])return d;o=yb(o)}return l}o=d,d=o.parentNode}return null}function Ou(o){return o=o[Ys]||o[Ci],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function zl(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function rh(o){return o[Mu]||null}var lg=[],Ul=-1;function Eo(o){return{current:o}}function Ot(o){0>Ul||(o.current=lg[Ul],lg[Ul]=null,Ul--)}function Tt(o,l){Ul++,lg[Ul]=o.current,o.current=l}var Co={},Gn=Eo(Co),mr=Eo(!1),ka=Co;function Bl(o,l){var d=o.type.contextTypes;if(!d)return Co;var g=o.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===l)return g.__reactInternalMemoizedMaskedChildContext;var b={},C;for(C in d)b[C]=l[C];return g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=b),b}function gr(o){return o=o.childContextTypes,o!=null}function sh(){Ot(mr),Ot(Gn)}function _b(o,l,d){if(Gn.current!==Co)throw Error(n(168));Tt(Gn,l),Tt(mr,d)}function xb(o,l,d){var g=o.stateNode;if(l=l.childContextTypes,typeof g.getChildContext!="function")return d;g=g.getChildContext();for(var b in g)if(!(b in l))throw Error(n(108,we(o)||"Unknown",b));return H({},d,g)}function ih(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Co,ka=Gn.current,Tt(Gn,o),Tt(mr,mr.current),!0}function wb(o,l,d){var g=o.stateNode;if(!g)throw Error(n(169));d?(o=xb(o,l,ka),g.__reactInternalMemoizedMergedChildContext=o,Ot(mr),Ot(Gn),Tt(Gn,o)):Ot(mr),Tt(mr,d)}var ki=null,oh=!1,cg=!1;function bb(o){ki===null?ki=[o]:ki.push(o)}function zM(o){oh=!0,bb(o)}function ko(){if(!cg&&ki!==null){cg=!0;var o=0,l=nt;try{var d=ki;for(nt=1;o<d.length;o++){var g=d[o];do g=g(!0);while(g!==null)}ki=null,oh=!1}catch(b){throw ki!==null&&(ki=ki.slice(o+1)),Ml(ba,ko),b}finally{nt=l,cg=!1}}return null}var Wl=[],Gl=0,ah=null,lh=0,os=[],as=0,Pa=null,Pi=1,Ti="";function Ta(o,l){Wl[Gl++]=lh,Wl[Gl++]=ah,ah=o,lh=l}function Sb(o,l,d){os[as++]=Pi,os[as++]=Ti,os[as++]=Pa,Pa=o;var g=Pi;o=Ti;var b=32-hr(g)-1;g&=~(1<<b),d+=1;var C=32-hr(l)+b;if(30<C){var I=b-b%5;C=(g&(1<<I)-1).toString(32),g>>=I,b-=I,Pi=1<<32-hr(l)+b|d<<b|g,Ti=C+o}else Pi=1<<C|d<<b|g,Ti=o}function ug(o){o.return!==null&&(Ta(o,1),Sb(o,1,0))}function dg(o){for(;o===ah;)ah=Wl[--Gl],Wl[Gl]=null,lh=Wl[--Gl],Wl[Gl]=null;for(;o===Pa;)Pa=os[--as],os[as]=null,Ti=os[--as],os[as]=null,Pi=os[--as],os[as]=null}var $r=null,Hr=null,Vt=!1,Is=null;function Eb(o,l){var d=ds(5,null,null,0);d.elementType="DELETED",d.stateNode=l,d.return=o,l=o.deletions,l===null?(o.deletions=[d],o.flags|=16):l.push(d)}function Cb(o,l){switch(o.tag){case 5:var d=o.type;return l=l.nodeType!==1||d.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,$r=o,Hr=So(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,$r=o,Hr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(d=Pa!==null?{id:Pi,overflow:Ti}:null,o.memoizedState={dehydrated:l,treeContext:d,retryLane:1073741824},d=ds(18,null,null,0),d.stateNode=l,d.return=o,o.child=d,$r=o,Hr=null,!0):!1;default:return!1}}function fg(o){return(o.mode&1)!==0&&(o.flags&128)===0}function hg(o){if(Vt){var l=Hr;if(l){var d=l;if(!Cb(o,l)){if(fg(o))throw Error(n(418));l=So(d.nextSibling);var g=$r;l&&Cb(o,l)?Eb(g,d):(o.flags=o.flags&-4097|2,Vt=!1,$r=o)}}else{if(fg(o))throw Error(n(418));o.flags=o.flags&-4097|2,Vt=!1,$r=o}}}function kb(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;$r=o}function ch(o){if(o!==$r)return!1;if(!Vt)return kb(o),Vt=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!sg(o.type,o.memoizedProps)),l&&(l=Hr)){if(fg(o))throw Pb(),Error(n(418));for(;l;)Eb(o,l),l=So(l.nextSibling)}if(kb(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"){if(l===0){Hr=So(o.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++}o=o.nextSibling}Hr=null}}else Hr=$r?So(o.stateNode.nextSibling):null;return!0}function Pb(){for(var o=Hr;o;)o=So(o.nextSibling)}function Kl(){Hr=$r=null,Vt=!1}function pg(o){Is===null?Is=[o]:Is.push(o)}var UM=k.ReactCurrentBatchConfig;function Lu(o,l,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var g=d.stateNode}if(!g)throw Error(n(147,o));var b=g,C=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===C?l.ref:(l=function(I){var V=b.refs;I===null?delete V[C]:V[C]=I},l._stringRef=C,l)}if(typeof o!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,o))}return o}function uh(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Tb(o){var l=o._init;return l(o._payload)}function Rb(o){function l(Q,Z){if(o){var ee=Q.deletions;ee===null?(Q.deletions=[Z],Q.flags|=16):ee.push(Z)}}function d(Q,Z){if(!o)return null;for(;Z!==null;)l(Q,Z),Z=Z.sibling;return null}function g(Q,Z){for(Q=new Map;Z!==null;)Z.key!==null?Q.set(Z.key,Z):Q.set(Z.index,Z),Z=Z.sibling;return Q}function b(Q,Z){return Q=Lo(Q,Z),Q.index=0,Q.sibling=null,Q}function C(Q,Z,ee){return Q.index=ee,o?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<Z?(Q.flags|=2,Z):ee):(Q.flags|=2,Z)):(Q.flags|=1048576,Z)}function I(Q){return o&&Q.alternate===null&&(Q.flags|=2),Q}function V(Q,Z,ee,ye){return Z===null||Z.tag!==6?(Z=iv(ee,Q.mode,ye),Z.return=Q,Z):(Z=b(Z,ee),Z.return=Q,Z)}function B(Q,Z,ee,ye){var je=ee.type;return je===L?fe(Q,Z,ee.props.children,ye,ee.key):Z!==null&&(Z.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===G&&Tb(je)===Z.type)?(ye=b(Z,ee.props),ye.ref=Lu(Q,Z,ee),ye.return=Q,ye):(ye=Lh(ee.type,ee.key,ee.props,null,Q.mode,ye),ye.ref=Lu(Q,Z,ee),ye.return=Q,ye)}function se(Q,Z,ee,ye){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ee.containerInfo||Z.stateNode.implementation!==ee.implementation?(Z=ov(ee,Q.mode,ye),Z.return=Q,Z):(Z=b(Z,ee.children||[]),Z.return=Q,Z)}function fe(Q,Z,ee,ye,je){return Z===null||Z.tag!==7?(Z=Da(ee,Q.mode,ye,je),Z.return=Q,Z):(Z=b(Z,ee),Z.return=Q,Z)}function me(Q,Z,ee){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=iv(""+Z,Q.mode,ee),Z.return=Q,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case A:return ee=Lh(Z.type,Z.key,Z.props,null,Q.mode,ee),ee.ref=Lu(Q,null,Z),ee.return=Q,ee;case O:return Z=ov(Z,Q.mode,ee),Z.return=Q,Z;case G:var ye=Z._init;return me(Q,ye(Z._payload),ee)}if(Pt(Z)||te(Z))return Z=Da(Z,Q.mode,ee,null),Z.return=Q,Z;uh(Q,Z)}return null}function de(Q,Z,ee,ye){var je=Z!==null?Z.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return je!==null?null:V(Q,Z,""+ee,ye);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case A:return ee.key===je?B(Q,Z,ee,ye):null;case O:return ee.key===je?se(Q,Z,ee,ye):null;case G:return je=ee._init,de(Q,Z,je(ee._payload),ye)}if(Pt(ee)||te(ee))return je!==null?null:fe(Q,Z,ee,ye,null);uh(Q,ee)}return null}function Re(Q,Z,ee,ye,je){if(typeof ye=="string"&&ye!==""||typeof ye=="number")return Q=Q.get(ee)||null,V(Z,Q,""+ye,je);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case A:return Q=Q.get(ye.key===null?ee:ye.key)||null,B(Z,Q,ye,je);case O:return Q=Q.get(ye.key===null?ee:ye.key)||null,se(Z,Q,ye,je);case G:var ze=ye._init;return Re(Q,Z,ee,ze(ye._payload),je)}if(Pt(ye)||te(ye))return Q=Q.get(ee)||null,fe(Z,Q,ye,je,null);uh(Z,ye)}return null}function Oe(Q,Z,ee,ye){for(var je=null,ze=null,Ue=Z,Ze=Z=0,Cn=null;Ue!==null&&Ze<ee.length;Ze++){Ue.index>Ze?(Cn=Ue,Ue=null):Cn=Ue.sibling;var ht=de(Q,Ue,ee[Ze],ye);if(ht===null){Ue===null&&(Ue=Cn);break}o&&Ue&&ht.alternate===null&&l(Q,Ue),Z=C(ht,Z,Ze),ze===null?je=ht:ze.sibling=ht,ze=ht,Ue=Cn}if(Ze===ee.length)return d(Q,Ue),Vt&&Ta(Q,Ze),je;if(Ue===null){for(;Ze<ee.length;Ze++)Ue=me(Q,ee[Ze],ye),Ue!==null&&(Z=C(Ue,Z,Ze),ze===null?je=Ue:ze.sibling=Ue,ze=Ue);return Vt&&Ta(Q,Ze),je}for(Ue=g(Q,Ue);Ze<ee.length;Ze++)Cn=Re(Ue,Q,Ze,ee[Ze],ye),Cn!==null&&(o&&Cn.alternate!==null&&Ue.delete(Cn.key===null?Ze:Cn.key),Z=C(Cn,Z,Ze),ze===null?je=Cn:ze.sibling=Cn,ze=Cn);return o&&Ue.forEach(function(No){return l(Q,No)}),Vt&&Ta(Q,Ze),je}function Ne(Q,Z,ee,ye){var je=te(ee);if(typeof je!="function")throw Error(n(150));if(ee=je.call(ee),ee==null)throw Error(n(151));for(var ze=je=null,Ue=Z,Ze=Z=0,Cn=null,ht=ee.next();Ue!==null&&!ht.done;Ze++,ht=ee.next()){Ue.index>Ze?(Cn=Ue,Ue=null):Cn=Ue.sibling;var No=de(Q,Ue,ht.value,ye);if(No===null){Ue===null&&(Ue=Cn);break}o&&Ue&&No.alternate===null&&l(Q,Ue),Z=C(No,Z,Ze),ze===null?je=No:ze.sibling=No,ze=No,Ue=Cn}if(ht.done)return d(Q,Ue),Vt&&Ta(Q,Ze),je;if(Ue===null){for(;!ht.done;Ze++,ht=ee.next())ht=me(Q,ht.value,ye),ht!==null&&(Z=C(ht,Z,Ze),ze===null?je=ht:ze.sibling=ht,ze=ht);return Vt&&Ta(Q,Ze),je}for(Ue=g(Q,Ue);!ht.done;Ze++,ht=ee.next())ht=Re(Ue,Q,Ze,ht.value,ye),ht!==null&&(o&&ht.alternate!==null&&Ue.delete(ht.key===null?Ze:ht.key),Z=C(ht,Z,Ze),ze===null?je=ht:ze.sibling=ht,ze=ht);return o&&Ue.forEach(function(bO){return l(Q,bO)}),Vt&&Ta(Q,Ze),je}function nn(Q,Z,ee,ye){if(typeof ee=="object"&&ee!==null&&ee.type===L&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case A:e:{for(var je=ee.key,ze=Z;ze!==null;){if(ze.key===je){if(je=ee.type,je===L){if(ze.tag===7){d(Q,ze.sibling),Z=b(ze,ee.props.children),Z.return=Q,Q=Z;break e}}else if(ze.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===G&&Tb(je)===ze.type){d(Q,ze.sibling),Z=b(ze,ee.props),Z.ref=Lu(Q,ze,ee),Z.return=Q,Q=Z;break e}d(Q,ze);break}else l(Q,ze);ze=ze.sibling}ee.type===L?(Z=Da(ee.props.children,Q.mode,ye,ee.key),Z.return=Q,Q=Z):(ye=Lh(ee.type,ee.key,ee.props,null,Q.mode,ye),ye.ref=Lu(Q,Z,ee),ye.return=Q,Q=ye)}return I(Q);case O:e:{for(ze=ee.key;Z!==null;){if(Z.key===ze)if(Z.tag===4&&Z.stateNode.containerInfo===ee.containerInfo&&Z.stateNode.implementation===ee.implementation){d(Q,Z.sibling),Z=b(Z,ee.children||[]),Z.return=Q,Q=Z;break e}else{d(Q,Z);break}else l(Q,Z);Z=Z.sibling}Z=ov(ee,Q.mode,ye),Z.return=Q,Q=Z}return I(Q);case G:return ze=ee._init,nn(Q,Z,ze(ee._payload),ye)}if(Pt(ee))return Oe(Q,Z,ee,ye);if(te(ee))return Ne(Q,Z,ee,ye);uh(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,Z!==null&&Z.tag===6?(d(Q,Z.sibling),Z=b(Z,ee),Z.return=Q,Q=Z):(d(Q,Z),Z=iv(ee,Q.mode,ye),Z.return=Q,Q=Z),I(Q)):d(Q,Z)}return nn}var Zl=Rb(!0),Ab=Rb(!1),dh=Eo(null),fh=null,ql=null,mg=null;function gg(){mg=ql=fh=null}function vg(o){var l=dh.current;Ot(dh),o._currentValue=l}function yg(o,l,d){for(;o!==null;){var g=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),o===d)break;o=o.return}}function Yl(o,l){fh=o,mg=ql=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(vr=!0),o.firstContext=null)}function ls(o){var l=o._currentValue;if(mg!==o)if(o={context:o,memoizedValue:l,next:null},ql===null){if(fh===null)throw Error(n(308));ql=o,fh.dependencies={lanes:0,firstContext:o}}else ql=ql.next=o;return l}var Ra=null;function _g(o){Ra===null?Ra=[o]:Ra.push(o)}function Ib(o,l,d,g){var b=l.interleaved;return b===null?(d.next=d,_g(l)):(d.next=b.next,b.next=d),l.interleaved=d,Ri(o,g)}function Ri(o,l){o.lanes|=l;var d=o.alternate;for(d!==null&&(d.lanes|=l),d=o,o=o.return;o!==null;)o.childLanes|=l,d=o.alternate,d!==null&&(d.childLanes|=l),d=o,o=o.return;return d.tag===3?d.stateNode:null}var Po=!1;function xg(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mb(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Ai(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function To(o,l,d){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(ft&2)!==0){var b=g.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),g.pending=l,Ri(o,d)}return b=g.interleaved,b===null?(l.next=l,_g(g)):(l.next=b.next,b.next=l),g.interleaved=l,Ri(o,d)}function hh(o,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194240)!==0)){var g=l.lanes;g&=o.pendingLanes,d|=g,l.lanes=d,Ei(o,d)}}function Ob(o,l){var d=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var b=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var I={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};C===null?b=C=I:C=C.next=I,d=d.next}while(d!==null);C===null?b=C=l:C=C.next=l}else b=C=l;d={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:C,shared:g.shared,effects:g.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}function ph(o,l,d,g){var b=o.updateQueue;Po=!1;var C=b.firstBaseUpdate,I=b.lastBaseUpdate,V=b.shared.pending;if(V!==null){b.shared.pending=null;var B=V,se=B.next;B.next=null,I===null?C=se:I.next=se,I=B;var fe=o.alternate;fe!==null&&(fe=fe.updateQueue,V=fe.lastBaseUpdate,V!==I&&(V===null?fe.firstBaseUpdate=se:V.next=se,fe.lastBaseUpdate=B))}if(C!==null){var me=b.baseState;I=0,fe=se=B=null,V=C;do{var de=V.lane,Re=V.eventTime;if((g&de)===de){fe!==null&&(fe=fe.next={eventTime:Re,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var Oe=o,Ne=V;switch(de=l,Re=d,Ne.tag){case 1:if(Oe=Ne.payload,typeof Oe=="function"){me=Oe.call(Re,me,de);break e}me=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ne.payload,de=typeof Oe=="function"?Oe.call(Re,me,de):Oe,de==null)break e;me=H({},me,de);break e;case 2:Po=!0}}V.callback!==null&&V.lane!==0&&(o.flags|=64,de=b.effects,de===null?b.effects=[V]:de.push(V))}else Re={eventTime:Re,lane:de,tag:V.tag,payload:V.payload,callback:V.callback,next:null},fe===null?(se=fe=Re,B=me):fe=fe.next=Re,I|=de;if(V=V.next,V===null){if(V=b.shared.pending,V===null)break;de=V,V=de.next,de.next=null,b.lastBaseUpdate=de,b.shared.pending=null}}while(!0);if(fe===null&&(B=me),b.baseState=B,b.firstBaseUpdate=se,b.lastBaseUpdate=fe,l=b.shared.interleaved,l!==null){b=l;do I|=b.lane,b=b.next;while(b!==l)}else C===null&&(b.shared.lanes=0);Ma|=I,o.lanes=I,o.memoizedState=me}}function Lb(o,l,d){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var g=o[l],b=g.callback;if(b!==null){if(g.callback=null,g=d,typeof b!="function")throw Error(n(191,b));b.call(g)}}}var Nu={},Xs=Eo(Nu),Du=Eo(Nu),ju=Eo(Nu);function Aa(o){if(o===Nu)throw Error(n(174));return o}function wg(o,l){switch(Tt(ju,l),Tt(Du,o),Tt(Xs,Nu),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Lr(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=Lr(l,o)}Ot(Xs),Tt(Xs,l)}function Xl(){Ot(Xs),Ot(Du),Ot(ju)}function Nb(o){Aa(ju.current);var l=Aa(Xs.current),d=Lr(l,o.type);l!==d&&(Tt(Du,o),Tt(Xs,d))}function bg(o){Du.current===o&&(Ot(Xs),Ot(Du))}var Bt=Eo(0);function mh(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Sg=[];function Eg(){for(var o=0;o<Sg.length;o++)Sg[o]._workInProgressVersionPrimary=null;Sg.length=0}var gh=k.ReactCurrentDispatcher,Cg=k.ReactCurrentBatchConfig,Ia=0,Wt=null,vn=null,Sn=null,vh=!1,Fu=!1,Vu=0,BM=0;function Kn(){throw Error(n(321))}function kg(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!As(o[d],l[d]))return!1;return!0}function Pg(o,l,d,g,b,C){if(Ia=C,Wt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,gh.current=o===null||o.memoizedState===null?ZM:qM,o=d(g,b),Fu){C=0;do{if(Fu=!1,Vu=0,25<=C)throw Error(n(301));C+=1,Sn=vn=null,l.updateQueue=null,gh.current=YM,o=d(g,b)}while(Fu)}if(gh.current=xh,l=vn!==null&&vn.next!==null,Ia=0,Sn=vn=Wt=null,vh=!1,l)throw Error(n(300));return o}function Tg(){var o=Vu!==0;return Vu=0,o}function Qs(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?Wt.memoizedState=Sn=o:Sn=Sn.next=o,Sn}function cs(){if(vn===null){var o=Wt.alternate;o=o!==null?o.memoizedState:null}else o=vn.next;var l=Sn===null?Wt.memoizedState:Sn.next;if(l!==null)Sn=l,vn=o;else{if(o===null)throw Error(n(310));vn=o,o={memoizedState:vn.memoizedState,baseState:vn.baseState,baseQueue:vn.baseQueue,queue:vn.queue,next:null},Sn===null?Wt.memoizedState=Sn=o:Sn=Sn.next=o}return Sn}function $u(o,l){return typeof l=="function"?l(o):l}function Rg(o){var l=cs(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var g=vn,b=g.baseQueue,C=d.pending;if(C!==null){if(b!==null){var I=b.next;b.next=C.next,C.next=I}g.baseQueue=b=C,d.pending=null}if(b!==null){C=b.next,g=g.baseState;var V=I=null,B=null,se=C;do{var fe=se.lane;if((Ia&fe)===fe)B!==null&&(B=B.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),g=se.hasEagerState?se.eagerState:o(g,se.action);else{var me={lane:fe,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};B===null?(V=B=me,I=g):B=B.next=me,Wt.lanes|=fe,Ma|=fe}se=se.next}while(se!==null&&se!==C);B===null?I=g:B.next=V,As(g,l.memoizedState)||(vr=!0),l.memoizedState=g,l.baseState=I,l.baseQueue=B,d.lastRenderedState=g}if(o=d.interleaved,o!==null){b=o;do C=b.lane,Wt.lanes|=C,Ma|=C,b=b.next;while(b!==o)}else b===null&&(d.lanes=0);return[l.memoizedState,d.dispatch]}function Ag(o){var l=cs(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var g=d.dispatch,b=d.pending,C=l.memoizedState;if(b!==null){d.pending=null;var I=b=b.next;do C=o(C,I.action),I=I.next;while(I!==b);As(C,l.memoizedState)||(vr=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),d.lastRenderedState=C}return[C,g]}function Db(){}function jb(o,l){var d=Wt,g=cs(),b=l(),C=!As(g.memoizedState,b);if(C&&(g.memoizedState=b,vr=!0),g=g.queue,Ig($b.bind(null,d,g,o),[o]),g.getSnapshot!==l||C||Sn!==null&&Sn.memoizedState.tag&1){if(d.flags|=2048,Hu(9,Vb.bind(null,d,g,b,l),void 0,null),En===null)throw Error(n(349));(Ia&30)!==0||Fb(d,l,b)}return b}function Fb(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=Wt.updateQueue,l===null?(l={lastEffect:null,stores:null},Wt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function Vb(o,l,d,g){l.value=d,l.getSnapshot=g,Hb(l)&&zb(o)}function $b(o,l,d){return d(function(){Hb(l)&&zb(o)})}function Hb(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!As(o,d)}catch{return!0}}function zb(o){var l=Ri(o,1);l!==null&&Ns(l,o,1,-1)}function Ub(o){var l=Qs();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$u,lastRenderedState:o},l.queue=o,o=o.dispatch=KM.bind(null,Wt,o),[l.memoizedState,o]}function Hu(o,l,d,g){return o={tag:o,create:l,destroy:d,deps:g,next:null},l=Wt.updateQueue,l===null?(l={lastEffect:null,stores:null},Wt.updateQueue=l,l.lastEffect=o.next=o):(d=l.lastEffect,d===null?l.lastEffect=o.next=o:(g=d.next,d.next=o,o.next=g,l.lastEffect=o)),o}function Bb(){return cs().memoizedState}function yh(o,l,d,g){var b=Qs();Wt.flags|=o,b.memoizedState=Hu(1|l,d,void 0,g===void 0?null:g)}function _h(o,l,d,g){var b=cs();g=g===void 0?null:g;var C=void 0;if(vn!==null){var I=vn.memoizedState;if(C=I.destroy,g!==null&&kg(g,I.deps)){b.memoizedState=Hu(l,d,C,g);return}}Wt.flags|=o,b.memoizedState=Hu(1|l,d,C,g)}function Wb(o,l){return yh(8390656,8,o,l)}function Ig(o,l){return _h(2048,8,o,l)}function Gb(o,l){return _h(4,2,o,l)}function Kb(o,l){return _h(4,4,o,l)}function Zb(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function qb(o,l,d){return d=d!=null?d.concat([o]):null,_h(4,4,Zb.bind(null,l,o),d)}function Mg(){}function Yb(o,l){var d=cs();l=l===void 0?null:l;var g=d.memoizedState;return g!==null&&l!==null&&kg(l,g[1])?g[0]:(d.memoizedState=[o,l],o)}function Xb(o,l){var d=cs();l=l===void 0?null:l;var g=d.memoizedState;return g!==null&&l!==null&&kg(l,g[1])?g[0]:(o=o(),d.memoizedState=[o,l],o)}function Qb(o,l,d){return(Ia&21)===0?(o.baseState&&(o.baseState=!1,vr=!0),o.memoizedState=d):(As(d,l)||(d=Ts(),Wt.lanes|=d,Ma|=d,o.baseState=!0),l)}function WM(o,l){var d=nt;nt=d!==0&&4>d?d:4,o(!0);var g=Cg.transition;Cg.transition={};try{o(!1),l()}finally{nt=d,Cg.transition=g}}function Jb(){return cs().memoizedState}function GM(o,l,d){var g=Mo(o);if(d={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null},eS(o))tS(l,d);else if(d=Ib(o,l,d,g),d!==null){var b=rr();Ns(d,o,g,b),nS(d,l,g)}}function KM(o,l,d){var g=Mo(o),b={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null};if(eS(o))tS(l,b);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var I=l.lastRenderedState,V=C(I,d);if(b.hasEagerState=!0,b.eagerState=V,As(V,I)){var B=l.interleaved;B===null?(b.next=b,_g(l)):(b.next=B.next,B.next=b),l.interleaved=b;return}}catch{}finally{}d=Ib(o,l,b,g),d!==null&&(b=rr(),Ns(d,o,g,b),nS(d,l,g))}}function eS(o){var l=o.alternate;return o===Wt||l!==null&&l===Wt}function tS(o,l){Fu=vh=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function nS(o,l,d){if((d&4194240)!==0){var g=l.lanes;g&=o.pendingLanes,d|=g,l.lanes=d,Ei(o,d)}}var xh={readContext:ls,useCallback:Kn,useContext:Kn,useEffect:Kn,useImperativeHandle:Kn,useInsertionEffect:Kn,useLayoutEffect:Kn,useMemo:Kn,useReducer:Kn,useRef:Kn,useState:Kn,useDebugValue:Kn,useDeferredValue:Kn,useTransition:Kn,useMutableSource:Kn,useSyncExternalStore:Kn,useId:Kn,unstable_isNewReconciler:!1},ZM={readContext:ls,useCallback:function(o,l){return Qs().memoizedState=[o,l===void 0?null:l],o},useContext:ls,useEffect:Wb,useImperativeHandle:function(o,l,d){return d=d!=null?d.concat([o]):null,yh(4194308,4,Zb.bind(null,l,o),d)},useLayoutEffect:function(o,l){return yh(4194308,4,o,l)},useInsertionEffect:function(o,l){return yh(4,2,o,l)},useMemo:function(o,l){var d=Qs();return l=l===void 0?null:l,o=o(),d.memoizedState=[o,l],o},useReducer:function(o,l,d){var g=Qs();return l=d!==void 0?d(l):l,g.memoizedState=g.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},g.queue=o,o=o.dispatch=GM.bind(null,Wt,o),[g.memoizedState,o]},useRef:function(o){var l=Qs();return o={current:o},l.memoizedState=o},useState:Ub,useDebugValue:Mg,useDeferredValue:function(o){return Qs().memoizedState=o},useTransition:function(){var o=Ub(!1),l=o[0];return o=WM.bind(null,o[1]),Qs().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,d){var g=Wt,b=Qs();if(Vt){if(d===void 0)throw Error(n(407));d=d()}else{if(d=l(),En===null)throw Error(n(349));(Ia&30)!==0||Fb(g,l,d)}b.memoizedState=d;var C={value:d,getSnapshot:l};return b.queue=C,Wb($b.bind(null,g,C,o),[o]),g.flags|=2048,Hu(9,Vb.bind(null,g,C,d,l),void 0,null),d},useId:function(){var o=Qs(),l=En.identifierPrefix;if(Vt){var d=Ti,g=Pi;d=(g&~(1<<32-hr(g)-1)).toString(32)+d,l=":"+l+"R"+d,d=Vu++,0<d&&(l+="H"+d.toString(32)),l+=":"}else d=BM++,l=":"+l+"r"+d.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},qM={readContext:ls,useCallback:Yb,useContext:ls,useEffect:Ig,useImperativeHandle:qb,useInsertionEffect:Gb,useLayoutEffect:Kb,useMemo:Xb,useReducer:Rg,useRef:Bb,useState:function(){return Rg($u)},useDebugValue:Mg,useDeferredValue:function(o){var l=cs();return Qb(l,vn.memoizedState,o)},useTransition:function(){var o=Rg($u)[0],l=cs().memoizedState;return[o,l]},useMutableSource:Db,useSyncExternalStore:jb,useId:Jb,unstable_isNewReconciler:!1},YM={readContext:ls,useCallback:Yb,useContext:ls,useEffect:Ig,useImperativeHandle:qb,useInsertionEffect:Gb,useLayoutEffect:Kb,useMemo:Xb,useReducer:Ag,useRef:Bb,useState:function(){return Ag($u)},useDebugValue:Mg,useDeferredValue:function(o){var l=cs();return vn===null?l.memoizedState=o:Qb(l,vn.memoizedState,o)},useTransition:function(){var o=Ag($u)[0],l=cs().memoizedState;return[o,l]},useMutableSource:Db,useSyncExternalStore:jb,useId:Jb,unstable_isNewReconciler:!1};function Ms(o,l){if(o&&o.defaultProps){l=H({},l),o=o.defaultProps;for(var d in o)l[d]===void 0&&(l[d]=o[d]);return l}return l}function Og(o,l,d,g){l=o.memoizedState,d=d(g,l),d=d==null?l:H({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var wh={isMounted:function(o){return(o=o._reactInternals)?Ps(o)===o:!1},enqueueSetState:function(o,l,d){o=o._reactInternals;var g=rr(),b=Mo(o),C=Ai(g,b);C.payload=l,d!=null&&(C.callback=d),l=To(o,C,b),l!==null&&(Ns(l,o,b,g),hh(l,o,b))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var g=rr(),b=Mo(o),C=Ai(g,b);C.tag=1,C.payload=l,d!=null&&(C.callback=d),l=To(o,C,b),l!==null&&(Ns(l,o,b,g),hh(l,o,b))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=rr(),g=Mo(o),b=Ai(d,g);b.tag=2,l!=null&&(b.callback=l),l=To(o,b,g),l!==null&&(Ns(l,o,g,d),hh(l,o,g))}};function rS(o,l,d,g,b,C,I){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,C,I):l.prototype&&l.prototype.isPureReactComponent?!Pu(d,g)||!Pu(b,C):!0}function sS(o,l,d){var g=!1,b=Co,C=l.contextType;return typeof C=="object"&&C!==null?C=ls(C):(b=gr(l)?ka:Gn.current,g=l.contextTypes,C=(g=g!=null)?Bl(o,b):Co),l=new l(d,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=wh,o.stateNode=l,l._reactInternals=o,g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=C),l}function iS(o,l,d,g){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,g),l.state!==o&&wh.enqueueReplaceState(l,l.state,null)}function Lg(o,l,d,g){var b=o.stateNode;b.props=d,b.state=o.memoizedState,b.refs={},xg(o);var C=l.contextType;typeof C=="object"&&C!==null?b.context=ls(C):(C=gr(l)?ka:Gn.current,b.context=Bl(o,C)),b.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Og(o,l,C,d),b.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(l=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),l!==b.state&&wh.enqueueReplaceState(b,b.state,null),ph(o,d,b,g),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function Ql(o,l){try{var d="",g=l;do d+=J(g),g=g.return;while(g);var b=d}catch(C){b=`
40
+ Error generating stack: `+C.message+`
41
+ `+C.stack}return{value:o,source:l,stack:b,digest:null}}function Ng(o,l,d){return{value:o,source:null,stack:d??null,digest:l??null}}function Dg(o,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var XM=typeof WeakMap=="function"?WeakMap:Map;function oS(o,l,d){d=Ai(-1,d),d.tag=3,d.payload={element:null};var g=l.value;return d.callback=function(){Th||(Th=!0,Xg=g),Dg(o,l)},d}function aS(o,l,d){d=Ai(-1,d),d.tag=3;var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var b=l.value;d.payload=function(){return g(b)},d.callback=function(){Dg(o,l)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(d.callback=function(){Dg(o,l),typeof g!="function"&&(Ao===null?Ao=new Set([this]):Ao.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),d}function lS(o,l,d){var g=o.pingCache;if(g===null){g=o.pingCache=new XM;var b=new Set;g.set(l,b)}else b=g.get(l),b===void 0&&(b=new Set,g.set(l,b));b.has(d)||(b.add(d),o=dO.bind(null,o,l,d),l.then(o,o))}function cS(o){do{var l;if((l=o.tag===13)&&(l=o.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return o;o=o.return}while(o!==null);return null}function uS(o,l,d,g,b){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=Ai(-1,1),l.tag=2,To(d,l,1))),d.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var QM=k.ReactCurrentOwner,vr=!1;function nr(o,l,d,g){l.child=o===null?Ab(l,null,d,g):Zl(l,o.child,d,g)}function dS(o,l,d,g,b){d=d.render;var C=l.ref;return Yl(l,b),g=Pg(o,l,d,g,C,b),d=Tg(),o!==null&&!vr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Ii(o,l,b)):(Vt&&d&&ug(l),l.flags|=1,nr(o,l,g,b),l.child)}function fS(o,l,d,g,b){if(o===null){var C=d.type;return typeof C=="function"&&!sv(C)&&C.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=C,hS(o,l,C,g,b)):(o=Lh(d.type,null,g,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(C=o.child,(o.lanes&b)===0){var I=C.memoizedProps;if(d=d.compare,d=d!==null?d:Pu,d(I,g)&&o.ref===l.ref)return Ii(o,l,b)}return l.flags|=1,o=Lo(C,g),o.ref=l.ref,o.return=l,l.child=o}function hS(o,l,d,g,b){if(o!==null){var C=o.memoizedProps;if(Pu(C,g)&&o.ref===l.ref)if(vr=!1,l.pendingProps=g=C,(o.lanes&b)!==0)(o.flags&131072)!==0&&(vr=!0);else return l.lanes=o.lanes,Ii(o,l,b)}return jg(o,l,d,g,b)}function pS(o,l,d){var g=l.pendingProps,b=g.children,C=o!==null?o.memoizedState:null;if(g.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(ec,zr),zr|=d;else{if((d&1073741824)===0)return o=C!==null?C.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Tt(ec,zr),zr|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=C!==null?C.baseLanes:d,Tt(ec,zr),zr|=g}else C!==null?(g=C.baseLanes|d,l.memoizedState=null):g=d,Tt(ec,zr),zr|=g;return nr(o,l,b,d),l.child}function mS(o,l){var d=l.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(l.flags|=512,l.flags|=2097152)}function jg(o,l,d,g,b){var C=gr(d)?ka:Gn.current;return C=Bl(l,C),Yl(l,b),d=Pg(o,l,d,g,C,b),g=Tg(),o!==null&&!vr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Ii(o,l,b)):(Vt&&g&&ug(l),l.flags|=1,nr(o,l,d,b),l.child)}function gS(o,l,d,g,b){if(gr(d)){var C=!0;ih(l)}else C=!1;if(Yl(l,b),l.stateNode===null)Sh(o,l),sS(l,d,g),Lg(l,d,g,b),g=!0;else if(o===null){var I=l.stateNode,V=l.memoizedProps;I.props=V;var B=I.context,se=d.contextType;typeof se=="object"&&se!==null?se=ls(se):(se=gr(d)?ka:Gn.current,se=Bl(l,se));var fe=d.getDerivedStateFromProps,me=typeof fe=="function"||typeof I.getSnapshotBeforeUpdate=="function";me||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(V!==g||B!==se)&&iS(l,I,g,se),Po=!1;var de=l.memoizedState;I.state=de,ph(l,g,I,b),B=l.memoizedState,V!==g||de!==B||mr.current||Po?(typeof fe=="function"&&(Og(l,d,fe,g),B=l.memoizedState),(V=Po||rS(l,d,V,g,de,B,se))?(me||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=B),I.props=g,I.state=B,I.context=se,g=V):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{I=l.stateNode,Mb(o,l),V=l.memoizedProps,se=l.type===l.elementType?V:Ms(l.type,V),I.props=se,me=l.pendingProps,de=I.context,B=d.contextType,typeof B=="object"&&B!==null?B=ls(B):(B=gr(d)?ka:Gn.current,B=Bl(l,B));var Re=d.getDerivedStateFromProps;(fe=typeof Re=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(V!==me||de!==B)&&iS(l,I,g,B),Po=!1,de=l.memoizedState,I.state=de,ph(l,g,I,b);var Oe=l.memoizedState;V!==me||de!==Oe||mr.current||Po?(typeof Re=="function"&&(Og(l,d,Re,g),Oe=l.memoizedState),(se=Po||rS(l,d,se,g,de,Oe,B)||!1)?(fe||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(g,Oe,B),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(g,Oe,B)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=Oe),I.props=g,I.state=Oe,I.context=B,g=se):(typeof I.componentDidUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),g=!1)}return Fg(o,l,d,g,C,b)}function Fg(o,l,d,g,b,C){mS(o,l);var I=(l.flags&128)!==0;if(!g&&!I)return b&&wb(l,d,!1),Ii(o,l,C);g=l.stateNode,QM.current=l;var V=I&&typeof d.getDerivedStateFromError!="function"?null:g.render();return l.flags|=1,o!==null&&I?(l.child=Zl(l,o.child,null,C),l.child=Zl(l,null,V,C)):nr(o,l,V,C),l.memoizedState=g.state,b&&wb(l,d,!0),l.child}function vS(o){var l=o.stateNode;l.pendingContext?_b(o,l.pendingContext,l.pendingContext!==l.context):l.context&&_b(o,l.context,!1),wg(o,l.containerInfo)}function yS(o,l,d,g,b){return Kl(),pg(b),l.flags|=256,nr(o,l,d,g),l.child}var Vg={dehydrated:null,treeContext:null,retryLane:0};function $g(o){return{baseLanes:o,cachePool:null,transitions:null}}function _S(o,l,d){var g=l.pendingProps,b=Bt.current,C=!1,I=(l.flags&128)!==0,V;if((V=I)||(V=o!==null&&o.memoizedState===null?!1:(b&2)!==0),V?(C=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),Tt(Bt,b&1),o===null)return hg(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((l.mode&1)===0?l.lanes=1:o.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(I=g.children,o=g.fallback,C?(g=l.mode,C=l.child,I={mode:"hidden",children:I},(g&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=I):C=Nh(I,g,0,null),o=Da(o,g,d,null),C.return=l,o.return=l,C.sibling=o,l.child=C,l.child.memoizedState=$g(d),l.memoizedState=Vg,o):Hg(l,I));if(b=o.memoizedState,b!==null&&(V=b.dehydrated,V!==null))return JM(o,l,I,g,V,b,d);if(C){C=g.fallback,I=l.mode,b=o.child,V=b.sibling;var B={mode:"hidden",children:g.children};return(I&1)===0&&l.child!==b?(g=l.child,g.childLanes=0,g.pendingProps=B,l.deletions=null):(g=Lo(b,B),g.subtreeFlags=b.subtreeFlags&14680064),V!==null?C=Lo(V,C):(C=Da(C,I,d,null),C.flags|=2),C.return=l,g.return=l,g.sibling=C,l.child=g,g=C,C=l.child,I=o.child.memoizedState,I=I===null?$g(d):{baseLanes:I.baseLanes|d,cachePool:null,transitions:I.transitions},C.memoizedState=I,C.childLanes=o.childLanes&~d,l.memoizedState=Vg,g}return C=o.child,o=C.sibling,g=Lo(C,{mode:"visible",children:g.children}),(l.mode&1)===0&&(g.lanes=d),g.return=l,g.sibling=null,o!==null&&(d=l.deletions,d===null?(l.deletions=[o],l.flags|=16):d.push(o)),l.child=g,l.memoizedState=null,g}function Hg(o,l){return l=Nh({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function bh(o,l,d,g){return g!==null&&pg(g),Zl(l,o.child,null,d),o=Hg(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function JM(o,l,d,g,b,C,I){if(d)return l.flags&256?(l.flags&=-257,g=Ng(Error(n(422))),bh(o,l,I,g)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(C=g.fallback,b=l.mode,g=Nh({mode:"visible",children:g.children},b,0,null),C=Da(C,b,I,null),C.flags|=2,g.return=l,C.return=l,g.sibling=C,l.child=g,(l.mode&1)!==0&&Zl(l,o.child,null,I),l.child.memoizedState=$g(I),l.memoizedState=Vg,C);if((l.mode&1)===0)return bh(o,l,I,null);if(b.data==="$!"){if(g=b.nextSibling&&b.nextSibling.dataset,g)var V=g.dgst;return g=V,C=Error(n(419)),g=Ng(C,g,void 0),bh(o,l,I,g)}if(V=(I&o.childLanes)!==0,vr||V){if(g=En,g!==null){switch(I&-I){case 4:b=2;break;case 16:b=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(g.suspendedLanes|I))!==0?0:b,b!==0&&b!==C.retryLane&&(C.retryLane=b,Ri(o,b),Ns(g,o,b,-1))}return rv(),g=Ng(Error(n(421))),bh(o,l,I,g)}return b.data==="$?"?(l.flags|=128,l.child=o.child,l=fO.bind(null,o),b._reactRetry=l,null):(o=C.treeContext,Hr=So(b.nextSibling),$r=l,Vt=!0,Is=null,o!==null&&(os[as++]=Pi,os[as++]=Ti,os[as++]=Pa,Pi=o.id,Ti=o.overflow,Pa=l),l=Hg(l,g.children),l.flags|=4096,l)}function xS(o,l,d){o.lanes|=l;var g=o.alternate;g!==null&&(g.lanes|=l),yg(o.return,l,d)}function zg(o,l,d,g,b){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:b}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=g,C.tail=d,C.tailMode=b)}function wS(o,l,d){var g=l.pendingProps,b=g.revealOrder,C=g.tail;if(nr(o,l,g.children,d),g=Bt.current,(g&2)!==0)g=g&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&xS(o,d,l);else if(o.tag===19)xS(o,d,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}g&=1}if(Tt(Bt,g),(l.mode&1)===0)l.memoizedState=null;else switch(b){case"forwards":for(d=l.child,b=null;d!==null;)o=d.alternate,o!==null&&mh(o)===null&&(b=d),d=d.sibling;d=b,d===null?(b=l.child,l.child=null):(b=d.sibling,d.sibling=null),zg(l,!1,b,d,C);break;case"backwards":for(d=null,b=l.child,l.child=null;b!==null;){if(o=b.alternate,o!==null&&mh(o)===null){l.child=b;break}o=b.sibling,b.sibling=d,d=b,b=o}zg(l,!0,d,null,C);break;case"together":zg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Sh(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function Ii(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),Ma|=l.lanes,(d&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,d=Lo(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=Lo(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function eO(o,l,d){switch(l.tag){case 3:vS(l),Kl();break;case 5:Nb(l);break;case 1:gr(l.type)&&ih(l);break;case 4:wg(l,l.stateNode.containerInfo);break;case 10:var g=l.type._context,b=l.memoizedProps.value;Tt(dh,g._currentValue),g._currentValue=b;break;case 13:if(g=l.memoizedState,g!==null)return g.dehydrated!==null?(Tt(Bt,Bt.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?_S(o,l,d):(Tt(Bt,Bt.current&1),o=Ii(o,l,d),o!==null?o.sibling:null);Tt(Bt,Bt.current&1);break;case 19:if(g=(d&l.childLanes)!==0,(o.flags&128)!==0){if(g)return wS(o,l,d);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Tt(Bt,Bt.current),g)break;return null;case 22:case 23:return l.lanes=0,pS(o,l,d)}return Ii(o,l,d)}var bS,Ug,SS,ES;bS=function(o,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Ug=function(){},SS=function(o,l,d,g){var b=o.memoizedProps;if(b!==g){o=l.stateNode,Aa(Xs.current);var C=null;switch(d){case"input":b=dt(o,b),g=dt(o,g),C=[];break;case"select":b=H({},b,{value:void 0}),g=H({},g,{value:void 0}),C=[];break;case"textarea":b=Ye(o,b),g=Ye(o,g),C=[];break;default:typeof b.onClick!="function"&&typeof g.onClick=="function"&&(o.onclick=nh)}Cs(d,g);var I;d=null;for(se in b)if(!g.hasOwnProperty(se)&&b.hasOwnProperty(se)&&b[se]!=null)if(se==="style"){var V=b[se];for(I in V)V.hasOwnProperty(I)&&(d||(d={}),d[I]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(s.hasOwnProperty(se)?C||(C=[]):(C=C||[]).push(se,null));for(se in g){var B=g[se];if(V=b!=null?b[se]:void 0,g.hasOwnProperty(se)&&B!==V&&(B!=null||V!=null))if(se==="style")if(V){for(I in V)!V.hasOwnProperty(I)||B&&B.hasOwnProperty(I)||(d||(d={}),d[I]="");for(I in B)B.hasOwnProperty(I)&&V[I]!==B[I]&&(d||(d={}),d[I]=B[I])}else d||(C||(C=[]),C.push(se,d)),d=B;else se==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,V=V?V.__html:void 0,B!=null&&V!==B&&(C=C||[]).push(se,B)):se==="children"?typeof B!="string"&&typeof B!="number"||(C=C||[]).push(se,""+B):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(s.hasOwnProperty(se)?(B!=null&&se==="onScroll"&&Mt("scroll",o),C||V===B||(C=[])):(C=C||[]).push(se,B))}d&&(C=C||[]).push("style",d);var se=C;(l.updateQueue=se)&&(l.flags|=4)}},ES=function(o,l,d,g){d!==g&&(l.flags|=4)};function zu(o,l){if(!Vt)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Zn(o){var l=o.alternate!==null&&o.alternate.child===o.child,d=0,g=0;if(l)for(var b=o.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags&14680064,g|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=g,o.childLanes=d,l}function tO(o,l,d){var g=l.pendingProps;switch(dg(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zn(l),null;case 1:return gr(l.type)&&sh(),Zn(l),null;case 3:return g=l.stateNode,Xl(),Ot(mr),Ot(Gn),Eg(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(o===null||o.child===null)&&(ch(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Is!==null&&(ev(Is),Is=null))),Ug(o,l),Zn(l),null;case 5:bg(l);var b=Aa(ju.current);if(d=l.type,o!==null&&l.stateNode!=null)SS(o,l,d,g,b),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!g){if(l.stateNode===null)throw Error(n(166));return Zn(l),null}if(o=Aa(Xs.current),ch(l)){g=l.stateNode,d=l.type;var C=l.memoizedProps;switch(g[Ys]=l,g[Mu]=C,o=(l.mode&1)!==0,d){case"dialog":Mt("cancel",g),Mt("close",g);break;case"iframe":case"object":case"embed":Mt("load",g);break;case"video":case"audio":for(b=0;b<Ru.length;b++)Mt(Ru[b],g);break;case"source":Mt("error",g);break;case"img":case"image":case"link":Mt("error",g),Mt("load",g);break;case"details":Mt("toggle",g);break;case"input":qt(g,C),Mt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!C.multiple},Mt("invalid",g);break;case"textarea":At(g,C),Mt("invalid",g)}Cs(d,C),b=null;for(var I in C)if(C.hasOwnProperty(I)){var V=C[I];I==="children"?typeof V=="string"?g.textContent!==V&&(C.suppressHydrationWarning!==!0&&th(g.textContent,V,o),b=["children",V]):typeof V=="number"&&g.textContent!==""+V&&(C.suppressHydrationWarning!==!0&&th(g.textContent,V,o),b=["children",""+V]):s.hasOwnProperty(I)&&V!=null&&I==="onScroll"&&Mt("scroll",g)}switch(d){case"input":De(g),Be(g,C,!0);break;case"textarea":De(g),In(g);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(g.onclick=nh)}g=b,l.updateQueue=g,g!==null&&(l.flags|=4)}else{I=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=Es(d)),o==="http://www.w3.org/1999/xhtml"?d==="script"?(o=I.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof g.is=="string"?o=I.createElement(d,{is:g.is}):(o=I.createElement(d),d==="select"&&(I=o,g.multiple?I.multiple=!0:g.size&&(I.size=g.size))):o=I.createElementNS(o,d),o[Ys]=l,o[Mu]=g,bS(o,l,!1,!1),l.stateNode=o;e:{switch(I=Zs(d,g),d){case"dialog":Mt("cancel",o),Mt("close",o),b=g;break;case"iframe":case"object":case"embed":Mt("load",o),b=g;break;case"video":case"audio":for(b=0;b<Ru.length;b++)Mt(Ru[b],o);b=g;break;case"source":Mt("error",o),b=g;break;case"img":case"image":case"link":Mt("error",o),Mt("load",o),b=g;break;case"details":Mt("toggle",o),b=g;break;case"input":qt(o,g),b=dt(o,g),Mt("invalid",o);break;case"option":b=g;break;case"select":o._wrapperState={wasMultiple:!!g.multiple},b=H({},g,{value:void 0}),Mt("invalid",o);break;case"textarea":At(o,g),b=Ye(o,g),Mt("invalid",o);break;default:b=g}Cs(d,b),V=b;for(C in V)if(V.hasOwnProperty(C)){var B=V[C];C==="style"?mo(o,B):C==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,B!=null&&tr(o,B)):C==="children"?typeof B=="string"?(d!=="textarea"||B!=="")&&wn(o,B):typeof B=="number"&&wn(o,""+B):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(s.hasOwnProperty(C)?B!=null&&C==="onScroll"&&Mt("scroll",o):B!=null&&P(o,C,B,I))}switch(d){case"input":De(o),Be(o,g,!1);break;case"textarea":De(o),In(o);break;case"option":g.value!=null&&o.setAttribute("value",""+oe(g.value));break;case"select":o.multiple=!!g.multiple,C=g.value,C!=null?tt(o,!!g.multiple,C,!1):g.defaultValue!=null&&tt(o,!!g.multiple,g.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=nh)}switch(d){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Zn(l),null;case 6:if(o&&l.stateNode!=null)ES(o,l,o.memoizedProps,g);else{if(typeof g!="string"&&l.stateNode===null)throw Error(n(166));if(d=Aa(ju.current),Aa(Xs.current),ch(l)){if(g=l.stateNode,d=l.memoizedProps,g[Ys]=l,(C=g.nodeValue!==d)&&(o=$r,o!==null))switch(o.tag){case 3:th(g.nodeValue,d,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&th(g.nodeValue,d,(o.mode&1)!==0)}C&&(l.flags|=4)}else g=(d.nodeType===9?d:d.ownerDocument).createTextNode(g),g[Ys]=l,l.stateNode=g}return Zn(l),null;case 13:if(Ot(Bt),g=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Vt&&Hr!==null&&(l.mode&1)!==0&&(l.flags&128)===0)Pb(),Kl(),l.flags|=98560,C=!1;else if(C=ch(l),g!==null&&g.dehydrated!==null){if(o===null){if(!C)throw Error(n(318));if(C=l.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[Ys]=l}else Kl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Zn(l),C=!1}else Is!==null&&(ev(Is),Is=null),C=!0;if(!C)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(g=g!==null,g!==(o!==null&&o.memoizedState!==null)&&g&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Bt.current&1)!==0?yn===0&&(yn=3):rv())),l.updateQueue!==null&&(l.flags|=4),Zn(l),null);case 4:return Xl(),Ug(o,l),o===null&&Au(l.stateNode.containerInfo),Zn(l),null;case 10:return vg(l.type._context),Zn(l),null;case 17:return gr(l.type)&&sh(),Zn(l),null;case 19:if(Ot(Bt),C=l.memoizedState,C===null)return Zn(l),null;if(g=(l.flags&128)!==0,I=C.rendering,I===null)if(g)zu(C,!1);else{if(yn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(I=mh(o),I!==null){for(l.flags|=128,zu(C,!1),g=I.updateQueue,g!==null&&(l.updateQueue=g,l.flags|=4),l.subtreeFlags=0,g=d,d=l.child;d!==null;)C=d,o=g,C.flags&=14680066,I=C.alternate,I===null?(C.childLanes=0,C.lanes=o,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=I.childLanes,C.lanes=I.lanes,C.child=I.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=I.memoizedProps,C.memoizedState=I.memoizedState,C.updateQueue=I.updateQueue,C.type=I.type,o=I.dependencies,C.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),d=d.sibling;return Tt(Bt,Bt.current&1|2),l.child}o=o.sibling}C.tail!==null&&_t()>tc&&(l.flags|=128,g=!0,zu(C,!1),l.lanes=4194304)}else{if(!g)if(o=mh(I),o!==null){if(l.flags|=128,g=!0,d=o.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),zu(C,!0),C.tail===null&&C.tailMode==="hidden"&&!I.alternate&&!Vt)return Zn(l),null}else 2*_t()-C.renderingStartTime>tc&&d!==1073741824&&(l.flags|=128,g=!0,zu(C,!1),l.lanes=4194304);C.isBackwards?(I.sibling=l.child,l.child=I):(d=C.last,d!==null?d.sibling=I:l.child=I,C.last=I)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=_t(),l.sibling=null,d=Bt.current,Tt(Bt,g?d&1|2:d&1),l):(Zn(l),null);case 22:case 23:return nv(),g=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==g&&(l.flags|=8192),g&&(l.mode&1)!==0?(zr&1073741824)!==0&&(Zn(l),l.subtreeFlags&6&&(l.flags|=8192)):Zn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function nO(o,l){switch(dg(l),l.tag){case 1:return gr(l.type)&&sh(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Xl(),Ot(mr),Ot(Gn),Eg(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return bg(l),null;case 13:if(Ot(Bt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Kl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Ot(Bt),null;case 4:return Xl(),null;case 10:return vg(l.type._context),null;case 22:case 23:return nv(),null;case 24:return null;default:return null}}var Eh=!1,qn=!1,rO=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function Jl(o,l){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(g){Xt(o,l,g)}else d.current=null}function Bg(o,l,d){try{d()}catch(g){Xt(o,l,g)}}var CS=!1;function sO(o,l){if(ng=Bf,o=rb(),Z0(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var b=g.anchorOffset,C=g.focusNode;g=g.focusOffset;try{d.nodeType,C.nodeType}catch{d=null;break e}var I=0,V=-1,B=-1,se=0,fe=0,me=o,de=null;t:for(;;){for(var Re;me!==d||b!==0&&me.nodeType!==3||(V=I+b),me!==C||g!==0&&me.nodeType!==3||(B=I+g),me.nodeType===3&&(I+=me.nodeValue.length),(Re=me.firstChild)!==null;)de=me,me=Re;for(;;){if(me===o)break t;if(de===d&&++se===b&&(V=I),de===C&&++fe===g&&(B=I),(Re=me.nextSibling)!==null)break;me=de,de=me.parentNode}me=Re}d=V===-1||B===-1?null:{start:V,end:B}}else d=null}d=d||{start:0,end:0}}else d=null;for(rg={focusedElem:o,selectionRange:d},Bf=!1,Ie=l;Ie!==null;)if(l=Ie,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Ie=o;else for(;Ie!==null;){l=Ie;try{var Oe=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Oe!==null){var Ne=Oe.memoizedProps,nn=Oe.memoizedState,Q=l.stateNode,Z=Q.getSnapshotBeforeUpdate(l.elementType===l.type?Ne:Ms(l.type,Ne),nn);Q.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var ee=l.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ye){Xt(l,l.return,ye)}if(o=l.sibling,o!==null){o.return=l.return,Ie=o;break}Ie=l.return}return Oe=CS,CS=!1,Oe}function Uu(o,l,d){var g=l.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var b=g=g.next;do{if((b.tag&o)===o){var C=b.destroy;b.destroy=void 0,C!==void 0&&Bg(l,d,C)}b=b.next}while(b!==g)}}function Ch(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&o)===o){var g=d.create;d.destroy=g()}d=d.next}while(d!==l)}}function Wg(o){var l=o.ref;if(l!==null){var d=o.stateNode;switch(o.tag){case 5:o=d;break;default:o=d}typeof l=="function"?l(o):l.current=o}}function kS(o){var l=o.alternate;l!==null&&(o.alternate=null,kS(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Ys],delete l[Mu],delete l[ag],delete l[$M],delete l[HM])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function PS(o){return o.tag===5||o.tag===3||o.tag===4}function TS(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||PS(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Gg(o,l,d){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(o,l):d.insertBefore(o,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(o,d)):(l=d,l.appendChild(o)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=nh));else if(g!==4&&(o=o.child,o!==null))for(Gg(o,l,d),o=o.sibling;o!==null;)Gg(o,l,d),o=o.sibling}function Kg(o,l,d){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?d.insertBefore(o,l):d.appendChild(o);else if(g!==4&&(o=o.child,o!==null))for(Kg(o,l,d),o=o.sibling;o!==null;)Kg(o,l,d),o=o.sibling}var Ln=null,Os=!1;function Ro(o,l,d){for(d=d.child;d!==null;)RS(o,l,d),d=d.sibling}function RS(o,l,d){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(Ea,d)}catch{}switch(d.tag){case 5:qn||Jl(d,l);case 6:var g=Ln,b=Os;Ln=null,Ro(o,l,d),Ln=g,Os=b,Ln!==null&&(Os?(o=Ln,d=d.stateNode,o.nodeType===8?o.parentNode.removeChild(d):o.removeChild(d)):Ln.removeChild(d.stateNode));break;case 18:Ln!==null&&(Os?(o=Ln,d=d.stateNode,o.nodeType===8?og(o.parentNode,d):o.nodeType===1&&og(o,d),wu(o)):og(Ln,d.stateNode));break;case 4:g=Ln,b=Os,Ln=d.stateNode.containerInfo,Os=!0,Ro(o,l,d),Ln=g,Os=b;break;case 0:case 11:case 14:case 15:if(!qn&&(g=d.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){b=g=g.next;do{var C=b,I=C.destroy;C=C.tag,I!==void 0&&((C&2)!==0||(C&4)!==0)&&Bg(d,l,I),b=b.next}while(b!==g)}Ro(o,l,d);break;case 1:if(!qn&&(Jl(d,l),g=d.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=d.memoizedProps,g.state=d.memoizedState,g.componentWillUnmount()}catch(V){Xt(d,l,V)}Ro(o,l,d);break;case 21:Ro(o,l,d);break;case 22:d.mode&1?(qn=(g=qn)||d.memoizedState!==null,Ro(o,l,d),qn=g):Ro(o,l,d);break;default:Ro(o,l,d)}}function AS(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new rO),l.forEach(function(g){var b=hO.bind(null,o,g);d.has(g)||(d.add(g),g.then(b,b))})}}function Ls(o,l){var d=l.deletions;if(d!==null)for(var g=0;g<d.length;g++){var b=d[g];try{var C=o,I=l,V=I;e:for(;V!==null;){switch(V.tag){case 5:Ln=V.stateNode,Os=!1;break e;case 3:Ln=V.stateNode.containerInfo,Os=!0;break e;case 4:Ln=V.stateNode.containerInfo,Os=!0;break e}V=V.return}if(Ln===null)throw Error(n(160));RS(C,I,b),Ln=null,Os=!1;var B=b.alternate;B!==null&&(B.return=null),b.return=null}catch(se){Xt(b,l,se)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)IS(l,o),l=l.sibling}function IS(o,l){var d=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Ls(l,o),Js(o),g&4){try{Uu(3,o,o.return),Ch(3,o)}catch(Ne){Xt(o,o.return,Ne)}try{Uu(5,o,o.return)}catch(Ne){Xt(o,o.return,Ne)}}break;case 1:Ls(l,o),Js(o),g&512&&d!==null&&Jl(d,d.return);break;case 5:if(Ls(l,o),Js(o),g&512&&d!==null&&Jl(d,d.return),o.flags&32){var b=o.stateNode;try{wn(b,"")}catch(Ne){Xt(o,o.return,Ne)}}if(g&4&&(b=o.stateNode,b!=null)){var C=o.memoizedProps,I=d!==null?d.memoizedProps:C,V=o.type,B=o.updateQueue;if(o.updateQueue=null,B!==null)try{V==="input"&&C.type==="radio"&&C.name!=null&&xe(b,C),Zs(V,I);var se=Zs(V,C);for(I=0;I<B.length;I+=2){var fe=B[I],me=B[I+1];fe==="style"?mo(b,me):fe==="dangerouslySetInnerHTML"?tr(b,me):fe==="children"?wn(b,me):P(b,fe,me,se)}switch(V){case"input":$e(b,C);break;case"textarea":Bn(b,C);break;case"select":var de=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!C.multiple;var Re=C.value;Re!=null?tt(b,!!C.multiple,Re,!1):de!==!!C.multiple&&(C.defaultValue!=null?tt(b,!!C.multiple,C.defaultValue,!0):tt(b,!!C.multiple,C.multiple?[]:"",!1))}b[Mu]=C}catch(Ne){Xt(o,o.return,Ne)}}break;case 6:if(Ls(l,o),Js(o),g&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,C=o.memoizedProps;try{b.nodeValue=C}catch(Ne){Xt(o,o.return,Ne)}}break;case 3:if(Ls(l,o),Js(o),g&4&&d!==null&&d.memoizedState.isDehydrated)try{wu(l.containerInfo)}catch(Ne){Xt(o,o.return,Ne)}break;case 4:Ls(l,o),Js(o);break;case 13:Ls(l,o),Js(o),b=o.child,b.flags&8192&&(C=b.memoizedState!==null,b.stateNode.isHidden=C,!C||b.alternate!==null&&b.alternate.memoizedState!==null||(Yg=_t())),g&4&&AS(o);break;case 22:if(fe=d!==null&&d.memoizedState!==null,o.mode&1?(qn=(se=qn)||fe,Ls(l,o),qn=se):Ls(l,o),Js(o),g&8192){if(se=o.memoizedState!==null,(o.stateNode.isHidden=se)&&!fe&&(o.mode&1)!==0)for(Ie=o,fe=o.child;fe!==null;){for(me=Ie=fe;Ie!==null;){switch(de=Ie,Re=de.child,de.tag){case 0:case 11:case 14:case 15:Uu(4,de,de.return);break;case 1:Jl(de,de.return);var Oe=de.stateNode;if(typeof Oe.componentWillUnmount=="function"){g=de,d=de.return;try{l=g,Oe.props=l.memoizedProps,Oe.state=l.memoizedState,Oe.componentWillUnmount()}catch(Ne){Xt(g,d,Ne)}}break;case 5:Jl(de,de.return);break;case 22:if(de.memoizedState!==null){LS(me);continue}}Re!==null?(Re.return=de,Ie=Re):LS(me)}fe=fe.sibling}e:for(fe=null,me=o;;){if(me.tag===5){if(fe===null){fe=me;try{b=me.stateNode,se?(C=b.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(V=me.stateNode,B=me.memoizedProps.style,I=B!=null&&B.hasOwnProperty("display")?B.display:null,V.style.display=Mn("display",I))}catch(Ne){Xt(o,o.return,Ne)}}}else if(me.tag===6){if(fe===null)try{me.stateNode.nodeValue=se?"":me.memoizedProps}catch(Ne){Xt(o,o.return,Ne)}}else if((me.tag!==22&&me.tag!==23||me.memoizedState===null||me===o)&&me.child!==null){me.child.return=me,me=me.child;continue}if(me===o)break e;for(;me.sibling===null;){if(me.return===null||me.return===o)break e;fe===me&&(fe=null),me=me.return}fe===me&&(fe=null),me.sibling.return=me.return,me=me.sibling}}break;case 19:Ls(l,o),Js(o),g&4&&AS(o);break;case 21:break;default:Ls(l,o),Js(o)}}function Js(o){var l=o.flags;if(l&2){try{e:{for(var d=o.return;d!==null;){if(PS(d)){var g=d;break e}d=d.return}throw Error(n(160))}switch(g.tag){case 5:var b=g.stateNode;g.flags&32&&(wn(b,""),g.flags&=-33);var C=TS(o);Kg(o,C,b);break;case 3:case 4:var I=g.stateNode.containerInfo,V=TS(o);Gg(o,V,I);break;default:throw Error(n(161))}}catch(B){Xt(o,o.return,B)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function iO(o,l,d){Ie=o,MS(o)}function MS(o,l,d){for(var g=(o.mode&1)!==0;Ie!==null;){var b=Ie,C=b.child;if(b.tag===22&&g){var I=b.memoizedState!==null||Eh;if(!I){var V=b.alternate,B=V!==null&&V.memoizedState!==null||qn;V=Eh;var se=qn;if(Eh=I,(qn=B)&&!se)for(Ie=b;Ie!==null;)I=Ie,B=I.child,I.tag===22&&I.memoizedState!==null?NS(b):B!==null?(B.return=I,Ie=B):NS(b);for(;C!==null;)Ie=C,MS(C),C=C.sibling;Ie=b,Eh=V,qn=se}OS(o)}else(b.subtreeFlags&8772)!==0&&C!==null?(C.return=b,Ie=C):OS(o)}}function OS(o){for(;Ie!==null;){var l=Ie;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:qn||Ch(5,l);break;case 1:var g=l.stateNode;if(l.flags&4&&!qn)if(d===null)g.componentDidMount();else{var b=l.elementType===l.type?d.memoizedProps:Ms(l.type,d.memoizedProps);g.componentDidUpdate(b,d.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var C=l.updateQueue;C!==null&&Lb(l,C,g);break;case 3:var I=l.updateQueue;if(I!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}Lb(l,I,d)}break;case 5:var V=l.stateNode;if(d===null&&l.flags&4){d=V;var B=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":B.autoFocus&&d.focus();break;case"img":B.src&&(d.src=B.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var se=l.alternate;if(se!==null){var fe=se.memoizedState;if(fe!==null){var me=fe.dehydrated;me!==null&&wu(me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}qn||l.flags&512&&Wg(l)}catch(de){Xt(l,l.return,de)}}if(l===o){Ie=null;break}if(d=l.sibling,d!==null){d.return=l.return,Ie=d;break}Ie=l.return}}function LS(o){for(;Ie!==null;){var l=Ie;if(l===o){Ie=null;break}var d=l.sibling;if(d!==null){d.return=l.return,Ie=d;break}Ie=l.return}}function NS(o){for(;Ie!==null;){var l=Ie;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{Ch(4,l)}catch(B){Xt(l,d,B)}break;case 1:var g=l.stateNode;if(typeof g.componentDidMount=="function"){var b=l.return;try{g.componentDidMount()}catch(B){Xt(l,b,B)}}var C=l.return;try{Wg(l)}catch(B){Xt(l,C,B)}break;case 5:var I=l.return;try{Wg(l)}catch(B){Xt(l,I,B)}}}catch(B){Xt(l,l.return,B)}if(l===o){Ie=null;break}var V=l.sibling;if(V!==null){V.return=l.return,Ie=V;break}Ie=l.return}}var oO=Math.ceil,kh=k.ReactCurrentDispatcher,Zg=k.ReactCurrentOwner,us=k.ReactCurrentBatchConfig,ft=0,En=null,un=null,Nn=0,zr=0,ec=Eo(0),yn=0,Bu=null,Ma=0,Ph=0,qg=0,Wu=null,yr=null,Yg=0,tc=1/0,Mi=null,Th=!1,Xg=null,Ao=null,Rh=!1,Io=null,Ah=0,Gu=0,Qg=null,Ih=-1,Mh=0;function rr(){return(ft&6)!==0?_t():Ih!==-1?Ih:Ih=_t()}function Mo(o){return(o.mode&1)===0?1:(ft&2)!==0&&Nn!==0?Nn&-Nn:UM.transition!==null?(Mh===0&&(Mh=Ts()),Mh):(o=nt,o!==0||(o=window.event,o=o===void 0?16:jw(o.type)),o)}function Ns(o,l,d,g){if(50<Gu)throw Gu=0,Qg=null,Error(n(185));pr(o,d,g),((ft&2)===0||o!==En)&&(o===En&&((ft&2)===0&&(Ph|=d),yn===4&&Oo(o,Nn)),_r(o,g),d===1&&ft===0&&(l.mode&1)===0&&(tc=_t()+500,oh&&ko()))}function _r(o,l){var d=o.callbackNode;On(o,l);var g=We(o,o===En?Nn:0);if(g===0)d!==null&&gu(d),o.callbackNode=null,o.callbackPriority=0;else if(l=g&-g,o.callbackPriority!==l){if(d!=null&&gu(d),l===1)o.tag===0?zM(jS.bind(null,o)):bb(jS.bind(null,o)),FM(function(){(ft&6)===0&&ko()}),d=null;else{switch(Hf(g)){case 1:d=ba;break;case 4:d=Vf;break;case 16:d=Sa;break;case 536870912:d=Ll;break;default:d=Sa}d=WS(d,DS.bind(null,o))}o.callbackPriority=l,o.callbackNode=d}}function DS(o,l){if(Ih=-1,Mh=0,(ft&6)!==0)throw Error(n(327));var d=o.callbackNode;if(nc()&&o.callbackNode!==d)return null;var g=We(o,o===En?Nn:0);if(g===0)return null;if((g&30)!==0||(g&o.expiredLanes)!==0||l)l=Oh(o,g);else{l=g;var b=ft;ft|=2;var C=VS();(En!==o||Nn!==l)&&(Mi=null,tc=_t()+500,La(o,l));do try{cO();break}catch(V){FS(o,V)}while(!0);gg(),kh.current=C,ft=b,un!==null?l=0:(En=null,Nn=0,l=yn)}if(l!==0){if(l===2&&(b=is(o),b!==0&&(g=b,l=Jg(o,b))),l===1)throw d=Bu,La(o,0),Oo(o,g),_r(o,_t()),d;if(l===6)Oo(o,g);else{if(b=o.current.alternate,(g&30)===0&&!aO(b)&&(l=Oh(o,g),l===2&&(C=is(o),C!==0&&(g=C,l=Jg(o,C))),l===1))throw d=Bu,La(o,0),Oo(o,g),_r(o,_t()),d;switch(o.finishedWork=b,o.finishedLanes=g,l){case 0:case 1:throw Error(n(345));case 2:Na(o,yr,Mi);break;case 3:if(Oo(o,g),(g&130023424)===g&&(l=Yg+500-_t(),10<l)){if(We(o,0)!==0)break;if(b=o.suspendedLanes,(b&g)!==g){rr(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=ig(Na.bind(null,o,yr,Mi),l);break}Na(o,yr,Mi);break;case 4:if(Oo(o,g),(g&4194240)===g)break;for(l=o.eventTimes,b=-1;0<g;){var I=31-hr(g);C=1<<I,I=l[I],I>b&&(b=I),g&=~C}if(g=b,g=_t()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*oO(g/1960))-g,10<g){o.timeoutHandle=ig(Na.bind(null,o,yr,Mi),g);break}Na(o,yr,Mi);break;case 5:Na(o,yr,Mi);break;default:throw Error(n(329))}}}return _r(o,_t()),o.callbackNode===d?DS.bind(null,o):null}function Jg(o,l){var d=Wu;return o.current.memoizedState.isDehydrated&&(La(o,l).flags|=256),o=Oh(o,l),o!==2&&(l=yr,yr=d,l!==null&&ev(l)),o}function ev(o){yr===null?yr=o:yr.push.apply(yr,o)}function aO(o){for(var l=o;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var g=0;g<d.length;g++){var b=d[g],C=b.getSnapshot;b=b.value;try{if(!As(C(),b))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Oo(o,l){for(l&=~qg,l&=~Ph,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var d=31-hr(l),g=1<<d;o[d]=-1,l&=~g}}function jS(o){if((ft&6)!==0)throw Error(n(327));nc();var l=We(o,0);if((l&1)===0)return _r(o,_t()),null;var d=Oh(o,l);if(o.tag!==0&&d===2){var g=is(o);g!==0&&(l=g,d=Jg(o,g))}if(d===1)throw d=Bu,La(o,0),Oo(o,l),_r(o,_t()),d;if(d===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,Na(o,yr,Mi),_r(o,_t()),null}function tv(o,l){var d=ft;ft|=1;try{return o(l)}finally{ft=d,ft===0&&(tc=_t()+500,oh&&ko())}}function Oa(o){Io!==null&&Io.tag===0&&(ft&6)===0&&nc();var l=ft;ft|=1;var d=us.transition,g=nt;try{if(us.transition=null,nt=1,o)return o()}finally{nt=g,us.transition=d,ft=l,(ft&6)===0&&ko()}}function nv(){zr=ec.current,Ot(ec)}function La(o,l){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==-1&&(o.timeoutHandle=-1,jM(d)),un!==null)for(d=un.return;d!==null;){var g=d;switch(dg(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&sh();break;case 3:Xl(),Ot(mr),Ot(Gn),Eg();break;case 5:bg(g);break;case 4:Xl();break;case 13:Ot(Bt);break;case 19:Ot(Bt);break;case 10:vg(g.type._context);break;case 22:case 23:nv()}d=d.return}if(En=o,un=o=Lo(o.current,null),Nn=zr=l,yn=0,Bu=null,qg=Ph=Ma=0,yr=Wu=null,Ra!==null){for(l=0;l<Ra.length;l++)if(d=Ra[l],g=d.interleaved,g!==null){d.interleaved=null;var b=g.next,C=d.pending;if(C!==null){var I=C.next;C.next=b,g.next=I}d.pending=g}Ra=null}return o}function FS(o,l){do{var d=un;try{if(gg(),gh.current=xh,vh){for(var g=Wt.memoizedState;g!==null;){var b=g.queue;b!==null&&(b.pending=null),g=g.next}vh=!1}if(Ia=0,Sn=vn=Wt=null,Fu=!1,Vu=0,Zg.current=null,d===null||d.return===null){yn=1,Bu=l,un=null;break}e:{var C=o,I=d.return,V=d,B=l;if(l=Nn,V.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var se=B,fe=V,me=fe.tag;if((fe.mode&1)===0&&(me===0||me===11||me===15)){var de=fe.alternate;de?(fe.updateQueue=de.updateQueue,fe.memoizedState=de.memoizedState,fe.lanes=de.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Re=cS(I);if(Re!==null){Re.flags&=-257,uS(Re,I,V,C,l),Re.mode&1&&lS(C,se,l),l=Re,B=se;var Oe=l.updateQueue;if(Oe===null){var Ne=new Set;Ne.add(B),l.updateQueue=Ne}else Oe.add(B);break e}else{if((l&1)===0){lS(C,se,l),rv();break e}B=Error(n(426))}}else if(Vt&&V.mode&1){var nn=cS(I);if(nn!==null){(nn.flags&65536)===0&&(nn.flags|=256),uS(nn,I,V,C,l),pg(Ql(B,V));break e}}C=B=Ql(B,V),yn!==4&&(yn=2),Wu===null?Wu=[C]:Wu.push(C),C=I;do{switch(C.tag){case 3:C.flags|=65536,l&=-l,C.lanes|=l;var Q=oS(C,B,l);Ob(C,Q);break e;case 1:V=B;var Z=C.type,ee=C.stateNode;if((C.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(Ao===null||!Ao.has(ee)))){C.flags|=65536,l&=-l,C.lanes|=l;var ye=aS(C,V,l);Ob(C,ye);break e}}C=C.return}while(C!==null)}HS(d)}catch(je){l=je,un===d&&d!==null&&(un=d=d.return);continue}break}while(!0)}function VS(){var o=kh.current;return kh.current=xh,o===null?xh:o}function rv(){(yn===0||yn===3||yn===2)&&(yn=4),En===null||(Ma&268435455)===0&&(Ph&268435455)===0||Oo(En,Nn)}function Oh(o,l){var d=ft;ft|=2;var g=VS();(En!==o||Nn!==l)&&(Mi=null,La(o,l));do try{lO();break}catch(b){FS(o,b)}while(!0);if(gg(),ft=d,kh.current=g,un!==null)throw Error(n(261));return En=null,Nn=0,yn}function lO(){for(;un!==null;)$S(un)}function cO(){for(;un!==null&&!L0();)$S(un)}function $S(o){var l=BS(o.alternate,o,zr);o.memoizedProps=o.pendingProps,l===null?HS(o):un=l,Zg.current=null}function HS(o){var l=o;do{var d=l.alternate;if(o=l.return,(l.flags&32768)===0){if(d=tO(d,l,zr),d!==null){un=d;return}}else{if(d=nO(d,l),d!==null){d.flags&=32767,un=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{yn=6,un=null;return}}if(l=l.sibling,l!==null){un=l;return}un=l=o}while(l!==null);yn===0&&(yn=5)}function Na(o,l,d){var g=nt,b=us.transition;try{us.transition=null,nt=1,uO(o,l,d,g)}finally{us.transition=b,nt=g}return null}function uO(o,l,d,g){do nc();while(Io!==null);if((ft&6)!==0)throw Error(n(327));d=o.finishedWork;var b=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var C=d.lanes|d.childLanes;if(cn(o,C),o===En&&(un=En=null,Nn=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Rh||(Rh=!0,WS(Sa,function(){return nc(),null})),C=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||C){C=us.transition,us.transition=null;var I=nt;nt=1;var V=ft;ft|=4,Zg.current=null,sO(o,d),IS(d,o),AM(rg),Bf=!!ng,rg=ng=null,o.current=d,iO(d),Rw(),ft=V,nt=I,us.transition=C}else o.current=d;if(Rh&&(Rh=!1,Io=o,Ah=b),C=o.pendingLanes,C===0&&(Ao=null),$f(d.stateNode),_r(o,_t()),l!==null)for(g=o.onRecoverableError,d=0;d<l.length;d++)b=l[d],g(b.value,{componentStack:b.stack,digest:b.digest});if(Th)throw Th=!1,o=Xg,Xg=null,o;return(Ah&1)!==0&&o.tag!==0&&nc(),C=o.pendingLanes,(C&1)!==0?o===Qg?Gu++:(Gu=0,Qg=o):Gu=0,ko(),null}function nc(){if(Io!==null){var o=Hf(Ah),l=us.transition,d=nt;try{if(us.transition=null,nt=16>o?16:o,Io===null)var g=!1;else{if(o=Io,Io=null,Ah=0,(ft&6)!==0)throw Error(n(331));var b=ft;for(ft|=4,Ie=o.current;Ie!==null;){var C=Ie,I=C.child;if((Ie.flags&16)!==0){var V=C.deletions;if(V!==null){for(var B=0;B<V.length;B++){var se=V[B];for(Ie=se;Ie!==null;){var fe=Ie;switch(fe.tag){case 0:case 11:case 15:Uu(8,fe,C)}var me=fe.child;if(me!==null)me.return=fe,Ie=me;else for(;Ie!==null;){fe=Ie;var de=fe.sibling,Re=fe.return;if(kS(fe),fe===se){Ie=null;break}if(de!==null){de.return=Re,Ie=de;break}Ie=Re}}}var Oe=C.alternate;if(Oe!==null){var Ne=Oe.child;if(Ne!==null){Oe.child=null;do{var nn=Ne.sibling;Ne.sibling=null,Ne=nn}while(Ne!==null)}}Ie=C}}if((C.subtreeFlags&2064)!==0&&I!==null)I.return=C,Ie=I;else e:for(;Ie!==null;){if(C=Ie,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:Uu(9,C,C.return)}var Q=C.sibling;if(Q!==null){Q.return=C.return,Ie=Q;break e}Ie=C.return}}var Z=o.current;for(Ie=Z;Ie!==null;){I=Ie;var ee=I.child;if((I.subtreeFlags&2064)!==0&&ee!==null)ee.return=I,Ie=ee;else e:for(I=Z;Ie!==null;){if(V=Ie,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:Ch(9,V)}}catch(je){Xt(V,V.return,je)}if(V===I){Ie=null;break e}var ye=V.sibling;if(ye!==null){ye.return=V.return,Ie=ye;break e}Ie=V.return}}if(ft=b,ko(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(Ea,o)}catch{}g=!0}return g}finally{nt=d,us.transition=l}}return!1}function zS(o,l,d){l=Ql(d,l),l=oS(o,l,1),o=To(o,l,1),l=rr(),o!==null&&(pr(o,1,l),_r(o,l))}function Xt(o,l,d){if(o.tag===3)zS(o,o,d);else for(;l!==null;){if(l.tag===3){zS(l,o,d);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ao===null||!Ao.has(g))){o=Ql(d,o),o=aS(l,o,1),l=To(l,o,1),o=rr(),l!==null&&(pr(l,1,o),_r(l,o));break}}l=l.return}}function dO(o,l,d){var g=o.pingCache;g!==null&&g.delete(l),l=rr(),o.pingedLanes|=o.suspendedLanes&d,En===o&&(Nn&d)===d&&(yn===4||yn===3&&(Nn&130023424)===Nn&&500>_t()-Yg?La(o,0):qg|=d),_r(o,l)}function US(o,l){l===0&&((o.mode&1)===0?l=1:(l=pe,pe<<=1,(pe&130023424)===0&&(pe=4194304)));var d=rr();o=Ri(o,l),o!==null&&(pr(o,l,d),_r(o,d))}function fO(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),US(o,d)}function hO(o,l){var d=0;switch(o.tag){case 13:var g=o.stateNode,b=o.memoizedState;b!==null&&(d=b.retryLane);break;case 19:g=o.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(l),US(o,d)}var BS;BS=function(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps||mr.current)vr=!0;else{if((o.lanes&d)===0&&(l.flags&128)===0)return vr=!1,eO(o,l,d);vr=(o.flags&131072)!==0}else vr=!1,Vt&&(l.flags&1048576)!==0&&Sb(l,lh,l.index);switch(l.lanes=0,l.tag){case 2:var g=l.type;Sh(o,l),o=l.pendingProps;var b=Bl(l,Gn.current);Yl(l,d),b=Pg(null,l,g,o,b,d);var C=Tg();return l.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,gr(g)?(C=!0,ih(l)):C=!1,l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,xg(l),b.updater=wh,l.stateNode=b,b._reactInternals=l,Lg(l,g,o,d),l=Fg(null,l,g,!0,C,d)):(l.tag=0,Vt&&C&&ug(l),nr(null,l,b,d),l=l.child),l;case 16:g=l.elementType;e:{switch(Sh(o,l),o=l.pendingProps,b=g._init,g=b(g._payload),l.type=g,b=l.tag=mO(g),o=Ms(g,o),b){case 0:l=jg(null,l,g,o,d);break e;case 1:l=gS(null,l,g,o,d);break e;case 11:l=dS(null,l,g,o,d);break e;case 14:l=fS(null,l,g,Ms(g.type,o),d);break e}throw Error(n(306,g,""))}return l;case 0:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Ms(g,b),jg(o,l,g,b,d);case 1:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Ms(g,b),gS(o,l,g,b,d);case 3:e:{if(vS(l),o===null)throw Error(n(387));g=l.pendingProps,C=l.memoizedState,b=C.element,Mb(o,l),ph(l,g,null,d);var I=l.memoizedState;if(g=I.element,C.isDehydrated)if(C={element:g,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){b=Ql(Error(n(423)),l),l=yS(o,l,g,d,b);break e}else if(g!==b){b=Ql(Error(n(424)),l),l=yS(o,l,g,d,b);break e}else for(Hr=So(l.stateNode.containerInfo.firstChild),$r=l,Vt=!0,Is=null,d=Ab(l,null,g,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Kl(),g===b){l=Ii(o,l,d);break e}nr(o,l,g,d)}l=l.child}return l;case 5:return Nb(l),o===null&&hg(l),g=l.type,b=l.pendingProps,C=o!==null?o.memoizedProps:null,I=b.children,sg(g,b)?I=null:C!==null&&sg(g,C)&&(l.flags|=32),mS(o,l),nr(o,l,I,d),l.child;case 6:return o===null&&hg(l),null;case 13:return _S(o,l,d);case 4:return wg(l,l.stateNode.containerInfo),g=l.pendingProps,o===null?l.child=Zl(l,null,g,d):nr(o,l,g,d),l.child;case 11:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Ms(g,b),dS(o,l,g,b,d);case 7:return nr(o,l,l.pendingProps,d),l.child;case 8:return nr(o,l,l.pendingProps.children,d),l.child;case 12:return nr(o,l,l.pendingProps.children,d),l.child;case 10:e:{if(g=l.type._context,b=l.pendingProps,C=l.memoizedProps,I=b.value,Tt(dh,g._currentValue),g._currentValue=I,C!==null)if(As(C.value,I)){if(C.children===b.children&&!mr.current){l=Ii(o,l,d);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var V=C.dependencies;if(V!==null){I=C.child;for(var B=V.firstContext;B!==null;){if(B.context===g){if(C.tag===1){B=Ai(-1,d&-d),B.tag=2;var se=C.updateQueue;if(se!==null){se=se.shared;var fe=se.pending;fe===null?B.next=B:(B.next=fe.next,fe.next=B),se.pending=B}}C.lanes|=d,B=C.alternate,B!==null&&(B.lanes|=d),yg(C.return,d,l),V.lanes|=d;break}B=B.next}}else if(C.tag===10)I=C.type===l.type?null:C.child;else if(C.tag===18){if(I=C.return,I===null)throw Error(n(341));I.lanes|=d,V=I.alternate,V!==null&&(V.lanes|=d),yg(I,d,l),I=C.sibling}else I=C.child;if(I!==null)I.return=C;else for(I=C;I!==null;){if(I===l){I=null;break}if(C=I.sibling,C!==null){C.return=I.return,I=C;break}I=I.return}C=I}nr(o,l,b.children,d),l=l.child}return l;case 9:return b=l.type,g=l.pendingProps.children,Yl(l,d),b=ls(b),g=g(b),l.flags|=1,nr(o,l,g,d),l.child;case 14:return g=l.type,b=Ms(g,l.pendingProps),b=Ms(g.type,b),fS(o,l,g,b,d);case 15:return hS(o,l,l.type,l.pendingProps,d);case 17:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Ms(g,b),Sh(o,l),l.tag=1,gr(g)?(o=!0,ih(l)):o=!1,Yl(l,d),sS(l,g,b),Lg(l,g,b,d),Fg(null,l,g,!0,o,d);case 19:return wS(o,l,d);case 22:return pS(o,l,d)}throw Error(n(156,l.tag))};function WS(o,l){return Ml(o,l)}function pO(o,l,d,g){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ds(o,l,d,g){return new pO(o,l,d,g)}function sv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function mO(o){if(typeof o=="function")return sv(o)?1:0;if(o!=null){if(o=o.$$typeof,o===F)return 11;if(o===W)return 14}return 2}function Lo(o,l){var d=o.alternate;return d===null?(d=ds(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function Lh(o,l,d,g,b,C){var I=2;if(g=o,typeof o=="function")sv(o)&&(I=1);else if(typeof o=="string")I=5;else e:switch(o){case L:return Da(d.children,b,C,l);case R:I=8,b|=8;break;case M:return o=ds(12,d,l,b|2),o.elementType=M,o.lanes=C,o;case q:return o=ds(13,d,l,b),o.elementType=q,o.lanes=C,o;case X:return o=ds(19,d,l,b),o.elementType=X,o.lanes=C,o;case K:return Nh(d,b,C,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case N:I=10;break e;case D:I=9;break e;case F:I=11;break e;case W:I=14;break e;case G:I=16,g=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=ds(I,d,l,b),l.elementType=o,l.type=g,l.lanes=C,l}function Da(o,l,d,g){return o=ds(7,o,g,l),o.lanes=d,o}function Nh(o,l,d,g){return o=ds(22,o,g,l),o.elementType=K,o.lanes=d,o.stateNode={isHidden:!1},o}function iv(o,l,d){return o=ds(6,o,null,l),o.lanes=d,o}function ov(o,l,d){return l=ds(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function gO(o,l,d,g,b){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rs(0),this.expirationTimes=Rs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rs(0),this.identifierPrefix=g,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function av(o,l,d,g,b,C,I,V,B){return o=new gO(o,l,d,V,B),l===1?(l=1,C===!0&&(l|=8)):l=0,C=ds(3,null,null,l),o.current=C,C.stateNode=o,C.memoizedState={element:g,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},xg(C),o}function vO(o,l,d){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:g==null?null:""+g,children:o,containerInfo:l,implementation:d}}function GS(o){if(!o)return Co;o=o._reactInternals;e:{if(Ps(o)!==o||o.tag!==1)throw Error(n(170));var l=o;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(gr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var d=o.type;if(gr(d))return xb(o,d,l)}return l}function KS(o,l,d,g,b,C,I,V,B){return o=av(d,g,!0,o,b,C,I,V,B),o.context=GS(null),d=o.current,g=rr(),b=Mo(d),C=Ai(g,b),C.callback=l??null,To(d,C,b),o.current.lanes=b,pr(o,b,g),_r(o,g),o}function Dh(o,l,d,g){var b=l.current,C=rr(),I=Mo(b);return d=GS(d),l.context===null?l.context=d:l.pendingContext=d,l=Ai(C,I),l.payload={element:o},g=g===void 0?null:g,g!==null&&(l.callback=g),o=To(b,l,I),o!==null&&(Ns(o,b,I,C),hh(o,b,I)),I}function jh(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function ZS(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function lv(o,l){ZS(o,l),(o=o.alternate)&&ZS(o,l)}function yO(){return null}var qS=typeof reportError=="function"?reportError:function(o){console.error(o)};function cv(o){this._internalRoot=o}Fh.prototype.render=cv.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));Dh(o,l,null,null)},Fh.prototype.unmount=cv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Oa(function(){Dh(null,o,null,null)}),l[Ci]=null}};function Fh(o){this._internalRoot=o}Fh.prototype.unstable_scheduleHydration=function(o){if(o){var l=Mw();o={blockedOn:null,target:o,priority:l};for(var d=0;d<xo.length&&l!==0&&l<xo[d].priority;d++);xo.splice(d,0,o),d===0&&Nw(o)}};function uv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Vh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function YS(){}function _O(o,l,d,g,b){if(b){if(typeof g=="function"){var C=g;g=function(){var se=jh(I);C.call(se)}}var I=KS(l,g,o,0,null,!1,!1,"",YS);return o._reactRootContainer=I,o[Ci]=I.current,Au(o.nodeType===8?o.parentNode:o),Oa(),I}for(;b=o.lastChild;)o.removeChild(b);if(typeof g=="function"){var V=g;g=function(){var se=jh(B);V.call(se)}}var B=av(o,0,!1,null,null,!1,!1,"",YS);return o._reactRootContainer=B,o[Ci]=B.current,Au(o.nodeType===8?o.parentNode:o),Oa(function(){Dh(l,B,d,g)}),B}function $h(o,l,d,g,b){var C=d._reactRootContainer;if(C){var I=C;if(typeof b=="function"){var V=b;b=function(){var B=jh(I);V.call(B)}}Dh(l,I,o,b)}else I=_O(d,l,o,b,g);return jh(I)}Aw=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var d=Ee(l.pendingLanes);d!==0&&(Ei(l,d|1),_r(l,_t()),(ft&6)===0&&(tc=_t()+500,ko()))}break;case 13:Oa(function(){var g=Ri(o,1);if(g!==null){var b=rr();Ns(g,o,1,b)}}),lv(o,1)}},N0=function(o){if(o.tag===13){var l=Ri(o,134217728);if(l!==null){var d=rr();Ns(l,o,134217728,d)}lv(o,134217728)}},Iw=function(o){if(o.tag===13){var l=Mo(o),d=Ri(o,l);if(d!==null){var g=rr();Ns(d,o,l,g)}lv(o,l)}},Mw=function(){return nt},Ow=function(o,l){var d=nt;try{return nt=o,l()}finally{nt=d}},go=function(o,l,d){switch(l){case"input":if($e(o,d),l=d.name,d.type==="radio"&&l!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var g=d[l];if(g!==o&&g.form===o.form){var b=rh(g);if(!b)throw Error(n(90));Pe(g),$e(g,b)}}}break;case"textarea":Bn(o,d);break;case"select":l=d.value,l!=null&&tt(o,!!d.multiple,l,!1)}},Ut=tv,bn=Oa;var xO={usingClientEntryPoint:!1,Events:[Ou,zl,rh,Ke,It,tv]},Ku={findFiberByHostInstance:Ca,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},wO={bundleType:Ku.bundleType,version:Ku.version,rendererPackageName:Ku.rendererPackageName,rendererConfig:Ku.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=jf(o),o===null?null:o.stateNode},findFiberByHostInstance:Ku.findFiberByHostInstance||yO,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hh.isDisabled&&Hh.supportsFiber)try{Ea=Hh.inject(wO),Fr=Hh}catch{}}return xr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xO,xr.createPortal=function(o,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uv(l))throw Error(n(200));return vO(o,l,null,d)},xr.createRoot=function(o,l){if(!uv(o))throw Error(n(299));var d=!1,g="",b=qS;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),l=av(o,1,!1,null,null,d,!1,g,b),o[Ci]=l.current,Au(o.nodeType===8?o.parentNode:o),new cv(l)},xr.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=jf(l),o=o===null?null:o.stateNode,o},xr.flushSync=function(o){return Oa(o)},xr.hydrate=function(o,l,d){if(!Vh(l))throw Error(n(200));return $h(null,o,l,!0,d)},xr.hydrateRoot=function(o,l,d){if(!uv(o))throw Error(n(405));var g=d!=null&&d.hydratedSources||null,b=!1,C="",I=qS;if(d!=null&&(d.unstable_strictMode===!0&&(b=!0),d.identifierPrefix!==void 0&&(C=d.identifierPrefix),d.onRecoverableError!==void 0&&(I=d.onRecoverableError)),l=KS(l,null,o,1,d??null,b,!1,C,I),o[Ci]=l.current,Au(o),g)for(o=0;o<g.length;o++)d=g[o],b=d._getVersion,b=b(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,b]:l.mutableSourceEagerHydrationData.push(d,b);return new Fh(l)},xr.render=function(o,l,d){if(!Vh(l))throw Error(n(200));return $h(null,o,l,!1,d)},xr.unmountComponentAtNode=function(o){if(!Vh(o))throw Error(n(40));return o._reactRootContainer?(Oa(function(){$h(null,null,o,!1,function(){o._reactRootContainer=null,o[Ci]=null})}),!0):!1},xr.unstable_batchedUpdates=tv,xr.unstable_renderSubtreeIntoContainer=function(o,l,d,g){if(!Vh(d))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return $h(o,l,d,!1,g)},xr.version="18.3.1-next-f1338f8080-20240426",xr}var vC;function NP(){if(vC)return Bv.exports;vC=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Bv.exports=zD(),Bv.exports}var yC;function UD(){if(yC)return ep;yC=1;var t=NP();return ep.createRoot=t.createRoot,ep.hydrateRoot=t.hydrateRoot,ep}var BD=UD();const WD=Jm(BD),eo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function DP(t){return"init"in t}function Wy(t){return typeof t.write=="function"}function GD(t){return!!t.onMount}function _C(t){return"v"in t||"e"in t}function Sm(t){if("e"in t)throw t.e;if((eo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Em(t){return typeof(t==null?void 0:t.then)=="function"}function KD(t){if(!(t instanceof Error))return!1;const e=t.name,n=t.message.toLowerCase();return(e==="RangeError"||e==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function jP(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function FP(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const a=new Set(s);for(const c of i)a.add(c);return a}function ZD(t){return!!t.INTERNAL_onInit}const qD=(t,e,n,...r)=>n.read(...r),YD=(t,e,n,...r)=>n.write(...r),XD=(t,e,n)=>n.INTERNAL_onInit(e),QD=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},JD=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const a=t[6],c=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=a.i)==null||r.call(a,n),ZD(n)&&c(t,e,n)}return i},e9=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],a=t[5],c=t[6],u=t[13];if(!c.f&&!s.size&&!i.size&&!a.size)return;const f=[],h=p=>{try{p()}catch(m){f.push(m)}};do{c.f&&h(c.f);const p=new Set;for(const m of s){const _=(n=r.get(m))==null?void 0:n.l;if(_)for(const x of _)p.add(x)}s.clear();for(const m of a)p.add(m);a.clear();for(const m of i)p.add(m);i.clear();for(const m of p)h(m);s.size&&u(t,e)}while(s.size||a.size||i.size);if(f.length)throw new AggregateError(f)},t9=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],a=t[14],c=t[17];if(!s.size)return;const u=[],f=[],h=new WeakSet,p=new WeakSet,m=[],_=[];for(const x of s)m.push(x),_.push(i(t,e,x));for(;m.length;){const x=m.length-1,y=m[x],w=_[x];if(p.has(y)){m.pop(),_.pop();continue}if(h.has(y)){if(r.get(y)===w.n)u.push(y),f.push(w);else if((eo?"production":void 0)!=="production"&&r.has(y))throw new Error("[Bug] invalidated atom exists");p.add(y),m.pop(),_.pop();continue}h.add(y);for(const S of FP(y,w,n))h.has(S)||(m.push(S),_.push(i(t,e,S)))}for(let x=u.length-1;x>=0;--x){const y=u[x],w=f[x];let S=!1;for(const T of w.d.keys())if(T!==y&&s.has(T)){S=!0;break}S&&(r.set(y,w.n),a(t,e,y),c(t,e,y)),r.delete(y)}},Gy=new WeakSet,n9=(t,e,n)=>{var r,s;const i=t[1],a=t[2],c=t[3],u=t[6],f=t[7],h=t[11],p=t[12],m=t[13],_=t[14],x=t[16],y=t[17],w=t[20],S=t[26],T=t[28],P=h(t,e,n),k=T[0];if(_C(P)){if(i.has(n)&&a.get(n)!==P.n||P.m===k)return P.m=k,P;let W=!1;for(const[G,K]of P.d)if(_(t,e,G).n!==K){W=!0;break}if(!W)return P.m=k,P}let A=!0;const O=new Set(P.d.keys()),L=()=>{for(const W of O)P.d.delete(W)},R=()=>{if(i.has(n)){const W=!c.size;y(t,e,n),W&&(m(t,e),p(t,e))}},M=W=>{var G;if(W===n){const $=h(t,e,W);if(!_C($))if(DP(W))w(t,e,W,W.init);else throw new Error("no atom init");return Sm($)}const K=_(t,e,W);try{return Sm(K)}finally{O.delete(W),P.d.set(W,K.n),Em(P.v)&&jP(n,P.v,K),i.has(n)&&((G=i.get(W))==null||G.t.add(n)),A||R()}};let N,D;const F={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(eo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(eo?"production":void 0)!=="production"&&!Wy(n)&&console.warn("setSelf function cannot be used with read-only atom"),!D&&Wy(n)&&(D=(...W)=>{if((eo?"production":void 0)!=="production"&&A&&console.warn("setSelf function cannot be called in sync"),!A)try{return x(t,e,n,W)}finally{m(t,e),p(t,e)}}),D}},q=P.n,X=a.get(n)===q;try{(eo?"production":void 0)!=="production"&&Gy.delete(e);const W=f(t,e,n,M,F);if((eo?"production":void 0)!=="production"&&Gy.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),w(t,e,n,W),Em(W)){S(t,e,W,()=>N==null?void 0:N.abort());const G=()=>{L(),R()};W.then(G,G)}else L();return(r=u.r)==null||r.call(u,n),P.m=k,P}catch(W){if(KD(W))throw W;return delete P.v,P.e=W,++P.n,P.m=k,P}finally{A=!1,P.n!==q&&X&&(a.set(n,P.n),c.add(n),(s=u.c)==null||s.call(u,n))}},r9=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],a=[n];for(;a.length;){const c=a.pop(),u=i(t,e,c);for(const f of FP(c,u,r)){const h=i(t,e,f);s.get(f)!==h.n&&(s.set(f,h.n),a.push(f))}}},s9=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],c=t[11],u=t[12],f=t[13],h=t[14],p=t[15],m=t[16],_=t[17],x=t[20],y=t[28];let w=!0;const S=P=>Sm(h(t,e,P)),T=(P,...k)=>{var A;const O=c(t,e,P);try{if(P===n){if(!DP(P))throw new Error("atom not writable");(eo?"production":void 0)!=="production"&&Gy.add(e);const L=O.n,R=k[0];x(t,e,P,R),_(t,e,P),L!==O.n&&(++y[0],s.add(P),p(t,e,P),(A=i.c)==null||A.call(i,P));return}else return m(t,e,P,k)}finally{w||(f(t,e),u(t,e))}};try{return a(t,e,n,S,T,...r)}finally{w=!1}},i9=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],c=t[11],u=t[15],f=t[18],h=t[19],p=c(t,e,n),m=s.get(n);if(m&&p.d.size>0){for(const[_,x]of p.d)if(!m.d.has(_)){const y=c(t,e,_);f(t,e,_).t.add(n),m.d.add(_),x!==y.n&&(i.add(_),u(t,e,_),(r=a.c)==null||r.call(a,_))}for(const _ of m.d)if(!p.d.has(_)){m.d.delete(_);const x=h(t,e,_);x==null||x.t.delete(n)}}},o9=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],c=t[10],u=t[11],f=t[12],h=t[13],p=t[14],m=t[16],_=t[18],x=u(t,e,n);let y=s.get(n);if(!y){p(t,e,n);for(const w of x.d.keys())_(t,e,w).t.add(n);if(y={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,y),Wy(n)&&GD(n)){const w=()=>{let S=!0;const T=(...P)=>{try{return m(t,e,n,P)}finally{S||(h(t,e),f(t,e))}};try{const P=c(t,e,n,T);P&&(y.u=()=>{S=!0;try{P()}finally{S=!1}})}finally{S=!1}};i.add(w)}(r=a.m)==null||r.call(a,n)}return y},a9=(t,e,n)=>{var r,s;const i=t[1],a=t[5],c=t[6],u=t[11],f=t[19],h=u(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const _ of p.t)if((r=i.get(_))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const _ of h.d.keys()){const x=f(t,e,_);x==null||x.t.delete(n)}(s=c.u)==null||s.call(c,n);return}return p},l9=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),c="v"in a,u=a.v;if(Em(r))for(const f of a.d.keys())jP(n,r,s(t,e,f));a.v=r,delete a.e,(!c||!Object.is(u,a.v))&&(++a.n,Em(u)&&i(t,e,u))},c9=(t,e,n)=>{const r=t[14];return Sm(r(t,e,n))},u9=(t,e,n,...r)=>{const s=t[3],i=t[12],a=t[13],c=t[16],u=s.size;try{return c(t,e,n,r)}finally{s.size!==u&&(a(t,e),i(t,e))}},d9=(t,e,n,r)=>{const s=t[12],i=t[13],a=t[18],c=t[19],f=a(t,e,n).l;return f.add(r),i(t,e),s(t,e),()=>{f.delete(r),c(t,e,n),i(t,e),s(t,e)}},f9=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const a=()=>s.delete(n);n.then(a,a)}i.add(r)},h9=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},VP=new WeakMap;function p9(t){const e=VP.get(t);if((eo?"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 m9(...t){const e={get(a){return r(n,e,a)},set(a,...c){return s(n,e,a,...c)},sub(a,c){return i(n,e,a,c)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},qD,YD,XD,QD,JD,e9,t9,n9,r9,s9,i9,o9,a9,l9,c9,u9,d9,void 0,new WeakMap,f9,h9,[0]].map((a,c)=>t[c]||a);VP.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const $P={};let g9=0;function rt(t,e){const n=`atom${++g9}`,r={toString(){return($P?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=v9,r.write=y9),e&&(r.write=e),r}function v9(t){return t(this)}function y9(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function _9(){return m9()}let od;function x9(){return od||(od=_9(),($P?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=od),globalThis.__JOTAI_DEFAULT_STORE__!==od&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),od}const w9={},b9=v.createContext(void 0);function j2(t){return v.useContext(b9)||x9()}const Ky=t=>typeof(t==null?void 0:t.then)=="function",Zy=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},S9=ve.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Zy(t),t)}),Kv=new WeakMap,xC=(t,e,n)=>{const r=p9(t),s=r[26];let i=Kv.get(e);return i||(i=new Promise((a,c)=>{let u=e;const f=m=>_=>{u===m&&a(_)},h=m=>_=>{u===m&&c(_)},p=()=>{try{const m=n();Ky(m)?(Kv.set(m,i),u=m,m.then(f(m),h(m)),s(r,t,m,p)):a(m)}catch(m){c(m)}};e.then(f(e),h(e)),s(r,t,e,p)}),Kv.set(e,i)),i};function et(t,e){const{delay:n,unstable_promiseStatus:r=!ve.use}={},s=j2(),[[i,a,c],u]=v.useReducer(h=>{const p=s.get(t);return Object.is(h[0],p)&&h[1]===s&&h[2]===t?h:[p,s,t]},void 0,()=>[s.get(t),s,t]);let f=i;if((a!==s||c!==t)&&(u(),f=s.get(t)),v.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);Ky(p)&&Zy(xC(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
42
+
43
+ Migration guide:
44
+
45
+ Create a custom hook like the following.
46
+
47
+ function useAtomValueWithDelay<Value>(
48
+ atom: Atom<Value>,
49
+ options: { delay: number },
50
+ ): Value {
51
+ const { delay } = options
52
+ const store = useStore(options)
53
+ const [value, setValue] = useState(() => store.get(atom))
54
+ useEffect(() => {
55
+ const unsub = store.sub(atom, () => {
56
+ setTimeout(() => setValue(store.get(atom)), delay)
57
+ })
58
+ return unsub
59
+ }, [store, atom, delay])
60
+ return value
61
+ }
62
+ `),setTimeout(u,n);return}u()});return u(),h},[s,t,n,r]),v.useDebugValue(f),Ky(f)){const h=xC(s,f,()=>s.get(t));return r&&Zy(h),S9(h)}return f}function at(t,e){const n=j2();return v.useCallback((...s)=>{if((w9?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function HP(t,e){return[et(t),at(t)]}const F2=v.createContext({});function V2(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const E9=typeof window<"u",$2=E9?v.useLayoutEffect:v.useEffect,s0=v.createContext(null);function H2(t,e){t.indexOf(e)===-1&&t.push(e)}function Cm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const gi=(t,e,n)=>n>e?e:n<t?t:n;let i0=()=>{};const oa={},zP=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),UP=t=>typeof t=="object"&&t!==null,BP=t=>/^0[^.\s]+$/u.test(t);function WP(t){let e;return()=>(e===void 0&&(e=t()),e)}const bs=t=>t,bf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Bd=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class z2{constructor(){this.subscriptions=[]}add(e){return H2(this.subscriptions,e),()=>Cm(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const a=this.subscriptions[i];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Qr=t=>t*1e3,ys=t=>t/1e3,GP=(t,e)=>e?t*(1e3/e):0,KP=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,C9=1e-7,k9=12;function P9(t,e,n,r,s){let i,a,c=0;do a=e+(n-e)/2,i=KP(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>C9&&++c<k9);return a}function Sf(t,e,n,r){if(t===e&&n===r)return bs;const s=i=>P9(i,0,1,t,n);return i=>i===0||i===1?i:KP(s(i),e,r)}const ZP=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,qP=t=>e=>1-t(1-e),YP=Sf(.33,1.53,.69,.99),U2=qP(YP),XP=ZP(U2),QP=t=>t>=1?1:(t*=2)<1?.5*U2(t):.5*(2-Math.pow(2,-10*(t-1))),B2=t=>1-Math.sin(Math.acos(t)),JP=qP(B2),e3=ZP(B2),T9=Sf(.42,0,1,1),R9=Sf(0,0,.58,1),t3=Sf(.42,0,.58,1),A9=t=>Array.isArray(t)&&typeof t[0]!="number",n3=t=>Array.isArray(t)&&typeof t[0]=="number",I9={linear:bs,easeIn:T9,easeInOut:t3,easeOut:R9,circIn:B2,circInOut:e3,circOut:JP,backIn:U2,backInOut:XP,backOut:YP,anticipate:QP},M9=t=>typeof t=="string",wC=t=>{if(n3(t)){i0(t.length===4);const[e,n,r,s]=t;return Sf(e,n,r,s)}else if(M9(t))return I9[t];return t},tp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function O9(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(f){i.has(f)&&(u.schedule(f),t()),f(a)}const u={schedule:(f,h=!1,p=!1)=>{const _=p&&r?e:n;return h&&i.add(f),_.add(f),f},cancel:f=>{n.delete(f),i.delete(f)},process:f=>{if(a=f,r){s=!0;return}r=!0;const h=e;e=n,n=h,e.forEach(c),e.clear(),r=!1,s&&(s=!1,u.process(f))}};return u}const L9=40;function r3(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=tp.reduce((P,k)=>(P[k]=O9(i),P),{}),{setup:c,read:u,resolveKeyframes:f,preUpdate:h,update:p,preRender:m,render:_,postRender:x}=a,y=()=>{const P=oa.useManualTiming,k=P?s.timestamp:performance.now();n=!1,P||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,L9),1)),s.timestamp=k,s.isProcessing=!0,c.process(s),u.process(s),f.process(s),h.process(s),p.process(s),m.process(s),_.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(y))},w=()=>{n=!0,r=!0,s.isProcessing||t(y)};return{schedule:tp.reduce((P,k)=>{const A=a[k];return P[k]=(O,L=!1,R=!1)=>(n||w(),A.schedule(O,L,R)),P},{}),cancel:P=>{for(let k=0;k<tp.length;k++)a[tp[k]].cancel(P)},state:s,steps:a}}const{schedule:kt,cancel:aa,state:jn,steps:Zv}=r3(typeof requestAnimationFrame<"u"?requestAnimationFrame:bs,!0);let Ap;function N9(){Ap=void 0}const ar={now:()=>(Ap===void 0&&ar.set(jn.isProcessing||oa.useManualTiming?jn.timestamp:performance.now()),Ap),set:t=>{Ap=t,queueMicrotask(N9)}},s3=t=>e=>typeof e=="string"&&e.startsWith(t),i3=s3("--"),D9=s3("var(--"),W2=t=>D9(t)?j9.test(t.split("/*")[0].trim()):!1,j9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function bC(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const lu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Wd={...lu,transform:t=>gi(0,1,t)},np={...lu,default:1},kd=t=>Math.round(t*1e5)/1e5,G2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function F9(t){return t==null}const V9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,K2=(t,e)=>n=>!!(typeof n=="string"&&V9.test(n)&&n.startsWith(t)||e&&!F9(n)&&Object.prototype.hasOwnProperty.call(n,e)),o3=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,c]=r.match(G2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},$9=t=>gi(0,255,t),qv={...lu,transform:t=>Math.round($9(t))},il={test:K2("rgb","red"),parse:o3("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+qv.transform(t)+", "+qv.transform(e)+", "+qv.transform(n)+", "+kd(Wd.transform(r))+")"};function H9(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 qy={test:K2("#"),parse:H9,transform:il.transform},Ef=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ui=Ef("deg"),mi=Ef("%"),Le=Ef("px"),z9=Ef("vh"),U9=Ef("vw"),SC={...mi,parse:t=>mi.parse(t)/100,transform:t=>mi.transform(t*100)},xc={test:K2("hsl","hue"),parse:o3("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+mi.transform(kd(e))+", "+mi.transform(kd(n))+", "+kd(Wd.transform(r))+")"},pn={test:t=>il.test(t)||qy.test(t)||xc.test(t),parse:t=>il.test(t)?il.parse(t):xc.test(t)?xc.parse(t):qy.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?il.transform(t):xc.transform(t),getAnimatableNone:t=>{const e=pn.parse(t);return e.alpha=0,pn.transform(e)}},B9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function W9(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(G2))==null?void 0:e.length)||0)+(((n=t.match(B9))==null?void 0:n.length)||0)>0}const a3="number",l3="color",G9="var",K9="var(",EC="${}",Z9=/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 tu(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const c=e.replace(Z9,u=>(pn.test(u)?(r.color.push(i),s.push(l3),n.push(pn.parse(u))):u.startsWith(K9)?(r.var.push(i),s.push(G9),n.push(u)):(r.number.push(i),s.push(a3),n.push(parseFloat(u))),++i,EC)).split(EC);return{values:n,split:c,indexes:r,types:s}}function q9(t){return tu(t).values}function c3({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const a=e[i];a===a3?s+=kd(r[i]):a===l3?s+=pn.transform(r[i]):s+=r[i]}return s}}function Y9(t){return c3(tu(t))}const X9=t=>typeof t=="number"?0:pn.test(t)?pn.getAnimatableNone(t):t,Q9=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:X9(t);function J9(t){const e=tu(t);return c3(e)(e.values.map((r,s)=>Q9(r,e.split[s])))}const Us={test:W9,parse:q9,createTransformer:Y9,getAnimatableNone:J9};function Yv(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 e7({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,a=0;if(!e)s=i=a=n;else{const c=n<.5?n*(1+e):n+e-n*e,u=2*n-c;s=Yv(u,c,t+1/3),i=Yv(u,c,t),a=Yv(u,c,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function km(t,e){return n=>n>0?e:t}const Ct=(t,e,n)=>t+(e-t)*n,Xv=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},t7=[qy,il,xc],n7=t=>t7.find(e=>e.test(t));function CC(t){const e=n7(t);if(!e)return!1;let n=e.parse(t);return e===xc&&(n=e7(n)),n}const kC=(t,e)=>{const n=CC(t),r=CC(e);if(!n||!r)return km(t,e);const s={...n};return i=>(s.red=Xv(n.red,r.red,i),s.green=Xv(n.green,r.green,i),s.blue=Xv(n.blue,r.blue,i),s.alpha=Ct(n.alpha,r.alpha,i),il.transform(s))},Yy=new Set(["none","hidden"]);function r7(t,e){return Yy.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function s7(t,e){return n=>Ct(t,e,n)}function Z2(t){return typeof t=="number"?s7:typeof t=="string"?W2(t)?km:pn.test(t)?kC:a7:Array.isArray(t)?u3:typeof t=="object"?pn.test(t)?kC:i7:km}function u3(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>Z2(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function i7(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Z2(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function o7(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],a=t.indexes[i][r[i]],c=t.values[a]??0;n[s]=c,r[i]++}return n}const a7=(t,e)=>{const n=Us.createTransformer(e),r=tu(t),s=tu(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?Yy.has(t)&&!s.values.length||Yy.has(e)&&!r.values.length?r7(t,e):bf(u3(o7(r,s),s.values),n):km(t,e)};function d3(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Ct(t,e,n):Z2(t)(t,e)}const l7=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>kt.update(e,n),stop:()=>aa(e),now:()=>jn.isProcessing?jn.timestamp:ar.now()}},f3=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=Math.round(t(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Pm=2e4;function q2(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Pm;)e+=n,r=t.next(e);return e>=Pm?1/0:e}function c7(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(q2(r),Pm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:ys(s)}}const Jt={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 Xy(t,e){return t*Math.sqrt(1-e*e)}const u7=12;function d7(t,e,n){let r=n;for(let s=1;s<u7;s++)r=r-t(r)/e(r);return r}const Qv=.001;function f7({duration:t=Jt.duration,bounce:e=Jt.bounce,velocity:n=Jt.velocity,mass:r=Jt.mass}){let s,i,a=1-e;a=gi(Jt.minDamping,Jt.maxDamping,a),t=gi(Jt.minDuration,Jt.maxDuration,ys(t)),a<1?(s=f=>{const h=f*a,p=h*t,m=h-n,_=Xy(f,a),x=Math.exp(-p);return Qv-m/_*x},i=f=>{const p=f*a*t,m=p*n+n,_=Math.pow(a,2)*Math.pow(f,2)*t,x=Math.exp(-p),y=Xy(Math.pow(f,2),a);return(-s(f)+Qv>0?-1:1)*((m-_)*x)/y}):(s=f=>{const h=Math.exp(-f*t),p=(f-n)*t+1;return-Qv+h*p},i=f=>{const h=Math.exp(-f*t),p=(n-f)*(t*t);return h*p});const c=5/t,u=d7(s,i,c);if(t=Qr(t),isNaN(u))return{stiffness:Jt.stiffness,damping:Jt.damping,duration:t};{const f=Math.pow(u,2)*r;return{stiffness:f,damping:a*2*Math.sqrt(r*f),duration:t}}}const h7=["duration","bounce"],p7=["stiffness","damping","mass"];function PC(t,e){return e.some(n=>t[n]!==void 0)}function m7(t){let e={velocity:Jt.velocity,stiffness:Jt.stiffness,damping:Jt.damping,mass:Jt.mass,isResolvedFromDuration:!1,...t};if(!PC(t,p7)&&PC(t,h7))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*gi(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Jt.mass,stiffness:s,damping:i}}else{const n=f7({...t,velocity:0});e={...e,...n,mass:Jt.mass},e.isResolvedFromDuration=!0}return e}function Tm(t=Jt.visualDuration,e=Jt.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:i},{stiffness:u,damping:f,mass:h,duration:p,velocity:m,isResolvedFromDuration:_}=m7({...n,velocity:-ys(n.velocity||0)}),x=m||0,y=f/(2*Math.sqrt(u*h)),w=a-i,S=ys(Math.sqrt(u/h)),T=Math.abs(w)<5;r||(r=T?Jt.restSpeed.granular:Jt.restSpeed.default),s||(s=T?Jt.restDelta.granular:Jt.restDelta.default);let P,k,A,O,L,R;if(y<1)A=Xy(S,y),O=(x+y*S*w)/A,P=N=>{const D=Math.exp(-y*S*N);return a-D*(O*Math.sin(A*N)+w*Math.cos(A*N))},L=y*S*O+w*A,R=y*S*w-O*A,k=N=>Math.exp(-y*S*N)*(L*Math.sin(A*N)+R*Math.cos(A*N));else if(y===1){P=D=>a-Math.exp(-S*D)*(w+(x+S*w)*D);const N=x+S*w;k=D=>Math.exp(-S*D)*(S*N*D-x)}else{const N=S*Math.sqrt(y*y-1);P=X=>{const W=Math.exp(-y*S*X),G=Math.min(N*X,300);return a-W*((x+y*S*w)*Math.sinh(G)+N*w*Math.cosh(G))/N};const D=(x+y*S*w)/N,F=y*S*D-w*N,q=y*S*w-D*N;k=X=>{const W=Math.exp(-y*S*X),G=Math.min(N*X,300);return W*(F*Math.sinh(G)+q*Math.cosh(G))}}const M={calculatedDuration:_&&p||null,velocity:N=>Qr(k(N)),next:N=>{if(!_&&y<1){const F=Math.exp(-y*S*N),q=Math.sin(A*N),X=Math.cos(A*N),W=a-F*(O*q+w*X),G=Qr(F*(L*q+R*X));return c.done=Math.abs(G)<=r&&Math.abs(a-W)<=s,c.value=c.done?a:W,c}const D=P(N);if(_)c.done=N>=p;else{const F=Qr(k(N));c.done=Math.abs(F)<=r&&Math.abs(a-D)<=s}return c.value=c.done?a:D,c},toString:()=>{const N=Math.min(q2(M),Pm),D=f3(F=>M.next(N*F).value,N,30);return N+"ms "+D},toTransition:()=>{}};return M}Tm.applyToOptions=t=>{const e=c7(t,100,Tm);return t.ease=e.ease,t.duration=Qr(e.duration),t.type="keyframes",t};const g7=5;function h3(t,e,n){const r=Math.max(e-g7,0);return GP(n-t(r),e-r)}function Qy({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:c,max:u,restDelta:f=.5,restSpeed:h}){const p=t[0],m={done:!1,value:p},_=R=>c!==void 0&&R<c||u!==void 0&&R>u,x=R=>c===void 0?u:u===void 0||Math.abs(c-R)<Math.abs(u-R)?c:u;let y=n*e;const w=p+y,S=a===void 0?w:a(w);S!==w&&(y=S-p);const T=R=>-y*Math.exp(-R/r),P=R=>S+T(R),k=R=>{const M=T(R),N=P(R);m.done=Math.abs(M)<=f,m.value=m.done?S:N};let A,O;const L=R=>{_(m.value)&&(A=R,O=Tm({keyframes:[m.value,x(m.value)],velocity:h3(P,R,m.value),damping:s,stiffness:i,restDelta:f,restSpeed:h}))};return L(0),{calculatedDuration:null,next:R=>{let M=!1;return!O&&A===void 0&&(M=!0,k(R),L(R)),A!==void 0&&R>=A?O.next(R-A):(!M&&k(R),m)}}}function v7(t,e,n){const r=[],s=n||oa.mix||d3,i=t.length-1;for(let a=0;a<i;a++){let c=s(t[a],t[a+1]);if(e){const u=Array.isArray(e)?e[a]||bs:e;c=bf(u,c)}r.push(c)}return r}function y7(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(i0(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=v7(e,r,s),u=c.length,f=h=>{if(a&&h<t[0])return e[0];let p=0;if(u>1)for(;p<t.length-2&&!(h<t[p+1]);p++);const m=Bd(t[p],t[p+1],h);return c[p](m)};return n?h=>f(gi(t[0],t[i-1],h)):f}function _7(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Bd(0,e,r);t.push(Ct(n,1,s))}}function x7(t){const e=[0];return _7(e,t.length-1),e}function w7(t,e){return t.map(n=>n*e)}function b7(t,e){return t.map(()=>e||t3).splice(0,t.length-1)}function Pd({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=A9(r)?r.map(wC):wC(r),i={done:!1,value:e[0]},a=w7(n&&n.length===e.length?n:x7(e),t),c=y7(a,e,{ease:Array.isArray(s)?s:b7(e,s)});return{calculatedDuration:t,next:u=>(i.value=c(u),i.done=u>=t,i)}}const S7=t=>t!==null;function o0(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(S7),c=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!c||r===void 0?i[c]:r}const E7={decay:Qy,inertia:Qy,tween:Pd,keyframes:Pd,spring:Tm};function p3(t){typeof t.type=="string"&&(t.type=E7[t.type])}class Y2{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 C7=t=>t/100;class Rm extends Y2{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==ar.now()&&this.tick(ar.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;p3(e);const{type:n=Pd,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:c}=e;const u=n||Pd;u!==Pd&&typeof c[0]!="number"&&(this.mixKeyframes=bf(C7,d3(c[0],c[1])),c=[0,100]);const f=u({...e,keyframes:c});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...c].reverse(),velocity:-a})),f.calculatedDuration===null&&(f.calculatedDuration=q2(f));const{calculatedDuration:h}=f;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=f}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:c,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:h,repeat:p,repeatType:m,repeatDelay:_,type:x,onUpdate:y,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const S=this.currentTime-f*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,k=r;if(p){const R=Math.min(this.currentTime,s)/c;let M=Math.floor(R),N=R%1;!N&&R>=1&&(N=1),N===1&&M--,M=Math.min(M,p+1),!!(M%2)&&(m==="reverse"?(N=1-N,_&&(N-=_/c)):m==="mirror"&&(k=a)),P=gi(0,1,N)*c}let A;T?(this.delayState.value=h[0],A=this.delayState):A=k.next(P),i&&!T&&(A.value=i(A.value));let{done:O}=A;!T&&u!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return L&&x!==Qy&&(A.value=o0(h,this.options,w,this.speed)),y&&y(A.value),L&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return ys(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ys(e)}get time(){return ys(this.currentTime)}set time(e){e=Qr(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return h3(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(ar.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=ys(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=l7,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ar.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function k7(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ol=t=>t*180/Math.PI,Jy=t=>{const e=ol(Math.atan2(t[1],t[0]));return e_(e)},P7={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Jy,rotateZ:Jy,skewX:t=>ol(Math.atan(t[1])),skewY:t=>ol(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},e_=t=>(t=t%360,t<0&&(t+=360),t),TC=Jy,RC=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),AC=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),T7={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:RC,scaleY:AC,scale:t=>(RC(t)+AC(t))/2,rotateX:t=>e_(ol(Math.atan2(t[6],t[5]))),rotateY:t=>e_(ol(Math.atan2(-t[2],t[0]))),rotateZ:TC,rotate:TC,skewX:t=>ol(Math.atan(t[4])),skewY:t=>ol(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function t_(t){return t.includes("scale")?1:0}function n_(t,e){if(!t||t==="none")return t_(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=T7,s=n;else{const c=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=P7,s=c}if(!s)return t_(e);const i=r[e],a=s[1].split(",").map(A7);return typeof i=="function"?i(a):a[i]}const R7=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return n_(n,e)};function A7(t){return parseFloat(t.trim())}const cu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],uu=new Set([...cu,"pathRotation"]),IC=t=>t===lu||t===Le,I7=new Set(["x","y","z"]),M7=cu.filter(t=>!I7.has(t));function O7(t){const e=[];return M7.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const qo={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})=>n_(e,"x"),y:(t,{transform:e})=>n_(e,"y")};qo.translateX=qo.x;qo.translateY=qo.y;const yl=new Set;let r_=!1,s_=!1,i_=!1;function m3(){if(s_){const t=Array.from(yl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=O7(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var c;(c=r.getValue(i))==null||c.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}s_=!1,r_=!1,yl.forEach(t=>t.complete(i_)),yl.clear()}function g3(){yl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(s_=!0)})}function L7(){i_=!0,g3(),m3(),i_=!1}class X2{constructor(e,n,r,s,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(yl.add(this),r_||(r_=!0,kt.read(g3),kt.resolveKeyframes(m3))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const c=r.readValue(n,a);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=a),s&&i===void 0&&s.set(e[0])}k7(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yl.delete(this)}cancel(){this.state==="scheduled"&&(yl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const N7=t=>t.startsWith("--");function v3(t,e,n){N7(e)?t.style.setProperty(e,n):t.style[e]=n}const D7={};function y3(t,e){const n=WP(t);return()=>D7[e]??n()}const j7=y3(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),_3=y3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),vd=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,MC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:vd([0,.65,.55,1]),circOut:vd([.55,0,1,.45]),backIn:vd([.31,.01,.66,-.59]),backOut:vd([.33,1.53,.69,.99])};function x3(t,e){if(t)return typeof t=="function"?_3()?f3(t,e):"ease-out":n3(t)?vd(t):Array.isArray(t)?t.map(n=>x3(n,e)||MC.easeOut):MC[t]}function F7(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:c="easeOut",times:u}={},f=void 0){const h={[e]:n};u&&(h.offset=u);const p=x3(c,s);Array.isArray(p)&&(h.easing=p);const m={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return f&&(m.pseudoElement=f),t.animate(h,m)}function w3(t){return typeof t=="function"&&"applyToOptions"in t}function V7({type:t,...e}){return w3(t)&&_3()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class b3 extends Y2{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:c,onComplete:u}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,i0(typeof e.type!="string");const f=V7(e);this.animation=F7(n,r,s,f,i),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=o0(s,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(h),v3(n,r,h),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ys(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ys(e)}get time(){return ys(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Qr(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&&j7()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),bs):s(this)}}const S3={anticipate:QP,backInOut:XP,circInOut:e3};function $7(t){return t in S3}function H7(t){typeof t.ease=="string"&&$7(t.ease)&&(t.ease=S3[t.ease])}const Jv=10;class z7 extends b3{constructor(e){H7(e),p3(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const c=new Rm({...a,autoplay:!1}),u=Math.max(Jv,ar.now()-this.startTime),f=gi(0,Jv,u-Jv),h=c.sample(u).value,{name:p}=this.options;i&&p&&v3(i,p,h),n.setWithVelocity(c.sample(Math.max(0,u-f)).value,h,f),c.stop()}}const OC=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url("));function U7(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 B7(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],a=OC(s,e),c=OC(i,e);return!a||!c?!1:U7(t)||(n==="spring"||w3(n))&&r}function o_(t){t.duration=0,t.type="keyframes"}const E3=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),W7=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function G7(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&W7.test(t[e]))return!0;return!1}const K7=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Z7=WP(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function q7(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:c}=t,u=(p=e==null?void 0:e.owner)==null?void 0:p.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:f,transformTemplate:h}=e.owner.getProps();return Z7()&&n&&(E3.has(n)||K7.has(n)&&G7(c))&&(n!=="transform"||!h)&&!f&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const Y7=40;class X7 extends Y2{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:c,name:u,motionValue:f,element:h,...p}){var x;super(),this.stop=()=>{var y,w;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=ar.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:u,motionValue:f,element:h,...p},_=(h==null?void 0:h.KeyframeResolver)||X2;this.keyframeResolver=new _(c,(y,w,S)=>this.onKeyframesResolved(y,w,m,!S),u,f,h),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,n,r,s){var S,T;this.keyframeResolver=void 0;const{name:i,type:a,velocity:c,delay:u,isHandoff:f,onUpdate:h}=r;this.resolvedAt=ar.now();let p=!0;B7(e,i,a,c)||(p=!1,(oa.instantAnimations||!u)&&(h==null||h(o0(e,r,n))),e[0]=e[e.length-1],o_(r),r.repeat=0);const _={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Y7?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=p&&!f&&q7(_),y=(T=(S=_.motionValue)==null?void 0:S.owner)==null?void 0:T.current;let w;if(x)try{w=new z7({..._,element:y})}catch{w=new Rm(_)}else w=new Rm(_);w.finished.then(()=>{this.notifyFinished()}).catch(bs),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(),L7()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function C3(t,e,n,r=0,s=1){const i=Array.from(t).sort((f,h)=>f.sortNodePosition(h)).indexOf(e),a=t.size,c=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:c-i*r}const LC=30,Q7=t=>!isNaN(parseFloat(t));class J7{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=ar.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ar.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Q7(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 z2);const r=this.events[e].add(n);return e==="change"?()=>{r(),kt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ar.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>LC)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,LC);return GP(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function nu(t,e){return new J7(t,e)}function k3(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Q2(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?k3(n,t):n}const ej={type:"spring",stiffness:500,damping:25,restSpeed:10},tj=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),nj={type:"keyframes",duration:.8},rj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sj=(t,{keyframes:e})=>e.length>2?nj:uu.has(t)?t.startsWith("scale")?tj(e[1]):ej:rj,ij=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function oj(t){for(const e in t)if(!ij.has(e))return!0;return!1}const J2=(t,e,n,r={},s,i)=>a=>{const c=Q2(r,t)||{},u=c.delay||r.delay||0;let{elapsed:f=0}=r;f=f-Qr(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-f,onUpdate:m=>{e.set(m),c.onUpdate&&c.onUpdate(m)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:i?void 0:s};oj(c)||Object.assign(h,sj(t,h)),h.duration&&(h.duration=Qr(h.duration)),h.repeatDelay&&(h.repeatDelay=Qr(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(o_(h),h.delay===0&&(p=!0)),(oa.instantAnimations||oa.skipAnimations||s!=null&&s.shouldSkipAnimations||c.skipAnimations)&&(p=!0,o_(h),h.delay=0),h.allowFlatten=!c.type&&!c.ease,p&&!i&&e.get()!==void 0){const m=o0(h.keyframes,c);if(m!==void 0){kt.update(()=>{h.onUpdate(m),h.onComplete()});return}}return c.isSync?new Rm(h):new X7(h)},aj=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function lj(t){const e=aj.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function P3(t,e,n=1){const[r,s]=lj(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return zP(a)?parseFloat(a):a}return W2(s)?P3(s,e,n+1):s}function NC(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function ex(t,e,n,r){if(typeof e=="function"){const[s,i]=NC(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=NC(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function _l(t,e,n){const r=t.getProps();return ex(r,e,n!==void 0?n:r.custom,t)}const T3=new Set(["width","height","top","left","right","bottom",...cu]),a_=t=>Array.isArray(t);function cj(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,nu(n))}function uj(t){return a_(t)?t[t.length-1]||0:t}function dj(t,e){const n=_l(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const c=uj(i[a]);cj(t,a,c)}}const $n=t=>!!(t&&t.getVelocity);function fj(t){return!!($n(t)&&t.add)}function l_(t,e){const n=t.getValue("willChange");if(fj(n))return n.add(e);if(!n&&oa.WillChange){const r=new oa.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function tx(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const hj="framerAppearId",R3="data-"+tx(hj);function A3(t){return t.props[R3]}function pj({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function I3(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...c}=e;const u=t.getDefaultTransition();i=i?k3(i,u):u;const f=i==null?void 0:i.reduceMotion,h=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],m=s&&t.animationState&&t.animationState.getState()[s],_=i==null?void 0:i.path;_&&_.animateVisualElement(t,c,i,n,p);for(const x in c){const y=t.getValue(x,t.latestValues[x]??null),w=c[x];if(w===void 0||m&&pj(m,x))continue;const S={delay:n,...Q2(i||{},x)};h&&(S.skipAnimations=!0);const T=y.get();if(T!==void 0&&!y.isAnimating()&&!Array.isArray(w)&&w===T&&!S.velocity){kt.update(()=>y.set(w));continue}let P=!1;if(window.MotionHandoffAnimation){const O=A3(t);if(O){const L=window.MotionHandoffAnimation(O,x,kt);L!==null&&(S.startTime=L,P=!0)}}l_(t,x);const k=f??t.shouldReduceMotion;y.start(J2(x,y,w,k&&T3.has(x)?{type:!1}:S,t,P));const A=y.animation;A&&p.push(A)}if(a){const x=()=>kt.update(()=>{a&&dj(t,a)});p.length?Promise.all(p).then(x):x()}return p}function c_(t,e,n={}){var u;const r=_l(t,e,n.type==="exit"?(u=t.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(I3(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:m}=s;return mj(t,e,f,h,p,m,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[f,h]=c==="beforeChildren"?[i,a]:[a,i];return f().then(()=>h())}else return Promise.all([i(),a(n.delay)])}function mj(t,e,n=0,r=0,s=0,i=1,a){const c=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),c.push(c_(u,e,{...a,delay:n+(typeof r=="function"?0:r)+C3(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(c)}function gj(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>c_(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=c_(t,e,n);else{const s=typeof e=="function"?_l(t,e,n.custom):e;r=Promise.all(I3(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const vj={test:t=>t==="auto",parse:t=>t},M3=t=>e=>e.test(t),O3=[lu,Le,mi,Ui,U9,z9,vj],DC=t=>O3.find(M3(t));function yj(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||BP(t):!0}const _j=new Set(["brightness","contrast","saturate","opacity"]);function xj(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(G2)||[];if(!r)return t;const s=n.replace(r,"");let i=_j.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const wj=/\b([a-z-]*)\(.*?\)/gu,u_={...Us,getAnimatableNone:t=>{const e=t.match(wj);return e?e.map(xj).join(" "):t}},d_={...Us,getAnimatableNone:t=>{const e=Us.parse(t);return Us.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},jC={...lu,transform:Math.round},bj={rotate:Ui,pathRotation:Ui,rotateX:Ui,rotateY:Ui,rotateZ:Ui,scale:np,scaleX:np,scaleY:np,scaleZ:np,skew:Ui,skewX:Ui,skewY:Ui,distance:Le,translateX:Le,translateY:Le,translateZ:Le,x:Le,y:Le,z:Le,perspective:Le,transformPerspective:Le,opacity:Wd,originX:SC,originY:SC,originZ:Le},Am={borderWidth:Le,borderTopWidth:Le,borderRightWidth:Le,borderBottomWidth:Le,borderLeftWidth:Le,borderRadius:Le,borderTopLeftRadius:Le,borderTopRightRadius:Le,borderBottomRightRadius:Le,borderBottomLeftRadius:Le,width:Le,maxWidth:Le,height:Le,maxHeight:Le,top:Le,right:Le,bottom:Le,left:Le,inset:Le,insetBlock:Le,insetBlockStart:Le,insetBlockEnd:Le,insetInline:Le,insetInlineStart:Le,insetInlineEnd:Le,padding:Le,paddingTop:Le,paddingRight:Le,paddingBottom:Le,paddingLeft:Le,paddingBlock:Le,paddingBlockStart:Le,paddingBlockEnd:Le,paddingInline:Le,paddingInlineStart:Le,paddingInlineEnd:Le,margin:Le,marginTop:Le,marginRight:Le,marginBottom:Le,marginLeft:Le,marginBlock:Le,marginBlockStart:Le,marginBlockEnd:Le,marginInline:Le,marginInlineStart:Le,marginInlineEnd:Le,fontSize:Le,backgroundPositionX:Le,backgroundPositionY:Le,...bj,zIndex:jC,fillOpacity:Wd,strokeOpacity:Wd,numOctaves:jC},Sj={...Am,color:pn,backgroundColor:pn,outlineColor:pn,fill:pn,stroke:pn,borderColor:pn,borderTopColor:pn,borderRightColor:pn,borderBottomColor:pn,borderLeftColor:pn,filter:u_,WebkitFilter:u_,mask:d_,WebkitMask:d_},L3=t=>Sj[t],Ej=new Set([u_,d_]);function N3(t,e){let n=L3(t);return Ej.has(n)||(n=Us),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Cj=new Set(["auto","none","0"]);function kj(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!Cj.has(i)&&tu(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=N3(n,s)}class Pj extends X2{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),W2(p))){const m=P3(p,n.current);m!==void 0&&(e[h]=m),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!T3.has(r)||e.length!==2)return;const[s,i]=e,a=DC(s),c=DC(i),u=bC(s),f=bC(i);if(u!==f&&qo[r]){this.needsMeasurement=!0;return}if(a!==c)if(IC(a)&&IC(c))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else qo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||yj(e[s]))&&r.push(s);r.length&&kj(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=qo[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var c;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=qo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(c=this.removedTransforms)!=null&&c.length&&this.removedTransforms.forEach(([u,f])=>{e.getValue(u).set(f)}),this.resolveNoneKeyframes()}}const nx=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function D3(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=(n==null?void 0:n[t])??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const f_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ip(t){return UP(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:rx}=r3(queueMicrotask,!1),Fs={x:!1,y:!1};function j3(){return Fs.x||Fs.y}function Tj(t){return t==="x"||t==="y"?Fs[t]?null:(Fs[t]=!0,()=>{Fs[t]=!1}):Fs.x||Fs.y?null:(Fs.x=Fs.y=!0,()=>{Fs.x=Fs.y=!1})}function F3(t,e){const n=D3(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function Rj(t){return!(t.pointerType==="touch"||j3())}function Aj(t,e,n={}){const[r,s,i]=F3(t,n);return r.forEach(a=>{let c=!1,u=!1,f;const h=()=>{a.removeEventListener("pointerleave",x)},p=w=>{f&&(f(w),f=void 0),h()},m=w=>{c=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,p(w))},_=()=>{c=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},x=w=>{if(w.pointerType!=="touch"){if(c){u=!0;return}p(w)}},y=w=>{if(!Rj(w))return;u=!1;const S=e(a,w);typeof S=="function"&&(f=S,a.addEventListener("pointerleave",x,s))};a.addEventListener("pointerenter",y,s),a.addEventListener("pointerdown",_,s)}),i}const V3=(t,e)=>e?t===e?!0:V3(t,e.parentElement):!1,sx=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ij=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Mj(t){return Ij.has(t.tagName)||t.isContentEditable===!0}const Oj=new Set(["INPUT","SELECT","TEXTAREA"]);function Lj(t){return Oj.has(t.tagName)||t.isContentEditable===!0}const Mp=new WeakSet;function FC(t){return e=>{e.key==="Enter"&&t(e)}}function e1(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Nj=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=FC(()=>{if(Mp.has(n))return;e1(n,"down");const s=FC(()=>{e1(n,"up")}),i=()=>e1(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function VC(t){return sx(t)&&!j3()}const $C=new WeakSet;function Dj(t,e,n={}){const[r,s,i]=F3(t,n),a=c=>{const u=c.currentTarget;if(!VC(c)||$C.has(c))return;Mp.add(u),n.stopPropagation&&$C.add(c);const f=e(u,c),h={...s,capture:!0},p=(x,y)=>{window.removeEventListener("pointerup",m,h),window.removeEventListener("pointercancel",_,h),Mp.has(u)&&Mp.delete(u),VC(x)&&typeof f=="function"&&f(x,{success:y})},m=x=>{p(x,u===window||u===document||n.useGlobalTarget||V3(u,x.target))},_=x=>{p(x,!1)};window.addEventListener("pointerup",m,h),window.addEventListener("pointercancel",_,h)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,s),Ip(c)&&(c.addEventListener("focus",f=>Nj(f,s)),!Mj(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),i}function ix(t){return UP(t)&&"ownerSVGElement"in t}const Op=new WeakMap;let Vo;const $3=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:ix(r)&&"getBBox"in r?r.getBBox()[e]:r[n],jj=$3("inline","width","offsetWidth"),Fj=$3("block","height","offsetHeight");function Vj({target:t,borderBoxSize:e}){var n;(n=Op.get(t))==null||n.forEach(r=>{r(t,{get width(){return jj(t,e)},get height(){return Fj(t,e)}})})}function $j(t){t.forEach(Vj)}function Hj(){typeof ResizeObserver>"u"||(Vo=new ResizeObserver($j))}function zj(t,e){Vo||Hj();const n=D3(t);return n.forEach(r=>{let s=Op.get(r);s||(s=new Set,Op.set(r,s)),s.add(e),Vo==null||Vo.observe(r)}),()=>{n.forEach(r=>{const s=Op.get(r);s==null||s.delete(e),s!=null&&s.size||Vo==null||Vo.unobserve(r)})}}const Lp=new Set;let wc;function Uj(){wc=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Lp.forEach(e=>e(t))},window.addEventListener("resize",wc)}function Bj(t){return Lp.add(t),wc||Uj(),()=>{Lp.delete(t),!Lp.size&&typeof wc=="function"&&(window.removeEventListener("resize",wc),wc=void 0)}}function HC(t,e){return typeof t=="function"?Bj(t):zj(t,e)}function Wj(t){return ix(t)&&t.tagName==="svg"}const Gj=[...O3,pn,Us],Kj=t=>Gj.find(M3(t)),zC=()=>({translate:0,scale:1,origin:0,originPoint:0}),bc=()=>({x:zC(),y:zC()}),UC=()=>({min:0,max:0}),xn=()=>({x:UC(),y:UC()}),Zj=new WeakMap;function a0(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Gd(t){return typeof t=="string"||Array.isArray(t)}const ox=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ax=["initial",...ox];function l0(t){return a0(t.animate)||ax.some(e=>Gd(t[e]))}function H3(t){return!!(l0(t)||t.variants)}function qj(t,e,n){for(const r in e){const s=e[r],i=n[r];if($n(s))t.addValue(r,s);else if($n(i))t.addValue(r,nu(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const a=t.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=t.getStaticValue(r);t.addValue(r,nu(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Im={current:null},lx={current:!1},Yj=typeof window<"u";function z3(){if(lx.current=!0,!!Yj)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Im.current=t.matches;t.addEventListener("change",e),e()}else Im.current=!1}const BC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Mm={};function U3(t){Mm=t}function Xj(){return Mm}class Qj{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:a,visualState:c},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=X2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const _=ar.now();this.renderScheduledAt<_&&(this.renderScheduledAt=_,kt.render(this.render,!1,!0))};const{latestValues:f,renderState:h}=c;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!a,this.isControllingVariants=l0(n),this.isVariantNode=H3(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const _ in m){const x=m[_];f[_]!==void 0&&$n(x)&&x.set(f[_])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,Zj.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:(lx.current||z3(),this.shouldReduceMotion=Im.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),aa(this.notifyUpdate),aa(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&E3.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:c,times:u,ease:f,duration:h}=n.accelerate,p=new b3({element:this.current,name:e,keyframes:c,times:u,ease:f,duration:Qr(h)}),m=a(p);this.valueSubscriptions.set(e,()=>{m(),p.cancel()});return}const r=uu.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&kt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Mm){const n=Mm[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):xn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<BC.length;r++){const s=BC[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,a=e[i];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=qj(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=nu(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(zP(r)||BP(r))?r=parseFloat(r):!Kj(r)&&Us.test(n)&&(r=N3(e,n)),this.setBaseTarget(e,$n(r)?r.get():r)),$n(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=ex(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!$n(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 z2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){rx.render(this.render)}}class B3 extends Qj{constructor(){super(...arguments),this.KeyframeResolver=Pj}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;$n(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class pa{constructor(e){this.isMounted=!1,this.node=e}update(){}}function W3({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Jj({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function eF(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 t1(t){return t===void 0||t===1}function h_({scale:t,scaleX:e,scaleY:n}){return!t1(t)||!t1(e)||!t1(n)}function el(t){return h_(t)||G3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function G3(t){return WC(t.x)||WC(t.y)}function WC(t){return t&&t!=="0%"}function Om(t,e,n){const r=t-n,s=e*r;return n+s}function GC(t,e,n,r,s){return s!==void 0&&(t=Om(t,s,r)),Om(t,n,r)+e}function p_(t,e=0,n=1,r,s){t.min=GC(t.min,e,n,r,s),t.max=GC(t.max,e,n,r,s)}function K3(t,{x:e,y:n}){p_(t.x,e.translate,e.scale,e.originPoint),p_(t.y,n.translate,n.scale,n.originPoint)}const KC=.999999999999,ZC=1.0000000000001;function tF(t,e,n,r=!1){var c;const s=n.length;if(!s)return;e.x=e.y=1;let i,a;for(let u=0;u<s;u++){i=n[u],a=i.projectionDelta;const{visualElement:f}=i.options;f&&f.props.style&&f.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(ci(t.x,-i.scroll.offset.x),ci(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,K3(t,a)),r&&el(i.latestValues)&&Np(t,i.latestValues,(c=i.layout)==null?void 0:c.layoutBox))}e.x<ZC&&e.x>KC&&(e.x=1),e.y<ZC&&e.y>KC&&(e.y=1)}function ci(t,e){t.min+=e,t.max+=e}function qC(t,e,n,r,s=.5){const i=Ct(t.min,t.max,s);p_(t,e,n,i,r)}function YC(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Np(t,e,n){const r=n??t;qC(t.x,YC(e.x,r.x),e.scaleX,e.scale,e.originX),qC(t.y,YC(e.y,r.y),e.scaleY,e.scale,e.originY)}function Z3(t,e){return W3(eF(t.getBoundingClientRect(),e))}function nF(t,e,n){const r=Z3(t,n),{scroll:s}=e;return s&&(ci(r.x,s.offset.x),ci(r.y,s.offset.y)),r}const rF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},sF=cu.length;function iF(t,e,n){let r="",s=!0;for(let a=0;a<sF;a++){const c=cu[a],u=t[c];if(u===void 0)continue;let f=!0;if(typeof u=="number")f=u===(c.startsWith("scale")?1:0);else{const h=parseFloat(u);f=c.startsWith("scale")?h===1:h===0}if(!f||n){const h=f_(u,Am[c]);if(!f){s=!1;const p=rF[c]||c;r+=`${p}(${h}) `}n&&(e[c]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${f_(i,Am.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function cx(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,c=!1;for(const u in e){const f=e[u];if(uu.has(u)){a=!0;continue}else if(i3(u)){s[u]=f;continue}else{const h=f_(f,Am[u]);u.startsWith("origin")?(c=!0,i[u]=h):r[u]=h}}if(e.transform||(a||n?r.transform=iF(e,t.transform,n):r.transform&&(r.transform="none")),c){const{originX:u="50%",originY:f="50%",originZ:h=0}=i;r.transformOrigin=`${u} ${f} ${h}`}}function q3(t,{style:e,vars:n},r,s){const i=t.style;let a;for(a in e)i[a]=e[a];s==null||s.applyProjectionStyles(i,r);for(a in n)i.setProperty(a,n[a])}function XC(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ad={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Le.test(t))t=parseFloat(t);else return t;const n=XC(t,e.target.x),r=XC(t,e.target.y);return`${n}% ${r}%`}},oF={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Us.parse(t);if(s.length>5)return r;const i=Us.createTransformer(t),a=typeof s[0]!="number"?1:0,c=n.x.scale*e.x,u=n.y.scale*e.y;s[0+a]/=c,s[1+a]/=u;const f=Ct(c,u,.5);return typeof s[2+a]=="number"&&(s[2+a]/=f),typeof s[3+a]=="number"&&(s[3+a]/=f),i(s)}},m_={borderRadius:{...ad,applyTo:[...nx]},borderTopLeftRadius:ad,borderTopRightRadius:ad,borderBottomLeftRadius:ad,borderBottomRightRadius:ad,boxShadow:oF};function Y3(t,{layout:e,layoutId:n}){return uu.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!m_[t]||t==="opacity")}function ux(t,e,n){var a;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const c in r)($n(r[c])||s&&$n(s[c])||Y3(c,t)||((a=n==null?void 0:n.getValue(c))==null?void 0:a.liveStyle)!==void 0)&&(i[c]=r[c]);return i}function aF(t){return window.getComputedStyle(t)}class lF extends B3{constructor(){super(...arguments),this.type="html",this.renderInstance=q3}mount(e){i0(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(uu.has(n))return(r=this.projection)!=null&&r.isProjecting?t_(n):R7(e,n);{const s=aF(e),i=(i3(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Z3(e,n)}build(e,n,r){cx(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return ux(e,n,r)}}const cF={offset:"stroke-dashoffset",array:"stroke-dasharray"},uF={offset:"strokeDashoffset",array:"strokeDasharray"};function dF(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?cF:uF;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const fF=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function X3(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...c},u,f,h){if(cx(t,c,f),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:m}=t;p.transform&&(m.transform=p.transform,delete p.transform),(m.transform||p.transformOrigin)&&(m.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),m.transform&&(m.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete p.transformBox);for(const _ of fF)p[_]!==void 0&&(m[_]=p[_],delete p[_]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&dF(p,s,i,a,!1)}const Q3=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),J3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function hF(t,e,n,r){q3(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(Q3.has(s)?s:tx(s),e.attrs[s])}function eT(t,e,n){const r=ux(t,e,n);for(const s in t)if($n(t[s])||$n(e[s])){const i=cu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class pF extends B3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(uu.has(n)){const r=L3(n);return r&&r.default||0}return n=Q3.has(n)?n:tx(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return eT(e,n,r)}build(e,n,r){X3(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){hF(e,n,r,s)}mount(e){this.isSVGTag=J3(e.tagName),super.mount(e)}}const mF=ax.length;function tT(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?tT(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<mF;n++){const r=ax[n],s=t.props[r];(Gd(s)||s===!1)&&(e[r]=s)}return e}function nT(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const gF=[...ox].reverse(),vF=ox.length;function yF(t){return e=>Promise.all(e.map(({animation:n,options:r})=>gj(t,n,r)))}function _F(t){let e=yF(t),n=QC(),r=!0,s=!1;const i=f=>(h,p)=>{var _;const m=_l(t,p,f==="exit"?(_=t.presenceContext)==null?void 0:_.custom:void 0);if(m){const{transition:x,transitionEnd:y,...w}=m;h={...h,...w,...y}}return h};function a(f){e=f(t)}function c(f){const{props:h}=t,p=tT(t.parent)||{},m=[],_=new Set;let x={},y=1/0;for(let S=0;S<vF;S++){const T=gF[S],P=n[T],k=h[T]!==void 0?h[T]:p[T],A=Gd(k),O=T===f?P.isActive:null;O===!1&&(y=S);let L=k===p[T]&&k!==h[T]&&A;if(L&&(r||s)&&t.manuallyAnimateOnMount&&(L=!1),P.protectedKeys={...x},!P.isActive&&O===null||!k&&!P.prevProp||a0(k)||typeof k=="boolean")continue;if(T==="exit"&&P.isActive&&O!==!0){P.prevResolvedValues&&(x={...x,...P.prevResolvedValues});continue}const R=xF(P.prevProp,k);let M=R||T===f&&P.isActive&&!L&&A||S>y&&A,N=!1;const D=Array.isArray(k)?k:[k];let F=D.reduce(i(T),{});O===!1&&(F={});const{prevResolvedValues:q={}}=P,X={...q,...F},W=$=>{M=!0,_.has($)&&(N=!0,_.delete($)),P.needsAnimating[$]=!0;const te=t.getValue($);te&&(te.liveStyle=!1)};for(const $ in X){const te=F[$],H=q[$];if(x.hasOwnProperty($))continue;let j=!1;a_(te)&&a_(H)?j=!nT(te,H)||R:j=te!==H,j?te!=null?W($):_.add($):te!==void 0&&_.has($)?W($):P.protectedKeys[$]=!0}P.prevProp=k,P.prevResolvedValues=F,P.isActive&&(x={...x,...F}),(r||s)&&t.blockInitialAnimation&&(M=!1);const G=L&&R;M&&(!G||N)&&m.push(...D.map($=>{const te={type:T};if(typeof $=="string"&&(r||s)&&!G&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,j=_l(H,$);if(H.enteringChildren&&j){const{delayChildren:Y}=j.transition||{};te.delay=C3(H.enteringChildren,t,Y)}}return{animation:$,options:te}}))}if(_.size){const S={};if(typeof h.initial!="boolean"){const T=_l(t,Array.isArray(h.initial)?h.initial[0]:h.initial);T&&T.transition&&(S.transition=T.transition)}_.forEach(T=>{const P=t.getBaseTarget(T),k=t.getValue(T);k&&(k.liveStyle=!0),S[T]=P??null}),m.push({animation:S})}let w=!!m.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?e(m):Promise.resolve()}function u(f,h){var m;if(n[f].isActive===h)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(_=>{var x;return(x=_.animationState)==null?void 0:x.setActive(f,h)}),n[f].isActive=h;const p=c(f);for(const _ in n)n[_].protectedKeys={};return p}return{animateChanges:c,setActive:u,setAnimateFunction:a,getState:()=>n,reset:()=>{n=QC(),s=!0}}}function xF(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!nT(e,t):!1}function Ua(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function QC(){return{animate:Ua(!0),whileInView:Ua(),whileHover:Ua(),whileTap:Ua(),whileDrag:Ua(),whileFocus:Ua(),exit:Ua()}}function g_(t,e){t.min=e.min,t.max=e.max}function Ds(t,e){g_(t.x,e.x),g_(t.y,e.y)}function JC(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const rT=1e-4,wF=1-rT,bF=1+rT,sT=.01,SF=0-sT,EF=0+sT;function lr(t){return t.max-t.min}function CF(t,e,n){return Math.abs(t-e)<=n}function e4(t,e,n,r=.5){t.origin=r,t.originPoint=Ct(e.min,e.max,t.origin),t.scale=lr(n)/lr(e),t.translate=Ct(n.min,n.max,t.origin)-t.originPoint,(t.scale>=wF&&t.scale<=bF||isNaN(t.scale))&&(t.scale=1),(t.translate>=SF&&t.translate<=EF||isNaN(t.translate))&&(t.translate=0)}function Td(t,e,n,r){e4(t.x,e.x,n.x,r?r.originX:void 0),e4(t.y,e.y,n.y,r?r.originY:void 0)}function t4(t,e,n,r=0){const s=r?Ct(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+lr(e)}function kF(t,e,n,r){t4(t.x,e.x,n.x,r==null?void 0:r.x),t4(t.y,e.y,n.y,r==null?void 0:r.y)}function n4(t,e,n,r=0){const s=r?Ct(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+lr(e)}function Lm(t,e,n,r){n4(t.x,e.x,n.x,r==null?void 0:r.x),n4(t.y,e.y,n.y,r==null?void 0:r.y)}function r4(t,e,n,r,s){return t-=e,t=Om(t,1/n,r),s!==void 0&&(t=Om(t,1/s,r)),t}function PF(t,e=0,n=1,r=.5,s,i=t,a=t){if(mi.test(e)&&(e=parseFloat(e),e=Ct(a.min,a.max,e/100)-a.min),typeof e!="number")return;let c=Ct(i.min,i.max,r);t===i&&(c-=e),t.min=r4(t.min,e,n,c,s),t.max=r4(t.max,e,n,c,s)}function s4(t,e,[n,r,s],i,a){PF(t,e[n],e[r],e[s],e.scale,i,a)}const TF=["x","scaleX","originX"],RF=["y","scaleY","originY"];function i4(t,e,n,r){s4(t.x,e,TF,n?n.x:void 0,r?r.x:void 0),s4(t.y,e,RF,n?n.y:void 0,r?r.y:void 0)}function o4(t){return t.translate===0&&t.scale===1}function iT(t){return o4(t.x)&&o4(t.y)}function a4(t,e){return t.min===e.min&&t.max===e.max}function AF(t,e){return a4(t.x,e.x)&&a4(t.y,e.y)}function l4(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function oT(t,e){return l4(t.x,e.x)&&l4(t.y,e.y)}function c4(t){return lr(t.x)/lr(t.y)}function u4(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function si(t){return[t("x"),t("y")]}function IF(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:f,rotate:h,pathRotation:p,rotateX:m,rotateY:_,skewX:x,skewY:y}=n;f&&(r=`perspective(${f}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),_&&(r+=`rotateY(${_}deg) `),x&&(r+=`skewX(${x}deg) `),y&&(r+=`skewY(${y}deg) `)}const c=t.x.scale*e.x,u=t.y.scale*e.y;return(c!==1||u!==1)&&(r+=`scale(${c}, ${u})`),r||"none"}const MF=nx.length,d4=t=>typeof t=="string"?parseFloat(t):t,f4=t=>typeof t=="number"||Le.test(t);function OF(t,e,n,r,s,i){s?(t.opacity=Ct(0,n.opacity??1,LF(r)),t.opacityExit=Ct(e.opacity??1,0,NF(r))):i&&(t.opacity=Ct(e.opacity??1,n.opacity??1,r));for(let a=0;a<MF;a++){const c=nx[a];let u=h4(e,c),f=h4(n,c);if(u===void 0&&f===void 0)continue;u||(u=0),f||(f=0),u===0||f===0||f4(u)===f4(f)?(t[c]=Math.max(Ct(d4(u),d4(f),r),0),(mi.test(f)||mi.test(u))&&(t[c]+="%")):t[c]=f}(e.rotate||n.rotate)&&(t.rotate=Ct(e.rotate||0,n.rotate||0,r))}function h4(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const LF=aT(0,.5,JP),NF=aT(.5,.95,bs);function aT(t,e,n){return r=>r<t?0:r>e?1:n(Bd(t,e,r))}function DF(t,e,n){const r=$n(t)?t:nu(t);return r.start(J2("",r,e,n)),r.animation}function Kd(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const jF=(t,e)=>t.depth-e.depth;class FF{constructor(){this.children=[],this.isDirty=!1}add(e){H2(this.children,e),this.isDirty=!0}remove(e){Cm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(jF),this.isDirty=!1,this.children.forEach(e)}}function VF(t,e){const n=ar.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(aa(r),t(i-e))};return kt.setup(r,!0),()=>aa(r)}function Dp(t){return $n(t)?t.get():t}class $F{constructor(){this.members=[]}add(e){H2(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Cm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Cm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:a}=e.options;(i===void 0||i!==a)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,a;(r=(n=e.options).onExitComplete)==null||r.call(n),(a=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||a.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const jp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},n1=["","X","Y","Z"],HF=1e3;let zF=0;function r1(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function lT(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=A3(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",kt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&lT(r)}function cT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},c=e==null?void 0:e()){this.id=zF++,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(WF),this.nodes.forEach(XF),this.nodes.forEach(QF),this.nodes.forEach(GF)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new FF)}addEventListener(a,c){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new z2),this.eventHandlers.get(a).add(c)}notifyListeners(a,...c){const u=this.eventHandlers.get(a);u&&u.notify(...c)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=ix(a)&&!Wj(a),this.instance=a;const{layoutId:c,layout:u,visualElement:f}=this.options;if(f&&!f.current&&f.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||c)&&(this.isLayoutDirty=!0),t){let h,p=0;const m=()=>this.root.updateBlockedByResize=!1;kt.read(()=>{p=window.innerWidth}),t(a,()=>{const _=window.innerWidth;_!==p&&(p=_,this.root.updateBlockedByResize=!0,h&&h(),h=VF(m,250),jp.hasAnimatedSinceResize&&(jp.hasAnimatedSinceResize=!1,this.nodes.forEach(g4)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||rV,{onLayoutAnimationStart:y,onLayoutAnimationComplete:w}=f.getProps(),S=!this.targetLayout||!oT(this.targetLayout,_),T=!p&&m;if(this.options.layoutRoot||this.resumeFrom||T||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...Q2(x,"layout"),onPlay:y,onComplete:w};(f.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(h,T,P.path)}else p||g4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),aa(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(JF),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&lT(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const p=this.path[h];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:c,layout:u}=this.options;if(c===void 0&&!u)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(ZF),this.nodes.forEach(p4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(m4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qF),this.nodes.forEach(YF),this.nodes.forEach(UF),this.nodes.forEach(BF)):this.nodes.forEach(m4),this.clearAllSnapshots();const c=ar.now();jn.delta=gi(0,1e3/60,c-jn.timestamp),jn.timestamp=c,jn.isProcessing=!0,Zv.update.process(jn),Zv.preRender.process(jn),Zv.render.process(jn),jn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,rx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(KF),this.sharedNodes.forEach(eV)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,kt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){kt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!lr(this.snapshot.measuredBox.x)&&!lr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=xn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(c=!1),c&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!iT(this.projectionDelta),u=this.getTransformTemplate(),f=u?u(this.latestValues,""):void 0,h=f!==this.prevTransformTemplateValue;a&&this.instance&&(c||el(this.latestValues)||h)&&(s(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const c=this.measurePageBox();let u=this.removeElementScroll(c);return a&&(u=this.removeTransform(u)),sV(u),{animationId:this.root.animationId,measuredBox:c,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:a}=this.options;if(!a)return xn();const c=a.measureViewportBox();if(!(((f=this.scroll)==null?void 0:f.wasRoot)||this.path.some(iV))){const{scroll:h}=this.root;h&&(ci(c.x,h.offset.x),ci(c.y,h.offset.y))}return c}removeElementScroll(a){var u;const c=xn();if(Ds(c,a),(u=this.scroll)!=null&&u.wasRoot)return c;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:p,options:m}=h;h!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&Ds(c,a),ci(c.x,p.offset.x),ci(c.y,p.offset.y))}return c}applyTransform(a,c=!1,u){var h,p;const f=u||xn();Ds(f,a);for(let m=0;m<this.path.length;m++){const _=this.path[m];!c&&_.options.layoutScroll&&_.scroll&&_!==_.root&&(ci(f.x,-_.scroll.offset.x),ci(f.y,-_.scroll.offset.y)),el(_.latestValues)&&Np(f,_.latestValues,(h=_.layout)==null?void 0:h.layoutBox)}return el(this.latestValues)&&Np(f,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),f}removeTransform(a){var u;const c=xn();Ds(c,a);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!el(h.latestValues))continue;let p;h.instance&&(h_(h.latestValues)&&h.updateSnapshot(),p=xn(),Ds(p,h.measurePageBox())),i4(c,h.latestValues,(u=h.snapshot)==null?void 0:u.layoutBox,p)}return el(this.latestValues)&&i4(c,this.latestValues),c}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==jn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var _;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(a||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=jn.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=xn(),this.targetWithTransforms=xn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),kF(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ds(this.target,this.layout.layoutBox),K3(this.target,this.targetDelta)):Ds(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||h_(this.parent.latestValues)||G3(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,c,u){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xn(),this.relativeTargetOrigin=xn(),Lm(this.relativeTargetOrigin,c,u,this.options.layoutAnchor||void 0),Ds(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const a=this.getLead(),c=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===jn.timestamp&&(u=!1),u)return;const{layout:f,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||h))return;Ds(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;tF(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=xn());const{target:_}=a;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(JC(this.prevProjectionDelta.x,this.projectionDelta.x),JC(this.prevProjectionDelta.y,this.projectionDelta.y)),Td(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!u4(this.projectionDelta.x,this.prevProjectionDelta.x)||!u4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var c;if((c=this.options.visualElement)==null||c.scheduleRender(),a){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bc(),this.projectionDelta=bc(),this.projectionDeltaWithTransform=bc()}setAnimationOrigin(a,c=!1,u){const f=this.snapshot,h=f?f.latestValues:{},p={...this.latestValues},m=bc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const _=xn(),x=f?f.source:void 0,y=this.layout?this.layout.source:void 0,w=x!==y,S=this.getStack(),T=!S||S.members.length<=1,P=!!(w&&!T&&this.options.crossfade===!0&&!this.path.some(nV));this.animationProgress=0;let k;const A=u==null?void 0:u.interpolateProjection(a);this.mixTargetDelta=O=>{const L=O/1e3,R=A==null?void 0:A(L);R?(m.x.translate=R.x,m.x.scale=Ct(a.x.scale,1,L),m.x.origin=a.x.origin,m.x.originPoint=a.x.originPoint,m.y.translate=R.y,m.y.scale=Ct(a.y.scale,1,L),m.y.origin=a.y.origin,m.y.originPoint=a.y.originPoint):(v4(m.x,a.x,L),v4(m.y,a.y,L)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Lm(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),tV(this.relativeTarget,this.relativeTargetOrigin,_,L),k&&AF(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=xn()),Ds(k,this.relativeTarget)),w&&(this.animationValues=p,OF(p,h,this.latestValues,L,P,T)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var c,u,f;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(f=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||f.stop(),this.pendingAnimation&&(aa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=kt.update(()=>{jp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=nu(0)),this.motionValue.jump(0,!1),this.currentAnimation=DF(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(HF),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:u,layout:f,latestValues:h}=a;if(!(!c||!u||!f)){if(this!==a&&this.layout&&f&&uT(this.options.animationType,this.layout.layoutBox,f.layoutBox)){u=this.target||xn();const p=lr(this.layout.layoutBox.x);u.x.min=a.target.x.min,u.x.max=u.x.min+p;const m=lr(this.layout.layoutBox.y);u.y.min=a.target.y.min,u.y.max=u.y.min+m}Ds(c,u),Np(c,h),Td(this.projectionDeltaWithTransform,this.layoutCorrected,c,h)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new $F),this.sharedNodes.get(a).add(c);const f=c.options.initialPromotionConfig;c.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var c;const{layoutId:a}=this.options;return a?((c=this.getStack())==null?void 0:c.lead)||this:this}getPrevLead(){var c;const{layoutId:a}=this.options;return a?(c=this.getStack())==null?void 0:c.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:u}={}){const f=this.getStack();f&&f.promote(this,u),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:u}=a;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(c=!0),!c)return;const f={};u.z&&r1("z",a,f,this.animationValues);for(let h=0;h<n1.length;h++)r1(`rotate${n1[h]}`,a,f,this.animationValues),r1(`skew${n1[h]}`,a,f,this.animationValues);a.render();for(const h in f)a.setStaticValue(h,f[h]),this.animationValues&&(this.animationValues[h]=f[h]);a.scheduleRender()}applyProjectionStyles(a,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Dp(c==null?void 0:c.pointerEvents)||"",a.transform=u?u(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Dp(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!el(this.latestValues)&&(a.transform=u?u({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=f.animationValues||f.latestValues;this.applyTransformsToTarget();let p=IF(this.projectionDeltaWithTransform,this.treeScale,h);u&&(p=u(h,p)),a.transform=p;const{x:m,y:_}=this.projectionDelta;a.transformOrigin=`${m.origin*100}% ${_.origin*100}% 0`,f.animationValues?a.opacity=f===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in m_){if(h[x]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:S}=m_[x],T=p==="none"?h[x]:y(h[x],f);if(w){const P=w.length;for(let k=0;k<P;k++)a[w[k]]=T}else S?this.options.visualElement.renderState.vars[x]=T:a[x]=T}this.options.layoutId&&(a.pointerEvents=f===this?Dp(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var c;return(c=a.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(p4),this.root.sharedNodes.clear()}}}function UF(t){t.updateLayout()}function BF(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,a=e.source!==t.layout.source;if(i==="size")si(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],_=lr(m);m.min=r[p].min,m.max=m.min+_});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";g_(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else uT(i,e.layoutBox,r)&&si(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],_=lr(r[p]);m.max=m.min+_,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+_)});const c=bc();Td(c,r,e.layoutBox);const u=bc();a?Td(u,t.applyTransform(s,!0),e.measuredBox):Td(u,r,e.layoutBox);const f=!iT(c);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:_}=p;if(m&&_){const x=t.options.layoutAnchor||void 0,y=xn();Lm(y,e.layoutBox,m.layoutBox,x);const w=xn();Lm(w,r,_.layoutBox,x),oT(y,w)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=y,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:u,layoutDelta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function WF(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 GF(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function KF(t){t.clearSnapshot()}function p4(t){t.clearMeasurements()}function ZF(t){t.isLayoutDirty=!0,t.updateLayout()}function m4(t){t.isLayoutDirty=!1}function qF(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function YF(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function g4(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function XF(t){t.resolveTargetDelta()}function QF(t){t.calcProjection()}function JF(t){t.resetSkewAndRotation()}function eV(t){t.removeLeadSnapshot()}function v4(t,e,n){t.translate=Ct(e.translate,0,n),t.scale=Ct(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function y4(t,e,n,r){t.min=Ct(e.min,n.min,r),t.max=Ct(e.max,n.max,r)}function tV(t,e,n,r){y4(t.x,e.x,n.x,r),y4(t.y,e.y,n.y,r)}function nV(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const rV={duration:.45,ease:[.4,0,.1,1]},_4=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),x4=_4("applewebkit/")&&!_4("chrome/")?Math.round:bs;function w4(t){t.min=x4(t.min),t.max=x4(t.max)}function sV(t){w4(t.x),w4(t.y)}function uT(t,e,n){return t==="position"||t==="preserve-aspect"&&!CF(c4(e),c4(n),.2)}function iV(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const oV=cT({attachResizeListener:(t,e)=>Kd(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}),s1={current:void 0},dT=cT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!s1.current){const t=new oV({});t.mount(window),t.setOptions({layoutScroll:!0}),s1.current=t}return s1.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),dx=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function b4(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function aV(...t){return e=>{let n=!1;const r=t.map(s=>{const i=b4(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():b4(t[s],null)}}}}function lV(...t){return v.useCallback(aV(...t),t)}class cV extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Ip(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Ip(r)&&r.offsetWidth||0,i=Ip(r)&&r.offsetHeight||0,a=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(a.height),c.width=parseFloat(a.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=s-c.width-c.left,c.bottom=i-c.height-c.top,c.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function uV({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const a=v.useId(),c=v.useRef(null),u=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:f}=v.useContext(dx),h=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,p=lV(c,h);return v.useInsertionEffect(()=>{const{width:_,height:x,top:y,left:w,right:S,bottom:T,direction:P}=u.current;if(e||i===!1||!c.current||!_||!x)return;const k=P==="rtl",A=n==="left"?k?`right: ${S}`:`left: ${w}`:k?`left: ${w}`:`right: ${S}`,O=r==="bottom"?`bottom: ${T}`:`top: ${y}`;c.current.dataset.motionPopId=a;const L=document.createElement("style");f&&(L.nonce=f);const R=s??document.head;return R.appendChild(L),L.sheet&&L.sheet.insertRule(`
63
+ [data-motion-pop-id="${a}"] {
64
+ position: absolute !important;
65
+ width: ${_}px !important;
66
+ height: ${x}px !important;
67
+ ${A}px !important;
68
+ ${O}px !important;
69
+ }
70
+ `),()=>{var M;(M=c.current)==null||M.removeAttribute("data-motion-pop-id"),R.contains(L)&&R.removeChild(L)}},[e]),E.jsx(cV,{isPresent:e,childRef:c,sizeRef:u,pop:i,children:i===!1?t:v.cloneElement(t,{ref:p})})}const dV=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:c,anchorY:u,root:f})=>{const h=V2(fV),p=v.useId(),m=v.useRef(n),_=v.useRef(r);$2(()=>{m.current=n,_.current=r});let x=!0,y=v.useMemo(()=>(x=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:w=>{h.set(w,!0);for(const S of h.values())if(!S)return;r&&r()},register:w=>(h.set(w,!1),()=>{var S;h.delete(w),!m.current&&!h.size&&((S=_.current)==null||S.call(_))})}),[n,h,r]);return i&&x&&(y={...y}),v.useMemo(()=>{h.forEach((w,S)=>h.set(S,!1))},[n]),v.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=E.jsx(uV,{pop:a==="popLayout",isPresent:n,anchorX:c,anchorY:u,root:f,children:t}),E.jsx(s0.Provider,{value:y,children:t})};function fV(){return new Map}function fT(t=!0){const e=v.useContext(s0);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=v.useId();v.useEffect(()=>{if(t)return s(i)},[t]);const a=v.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,a]:[!0]}const rp=t=>t.key||"";function S4(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const ro=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:c="left",anchorY:u="top",root:f})=>{const[h,p]=fT(a),m=v.useMemo(()=>S4(t),[t]),_=a&&!h?[]:m.map(rp),x=v.useRef(!0),y=v.useRef(m),w=V2(()=>new Map),S=v.useRef(new Set),[T,P]=v.useState(m),[k,A]=v.useState(m);$2(()=>{x.current=!1,y.current=m;for(let R=0;R<k.length;R++){const M=rp(k[R]);_.includes(M)?(w.delete(M),S.current.delete(M)):w.get(M)!==!0&&w.set(M,!1)}},[k,_.length,_.join("-")]);const O=[];if(m!==T){let R=[...m];for(let M=0;M<k.length;M++){const N=k[M],D=rp(N);_.includes(D)||(R.splice(M,0,N),O.push(N))}return i==="wait"&&O.length&&(R=O),A(S4(R)),P(m),null}const{forceRender:L}=v.useContext(F2);return E.jsx(E.Fragment,{children:k.map(R=>{const M=rp(R),N=a&&!h?!1:m===k||_.includes(M),D=()=>{if(S.current.has(M))return;if(w.has(M))S.current.add(M),w.set(M,!0);else return;let F=!0;w.forEach(q=>{q||(F=!1)}),F&&(L==null||L(),A(y.current),a&&(p==null||p()),r&&r())};return E.jsx(dV,{isPresent:N,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:f,onExitComplete:N?void 0:D,anchorX:c,anchorY:u,children:R},M)})})},hT=v.createContext({strict:!1}),E4={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let C4=!1;function hV(){if(C4)return;const t={};for(const e in E4)t[e]={isEnabled:n=>E4[e].some(r=>!!n[r])};U3(t),C4=!0}function pT(){return hV(),Xj()}function pV(t){const e=pT();for(const n in t)e[n]={...e[n],...t[n]};U3(e)}const mV=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Nm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||mV.has(t)}let mT=t=>!Nm(t);function gV(t){typeof t=="function"&&(mT=e=>e.startsWith("on")?!Nm(e):t(e))}try{gV(require("@emotion/is-prop-valid").default)}catch{}function vV(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||$n(t[s])||(mT(s)||n===!0&&Nm(s)||!e&&!Nm(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const c0=v.createContext({});function yV(t,e){if(l0(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Gd(n)?n:void 0,animate:Gd(r)?r:void 0}}return t.inherit!==!1?e:{}}function _V(t){const{initial:e,animate:n}=yV(t,v.useContext(c0));return v.useMemo(()=>({initial:e,animate:n}),[k4(e),k4(n)])}function k4(t){return Array.isArray(t)?t.join(" "):t}const fx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gT(t,e,n){for(const r in e)!$n(e[r])&&!Y3(r,n)&&(t[r]=e[r])}function xV({transformTemplate:t},e){return v.useMemo(()=>{const n=fx();return cx(n,e,t),Object.assign({},n.vars,n.style)},[e])}function wV(t,e){const n=t.style||{},r={};return gT(r,n,t),Object.assign(r,xV(t,e)),r}function bV(t,e){const n={},r=wV(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const vT=()=>({...fx(),attrs:{}});function SV(t,e,n,r){const s=v.useMemo(()=>{const i=vT();return X3(i,e,J3(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};gT(i,t.style,t),s.style={...i,...s.style}}return s}const EV=["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 hx(t){return typeof t!="string"||t.includes("-")?!1:!!(EV.indexOf(t)>-1||/[A-Z]/u.test(t))}function CV(t,e,n,{latestValues:r},s,i=!1,a){const u=(a??hx(t)?SV:bV)(e,r,s,t),f=vV(e,typeof t=="string",i),h=t!==v.Fragment?{...f,...u,ref:n}:{},{children:p}=e,m=v.useMemo(()=>$n(p)?p.get():p,[p]);return v.createElement(t,{...h,children:m})}function kV({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:PV(n,r,s,t),renderState:e()}}function PV(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Dp(i[m]);let{initial:a,animate:c}=t;const u=l0(t),f=H3(t);e&&f&&!u&&t.inherit!==!1&&(a===void 0&&(a=e.initial),c===void 0&&(c=e.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const p=h?c:a;if(p&&typeof p!="boolean"&&!a0(p)){const m=Array.isArray(p)?p:[p];for(let _=0;_<m.length;_++){const x=ex(t,m[_]);if(x){const{transitionEnd:y,transition:w,...S}=x;for(const T in S){let P=S[T];if(Array.isArray(P)){const k=h?P.length-1:0;P=P[k]}P!==null&&(s[T]=P)}for(const T in y)s[T]=y[T]}}}return s}const yT=t=>(e,n)=>{const r=v.useContext(c0),s=v.useContext(s0),i=()=>kV(t,e,r,s);return n?i():V2(i)},TV=yT({scrapeMotionValuesFromProps:ux,createRenderState:fx}),RV=yT({scrapeMotionValuesFromProps:eT,createRenderState:vT}),AV=Symbol.for("motionComponentSymbol");function IV(t,e,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const s=v.useRef(null);return v.useCallback(i=>{var c;i&&((c=t.onMount)==null||c.call(t,i)),e&&(i?e.mount(i):e.unmount());const a=r.current;if(typeof a=="function")if(i){const u=a(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[e])}const _T=v.createContext({});function gc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function MV(t,e,n,r,s,i){var P,k;const{visualElement:a}=v.useContext(c0),c=v.useContext(hT),u=v.useContext(s0),f=v.useContext(dx),h=f.reducedMotion,p=f.skipAnimations,m=v.useRef(null),_=v.useRef(!1);r=r||c.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:i}),_.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,y=v.useContext(_T);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&OV(m.current,n,s,y);const w=v.useRef(!1);v.useInsertionEffect(()=>{x&&w.current&&x.update(n,u)});const S=n[R3],T=v.useRef(!!S&&typeof window<"u"&&!((P=window.MotionHandoffIsComplete)!=null&&P.call(window,S))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,S)));return $2(()=>{_.current=!0,x&&(w.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),T.current&&x.animationState&&x.animationState.animateChanges())}),v.useEffect(()=>{x&&(!T.current&&x.animationState&&x.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,S)}),T.current=!1),x.enteringChildren=void 0)}),x}function OV(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:c,layoutScroll:u,layoutRoot:f,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:xT(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||c&&gc(c),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:u,layoutRoot:f,layoutAnchor:h})}function xT(t){if(t)return t.options.allowProjection!==!1?t.projection:xT(t.parent)}function i1(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&pV(r);const i=n?n==="svg":hx(t),a=i?RV:TV;function c(f,h){let p;const m={...v.useContext(dx),...f,layoutId:LV(f)},{isStatic:_}=m,x=_V(f),y=a(f,_);if(!_&&typeof window<"u"){NV();const w=DV(m);p=w.MeasureLayout,x.visualElement=MV(t,y,m,s,w.ProjectionNode,i)}return E.jsxs(c0.Provider,{value:x,children:[p&&x.visualElement?E.jsx(p,{visualElement:x.visualElement,...m}):null,CV(t,f,IV(y,x.visualElement,h),y,_,e,i)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=v.forwardRef(c);return u[AV]=t,u}function LV({layoutId:t}){const e=v.useContext(F2).id;return e&&t!==void 0?e+"-"+t:t}function NV(t,e){v.useContext(hT).strict}function DV(t){const e=pT(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function jV(t,e){if(typeof Proxy>"u")return i1;const n=new Map,r=(i,a)=>i1(i,a,t,e),s=(i,a)=>r(i,a);return new Proxy(s,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,i1(a,void 0,t,e)),n.get(a))})}const FV=(t,e)=>e.isSVG??hx(t)?new pF(e):new lF(e,{allowProjection:t!==v.Fragment});class VV extends pa{constructor(e){super(e),e.animationState||(e.animationState=_F(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();a0(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 $V=0;class HV extends pa{constructor(){super(...arguments),this.id=$V++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:a,custom:c}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const u=_l(this.node,a,c);if(u){const{transition:f,transitionEnd:h,...p}=u;for(const m in p)(i=this.node.getValue(m))==null||i.jump(p[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const zV={animation:{Feature:VV},exit:{Feature:HV}};function Cf(t){return{point:{x:t.pageX,y:t.pageY}}}const UV=t=>e=>sx(e)&&t(e,Cf(e));function Rd(t,e,n,r){return Kd(t,e,UV(n),r)}const wT=({current:t})=>t?t.ownerDocument.defaultView:null,P4=(t,e)=>Math.abs(t-e);function BV(t,e){const n=P4(t.x,e.x),r=P4(t.y,e.y);return Math.sqrt(n**2+r**2)}const T4=new Set(["auto","scroll"]);class bT{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=sp(this.lastRawMoveEventInfo,this.transformPagePoint));const x=o1(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,w=BV(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!w)return;const{point:S}=x,{timestamp:T}=jn;this.history.push({...S,timestamp:T});const{onStart:P,onMove:k}=this.handlers;y||(P&&P(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=sp(y,this.transformPagePoint),kt.update(this.updatePoint,!0)},this.handlePointerUp=(x,y)=>{this.end();const{onEnd:w,onSessionEnd:S,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=o1(x.type==="pointercancel"?this.lastMoveEventInfo:sp(y,this.transformPagePoint),this.history);this.startEvent&&w&&w(x,P),S&&S(x,P)},!sx(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const u=Cf(e),f=sp(u,this.transformPagePoint),{point:h}=f,{timestamp:p}=jn;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,o1(f,this.history));const _={passive:!0,capture:!0};this.removeListeners=bf(Rd(this.contextWindow,"pointermove",this.handlePointerMove,_),Rd(this.contextWindow,"pointerup",this.handlePointerUp,_),Rd(this.contextWindow,"pointercancel",this.handlePointerUp,_)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(T4.has(r.overflowX)||T4.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),kt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),aa(this.updatePoint)}}function sp(t,e){return e?{point:e(t.point)}:t}function R4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function o1({point:t},e){return{point:t,delta:R4(t,ST(e)),offset:R4(t,WV(e)),velocity:GV(e,.1)}}function WV(t){return t[0]}function ST(t){return t[t.length-1]}function GV(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=ST(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Qr(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Qr(e)*2&&(r=t[1]);const i=ys(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function KV(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Ct(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Ct(n,t,r.max):Math.min(t,n)),t}function A4(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function ZV(t,{top:e,left:n,bottom:r,right:s}){return{x:A4(t.x,n,s),y:A4(t.y,e,r)}}function I4(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function qV(t,e){return{x:I4(t.x,e.x),y:I4(t.y,e.y)}}function YV(t,e){let n=.5;const r=lr(t),s=lr(e);return s>r?n=Bd(e.min,e.max-r,t.min):r>s&&(n=Bd(t.min,t.max-s,e.min)),gi(0,1,n)}function XV(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 v_=.35;function QV(t=v_){return t===!1?t=0:t===!0&&(t=v_),{x:M4(t,"left","right"),y:M4(t,"top","bottom")}}function M4(t,e,n){return{min:O4(t,e),max:O4(t,n)}}function O4(t,e){return typeof t=="number"?t:t[e]||0}const JV=new WeakMap;class e${constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=xn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=p=>{n&&this.snapToCursor(Cf(p).point),this.stopAnimation()},a=(p,m)=>{const{drag:_,dragPropagation:x,onDragStart:y}=this.getProps();if(_&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Tj(_),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),si(S=>{let T=this.getAxisMotionValue(S).get()||0;if(mi.test(T)){const{projection:P}=this.visualElement;if(P&&P.layout){const k=P.layout.layoutBox[S];k&&(T=lr(k)*(parseFloat(T)/100))}}this.originPoint[S]=T}),y&&kt.update(()=>y(p,m),!1,!0),l_(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:_,dragDirectionLock:x,onDirectionLock:y,onDrag:w}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:S}=m;if(x&&this.currentDirection===null){this.currentDirection=n$(S),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",m.point,S),this.updateAxis("y",m.point,S),this.visualElement.render(),w&&kt.update(()=>w(p,m),!1,!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new bT(e,{onSessionStart:i,onStart:a,onMove:c,onSessionEnd:u,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:wT(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&kt.postRender(()=>c(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!ip(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=KV(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&gc(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=ZV(r.layoutBox,e):this.constraints=!1,this.elastic=QV(n),s!==this.constraints&&!gc(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&si(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=XV(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!gc(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=nF(r,s.root,this.visualElement.getTransformPagePoint());let a=qV(s.layout.layoutBox,i);if(n){const c=n(Jj(a));this.hasMutatedConstraints=!!c,c&&(a=W3(c))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),u=this.constraints||{},f=si(h=>{if(!ip(h,n,this.currentDirection))return;let p=u&&u[h]||{};(a===!0||a===h)&&(p={min:0,max:0});const m=s?200:1e6,_=s?40:1e7,x={type:"inertia",velocity:r?e[h]:0,bounceStiffness:m,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,x)});return Promise.all(f).then(c)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return l_(this.visualElement,e),r.start(J2(e,r,0,n,this.visualElement,!1))}stopAnimation(){si(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){si(n=>{const{drag:r}=this.getProps();if(!ip(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:c}=s.layout.layoutBox[n],u=i.get()||0;i.set(e[n]-Ct(a,c,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!gc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};si(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const u=c.get();s[a]=YV({min:u,max:u},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),si(a=>{if(!ip(a,e,null))return;const c=this.getAxisMotionValue(a),{min:u,max:f}=this.constraints[a];c.set(Ct(u,f,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;JV.set(this.visualElement,this);const e=this.visualElement.current,n=Rd(e,"pointerdown",f=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=f.target,_=m!==e&&Lj(m);h&&p&&!_&&this.start(f)});let r;const s=()=>{const{dragConstraints:f}=this.getProps();gc(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),r||(r=t$(e,f.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),kt.read(s);const c=Kd(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:h})=>{this.isDragging&&h&&(si(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=f[p].translate,m.set(m.get()+f[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),a(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=v_,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:c}}}function L4(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function t$(t,e,n){const r=HC(t,L4(n)),s=HC(e,L4(n));return()=>{r(),s()}}function ip(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function n$(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class r$ extends pa{constructor(e){super(e),this.removeGroupControls=bs,this.removeListeners=bs,this.controls=new e$(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||bs}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 a1=t=>(e,n)=>{t&&kt.update(()=>t(e,n),!1,!0)};class s$ extends pa{constructor(){super(...arguments),this.removePointerDownListener=bs}onPointerDown(e){this.session=new bT(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:wT(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:a1(e),onStart:a1(n),onMove:a1(r),onEnd:(i,a)=>{delete this.session,s&&kt.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Rd(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 l1=!1;class i$ extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),l1&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),jp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),l1=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||kt.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),rx.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;l1=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function ET(t){const[e,n]=fT(),r=v.useContext(F2);return E.jsx(i$,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(_T),isPresent:e,safeToRemove:n})}const o$={pan:{Feature:s$},drag:{Feature:r$,ProjectionNode:dT,MeasureLayout:ET}};function N4(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&kt.postRender(()=>i(e,Cf(e)))}class a$ extends pa{mount(){const{current:e}=this.node;e&&(this.unmount=Aj(e,(n,r)=>(N4(this.node,r,"Start"),s=>N4(this.node,s,"End"))))}unmount(){}}class l$ extends pa{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=bf(Kd(this.node.current,"focus",()=>this.onFocus()),Kd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function D4(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&kt.postRender(()=>i(e,Cf(e)))}class c$ extends pa{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Dj(e,(s,i)=>(D4(this.node,i,"Start"),(a,{success:c})=>D4(this.node,a,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const y_=new WeakMap,c1=new WeakMap,u$=t=>{const e=y_.get(t.target);e&&e(t)},d$=t=>{t.forEach(u$)};function f$({root:t,...e}){const n=t||document;c1.has(n)||c1.set(n,{});const r=c1.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(d$,{root:t,...e})),r[s]}function h$(t,e,n){const r=f$(e);return y_.set(t,n),r.observe(t),()=>{y_.delete(t),r.unobserve(t)}}const p$={some:0,all:1};class m$ extends pa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:p$[s]},c=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,i&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),_=h?p:m;_&&_(f)};this.stopObserver=h$(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(g$(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function g$({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const v$={inView:{Feature:m$},tap:{Feature:c$},focus:{Feature:l$},hover:{Feature:a$}},y$={layout:{ProjectionNode:dT,MeasureLayout:ET}},_$={...zV,...v$,...o$,...y$},so=jV(_$,FV);function x$(){!lx.current&&z3();const[t]=v.useState(Im.current);return t}const xl=so;var u0=NP();const w$=Jm(u0);function b$(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 S$=t=>{switch(t){case"success":return k$;case"info":return T$;case"warning":return P$;case"error":return R$;default:return null}},E$=Array(12).fill(0),C$=({visible:t,className:e})=>ve.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ve.createElement("div",{className:"sonner-spinner"},E$.map((n,r)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),k$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),P$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),T$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),R$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-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"})),A$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),I$=()=>{const[t,e]=ve.useState(document.hidden);return ve.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let __=1;class M${constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:__++,a=this.toasts.find(u=>u.id===i),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...e,id:i,title:r}),{...u,...e,id:i,dismissible:c,title:r}):u):this.addToast({title:r,...s,dismissible:c,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,a;const c=s.then(async f=>{if(a=["resolve",f],ve.isValidElement(f))i=!1,this.create({id:r,type:"default",message:f});else if(L$(f)&&!f.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}else if(f instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(f):n.error,m=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(f):n.success,m=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,...x})}}).catch(async f=>{if(a=["reject",f],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,_=typeof h=="object"&&!ve.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,..._})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((f,h)=>c.then(()=>a[0]==="reject"?h(a[1]):f(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||__++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Sr=new M$,O$=(t,e)=>{const n=(e==null?void 0:e.id)||__++;return Sr.addToast({title:t,...e,id:n}),n},L$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",N$=O$,D$=()=>Sr.toasts,j$=()=>Sr.getActiveToasts(),mt=Object.assign(N$,{success:Sr.success,info:Sr.info,warning:Sr.warning,error:Sr.error,custom:Sr.custom,message:Sr.message,promise:Sr.promise,dismiss:Sr.dismiss,loading:Sr.loading},{getHistory:D$,getToasts:j$});b$("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function op(t){return t.label!==void 0}const F$=3,V$="24px",$$="16px",j4=4e3,H$=356,z$=14,U$=45,B$=200;function ti(...t){return t.filter(Boolean).join(" ")}function W$(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const G$=t=>{var e,n,r,s,i,a,c,u,f;const{invert:h,toast:p,unstyled:m,interacting:_,setHeights:x,visibleToasts:y,heights:w,index:S,toasts:T,expanded:P,removeToast:k,defaultRichColors:A,closeButton:O,style:L,cancelButtonStyle:R,actionButtonStyle:M,className:N="",descriptionClassName:D="",duration:F,position:q,gap:X,expandByDefault:W,classNames:G,icons:K,closeButtonAriaLabel:$="Close toast"}=t,[te,H]=ve.useState(null),[j,Y]=ve.useState(null),[ne,ie]=ve.useState(!1),[J,ce]=ve.useState(!1),[we,oe]=ve.useState(!1),[le,Fe]=ve.useState(!1),[De,Pe]=ve.useState(!1),[Qe,dt]=ve.useState(0),[qt,xe]=ve.useState(0),$e=ve.useRef(p.duration||F||j4),Be=ve.useRef(null),ot=ve.useRef(null),Pt=S===0,tt=S+1<=y,Ye=p.type,At=p.dismissible!==!1,Bn=p.className||"",In=p.descriptionClassName||"",Es=ve.useMemo(()=>w.findIndex(Ke=>Ke.toastId===p.id)||0,[w,p.id]),Lr=ve.useMemo(()=>{var Ke;return(Ke=p.closeButton)!=null?Ke:O},[p.closeButton,O]),Nr=ve.useMemo(()=>p.duration||F||j4,[p.duration,F]),tr=ve.useRef(0),wn=ve.useRef(0),Gs=ve.useRef(0),Ks=ve.useRef(null),[Mn,mo]=q.split("-"),bi=ve.useMemo(()=>w.reduce((Ke,It,Ut)=>Ut>=Es?Ke:Ke+It.height,0),[w,Es]),Cs=I$(),Zs=p.invert||h,rs=Ye==="loading";wn.current=ve.useMemo(()=>Es*X+bi,[Es,bi]),ve.useEffect(()=>{$e.current=Nr},[Nr]),ve.useEffect(()=>{ie(!0)},[]),ve.useEffect(()=>{const Ke=ot.current;if(Ke){const It=Ke.getBoundingClientRect().height;return xe(It),x(Ut=>[{toastId:p.id,height:It,position:p.position},...Ut]),()=>x(Ut=>Ut.filter(bn=>bn.toastId!==p.id))}},[x,p.id]),ve.useLayoutEffect(()=>{if(!ne)return;const Ke=ot.current,It=Ke.style.height;Ke.style.height="auto";const Ut=Ke.getBoundingClientRect().height;Ke.style.height=It,xe(Ut),x(bn=>bn.find(Yt=>Yt.toastId===p.id)?bn.map(Yt=>Yt.toastId===p.id?{...Yt,height:Ut}:Yt):[{toastId:p.id,height:Ut,position:p.position},...bn])},[ne,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const gn=ve.useCallback(()=>{ce(!0),dt(wn.current),x(Ke=>Ke.filter(It=>It.toastId!==p.id)),setTimeout(()=>{k(p)},B$)},[p,k,x,wn]);ve.useEffect(()=>{if(p.promise&&Ye==="loading"||p.duration===1/0||p.type==="loading")return;let Ke;return P||_||Cs?(()=>{if(Gs.current<tr.current){const bn=new Date().getTime()-tr.current;$e.current=$e.current-bn}Gs.current=new Date().getTime()})():(()=>{$e.current!==1/0&&(tr.current=new Date().getTime(),Ke=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),gn()},$e.current))})(),()=>clearTimeout(Ke)},[P,_,p,Ye,Cs,gn]),ve.useEffect(()=>{p.delete&&(gn(),p.onDismiss==null||p.onDismiss.call(p,p))},[gn,p.delete]);function go(){var Ke;if(K!=null&&K.loading){var It;return ve.createElement("div",{className:ti(G==null?void 0:G.loader,p==null||(It=p.classNames)==null?void 0:It.loader,"sonner-loader"),"data-visible":Ye==="loading"},K.loading)}return ve.createElement(C$,{className:ti(G==null?void 0:G.loader,p==null||(Ke=p.classNames)==null?void 0:Ke.loader),visible:Ye==="loading"})}const Dr=p.icon||(K==null?void 0:K[Ye])||S$(Ye);var ss,Si;return ve.createElement("li",{tabIndex:0,ref:ot,className:ti(N,Bn,G==null?void 0:G.toast,p==null||(e=p.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[Ye],p==null||(n=p.classNames)==null?void 0:n[Ye]),"data-sonner-toast":"","data-rich-colors":(ss=p.richColors)!=null?ss:A,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":ne,"data-promise":!!p.promise,"data-swiped":De,"data-removed":J,"data-visible":tt,"data-y-position":Mn,"data-x-position":mo,"data-index":S,"data-front":Pt,"data-swiping":we,"data-dismissible":At,"data-type":Ye,"data-invert":Zs,"data-swipe-out":le,"data-swipe-direction":j,"data-expanded":!!(P||W&&ne),"data-testid":p.testId,style:{"--index":S,"--toasts-before":S,"--z-index":T.length-S,"--offset":`${J?Qe:wn.current}px`,"--initial-height":W?"auto":`${qt}px`,...L,...p.style},onDragEnd:()=>{oe(!1),H(null),Ks.current=null},onPointerDown:Ke=>{Ke.button!==2&&(rs||!At||(Be.current=new Date,dt(wn.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(oe(!0),Ks.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,It,Ut;if(le||!At)return;Ks.current=null;const bn=Number(((Ke=ot.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),jr=Number(((It=ot.current)==null?void 0:It.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Yt=new Date().getTime()-((Ut=Be.current)==null?void 0:Ut.getTime()),an=te==="x"?bn:jr,qs=Math.abs(an)/Yt;if(Math.abs(an)>=U$||qs>.11){dt(wn.current),p.onDismiss==null||p.onDismiss.call(p,p),Y(te==="x"?bn>0?"right":"left":jr>0?"down":"up"),gn(),Fe(!0);return}else{var ln,Wn;(ln=ot.current)==null||ln.style.setProperty("--swipe-amount-x","0px"),(Wn=ot.current)==null||Wn.style.setProperty("--swipe-amount-y","0px")}Pe(!1),oe(!1),H(null)},onPointerMove:Ke=>{var It,Ut,bn;if(!Ks.current||!At||((It=window.getSelection())==null?void 0:It.toString().length)>0)return;const Yt=Ke.clientY-Ks.current.y,an=Ke.clientX-Ks.current.x;var qs;const ln=(qs=t.swipeDirections)!=null?qs:W$(q);!te&&(Math.abs(an)>1||Math.abs(Yt)>1)&&H(Math.abs(an)>Math.abs(Yt)?"x":"y");let Wn={x:0,y:0};const ks=fr=>1/(1.5+Math.abs(fr)/20);if(te==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&Yt<0||ln.includes("bottom")&&Yt>0)Wn.y=Yt;else{const fr=Yt*ks(Yt);Wn.y=Math.abs(fr)<Math.abs(Yt)?fr:Yt}}else if(te==="x"&&(ln.includes("left")||ln.includes("right")))if(ln.includes("left")&&an<0||ln.includes("right")&&an>0)Wn.x=an;else{const fr=an*ks(an);Wn.x=Math.abs(fr)<Math.abs(an)?fr:an}(Math.abs(Wn.x)>0||Math.abs(Wn.y)>0)&&Pe(!0),(Ut=ot.current)==null||Ut.style.setProperty("--swipe-amount-x",`${Wn.x}px`),(bn=ot.current)==null||bn.style.setProperty("--swipe-amount-y",`${Wn.y}px`)}},Lr&&!p.jsx&&Ye!=="loading"?ve.createElement("button",{"aria-label":$,"data-disabled":rs,"data-close-button":!0,onClick:rs||!At?()=>{}:()=>{gn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ti(G==null?void 0:G.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Si=K==null?void 0:K.close)!=null?Si:A$):null,(Ye||p.icon||p.promise)&&p.icon!==null&&((K==null?void 0:K[Ye])!==null||p.icon)?ve.createElement("div",{"data-icon":"",className:ti(G==null?void 0:G.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||go():null,p.type!=="loading"?Dr:null):null,ve.createElement("div",{"data-content":"",className:ti(G==null?void 0:G.content,p==null||(i=p.classNames)==null?void 0:i.content)},ve.createElement("div",{"data-title":"",className:ti(G==null?void 0:G.title,p==null||(a=p.classNames)==null?void 0:a.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ve.createElement("div",{"data-description":"",className:ti(D,In,G==null?void 0:G.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),ve.isValidElement(p.cancel)?p.cancel:p.cancel&&op(p.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:Ke=>{op(p.cancel)&&At&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ke),gn())},className:ti(G==null?void 0:G.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,ve.isValidElement(p.action)?p.action:p.action&&op(p.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||M,onClick:Ke=>{op(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ke),!Ke.defaultPrevented&&gn())},className:ti(G==null?void 0:G.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function F4(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function K$(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",c=i?$$:V$;function u(f){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${a}-${f}`]=c:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):u(c)}),n}const Z$=ve.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:u,className:f,offset:h,mobileOffset:p,theme:m="light",richColors:_,duration:x,style:y,visibleToasts:w=F$,toastOptions:S,dir:T=F4(),gap:P=z$,icons:k,containerAriaLabel:A="Notifications"}=e,[O,L]=ve.useState([]),R=ve.useMemo(()=>r?O.filter(ne=>ne.toasterId===r):O.filter(ne=>!ne.toasterId),[O,r]),M=ve.useMemo(()=>Array.from(new Set([i].concat(R.filter(ne=>ne.position).map(ne=>ne.position)))),[R,i]),[N,D]=ve.useState([]),[F,q]=ve.useState(!1),[X,W]=ve.useState(!1),[G,K]=ve.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ve.useRef(null),te=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=ve.useRef(null),j=ve.useRef(!1),Y=ve.useCallback(ne=>{L(ie=>{var J;return(J=ie.find(ce=>ce.id===ne.id))!=null&&J.delete||Sr.dismiss(ne.id),ie.filter(({id:ce})=>ce!==ne.id)})},[]);return ve.useEffect(()=>Sr.subscribe(ne=>{if(ne.dismiss){requestAnimationFrame(()=>{L(ie=>ie.map(J=>J.id===ne.id?{...J,delete:!0}:J))});return}setTimeout(()=>{w$.flushSync(()=>{L(ie=>{const J=ie.findIndex(ce=>ce.id===ne.id);return J!==-1?[...ie.slice(0,J),{...ie[J],...ne},...ie.slice(J+1)]:[ne,...ie]})})})}),[O]),ve.useEffect(()=>{if(m!=="system"){K(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:ie})=>{K(ie?"dark":"light")})}catch{ne.addListener(({matches:J})=>{try{K(J?"dark":"light")}catch(ce){console.error(ce)}})}},[m]),ve.useEffect(()=>{O.length<=1&&q(!1)},[O]),ve.useEffect(()=>{const ne=ie=>{var J;if(a.every(oe=>ie[oe]||ie.code===oe)){var we;q(!0),(we=$.current)==null||we.focus()}ie.code==="Escape"&&(document.activeElement===$.current||(J=$.current)!=null&&J.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[a]),ve.useEffect(()=>{if($.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,j.current=!1)}},[$.current]),ve.createElement("section",{ref:n,"aria-label":`${A} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((ne,ie)=>{var J;const[ce,we]=ne.split("-");return R.length?ve.createElement("ol",{key:ne,dir:T==="auto"?F4():T,tabIndex:-1,ref:$,className:f,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":ce,"data-x-position":we,style:{"--front-toast-height":`${((J=N[0])==null?void 0:J.height)||0}px`,"--width":`${H$}px`,"--gap":`${P}px`,...y,...K$(h,p)},onBlur:oe=>{j.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(j.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||j.current||(j.current=!0,H.current=oe.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{X||q(!1)},onDragEnd:()=>q(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},R.filter(oe=>!oe.position&&ie===0||oe.position===ne).map((oe,le)=>{var Fe,De;return ve.createElement(G$,{key:oe.id,icons:k,index:le,toast:oe,defaultRichColors:_,duration:(Fe=S==null?void 0:S.duration)!=null?Fe:x,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:s,visibleToasts:w,closeButton:(De=S==null?void 0:S.closeButton)!=null?De:u,interacting:X,position:ne,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:Y,toasts:R.filter(Pe=>Pe.position==oe.position),heights:N.filter(Pe=>Pe.position==oe.position),setHeights:D,expandByDefault:c,gap:P,expanded:F,swipeDirections:e.swipeDirections})})):null}))});var q$=Object.defineProperty,du=(t,e)=>q$(t,"name",{value:e,configurable:!0}),CT=!!(typeof window<"u"&&window.document&&window.document.createElement);function Nt(t,e,{checkForDefaultPrevented:n=!0}={}){return du(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}du(Nt,"composeEventHandlers");function Y$(t){var e;if(!CT)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}du(Y$,"getOwnerWindow");function x_(t){if(!CT)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}du(x_,"getOwnerDocument");function kT(t,e=!1){const{activeElement:n}=x_(t);if(!(n!=null&&n.nodeName))return null;if(PT(n)&&n.contentDocument)return kT(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=x_(n).getElementById(r);if(s)return s}}return n}du(kT,"getActiveElement");function PT(t){return t.tagName==="IFRAME"}du(PT,"isFrame");var X$=Object.defineProperty,px=(t,e)=>X$(t,"name",{value:e,configurable:!0});function w_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}px(w_,"setRef");function TT(...t){return e=>{let n=!1;const r=t.map(s=>{const i=w_(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():w_(t[s],null)}}}}px(TT,"composeRefs");function jt(...t){return v.useCallback(TT(...t),t)}px(jt,"useComposedRefs");var Q$=Object.defineProperty,vs=(t,e)=>Q$(t,"name",{value:e,configurable:!0});function J$(t,e){const n=v.createContext(e);n.displayName=t+"Context";const r=vs(i=>{const{children:a,...c}=i,u=v.useMemo(()=>c,Object.values(c));return E.jsx(n.Provider,{value:u,children:a})},"Provider");r.displayName=t+"Provider";function s(i,a={}){const{optional:c=!1}=a,u=v.useContext(n);if(u)return u;if(e!==void 0)return e;if(!c)throw new Error(`\`${i}\` must be used within \`${t}\``)}return vs(s,"useContext"),[r,s]}vs(J$,"createContext");function xi(t,e=[]){let n=[];function r(i,a){const c=v.createContext(a);c.displayName=i+"Context";const u=n.length;n=[...n,a];const f=vs(p=>{var S;const{scope:m,children:_,...x}=p,y=((S=m==null?void 0:m[t])==null?void 0:S[u])||c,w=v.useMemo(()=>x,Object.values(x));return E.jsx(y.Provider,{value:w,children:_})},"Provider");f.displayName=i+"Provider";function h(p,m,_={}){var S;const{optional:x=!1}=_,y=((S=m==null?void 0:m[t])==null?void 0:S[u])||c,w=v.useContext(y);if(w)return w;if(a!==void 0)return a;if(!x)throw new Error(`\`${p}\` must be used within \`${i}\``)}return vs(h,"useContext"),[f,h]}vs(r,"createContext");const s=vs(()=>{const i=n.map(a=>v.createContext(a));return vs(function(c){const u=(c==null?void 0:c[t])||i;return v.useMemo(()=>({[`__scope${t}`]:{...c,[t]:u}}),[c,u])},"useScope")},"createScope");return s.scopeName=t,[r,RT(s,...e)]}vs(xi,"createContextScope");function RT(...t){const e=t[0];if(t.length===1)return e;const n=vs(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return vs(function(i){const a=r.reduce((c,{useScope:u,scopeName:f})=>{const p=u(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}vs(RT,"composeContextScopes");var Pr=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},eH=Object.defineProperty,tH=(t,e)=>eH(t,"name",{value:e,configurable:!0}),nH=xf[" useId ".trim().toString()]||(()=>{}),rH=0;function ea(t){const[e,n]=v.useState(nH());return Pr(()=>{t||n(r=>r??String(rH++))},[t]),t||(e?`radix-${e}`:"")}tH(ea,"useId");var sH=Object.defineProperty,iH=(t,e)=>sH(t,"name",{value:e,configurable:!0}),V4=xf[" useEffectEvent ".trim().toString()],$4=xf[" useInsertionEffect ".trim().toString()];function AT(t){if(typeof V4=="function")return V4(t);const e=v.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof $4=="function"?$4(()=>{e.current=t}):Pr(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}iH(AT,"useEffectEvent");var oH=Object.defineProperty,kf=(t,e)=>oH(t,"name",{value:e,configurable:!0}),aH=xf[" useInsertionEffect ".trim().toString()]||Pr;function ma({prop:t,defaultProp:e,onChange:n=kf(()=>{},"onChange"),caller:r}){const[s,i,a]=IT({defaultProp:e,onChange:n}),c=t!==void 0,u=c?t:s,f=v.useCallback(h=>{var p;if(c){const m=MT(h)?h(t):h;m!==t&&((p=a.current)==null||p.call(a,m))}else i(h)},[c,t,i,a]);return[u,f]}kf(ma,"useControllableState");function IT({defaultProp:t,onChange:e}){const[n,r]=v.useState(t),s=v.useRef(n),i=v.useRef(e);return aH(()=>{i.current=e},[e]),v.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}kf(IT,"useUncontrolledState");function MT(t){return typeof t=="function"}kf(MT,"isFunction");var H4=Symbol("RADIX:SYNC_STATE");function lH(t,e,n,r){const{prop:s,defaultProp:i,onChange:a,caller:c}=e,u=s!==void 0,f=AT(a),h=[{...n,state:i}];r&&h.push(r);const[p,m]=v.useReducer((w,S)=>{if(S.type===H4)return{...w,state:S.state};const T=t(w,S);return u&&!Object.is(T.state,w.state)&&f(T.state),T},...h),_=p.state,x=v.useRef(_);v.useEffect(()=>{x.current!==_&&(x.current=_,u||f(_))},[_,x,u]);const y=v.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return v.useEffect(()=>{u&&!Object.is(s,p.state)&&m({type:H4,state:s})},[s,p.state,u]),[y,m]}kf(lH,"useControllableStateReducer");var cH=Object.defineProperty,Bs=(t,e)=>cH(t,"name",{value:e,configurable:!0});function la(t){const e=v.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,c=!1;const u=[];b_(s)&&typeof ap=="function"&&(s=ap(s._payload)),v.Children.forEach(s,m=>{var _;if(jT(m)){c=!0;const x=m;let y="child"in x.props?x.props.child:x.props.children;b_(y)&&typeof ap=="function"&&(y=ap(y._payload)),a=uH(x,y),u.push((_=a==null?void 0:a.props)==null?void 0:_.children)}else u.push(m)}),a?a=v.cloneElement(a,void 0,u):!c&&v.Children.count(s)===1&&v.isValidElement(s)&&(a=s);const f=a?DT(a):void 0,h=jt(r,f);if(!a){if(s||s===0)throw new Error(c?hH(t):fH(t));return s}const p=NT(i,a.props??{});return a.type!==v.Fragment&&(p.ref=r?h:f),v.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}Bs(la,"createSlot");var OT=Symbol.for("radix.slottable");function LT(t){const e=Bs(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=OT,e}Bs(LT,"createSlottable");var uH=Bs((t,e)=>{if("child"in t.props){const n=t.props.child;return v.isValidElement(n)?v.cloneElement(n,void 0,t.props.children(n.props.children)):null}return v.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function NT(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const u=i(...c);return s(...c),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}Bs(NT,"mergeProps");function DT(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Bs(DT,"getElementRef");function jT(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===OT}Bs(jT,"isSlottable");var dH=Symbol.for("react.lazy");function b_(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===dH&&"_payload"in t&&FT(t._payload)}Bs(b_,"isLazyComponent");function FT(t){return typeof t=="object"&&t!==null&&"then"in t}Bs(FT,"isPromiseLike");var fH=Bs(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),hH=Bs(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ap=xf[" use ".trim().toString()],pH=Object.defineProperty,mH=(t,e)=>pH(t,"name",{value:e,configurable:!0}),gH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],on=gH.reduce((t,e)=>{const n=la(`Primitive.${e}`),r=v.forwardRef((s,i)=>{const{asChild:a,...c}=s,u=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function VT(t,e){t&&u0.flushSync(()=>t.dispatchEvent(e))}mH(VT,"dispatchDiscreteCustomEvent");var vH=Object.defineProperty,yH=(t,e)=>vH(t,"name",{value:e,configurable:!0});function kl(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}yH(kl,"useCallbackRef");var _H=Object.defineProperty,Pn=(t,e)=>_H(t,"name",{value:e,configurable:!0}),S_="dismissableLayer.update",xH="dismissableLayer.pointerDownOutside",wH="dismissableLayer.focusOutside",z4,$T=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),mx=v.forwardRef(Pn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,onDismiss:f,...h}=e,p=v.useContext($T),[m,_]=v.useState(null),x=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=v.useState({}),w=jt(n,_),S=Array.from(p.layers),[T]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),P=T?S.indexOf(T):-1,k=m?S.indexOf(m):-1,A=p.layersWithOutsidePointerEventsDisabled.size>0,O=k>=P,L=v.useRef(!1),R=zT(F=>{a==null||a(F),u==null||u(F),F.defaultPrevented||f==null||f()},{ownerDocument:x,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:L,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(F=>{if(!(F instanceof Node))return!1;const q=[...p.branches].some(X=>X.contains(F));return O&&!q},[p.branches,O])}),M=UT(F=>{if(s&&L.current)return;const q=F.target;[...p.branches].some(W=>W.contains(q))||(c==null||c(F),u==null||u(F),F.defaultPrevented||f==null||f())},x),N=m?k===S.length-1:!1,D=kl(F=>{F.key==="Escape"&&(i==null||i(F),!F.defaultPrevented&&f&&(F.preventDefault(),f()))});return v.useEffect(()=>{if(N)return x.addEventListener("keydown",D,{capture:!0}),()=>x.removeEventListener("keydown",D,{capture:!0})},[x,N,D]),v.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(z4=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),E_(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=z4))}},[m,x,r,p]),v.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),E_())},[m,p]),v.useEffect(()=>{const F=Pn(()=>y({}),"handleUpdate");return document.addEventListener(S_,F),()=>document.removeEventListener(S_,F)},[]),E.jsx(on.div,{...h,ref:w,style:{pointerEvents:A?O?"auto":"none":void 0,...e.style},onFocusCapture:Nt(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Nt(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Nt(e.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function HT(){const t=v.useContext($T),[e,n]=v.useState(null);return v.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Pn(HT,"useDismissableLayerSurface");var bH=Pn(()=>!0,"IS_TRUE");function zT(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=bH}=e,c=kl(t),u=v.useRef(!1),f=v.useRef(!1),h=v.useRef(new Map),p=v.useRef(()=>{});return v.useEffect(()=>{function m(){f.current=!1,s.current=!1,h.current.clear()}Pn(m,"resetOutsideInteraction");function _(){return Array.from(h.current.values()).some(Boolean)}Pn(_,"isOutsideInteractionIntercepted");function x(P){if(!f.current)return;const k=P.target;k instanceof Node&&[...i].some(O=>O.contains(k))||h.current.set(P.type,!0),P.type==="click"&&window.setTimeout(()=>{f.current&&p.current()},0)}Pn(x,"handleInteractionCapture");function y(P){f.current&&h.current.set(P.type,!1)}Pn(y,"handleInteractionBubble");const w=Pn(P=>{if(P.target&&!u.current){let k=function(){n.removeEventListener("click",p.current);const O=_();m(),O||gx(xH,c,A,{discrete:!0})};if(Pn(k,"handleAndDispatchPointerDownOutsideEvent"),!a(P.target)){n.removeEventListener("click",p.current),m(),u.current=!1;return}const A={originalEvent:P};f.current=!0,s.current=r&&P.button===0,h.current.clear(),!r||P.button!==0?k():(n.removeEventListener("click",p.current),p.current=k,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();u.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const P of S)n.addEventListener(P,x,!0),n.addEventListener(P,y);const T=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(T),n.removeEventListener("pointerdown",w),n.removeEventListener("click",p.current);for(const P of S)n.removeEventListener(P,x,!0),n.removeEventListener(P,y)}},[n,c,r,s,i,a]),{onPointerDownCapture:Pn(()=>u.current=!0,"onPointerDownCapture")}}Pn(zT,"usePointerDownOutside");function UT(t,e=globalThis==null?void 0:globalThis.document){const n=kl(t),r=v.useRef(!1);return v.useEffect(()=>{const s=Pn(i=>{i.target&&!r.current&&gx(wH,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:Pn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Pn(()=>r.current=!1,"onBlurCapture")}}Pn(UT,"useFocusOutside");function E_(){const t=new CustomEvent(S_);document.dispatchEvent(t)}Pn(E_,"dispatchUpdate");function gx(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?VT(s,i):s.dispatchEvent(i)}Pn(gx,"handleAndDispatchCustomEvent");var SH=Object.defineProperty,cr=(t,e)=>SH(t,"name",{value:e,configurable:!0}),u1="focusScope.autoFocusOnMount",d1="focusScope.autoFocusOnUnmount",U4={bubbles:!1,cancelable:!0},BT=v.forwardRef(cr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...c}=e,[u,f]=v.useState(null),h=kl(i),p=kl(a),m=v.useRef(null),_=jt(n,f),x=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(s){let w=function(k){if(x.paused||!u)return;const A=k.target;u.contains(A)?m.current=A:Wi(m.current,{select:!0})},S=function(k){if(x.paused||!u)return;const A=k.relatedTarget;A!==null&&(u.contains(A)||Wi(m.current,{select:!0}))},T=function(k){if(document.activeElement===document.body)for(const O of k)O.removedNodes.length>0&&Wi(u)};cr(w,"handleFocusIn"),cr(S,"handleFocusOut"),cr(T,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",S);const P=new MutationObserver(T);return u&&P.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),P.disconnect()}}},[s,u,x.paused]),v.useEffect(()=>{if(u){B4.add(x);const w=document.activeElement;if(!u.contains(w)){const T=new CustomEvent(u1,U4);u.addEventListener(u1,h),u.dispatchEvent(T),T.defaultPrevented||(WT(YT(vx(u)),{select:!0}),document.activeElement===w&&Wi(u))}return()=>{u.removeEventListener(u1,h),setTimeout(()=>{const T=new CustomEvent(d1,U4);u.addEventListener(d1,p),u.dispatchEvent(T),T.defaultPrevented||Wi(w??document.body,{select:!0}),u.removeEventListener(d1,p),B4.remove(x)},0)}}},[u,h,p,x]);const y=v.useCallback(w=>{if(!r&&!s||x.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,T=document.activeElement;if(S&&T){const P=w.currentTarget,[k,A]=GT(P);k&&A?!w.shiftKey&&T===A?(w.preventDefault(),r&&Wi(k,{select:!0})):w.shiftKey&&T===k&&(w.preventDefault(),r&&Wi(A,{select:!0})):T===P&&w.preventDefault()}},[r,s,x.paused]);return E.jsx(on.div,{tabIndex:-1,...c,ref:_,onKeyDown:y})},"FocusScope"));function WT(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Wi(r,{select:e}),document.activeElement!==n)return}cr(WT,"focusFirst");function GT(t){const e=vx(t),n=C_(e,t),r=C_(e.reverse(),t);return[n,r]}cr(GT,"getTabbableEdges");function vx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:cr(r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}cr(vx,"getTabbableCandidates");function C_(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):KT(r,{upTo:e})))return r}cr(C_,"findVisible");function KT(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}cr(KT,"isHidden");function ZT(t){return t instanceof HTMLInputElement&&"select"in t}cr(ZT,"isSelectableInput");function Wi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&ZT(t)&&e&&t.select()}}cr(Wi,"focus");var B4=qT();function qT(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=k_(t,e),t.unshift(e)},remove(e){var n;t=k_(t,e),(n=t[0])==null||n.resume()}}}cr(qT,"createFocusScopesStack");function k_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}cr(k_,"arrayRemove");function YT(t){return t.filter(e=>e.tagName!=="A")}cr(YT,"removeLinks");var EH=Object.defineProperty,CH=(t,e)=>EH(t,"name",{value:e,configurable:!0}),yx=v.forwardRef(CH(function(e,n){var u;const{container:r,...s}=e,[i,a]=v.useState(!1);Pr(()=>a(!0),[]);const c=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?u0.createPortal(E.jsx(on.div,{...s,ref:n}),c):null},"Portal")),kH=Object.defineProperty,ao=(t,e)=>kH(t,"name",{value:e,configurable:!0});function XT(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}ao(XT,"useStateMachine");var ga=ao(t=>{const{present:e,children:n}=t,r=QT(e),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=JT(r.ref,e5(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:i}):null},"Presence");function QT(t){const[e,n]=v.useState(),r=v.useRef(null),s=v.useRef(t),i=v.useRef("none"),a=v.useRef(void 0),c=t?"mounted":"unmounted",[u,f]=XT(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{u==="mounted"?(i.current=a.current??vc(r.current),a.current=void 0):i.current="none"},[u]),Pr(()=>{const h=r.current,p=s.current;if(p!==t){const _=i.current,x=vc(h);t?(a.current=x,f("MOUNT")):x==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(p&&_!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,f]),Pr(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,m=ao(x=>{const w=vc(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&w&&(f("ANIMATION_END"),!s.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},"handleAnimationEnd"),_=ao(x=>{x.target===e&&(i.current=vc(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",_),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",_),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:v.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,a.current=vc(p)}else r.current=null;n(h)},[])}}ao(QT,"usePresence");function P_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}ao(P_,"setRef");function JT(...t){const e=v.useRef(t);return e.current=t,v.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(a=>{const c=P_(a,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let a=0;a<i.length;a++){const c=i[a];typeof c=="function"?c():P_(r[a],null)}}},[])}ao(JT,"useStableComposedRefs");function vc(t){return(t==null?void 0:t.animationName)||"none"}ao(vc,"getAnimationName");function e5(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}ao(e5,"getElementRef");var PH=Object.defineProperty,_x=(t,e)=>PH(t,"name",{value:e,configurable:!0}),lp=0,ni=null;function TH(t){return d0(),t.children}_x(TH,"FocusGuards");function d0(){v.useEffect(()=>{ni||(ni={start:T_(),end:T_()});const{start:t,end:e}=ni;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),lp++,()=>{lp===1&&(ni==null||ni.start.remove(),ni==null||ni.end.remove(),ni=null),lp=Math.max(0,lp-1)}},[])}_x(d0,"useFocusGuards");function T_(){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}_x(T_,"createFocusGuard");var ui=function(){return ui=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},ui.apply(this,arguments)};function t5(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function RH(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var Fp="right-scroll-bar-position",Vp="width-before-scroll-bar",AH="with-scroll-bars-hidden",IH="--removed-body-scroll-bar-size";function f1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function MH(t,e){var n=v.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var OH=typeof window<"u"?v.useLayoutEffect:v.useEffect,W4=new WeakMap;function LH(t,e){var n=MH(null,function(r){return t.forEach(function(s){return f1(s,r)})});return OH(function(){var r=W4.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(c){i.has(c)||f1(c,null)}),i.forEach(function(c){s.has(c)||f1(c,a)})}W4.set(n,t)},[t]),n}function NH(t){return t}function DH(t,e){e===void 0&&(e=NH);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var a=e(i,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(i),a=n}var u=function(){var h=a;a=[],h.forEach(i)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(h){a.push(h),f()},filter:function(h){return a=a.filter(h),n}}}};return s}function jH(t){t===void 0&&(t={});var e=DH(null);return e.options=ui({async:!0,ssr:!1},t),e}var n5=function(t){var e=t.sideCar,n=t5(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,ui({},n))};n5.isSideCarExport=!0;function FH(t,e){return t.useMedium(e),n5}var r5=jH(),h1=function(){},f0=v.forwardRef(function(t,e){var n=v.useRef(null),r=v.useState({onScrollCapture:h1,onWheelCapture:h1,onTouchMoveCapture:h1}),s=r[0],i=r[1],a=t.forwardProps,c=t.children,u=t.className,f=t.removeScrollBar,h=t.enabled,p=t.shards,m=t.sideCar,_=t.noRelative,x=t.noIsolation,y=t.inert,w=t.allowPinchZoom,S=t.as,T=S===void 0?"div":S,P=t.gapMode,k=t5(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=m,O=LH([n,e]),L=ui(ui({},k),s);return v.createElement(v.Fragment,null,h&&v.createElement(A,{sideCar:r5,removeScrollBar:f,shards:p,noRelative:_,noIsolation:x,inert:y,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:P}),a?v.cloneElement(v.Children.only(c),ui(ui({},L),{ref:O})):v.createElement(T,ui({},L,{className:u,ref:O}),c))});f0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};f0.classNames={fullWidth:Vp,zeroRight:Fp};var VH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $H(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=VH();return e&&t.setAttribute("nonce",e),t}function HH(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function zH(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var UH=function(){var t=0,e=null;return{add:function(n){t==0&&(e=$H())&&(HH(e,n),zH(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},BH=function(){var t=UH();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},s5=function(){var t=BH(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},WH={left:0,top:0,right:0,gap:0},p1=function(t){return parseInt(t||"",10)||0},GH=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[p1(n),p1(r),p1(s)]},KH=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return WH;var e=GH(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])}},ZH=s5(),Pc="data-scroll-locked",qH=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,c=t.gap;return n===void 0&&(n="margin"),`
71
+ .`.concat(AH,` {
72
+ overflow: hidden `).concat(r,`;
73
+ padding-right: `).concat(c,"px ").concat(r,`;
74
+ }
75
+ body[`).concat(Pc,`] {
76
+ overflow: hidden `).concat(r,`;
77
+ overscroll-behavior: contain;
78
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
79
+ padding-left: `.concat(s,`px;
80
+ padding-top: `).concat(i,`px;
81
+ padding-right: `).concat(a,`px;
82
+ margin-left:0;
83
+ margin-top:0;
84
+ margin-right: `).concat(c,"px ").concat(r,`;
85
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
86
+ }
87
+
88
+ .`).concat(Fp,` {
89
+ right: `).concat(c,"px ").concat(r,`;
90
+ }
91
+
92
+ .`).concat(Vp,` {
93
+ margin-right: `).concat(c,"px ").concat(r,`;
94
+ }
95
+
96
+ .`).concat(Fp," .").concat(Fp,` {
97
+ right: 0 `).concat(r,`;
98
+ }
99
+
100
+ .`).concat(Vp," .").concat(Vp,` {
101
+ margin-right: 0 `).concat(r,`;
102
+ }
103
+
104
+ body[`).concat(Pc,`] {
105
+ `).concat(IH,": ").concat(c,`px;
106
+ }
107
+ `)},G4=function(){var t=parseInt(document.body.getAttribute(Pc)||"0",10);return isFinite(t)?t:0},YH=function(){v.useEffect(function(){return document.body.setAttribute(Pc,(G4()+1).toString()),function(){var t=G4()-1;t<=0?document.body.removeAttribute(Pc):document.body.setAttribute(Pc,t.toString())}},[])},XH=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;YH();var i=v.useMemo(function(){return KH(s)},[s]);return v.createElement(ZH,{styles:qH(i,!e,s,n?"":"!important")})},R_=!1;if(typeof window<"u")try{var cp=Object.defineProperty({},"passive",{get:function(){return R_=!0,!0}});window.addEventListener("test",cp,cp),window.removeEventListener("test",cp,cp)}catch{R_=!1}var ac=R_?{passive:!1}:!1,QH=function(t){return t.tagName==="TEXTAREA"},i5=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!QH(t)&&n[e]==="visible")},JH=function(t){return i5(t,"overflowY")},ez=function(t){return i5(t,"overflowX")},K4=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=o5(t,r);if(s){var i=a5(t,r),a=i[1],c=i[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},tz=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},nz=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},o5=function(t,e){return t==="v"?JH(e):ez(e)},a5=function(t,e){return t==="v"?tz(e):nz(e)},rz=function(t,e){return t==="h"&&e==="rtl"?-1:1},sz=function(t,e,n,r,s){var i=rz(t,window.getComputedStyle(e).direction),a=i*r,c=n.target,u=e.contains(c),f=!1,h=a>0,p=0,m=0;do{if(!c)break;var _=a5(t,c),x=_[0],y=_[1],w=_[2],S=y-w-i*x;(x||S)&&o5(t,c)&&(p+=S,m+=x);var T=c.parentNode;c=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!u&&c!==document.body||u&&(e.contains(c)||e===c));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(f=!0),f},up=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Z4=function(t){return[t.deltaX,t.deltaY]},q4=function(t){return t&&"current"in t?t.current:t},iz=function(t,e){return t[0]===e[0]&&t[1]===e[1]},oz=function(t){return`
108
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
109
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
110
+ `)},az=0,lc=[];function lz(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(az++)[0],i=v.useState(s5)[0],a=v.useRef(t);v.useEffect(function(){a.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var y=RH([t.lockRef.current],(t.shards||[]).map(q4),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var c=v.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var S=up(y),T=n.current,P="deltaX"in y?y.deltaX:T[0]-S[0],k="deltaY"in y?y.deltaY:T[1]-S[1],A,O=y.target,L=Math.abs(P)>Math.abs(k)?"h":"v";if("touches"in y&&L==="h"&&O.type==="range")return!1;var R=window.getSelection(),M=R&&R.anchorNode,N=M?M===O||M.contains(O):!1;if(N)return!1;var D=K4(L,O);if(!D)return!0;if(D?A=L:(A=L==="v"?"h":"v",D=K4(L,O)),!D)return!1;if(!r.current&&"changedTouches"in y&&(P||k)&&(r.current=A),!A)return!0;var F=r.current||A;return sz(F,w,y,F==="h"?P:k)},[]),u=v.useCallback(function(y){var w=y;if(!(!lc.length||lc[lc.length-1]!==i)){var S="deltaY"in w?Z4(w):up(w),T=e.current.filter(function(A){return A.name===w.type&&(A.target===w.target||w.target===A.shadowParent)&&iz(A.delta,S)})[0];if(T&&T.should){w.cancelable&&w.preventDefault();return}if(!T){var P=(a.current.shards||[]).map(q4).filter(Boolean).filter(function(A){return A.contains(w.target)}),k=P.length>0?c(w,P[0]):!a.current.noIsolation;k&&w.cancelable&&w.preventDefault()}}},[]),f=v.useCallback(function(y,w,S,T){var P={name:y,delta:w,target:S,should:T,shadowParent:cz(S)};e.current.push(P),setTimeout(function(){e.current=e.current.filter(function(k){return k!==P})},1)},[]),h=v.useCallback(function(y){n.current=up(y),r.current=void 0},[]),p=v.useCallback(function(y){f(y.type,Z4(y),y.target,c(y,t.lockRef.current))},[]),m=v.useCallback(function(y){f(y.type,up(y),y.target,c(y,t.lockRef.current))},[]);v.useEffect(function(){return lc.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,ac),document.addEventListener("touchmove",u,ac),document.addEventListener("touchstart",h,ac),function(){lc=lc.filter(function(y){return y!==i}),document.removeEventListener("wheel",u,ac),document.removeEventListener("touchmove",u,ac),document.removeEventListener("touchstart",h,ac)}},[]);var _=t.removeScrollBar,x=t.inert;return v.createElement(v.Fragment,null,x?v.createElement(i,{styles:oz(s)}):null,_?v.createElement(XH,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function cz(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const uz=FH(r5,lz);var xx=v.forwardRef(function(t,e){return v.createElement(f0,ui({},t,{ref:e,sideCar:uz}))});xx.classNames=f0.classNames;var dz=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},cc=new WeakMap,dp=new WeakMap,fp={},m1=0,l5=function(t){return t&&(t.host||l5(t.parentNode))},fz=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=l5(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},hz=function(t,e,n,r){var s=fz(e,Array.isArray(t)?t:[t]);fp[n]||(fp[n]=new WeakMap);var i=fp[n],a=[],c=new Set,u=new Set(s),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};s.forEach(f);var h=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(m){if(c.has(m))h(m);else try{var _=m.getAttribute(r),x=_!==null&&_!=="false",y=(cc.get(m)||0)+1,w=(i.get(m)||0)+1;cc.set(m,y),i.set(m,w),a.push(m),y===1&&x&&dp.set(m,!0),w===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return h(e),c.clear(),m1++,function(){a.forEach(function(p){var m=cc.get(p)-1,_=i.get(p)-1;cc.set(p,m),i.set(p,_),m||(dp.has(p)||p.removeAttribute(r),dp.delete(p)),_||p.removeAttribute(n)}),m1--,m1||(cc=new WeakMap,cc=new WeakMap,dp=new WeakMap,fp={})}},c5=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=dz(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),hz(r,s,n,"aria-hidden")):function(){return null}},pz=Object.defineProperty,Ws=(t,e)=>pz(t,"name",{value:e,configurable:!0}),wx="Dialog",[u5,NJ]=xi(wx),[mz,ho]=u5(wx),bx=Ws(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,c=v.useRef(null),u=v.useRef(null),[f,h]=ma({prop:r,defaultProp:s??!1,onChange:i,caller:wx}),[p,m]=v.useState(0),[_,x]=v.useState(0);return E.jsx(mz,{scope:e,triggerRef:c,contentRef:u,contentId:ea(),titleId:ea(),descriptionId:ea(),titlePresent:p>0,descriptionPresent:_>0,setTitleCount:m,setDescriptionCount:x,open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(y=>!y),[h]),modal:a,children:n})},"Dialog"),d5="DialogPortal",[gz,f5]=u5(d5,{forceMount:void 0}),Sx=Ws(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=ho(d5,e);return E.jsx(gz,{scope:e,forceMount:n,children:v.Children.map(r,a=>E.jsx(ga,{present:n||i.open,children:E.jsx(yx,{asChild:!0,container:s,children:a})}))})},"DialogPortal"),A_="DialogOverlay",Ex=v.forwardRef(Ws(function(e,n){const r=f5(A_,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=ho(A_,e.__scopeDialog);return a.modal?E.jsx(ga,{present:s||a.open,children:E.jsx(yz,{...i,ref:n})}):null},"DialogOverlay")),vz=la("DialogOverlay.RemoveScroll"),yz=v.forwardRef(Ws(function(e,n){const{__scopeDialog:r,...s}=e,i=ho(A_,r),a=HT(),c=jt(n,a);return E.jsx(xx,{as:vz,allowPinchZoom:!0,shards:[i.contentRef],children:E.jsx(on.div,{"data-state":Tx(i.open),...s,ref:c,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Zd="DialogContent",Cx=v.forwardRef(Ws(function(e,n){const r=f5(Zd,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=ho(Zd,e.__scopeDialog);return E.jsx(ga,{present:s||a.open,children:a.modal?E.jsx(_z,{...i,ref:n}):E.jsx(xz,{...i,ref:n})})},"DialogContent")),_z=v.forwardRef(Ws(function(e,n){const r=ho(Zd,e.__scopeDialog),s=v.useRef(null),i=jt(n,r.contentRef,s);return v.useEffect(()=>{const a=s.current;if(a)return c5(a)},[]),E.jsx(h5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Nt(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Nt(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&a.preventDefault()}),onFocusOutside:Nt(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),xz=v.forwardRef(Ws(function(e,n){const r=ho(Zd,e.__scopeDialog),s=v.useRef(!1),i=v.useRef(!1);return E.jsx(h5,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"DialogContentNonModal")),h5=v.forwardRef(Ws(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,...c}=e,u=ho(Zd,r);return d0(),E.jsx(E.Fragment,{children:E.jsx(BT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(mx,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":Tx(u.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),wz="DialogTitle",kx=v.forwardRef(Ws(function(e,n){const{__scopeDialog:r,...s}=e,i=ho(wz,r),{setTitleCount:a}=i;return Pr(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),E.jsx(on.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),bz="DialogDescription",Px=v.forwardRef(Ws(function(e,n){const{__scopeDialog:r,...s}=e,i=ho(bz,r),{setDescriptionCount:a}=i;return Pr(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),E.jsx(on.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function Tx(t){return t?"open":"closed"}Ws(Tx,"getState");const Sz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),v.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),Ez=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),v.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),Cz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),v.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),kz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),v.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),Pz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),v.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"}))]]),Tz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),v.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),Rz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),v.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]),Az=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),v.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),Iz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),v.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),Mz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),v.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),Oz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),v.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),Lz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),v.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z"}))]]),Nz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z",opacity:"0.2"}),v.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z"}))]]),Dz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M242.79,149.32,223.7,97.11A20,20,0,0,0,198.12,85.2l-61.31,22.22L147.7,45.18A20,20,0,0,0,131.55,22L76.87,12.31A19.94,19.94,0,0,0,53.76,28.55l-25,143.13A48,48,0,0,0,67.4,227.26a51.19,51.19,0,0,0,8.7.74H224a20,20,0,0,0,20-20V156.19A21.74,21.74,0,0,0,242.79,149.32ZM99,184.18a23.84,23.84,0,0,1-9.86,15.56,23.28,23.28,0,0,1-17.56,3.89,24,24,0,0,1-19.23-27.82L76.71,36.66,123.37,45,99,184.18Zm23.64,4.13,9.39-53.64,70.49-25.54,16.3,44.59-96.23,34.87C122.62,188.5,122.65,188.41,122.66,188.31ZM220,204H150.52L220,178.82ZM89.22,174.07l-1.4,8A12,12,0,0,1,76,192a12.35,12.35,0,0,1-2.08-.18,12,12,0,0,1-9.75-13.89l1.4-8a12,12,0,0,1,23.64,4.14Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M135.88,43.11l-25,143.14a35.71,35.71,0,0,1-41.34,29.2h0a36,36,0,0,1-28.95-41.71l25-143.13a8,8,0,0,1,9.19-6.49l54.67,9.73A8,8,0,0,1,135.88,43.11Z",opacity:"0.2"}),v.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M240,155.91a16,16,0,0,0-1-5.22L219.94,98.48A16,16,0,0,0,199.49,89l-67.81,24.57,12.08-69A16,16,0,0,0,130.84,26L76.17,16.25a15.94,15.94,0,0,0-18.47,13l-25,143.12A43.82,43.82,0,0,0,75.78,224H224a16,16,0,0,0,16-16ZM76,196a16,16,0,1,1,16-16A16,16,0,0,1,76,196Zm42.72-8.38,9.78-55.92L204.92,104,224,156.11,116.78,195A44.89,44.89,0,0,0,118.72,187.62ZM224,208H127.74L224,173.11Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M86,180a10,10,0,1,1-10-10A10,10,0,0,1,86,180Zm152-23.81V208a14,14,0,0,1-14,14H76a44.18,44.18,0,0,1-7.58-.65,42,42,0,0,1-33.81-48.64l25-143.13A13.94,13.94,0,0,1,75.82,18.22l54.67,9.72a14,14,0,0,1,11.3,16.21l-12.67,72.44,71-25.75a14,14,0,0,1,17.89,8.32l19.09,52.22A15.66,15.66,0,0,1,238,156.19Zm-133.07,29L130,42.08a2,2,0,0,0-1.58-2.32L73.72,30l-.34,0a1.84,1.84,0,0,0-1.07.35,2,2,0,0,0-.82,1.3l-25,143.13a30,30,0,0,0,24.09,34.76,29.25,29.25,0,0,0,22-4.89,29.81,29.81,0,0,0,12.33-19.44Zm8.25,13.17L224.71,158a2,2,0,0,0,1.11-1,1.86,1.86,0,0,0,.06-1.46l-19.09-52.21a2,2,0,0,0-2.53-1.17l-77.53,28.09-10,57.07A41.9,41.9,0,0,1,113.18,198.38ZM226,170.27,116.35,210H224a2,2,0,0,0,2-2Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M235.27,152.07,216.19,99.85a12,12,0,0,0-15.34-7.13l-74.3,26.92,13.27-75.83a12,12,0,0,0-9.68-13.9L75.47,20.19a11.75,11.75,0,0,0-8.89,2,11.9,11.9,0,0,0-4.94,7.77l-25,143.13A40,40,0,0,0,68.8,219.39,42.68,42.68,0,0,0,76,220H224a12,12,0,0,0,12-12V156.19A14,14,0,0,0,235.27,152.07Zm-31.7-51.83a4,4,0,0,1,5.1,2.36l19.09,52.21a3.9,3.9,0,0,1-.13,3,3.94,3.94,0,0,1-2.24,2L108.78,202.11a40,40,0,0,0,6-15.17L125,128.73ZM93.75,206.29a31.25,31.25,0,0,1-23.55,5.22,32,32,0,0,1-25.71-37.08l25-143.13a4,4,0,0,1,1.64-2.59A3.85,3.85,0,0,1,73.38,28a4,4,0,0,1,.69.06l54.67,9.73a4,4,0,0,1,3.2,4.64l-25,143.13h0A31.79,31.79,0,0,1,93.75,206.29ZM228,208a4,4,0,0,1-4,4H105l123-44.59ZM84,180a8,8,0,1,1-8-8A8,8,0,0,1,84,180Z"}))]]),jz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),v.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),Fz=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),v.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),Vz=v.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Un=v.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:c,weights:u,...f}=t,{color:h="currentColor",size:p,weight:m="regular",mirrored:_=!1,...x}=v.useContext(Vz);return v.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??h,viewBox:"0 0 256 256",transform:a||_?"scale(-1, 1)":void 0,...x,...f},!!n&&v.createElement("title",null,n),c,u.get(i??m))});Un.displayName="IconBase";const p5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Sz}));p5.displayName="ArrowLeftIcon";const $z=p5,m5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Ez}));m5.displayName="ArrowSquareOutIcon";const Hz=m5,g5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Cz}));g5.displayName="ArrowUpIcon";const zz=g5,v5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:kz}));v5.displayName="CaretDownIcon";const Uz=v5,y5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Pz}));y5.displayName="ChatCircleIcon";const Bz=y5,_5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Tz}));_5.displayName="CheckIcon";const x5=_5,w5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Rz}));w5.displayName="CircleNotchIcon";const h0=w5,b5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Az}));b5.displayName="CopyIcon";const qd=b5,S5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Iz}));S5.displayName="MagnifyingGlassIcon";const Wz=S5,E5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Mz}));E5.displayName="PencilSimpleIcon";const Gz=E5,C5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Oz}));C5.displayName="SidebarSimpleIcon";const Kz=C5,k5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Lz}));k5.displayName="SignOutIcon";const Zz=k5,P5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Nz}));P5.displayName="SparkleIcon";const g1=P5,T5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Dz}));T5.displayName="SwatchesIcon";const R5=T5,A5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:jz}));A5.displayName="TrashIcon";const qz=A5,I5=v.forwardRef((t,e)=>v.createElement(Un,{ref:e,...t,weights:Fz}));I5.displayName="XIcon";const M5=I5;function O5(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=O5(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Yz(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=O5(t))&&(r&&(r+=" "),r+=e);return r}const Xz=(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},Qz=(t,e)=>({classGroupId:t,validator:e}),L5=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Dm="-",Y4=[],Jz="arbitrary..",eU=t=>{const e=nU(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return tU(a);const c=a.split(Dm),u=c[0]===""&&c.length>1?1:0;return N5(c,u,e)},getConflictingClassGroupIds:(a,c)=>{if(c){const u=r[a],f=n[a];return u?f?Xz(f,u):u:f||Y4}return n[a]||Y4}}},N5=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const f=N5(t,e+1,i);if(f)return f}const a=n.validators;if(a===null)return;const c=e===0?t.join(Dm):t.slice(e).join(Dm),u=a.length;for(let f=0;f<u;f++){const h=a[f];if(h.validator(c))return h.classGroupId}},tU=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?Jz+r:void 0})(),nU=t=>{const{theme:e,classGroups:n}=t;return rU(n,e)},rU=(t,e)=>{const n=L5();for(const r in t){const s=t[r];Rx(s,n,r,e)}return n},Rx=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];sU(a,e,n,r)}},sU=(t,e,n,r)=>{if(typeof t=="string"){iU(t,e,n);return}if(typeof t=="function"){oU(t,e,n,r);return}aU(t,e,n,r)},iU=(t,e,n)=>{const r=t===""?e:D5(e,t);r.classGroupId=n},oU=(t,e,n,r)=>{if(lU(t)){Rx(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Qz(n,t))},aU=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[c,u]=s[a];Rx(u,D5(e,c),n,r)}},D5=(t,e)=>{let n=t;const r=e.split(Dm),s=r.length;for(let i=0;i<s;i++){const a=r[i];let c=n.nextPart.get(a);c||(c=L5(),n.nextPart.set(a,c)),n=c}return n},lU=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,cU=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},I_="!",X4=":",uU=[],Q4=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),dU=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,c=0,u=0,f;const h=s.length;for(let y=0;y<h;y++){const w=s[y];if(a===0&&c===0){if(w===X4){i.push(s.slice(u,y)),u=y+1;continue}if(w==="/"){f=y;continue}}w==="["?a++:w==="]"?a--:w==="("?c++:w===")"&&c--}const p=i.length===0?s:s.slice(u);let m=p,_=!1;p.endsWith(I_)?(m=p.slice(0,-1),_=!0):p.startsWith(I_)&&(m=p.slice(1),_=!0);const x=f&&f>u?f-u:void 0;return Q4(i,_,m,x)};if(e){const s=e+X4,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):Q4(uU,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},fU=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const a=n[i],c=a[0]==="[",u=e.has(a);c||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},hU=t=>({cache:cU(t.cacheSize),parseClassName:dU(t),sortModifiers:fU(t),postfixLookupClassGroupIds:pU(t),...eU(t)}),pU=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},mU=/\s+/,gU=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,c=[],u=t.trim().split(mU);let f="";for(let h=u.length-1;h>=0;h-=1){const p=u[h],{isExternal:m,modifiers:_,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:w}=n(p);if(m){f=p+(f.length>0?" "+f:f);continue}let S=!!w,T;if(S){const L=y.substring(0,w);T=r(L);const R=T&&a[T]?r(y):void 0;R&&R!==T&&(T=R,S=!1)}else T=r(y);if(!T){if(!S){f=p+(f.length>0?" "+f:f);continue}if(T=r(y),!T){f=p+(f.length>0?" "+f:f);continue}S=!1}const P=_.length===0?"":_.length===1?_[0]:i(_).join(":"),k=x?P+I_:P,A=k+T;if(c.indexOf(A)>-1)continue;c.push(A);const O=s(T,S);for(let L=0;L<O.length;++L){const R=O[L];c.push(k+R)}f=p+(f.length>0?" "+f:f)}return f},vU=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=j5(n))&&(s&&(s+=" "),s+=r);return s},j5=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=j5(t[r]))&&(n&&(n+=" "),n+=e);return n},yU=(t,...e)=>{let n,r,s,i;const a=u=>{const f=e.reduce((h,p)=>p(h),t());return n=hU(f),r=n.cache.get,s=n.cache.set,i=c,c(u)},c=u=>{const f=r(u);if(f)return f;const h=gU(u,n);return s(u,h),h};return i=a,(...u)=>i(vU(...u))},_U=[],_n=t=>{const e=n=>n[t]||_U;return e.isThemeGetter=!0,e},F5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,V5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xU=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bU=/\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$/,SU=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EU=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jo=t=>xU.test(t),st=t=>!!t&&!Number.isNaN(Number(t)),ri=t=>!!t&&Number.isInteger(Number(t)),v1=t=>t.endsWith("%")&&st(t.slice(0,-1)),Di=t=>wU.test(t),$5=()=>!0,kU=t=>bU.test(t)&&!SU.test(t),Ax=()=>!1,PU=t=>EU.test(t),TU=t=>CU.test(t),RU=t=>!Ae(t)&&!Me(t),AU=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)),IU=t=>va(t,U5,Ax),Ae=t=>F5.test(t),Ba=t=>va(t,B5,kU),J4=t=>va(t,VU,st),MU=t=>va(t,G5,$5),OU=t=>va(t,W5,Ax),ek=t=>va(t,H5,Ax),LU=t=>va(t,z5,TU),hp=t=>va(t,K5,PU),Me=t=>V5.test(t),ld=t=>Rl(t,B5),NU=t=>Rl(t,W5),tk=t=>Rl(t,H5),DU=t=>Rl(t,U5),jU=t=>Rl(t,z5),pp=t=>Rl(t,K5,!0),FU=t=>Rl(t,G5,!0),va=(t,e,n)=>{const r=F5.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Rl=(t,e,n=!1)=>{const r=V5.exec(t);return r?r[1]?e(r[1]):n:!1},H5=t=>t==="position"||t==="percentage",z5=t=>t==="image"||t==="url",U5=t=>t==="length"||t==="size"||t==="bg-size",B5=t=>t==="length",VU=t=>t==="number",W5=t=>t==="family-name",G5=t=>t==="number"||t==="weight",K5=t=>t==="shadow",$U=()=>{const t=_n("color"),e=_n("font"),n=_n("text"),r=_n("font-weight"),s=_n("tracking"),i=_n("leading"),a=_n("breakpoint"),c=_n("container"),u=_n("spacing"),f=_n("radius"),h=_n("shadow"),p=_n("inset-shadow"),m=_n("text-shadow"),_=_n("drop-shadow"),x=_n("blur"),y=_n("perspective"),w=_n("aspect"),S=_n("ease"),T=_n("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...k(),Me,Ae],O=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],R=()=>[Me,Ae,u],M=()=>[jo,"full","auto",...R()],N=()=>[ri,"none","subgrid",Me,Ae],D=()=>["auto",{span:["full",ri,Me,Ae]},ri,Me,Ae],F=()=>[ri,"auto",Me,Ae],q=()=>["auto","min","max","fr",Me,Ae],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...R()],K=()=>[jo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],$=()=>[jo,"screen","full","dvw","lvw","svw","min","max","fit",...R()],te=()=>[jo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],H=()=>[t,Me,Ae],j=()=>[...k(),tk,ek,{position:[Me,Ae]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",DU,IU,{size:[Me,Ae]}],ie=()=>[v1,ld,Ba],J=()=>["","none","full",f,Me,Ae],ce=()=>["",st,ld,Ba],we=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[st,v1,tk,ek],Fe=()=>["","none",x,Me,Ae],De=()=>["none",st,Me,Ae],Pe=()=>["none",st,Me,Ae],Qe=()=>[st,Me,Ae],dt=()=>[jo,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Di],breakpoint:[Di],color:[$5],container:[Di],"drop-shadow":[Di],ease:["in","out","in-out"],font:[RU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Di],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Di],shadow:[Di],spacing:["px",st],text:[Di],"text-shadow":[Di],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",jo,Ae,Me,w]}],container:["container"],"container-type":[{"@container":["","normal","size",Me,Ae]}],"container-named":[AU],columns:[{columns:[st,Ae,Me,c]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],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:[ri,"auto",Me,Ae]}],basis:[{basis:[jo,"full","auto",c,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[st,jo,"auto","initial","none",Ae]}],grow:[{grow:["",st,Me,Ae]}],shrink:[{shrink:["",st,Me,Ae]}],order:[{order:[ri,"first","last","none",Me,Ae]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[c,"screen",...K()]}],"min-w":[{"min-w":[c,"screen","none",...K()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,ld,Ba]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,FU,MU]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",v1,Ae]}],"font-family":[{font:[NU,OU,e]}],"font-features":[{"font-features":[Ae]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Me,Ae]}],"line-clamp":[{"line-clamp":[st,"none",Me,J4]}],leading:[{leading:[i,...R()]}],"list-image":[{"list-image":["none",Me,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[st,"from-font","auto",Me,Ba]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[st,"auto",Me,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[ri,Me,Ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ri,Me,Ae],radial:["",Me,Ae],conic:[ri,Me,Ae]},jU,LU]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[st,Me,Ae]}],"outline-w":[{outline:["",st,ld,Ba]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",h,pp,hp]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,pp,hp]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[st,Ba]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",m,pp,hp]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[st,Me,Ae]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"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":[st]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Me,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[st]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,Ae]}],filter:[{filter:["","none",Me,Ae]}],blur:[{blur:Fe()}],brightness:[{brightness:[st,Me,Ae]}],contrast:[{contrast:[st,Me,Ae]}],"drop-shadow":[{"drop-shadow":["","none",_,pp,hp]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",st,Me,Ae]}],"hue-rotate":[{"hue-rotate":[st,Me,Ae]}],invert:[{invert:["",st,Me,Ae]}],saturate:[{saturate:[st,Me,Ae]}],sepia:[{sepia:["",st,Me,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,Ae]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[st,Me,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[st,Me,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",st,Me,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[st,Me,Ae]}],"backdrop-invert":[{"backdrop-invert":["",st,Me,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[st,Me,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[st,Me,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",st,Me,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[st,"initial",Me,Ae]}],ease:[{ease:["linear","initial",S,Me,Ae]}],delay:[{delay:[st,Me,Ae]}],animate:[{animate:["none",T,Me,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Me,Ae]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:De()}],"rotate-x":[{"rotate-x":De()}],"rotate-y":[{"rotate-y":De()}],"rotate-z":[{"rotate-z":De()}],scale:[{scale:Pe()}],"scale-x":[{"scale-x":Pe()}],"scale-y":[{"scale-y":Pe()}],"scale-z":[{"scale-z":Pe()}],"scale-3d":["scale-3d"],skew:[{skew:Qe()}],"skew-x":[{"skew-x":Qe()}],"skew-y":[{"skew-y":Qe()}],transform:[{transform:[Me,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:dt()}],"translate-x":[{"translate-x":dt()}],"translate-y":[{"translate-y":dt()}],"translate-z":[{"translate-z":dt()}],"translate-none":["translate-none"],zoom:[{zoom:[ri,Me,Ae]}],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Me,Ae]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":H()}],"scrollbar-track-color":[{"scrollbar-track":H()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Me,Ae]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[st,ld,Ba,J4]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},HU=yU($U);function dr(...t){return HU(Yz(t))}const Yd={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},nk=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function Z5(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=nk[Math.abs(e)%nk.length];return{color:n,backgroundColor:`${n}22`}}function q5(t,e={}){const{axis:n="y"}=e,r=v.useRef(new Map),[s,i]=v.useState(null),[a,c]=v.useState([]),u=v.useRef([]),f=v.useRef(0),h=v.useRef(null),p=v.useRef(null),m=v.useCallback(()=>{if(!t.current)return;const T=[];r.current.forEach((P,k)=>{T[k]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),u.current=T,c(T)},[t]),_=v.useCallback((S,T)=>{T?r.current.set(S,T):r.current.delete(S),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,m()})},[m]),x=v.useCallback(S=>{const T=S.clientX,P=S.clientY;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const k=t.current;if(!k)return;const A=k.getBoundingClientRect(),O=n==="x"?T:P;let L=null,R=1/0,M=null;const N=u.current,D=n==="x"?k.scrollLeft:k.scrollTop,F=n==="x"?k.clientLeft:k.clientTop,q=n==="x"?A.left:A.top,X=n==="x"?k.offsetWidth:k.offsetHeight,W=n==="x"?A.width:A.height,G=X>0?W/X:1;for(let K=0;K<N.length;K++){const $=N[K];if(!$)continue;const te=n==="x"?$.left:$.top,H=q+(F+te-D)*G,j=(n==="x"?$.width:$.height)*G,Y=H+j;O>=H&&O<=Y&&(M=K);const ne=H+j/2,ie=Math.abs(O-ne);ie<R&&(R=ie,L=K)}i(M??L)})},[n,t]),y=v.useCallback(()=>{f.current+=1,m()},[m]),w=v.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i(null)},[]);return v.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),p.current!==null&&cancelAnimationFrame(p.current)},[]),{activeIndex:s,setActiveIndex:i,itemRects:a,sessionRef:f,handlers:{onMouseMove:x,onMouseEnter:y,onMouseLeave:w},registerItem:_,measureItems:m}}function zU(t,e,n){v.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const Y5=(t,e)=>`style:${t}:${e}`,X5=t=>`text:${t}`,Q5=t=>{const e=[t.rivetId,t.xpath,t.cssSelector].filter(n=>!!n).map(n=>n.trim()).filter(Boolean);return e.length>0?[...new Set(e)]:["unknown"]},J5=t=>Q5(t)[0],mp=(t,e)=>Q5(t).includes(e),UU=t=>{const e=J5(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${Y5(e,t.property)}${n}`:`${X5(e)}${n}`},Dn=[];for(let t=0;t<256;++t)Dn.push((t+256).toString(16).slice(1));function BU(t,e=0){return(Dn[t[e+0]]+Dn[t[e+1]]+Dn[t[e+2]]+Dn[t[e+3]]+"-"+Dn[t[e+4]]+Dn[t[e+5]]+"-"+Dn[t[e+6]]+Dn[t[e+7]]+"-"+Dn[t[e+8]]+Dn[t[e+9]]+"-"+Dn[t[e+10]]+Dn[t[e+11]]+Dn[t[e+12]]+Dn[t[e+13]]+Dn[t[e+14]]+Dn[t[e+15]]).toLowerCase()}const WU=new Uint8Array(16);function GU(){return crypto.getRandomValues(WU)}function rk(t,e,n){return crypto.randomUUID?crypto.randomUUID():KU(t)}function KU(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??GU();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,BU(r)}const ZU=300;class qU{constructor(){Do(this,"history",{current:new Map,past:[],future:[]});Do(this,"pendingChanges",new Map);Do(this,"currentBatchId",null);Do(this,"debounceTimer",null);Do(this,"onChangeCallbacks",[]);Do(this,"stateBeforePending",null);Do(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=rk(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=J5(e.elementId),r=e.type==="style"?Y5(n,e.property):X5(n),s=Array.from(this.history.current.entries()).find(([a])=>a===r||a.startsWith(`${r}:`));if(s){const a=s[1];e.type==="style"&&a.type==="style"?e.oldValue=a.oldValue:e.type==="text"&&a.type==="text"&&(e.oldText=a.oldText)}const i=UU(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},ZU),this.notifyChange()}flushPending(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.commitPending()}removeChange(e){const n=this.history.current.get(e)??this.pendingChanges.get(e)??null,r=this.history.current.has(e),s=this.pendingChanges.has(e);return!r&&!s?null:(r&&this.history.current.delete(e),s&&this.pendingChanges.delete(e),n&&this.stateBeforePending&&(this.stateBeforePending=this.removeChangeFromSnapshotById(this.stateBeforePending,n.id)),s&&this.pendingChanges.size===0&&(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.stateBeforePending=null,this.currentBatchId=null),r&&(this.history.future=[]),n&&(this.history.past=this.history.past.map(i=>this.removeChangeFromSnapshotById(i,n.id)).filter(i=>i.size>0)),this.notifyChange(),n)}removeChangeById(e){const n=Array.from(this.history.current.entries()).find(([,s])=>s.id===e);if(n)return this.removeChange(n[0]);const r=Array.from(this.pendingChanges.entries()).find(([,s])=>s.id===e);return r?this.removeChange(r[0]):null}removeChangeFromSnapshotById(e,n){return new Map(Array.from(e.entries()).filter(([,r])=>r.id!==n))}commitPending(){this.pendingChanges.size===0||!this.stateBeforePending||this.transactionDepth>0||(this.history.past.push(this.stateBeforePending),this.history.future=[],this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange())}undo(){if(this.pendingChanges.size>0&&this.commitPending(),this.history.past.length===0)return null;const e=new Map(this.history.current);this.history.future.push(e),this.history.current=this.history.past.pop(),this.notifyChange();const n=[];for(const[r,s]of e)this.history.current.has(r)||n.push(s);return n}redo(){if(this.history.future.length===0)return null;const e=new Map(this.history.current);this.history.past.push(e),this.history.current=this.history.future.pop(),this.notifyChange();const n=[];for(const[r,s]of this.history.current)e.has(r)||n.push(s);return n}getChanges(){return Array.from(this.history.current.values())}getStyleChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="style")}getTextChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="text")}getChangeCount(){return this.getUniqueBatchCount(this.history.current.values())}getStyleBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="style"))}getTextBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="text"))}getUniqueBatchCount(e){const n=new Set;for(const r of e)r.batchId?n.add(r.batchId):n.add(r.id);return n.size}canUndo(){return this.history.past.length>0||this.pendingChanges.size>0}canRedo(){return this.history.future.length>0}clear(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.history={current:new Map,past:[],future:[]},this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange()}getStyleChange(e,n){return Array.from(this.history.current.values()).filter(s=>s.type==="style"&&mp(s.elementId,e)&&s.property===n).sort((s,i)=>i.timestamp-s.timestamp)[0]}getTextChange(e){return Array.from(this.history.current.values()).filter(r=>r.type==="text"&&mp(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>mp(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>mp(n.elementId,e))}onChange(e){return this.onChangeCallbacks.push(e),()=>{const n=this.onChangeCallbacks.indexOf(e);n!==-1&&this.onChangeCallbacks.splice(n,1)}}notifyChange(){this.onChangeCallbacks.forEach(e=>e())}export(){return{current:Array.from(this.history.current.entries()),past:this.history.past.map(e=>Array.from(e.entries())),future:this.history.future.map(e=>Array.from(e.entries()))}}import(e){this.history={current:new Map(e.current),past:e.past.map(n=>new Map(n)),future:e.future.map(n=>new Map(n))},this.notifyChange()}async transaction(e){const n=this.pendingChanges.size===0;n&&(this.currentBatchId=rk(),this.stateBeforePending=new Map(this.history.current)),this.transactionDepth++;try{await e()}catch(r){throw n&&this.stateBeforePending&&(this.history.current=new Map(this.stateBeforePending),this.pendingChanges.clear(),this.currentBatchId=null,this.stateBeforePending=null),r}finally{this.transactionDepth--,n&&this.transactionDepth===0&&this.flushPending()}}}const jm={kind:"base"};function Xd(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function YU(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const XU={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},desktopForceUpgrade:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},variantSend:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},designContextViewer:{default:!1},variantReferences:{default:!1},inspectorUndoRedo:{default:!1}},eR=Object.fromEntries(Object.entries(XU).map(([t,e])=>[t,{isEnabled:e.default}]));rt("view");const tR=rt(!0),nR=rt(null),QU=rt("chat"),rR=rt(0),sR=rt({name:null,email:null}),sk=rt(jm);rt(null);const Qd=new Map,JU=t=>{const e=Xd(t);let n=Qd.get(e);return n||(n=new qU,Qd.set(e,n)),n};rt(t=>JU(t(sk)),(t,e,n)=>{Qd.set(Xd(t(sk)),n)});const eB=t=>{for(const e of[...Qd.keys()])e==="base"||t.has(e)||Qd.delete(e)},Jd=rt(new Map),ik=rt(null);rt(null);const M_=rt(0),Fm=rt(null),O_=rt(!1),L_=rt(null),iR=rt(!1),oR=rt(!1),N_=rt(null),D_=rt(null),ef=rt(null),Ix=rt(null),lo=rt(null),Pf=rt({active:!1}),aR=rt([]),ok=rt(null),tB=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&YU(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},nB=rt(null,(t,e,n)=>{const r=u=>{const f=u??jm;return f.kind==="variant"&&!n.has(Xd(f))},s=t(Jd);let i=null;for(const[u,f]of s)r(f.target)&&(i??(i=new Set)).add(u);if(i){const u=new Map(s);for(const f of i)u.delete(f);e(Jd,u)}const a=t(ik);a&&r(a.target)&&(e(ik,null),e(oB,!1));const c=t(ok);c&&(i!=null&&i.has(c.commentId))&&e(ok,null),eB(n)}),j_=rt(eR),rB=rt(!1),lR=rt(null),Tf=rt(!0),cR=rt(!1),uR=rt(!1),dR=rt(null),sB=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},p0=rt(sB()),iB=rt(null),oB=rt(!1);rt(0);rt(0);var $p={exports:{}},aB=$p.exports,ak;function lB(){return ak||(ak=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(aB,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},a=null;function c(y,w){var S=y[w];if(typeof S.bind=="function")return S.bind(y);try{return Function.prototype.bind.call(S,y)}catch{return function(){return Function.prototype.apply.apply(S,[y,arguments])}}}function u(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function f(y){return y==="debug"&&(y="log"),typeof console===n?!1:y==="trace"&&r?u:console[y]!==void 0?c(console,y):console.log!==void 0?c(console,"log"):e}function h(){for(var y=this.getLevel(),w=0;w<s.length;w++){var S=s[w];this[S]=w<y?e:this.methodFactory(S,y,this.name)}if(this.log=this.debug,typeof console===n&&y<this.levels.SILENT)return"No console available for logging"}function p(y){return function(){typeof console!==n&&(h.call(this),this[y].apply(this,arguments))}}function m(y,w,S){return f(y)||p.apply(this,arguments)}function _(y,w){var S=this,T,P,k,A="loglevel";typeof y=="string"?A+=":"+y:typeof y=="symbol"&&(A=void 0);function O(D){var F=(s[D]||"silent").toUpperCase();if(!(typeof window===n||!A)){try{window.localStorage[A]=F;return}catch{}try{window.document.cookie=encodeURIComponent(A)+"="+F+";"}catch{}}}function L(){var D;if(!(typeof window===n||!A)){try{D=window.localStorage[A]}catch{}if(typeof D===n)try{var F=window.document.cookie,q=encodeURIComponent(A),X=F.indexOf(q+"=");X!==-1&&(D=/^([^;]+)/.exec(F.slice(X+q.length+1))[1])}catch{}return S.levels[D]===void 0&&(D=void 0),D}}function R(){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(D){var F=D;if(typeof F=="string"&&S.levels[F.toUpperCase()]!==void 0&&(F=S.levels[F.toUpperCase()]),typeof F=="number"&&F>=0&&F<=S.levels.SILENT)return F;throw new TypeError("log.setLevel() called with invalid level: "+D)}S.name=y,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=w||m,S.getLevel=function(){return k??P??T},S.setLevel=function(D,F){return k=M(D),F!==!1&&O(k),h.call(S)},S.setDefaultLevel=function(D){P=M(D),L()||S.setLevel(D,!1)},S.resetLevel=function(){k=null,R(),h.call(S)},S.enableAll=function(D){S.setLevel(S.levels.TRACE,D)},S.disableAll=function(D){S.setLevel(S.levels.SILENT,D)},S.rebuild=function(){if(a!==S&&(T=M(a.getLevel())),h.call(S),a===S)for(var D in i)i[D].rebuild()},T=M(a?a.getLevel():"WARN");var N=L();N!=null&&(k=M(N)),h.call(S)}a=new _,a.getLogger=function(w){if(typeof w!="symbol"&&typeof w!="string"||w==="")throw new TypeError("You must supply a name when creating a logger.");var S=i[w];return S||(S=i[w]=new _(w,a.methodFactory)),S};var x=typeof window!==n?window.log:void 0;return a.noConflict=function(){return typeof window!==n&&window.log===a&&(window.log=x),a},a.getLoggers=function(){return i},a.default=a,a})})($p)),$p.exports}var cB=lB();const Vs=Jm(cB),uB="INFO",dB=uB.toUpperCase();Vs.setLevel(Vs.levels[dB]||Vs.levels.INFO);const Ss=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>Vs.trace(`${e}${n}`,...r),debug:(n,...r)=>Vs.debug(`${e}${n}`,...r),info:(n,...r)=>Vs.info(`${e}${n}`,...r),warn:(n,...r)=>Vs.warn(`${e}${n}`,...r),error:(n,...r)=>{Vs.error(`${e}${n}`,...r);try{const i=r.map(c=>c instanceof Error?c.message:String(c)).join(" ").slice(0,512),a={source:"ui",error_message:n,service:t??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Se.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>Vs.info(`${e}API: ${n}`,...r),hook:(n,...r)=>Vs.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>Vs.debug(`${e}Mount: ${n}`,...r)}};let Hp=0;const fB=()=>{Hp+=1;let t=!1;return()=>{t||(t=!0,Hp=Math.max(0,Hp-1))}},hB=()=>Hp>0;function pB(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const mB=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Mx=({className:t,"data-testid":e}={})=>E.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:E.jsx("div",{className:"rivet-sparkle-strip",children:mB.map((n,r)=>E.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),gB=["top","right","bottom","left"],ca=Math.min,io=Math.max,Vm=Math.round,gp=Math.floor,oo=t=>({x:t,y:t}),vB={left:"right",right:"left",bottom:"top",top:"bottom"};function fR(t,e,n){return io(t,ca(e,n))}function co(t,e){return typeof t=="function"?t(e):t}function ua(t){return t.split("-")[0]}function fu(t){return t.split("-")[1]}function Ox(t){return t==="x"?"y":"x"}function Lx(t){return t==="y"?"height":"width"}function hi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Nx(t){return Ox(hi(t))}function yB(t,e,n){n===void 0&&(n=!1);const r=fu(t),s=Nx(t),i=Lx(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=$m(a)),[a,$m(a)]}function _B(t){const e=$m(t);return[F_(t),e,F_(e)]}function F_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const lk=["left","right"],ck=["right","left"],xB=["top","bottom"],wB=["bottom","top"];function bB(t,e,n){switch(t){case"top":case"bottom":return n?e?ck:lk:e?lk:ck;case"left":case"right":return e?xB:wB;default:return[]}}function SB(t,e,n,r){const s=fu(t);let i=bB(ua(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(F_)))),i}function $m(t){const e=ua(t);return vB[e]+t.slice(e.length)}function EB(t){var e,n,r,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(s=t.left)!=null?s:0}}function hR(t){return typeof t!="number"?EB(t):{top:t,right:t,bottom:t,left:t}}function Hm(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function uk(t,e,n){let{reference:r,floating:s}=t;const i=hi(e),a=Nx(e),c=Lx(a),u=ua(e),f=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[c]/2-s[c]/2;let _;switch(u){case"top":_={x:h,y:r.y-s.height};break;case"bottom":_={x:h,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:p};break;case"left":_={x:r.x-s.width,y:p};break;default:_={x:r.x,y:r.y}}const x=fu(e);return x&&(_[a]+=m*(x==="end"?1:-1)*(n&&f?-1:1)),_}async function CB(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:c,strategy:u}=t,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:_=0}=co(e,t),x=hR(_),w=c[m?p==="floating"?"reference":"floating":p],S=Hm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:u})),T=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),k=await(i.isElement==null?void 0:i.isElement(P))&&await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1},A=Hm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:T,offsetParent:P,strategy:u}):T);return{top:(S.top-A.top+x.top)/k.y,bottom:(A.bottom-S.bottom+x.bottom)/k.y,left:(S.left-A.left+x.left)/k.x,right:(A.right-S.right+x.right)/k.x}}const kB=50,PB=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:CB},u=await(a.isRTL==null?void 0:a.isRTL(e));let f=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=uk(f,r,u),m=r,_=0;const x={};for(let y=0;y<i.length;y++){const w=i[y];if(!w)continue;const{name:S,fn:T}=w,{x:P,y:k,data:A,reset:O}=await T({x:h,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:x,rects:f,platform:c,elements:{reference:t,floating:e}});h=P??h,p=k??p,x[S]={...x[S],...A},O&&_<kB&&(_++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(f=O.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):O.rects),{x:h,y:p}=uk(f,m,u)),y=-1)}return{x:h,y:p,placement:m,strategy:s,middlewareData:x}},TB=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:c,middlewareData:u}=e,{element:f,padding:h=0}=co(t,e)||{};if(f==null)return{};const p=hR(h),m={x:n,y:r},_=Nx(s),x=Lx(_),y=await a.getDimensions(f),w=_==="y",S=w?"top":"left",T=w?"bottom":"right",P=w?"clientHeight":"clientWidth",k=i.reference[x]+i.reference[_]-m[_]-i.floating[x],A=m[_]-i.reference[_],O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let L=O?O[P]:0;(!L||!await(a.isElement==null?void 0:a.isElement(O)))&&(L=c.floating[P]||i.floating[x]);const R=k/2-A/2,M=L/2-y[x]/2-1,N=ca(p[S],M),D=ca(p[T],M),F=L-y[x]-D,q=L/2-y[x]/2+R,X=fR(N,q,F),W=!u.arrow&&fu(s)!=null&&q!==X&&i.reference[x]/2-(q<N?N:D)-y[x]/2<0,G=W?q<N?q-N:q-F:0;return{[_]:m[_]+G,data:{[_]:X,centerOffset:q-X-G,...W&&{alignmentOffset:G}},reset:W}}}),RB=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:c,platform:u,elements:f}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...w}=co(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=ua(s),T=hi(c),P=ua(c)===c,k=await(u.isRTL==null?void 0:u.isRTL(f.floating)),A=m||(P||!y?[$m(c)]:_B(c)),O=x!=="none";!m&&O&&A.push(...SB(c,y,x,k));const L=[c,...A],R=await u.detectOverflow(e,w),M=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&M.push(R[S]),p){const X=yB(s,a,k);M.push(R[X[0]],R[X[1]])}if(N=[...N,{placement:s,overflows:M}],!M.every(X=>X<=0)){var D,F;const X=(((D=i.flip)==null?void 0:D.index)||0)+1,W=L[X];if(W&&(!(p==="alignment"?T!==hi(W):!1)||N.every($=>hi($.placement)===T?$.overflows[0]>0:!0)))return{data:{index:X,overflows:N},reset:{placement:W}};let G=(F=N.filter(K=>K.overflows[0]<=0).sort((K,$)=>K.overflows[1]-$.overflows[1])[0])==null?void 0:F.placement;if(!G)switch(_){case"bestFit":{var q;const K=(q=N.filter($=>{if(O){const te=hi($.placement);return te===T||te==="y"}return!0}).map($=>[$.placement,$.overflows.filter(te=>te>0).reduce((te,H)=>te+H,0)]).sort(($,te)=>$[1]-te[1])[0])==null?void 0:q[0];K&&(G=K);break}case"initialPlacement":G=c;break}if(s!==G)return{reset:{placement:G}}}return{}}}};function dk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function fk(t){return gB.some(e=>t[e]>=0)}const AB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=co(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),c=dk(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:fk(c)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),c=dk(a,n.floating);return{data:{escapedOffsets:c,escaped:fk(c)}}}default:return{}}}}},pR=new Set(["left","top"]);async function IB(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=ua(n),c=fu(n),u=hi(n)==="y",f=pR.has(a)?-1:1,h=i&&u?-1:1,p=co(e,t);let{mainAxis:m,crossAxis:_,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof x=="number"&&(_=c==="end"?x*-1:x),u?{x:_*h,y:m*f}:{x:m*f,y:_*h}}const MB=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:c}=e,u=await IB(e,t);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:a}}}}},OB=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:a=!0,crossAxis:c=!1,limiter:u={fn:T=>{let{x:P,y:k}=T;return{x:P,y:k}}},...f}=co(t,e),h={x:n,y:r},p=await i.detectOverflow(e,f),m=hi(s),_=Ox(m);let x=h[_],y=h[m];const w=(T,P)=>fR(P+p[T==="y"?"top":"left"],P,P-p[T==="y"?"bottom":"right"]);a&&(x=w(_,x)),c&&(y=w(m,y));const S=u.fn({...e,[_]:x,[m]:y});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[_]:a,[m]:c}}}}}},LB=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:a,rects:c,middlewareData:u}=e,{offset:f=0,mainAxis:h=!0,crossAxis:p=!0}=co(t,e),m={x:s,y:i},_=hi(a),x=Ox(_);let y=m[x],w=m[_];const S=co(f,e),T=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(h){const A=x==="y"?"height":"width",O=c.reference[x]-c.floating[A]+T.mainAxis,L=c.reference[x]+c.reference[A]-T.mainAxis;y<O?y=O:y>L&&(y=L)}if(p){var P,k;const A=x==="y"?"width":"height",O=pR.has(ua(a)),L=c.reference[_]-c.floating[A]+(O&&((P=u.offset)==null?void 0:P[_])||0)+(O?0:T.crossAxis),R=c.reference[_]+c.reference[A]+(O?0:((k=u.offset)==null?void 0:k[_])||0)-(O?T.crossAxis:0);w<L?w=L:w>R&&(w=R)}return{[x]:y,[_]:w}}}},NB=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:a=()=>{},...c}=co(t,e),u=await s.detectOverflow(e,c),f=ua(n),h=fu(n),p=hi(n)==="y",{width:m,height:_}=r.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(y=f,x=h==="end"?"top":"bottom");const w=_-u.top-u.bottom,S=m-u.left-u.right,T=ca(_-u[x],w),P=ca(m-u[y],S),k=e.middlewareData.shift,A=!k;let O=T,L=P;k!=null&&k.enabled.x&&(L=S),k!=null&&k.enabled.y&&(O=w),A&&!h&&(p?L=m-2*io(u.left,u.right):O=_-2*io(u.top,u.bottom)),await a({...e,availableWidth:L,availableHeight:O});const R=await s.getDimensions(i.floating);return m!==R.width||_!==R.height?{reset:{rects:!0}}:{}}}};function m0(){return typeof window<"u"}function hu(t){return mR(t)?(t.nodeName||"").toLowerCase():"#document"}function Tr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function po(t){var e;return(e=(mR(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function mR(t){return m0()?t instanceof Node||t instanceof Tr(t).Node:!1}function vi(t){return m0()?t instanceof Element||t instanceof Tr(t).Element:!1}function ya(t){return m0()?t instanceof HTMLElement||t instanceof Tr(t).HTMLElement:!1}function hk(t){return!m0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Tr(t).ShadowRoot}function g0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=yi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function DB(t){return/^(table|td|th)$/.test(hu(t))}function v0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const jB=/transform|translate|scale|rotate|perspective|filter/,FB=/paint|layout|strict|content/,Wa=t=>!!t&&t!=="none";let y1;function Dx(t){const e=vi(t)?yi(t):t;return Wa(e.transform)||Wa(e.translate)||Wa(e.scale)||Wa(e.rotate)||Wa(e.perspective)||!jx()&&(Wa(e.backdropFilter)||Wa(e.filter))||jB.test(e.willChange||"")||FB.test(e.contain||"")}function VB(t){let e=Pl(t);for(;ya(e)&&!tf(e);){if(Dx(e))return e;if(v0(e))return null;e=Pl(e)}return null}function jx(){return y1==null&&(y1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),y1}function tf(t){return/^(html|body|#document)$/.test(hu(t))}function yi(t){return Tr(t).getComputedStyle(t)}function y0(t){return vi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Pl(t){if(hu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||hk(t)&&t.host||po(t);return hk(e)?e.host:e}function gR(t){const e=Pl(t);return tf(e)?(t.ownerDocument||t).body:ya(e)&&g0(e)?e:gR(e)}function nf(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=gR(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Tr(s);if(i){const c=V_(a);return e.concat(a,a.visualViewport||[],g0(s)?s:[],c&&n?nf(c):[])}else return e.concat(s,nf(s,[],n))}function V_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function vR(t){const e=yi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=ya(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,c=Vm(n)!==i||Vm(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function Fx(t){return vi(t)?t:t.contextElement}function Tc(t){const e=Fx(t);if(!ya(e))return oo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=vR(e);let a=(i?Vm(n.width):n.width)/r,c=(i?Vm(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const $B=oo(0);function yR(t){const e=Tr(t);return!jx()||!e.visualViewport?$B:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function HB(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Tr(t)}function Tl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Fx(t);let a=oo(1);e&&(r?vi(r)&&(a=Tc(r)):a=Tc(t));const c=HB(i,n,r)?yR(i):oo(0);let u=(s.left+c.x)/a.x,f=(s.top+c.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(i&&r){const m=Tr(i),_=vi(r)?Tr(r):r;let x=m,y=V_(x);for(;y&&_!==x;){const w=Tc(y),S=y.getBoundingClientRect(),T=yi(y),P=S.left+(y.clientLeft+parseFloat(T.paddingLeft))*w.x,k=S.top+(y.clientTop+parseFloat(T.paddingTop))*w.y;u*=w.x,f*=w.y,h*=w.x,p*=w.y,u+=P,f+=k,x=Tr(y),y=V_(x)}}return Hm({width:h,height:p,x:u,y:f})}function _0(t,e){const n=y0(t).scrollLeft;return e?e.left+n:Tl(po(t)).left+n}function _R(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-_0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function zB(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=po(r),c=e?v0(e.floating):!1;if(r===a||c&&i)return n;let u={scrollLeft:0,scrollTop:0},f=oo(1);const h=oo(0),p=ya(r);if((p||!i)&&((hu(r)!=="body"||g0(a))&&(u=y0(r)),p)){const _=Tl(r);f=Tc(r),h.x=_.x+r.clientLeft,h.y=_.y+r.clientTop}const m=a&&!p&&!i?_R(a,u):oo(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+h.x+m.x,y:n.y*f.y-u.scrollTop*f.y+h.y+m.y}}function UB(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function BB(t){const e=y0(t),n=t.ownerDocument.body,r=io(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=io(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+_0(t);const a=-e.scrollTop;return yi(n).direction==="rtl"&&(i+=io(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:a}}const WB=25;function GB(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Tr(t),i=po(t),a=s.visualViewport;let c=i.clientWidth,u=i.clientHeight,f=0,h=0;if(a){const m=!jx()||e==="fixed";r?m||(f=-a.offsetLeft,h=-a.offsetTop):(c=a.width,u=a.height,m&&(f=a.offsetLeft,h=a.offsetTop))}if(_0(i)<=0){const m=i.ownerDocument,_=m.body,x=getComputedStyle(_),y=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(i.clientWidth-_.clientWidth-y),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;S<=WB&&(c-=S)}return{width:c,height:u,x:f,y:h}}function KB(t,e){const n=Tl(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Tc(t),a=t.clientWidth*i.x,c=t.clientHeight*i.y,u=s*i.x,f=r*i.y;return{width:a,height:c,x:u,y:f}}function pk(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=GB(t,n,e);else if(e==="document")r=BB(po(t));else if(vi(e))r=KB(e,n);else{const s=yR(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Hm(r)}function ZB(t,e){const n=e.get(t);if(n)return n;let r=nf(t,[],!1).filter(c=>vi(c)&&hu(c)!=="body"),s=null;const i=yi(t).position==="fixed";let a=i?Pl(t):t;for(;vi(a)&&!tf(a);){const c=yi(a),u=Dx(a),f=s?s.position:i?"fixed":"";!u&&(f==="fixed"||f==="absolute"&&c.position==="static")?r=r.filter(p=>p!==a):s=c,a=Pl(a)}return e.set(t,r),r}function qB(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?v0(e)?[]:ZB(e,this._c):[].concat(n),r],c=pk(e,a[0],s);let u=c.top,f=c.right,h=c.bottom,p=c.left;for(let m=1;m<a.length;m++){const _=pk(e,a[m],s);u=io(_.top,u),f=ca(_.right,f),h=ca(_.bottom,h),p=io(_.left,p)}return{width:f-p,height:h-u,x:p,y:u}}function YB(t){const{width:e,height:n}=vR(t);return{width:e,height:n}}function XB(t,e,n){const r=ya(e),s=po(e),i=n==="fixed",a=Tl(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const u=oo(0);if((r||!i)&&((hu(e)!=="body"||g0(s))&&(c=y0(e)),r)){const m=Tl(e,!0,i,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}!r&&s&&(u.x=_0(s));const f=s&&!r&&!i?_R(s,c):oo(0),h=a.left+c.scrollLeft-u.x-f.x,p=a.top+c.scrollTop-u.y-f.y;return{x:h,y:p,width:a.width,height:a.height}}function _1(t){return yi(t).position==="static"}function mk(t,e){if(!ya(t)||yi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return po(t)===n&&(n=n.ownerDocument.body),n}function xR(t,e){const n=Tr(t);if(v0(t))return n;if(!ya(t)){let s=Pl(t);for(;s&&!tf(s);){if(vi(s)&&!_1(s))return s;s=Pl(s)}return n}let r=mk(t,e);for(;r&&DB(r)&&_1(r);)r=mk(r,e);return r&&tf(r)&&_1(r)&&!Dx(r)?n:r||VB(t)||n}const QB=async function(t){const e=this.getOffsetParent||xR,n=this.getDimensions,r=await n(t.floating);return{reference:XB(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function JB(t){return yi(t).direction==="rtl"}const eW={convertOffsetParentRelativeRectToViewportRelativeRect:zB,getDocumentElement:po,getClippingRect:qB,getOffsetParent:xR,getElementRects:QB,getClientRects:UB,getDimensions:YB,getScale:Tc,isElement:vi,isRTL:JB};function wR(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function tW(t,e,n){let r=null,s;const i=po(t);function a(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function c(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),a();const m=t.getBoundingClientRect(),{left:_,top:x,width:y,height:w}=m;if(h||e(),!y||!w)return;const S=gp(x),T=gp(i.clientWidth-(_+y)),P=gp(i.clientHeight-(x+w)),k=gp(_),O={rootMargin:-S+"px "+-T+"px "+-P+"px "+-k+"px",threshold:io(0,ca(1,p))||1};let L=!0;function R(M){const N=M[0].intersectionRatio;if(!wR(m,t.getBoundingClientRect()))return c();if(N!==p){if(!L)return c();N?c(!1,N):s=setTimeout(()=>{c(!1,1e-7)},1e3)}L=!1}try{r=new IntersectionObserver(R,{...O,root:i.ownerDocument})}catch{r=new IntersectionObserver(R,O)}r.observe(t)}const u=Tr(t),f=()=>c(n);return u.addEventListener("resize",f),c(!0),()=>{u.removeEventListener("resize",f),a()}}function nW(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=Fx(t),h=s||i?[...f?nf(f):[],...e?nf(e):[]]:[];h.forEach(S=>{s&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const p=f&&c?tW(f,n,i):null;let m=-1,_=null;a&&(_=new ResizeObserver(S=>{let[T]=S;T&&T.target===f&&_&&e&&(_.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var P;(P=_)==null||P.observe(e)})),n()}),f&&!u&&_.observe(f),e&&_.observe(e));let x,y=u?Tl(t):null;u&&w();function w(){const S=Tl(t);y&&!wR(y,S)&&n(),y=S,x=requestAnimationFrame(w)}return n(),()=>{var S;h.forEach(T=>{s&&T.removeEventListener("scroll",n),i&&T.removeEventListener("resize",n)}),p==null||p(),(S=_)==null||S.disconnect(),_=null,u&&cancelAnimationFrame(x)}}const rW=MB,sW=OB,iW=RB,oW=NB,aW=AB,gk=TB,lW=LB,cW=(t,e,n)=>{const r=new Map,s=n??{},i={...eW,...s.platform,_c:r};return PB(t,e,{...s,platform:i})};var uW=typeof document<"u",dW=function(){},zp=uW?v.useLayoutEffect:dW;function zm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!zm(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!zm(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function bR(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function vk(t,e){const n=bR(t);return Math.round(e*n)/n}function x1(t){const e=v.useRef(t);return zp(()=>{e.current=t}),e}function fW(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:u,open:f}=t,[h,p]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,_]=v.useState(r);zm(m,r)||_(r);const[x,y]=v.useState(null),[w,S]=v.useState(null),T=v.useCallback($=>{$!==O.current&&(O.current=$,y($))},[]),P=v.useCallback($=>{$!==L.current&&(L.current=$,S($))},[]),k=i||x,A=a||w,O=v.useRef(null),L=v.useRef(null),R=v.useRef(h),M=u!=null,N=x1(u),D=x1(s),F=x1(f),q=v.useCallback(()=>{if(!O.current||!L.current)return;const $={placement:e,strategy:n,middleware:m};D.current&&($.platform=D.current),cW(O.current,L.current,$).then(te=>{const H={...te,isPositioned:F.current!==!1};X.current&&!zm(R.current,H)&&(R.current=H,u0.flushSync(()=>{p(H)}))})},[m,e,n,D,F]);zp(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[f]);const X=v.useRef(!1);zp(()=>(X.current=!0,()=>{X.current=!1}),[]),zp(()=>{if(k&&(O.current=k),A&&(L.current=A),k&&A){if(N.current)return N.current(k,A,q);q()}},[k,A,q,N,M]);const W=v.useMemo(()=>({reference:O,floating:L,setReference:T,setFloating:P}),[T,P]),G=v.useMemo(()=>({reference:k,floating:A}),[k,A]),K=v.useMemo(()=>{const $={position:n,left:0,top:0};if(!G.floating)return $;const te=vk(G.floating,h.x),H=vk(G.floating,h.y);return c?{...$,transform:"translate("+te+"px, "+H+"px)",...bR(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:H}},[n,c,G.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:q,refs:W,elements:G,floatingStyles:K}),[h,q,W,G,K])}const hW=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?gk({element:r.current,padding:s}).fn(n):{}:r?gk({element:r,padding:s}).fn(n):{}}}},pW=(t,e)=>{const n=rW(t);return{name:n.name,fn:n.fn,options:[t,e]}},mW=(t,e)=>{const n=sW(t);return{name:n.name,fn:n.fn,options:[t,e]}},gW=(t,e)=>({fn:lW(t).fn,options:[t,e]}),vW=(t,e)=>{const n=iW(t);return{name:n.name,fn:n.fn,options:[t,e]}},yW=(t,e)=>{const n=oW(t);return{name:n.name,fn:n.fn,options:[t,e]}},_W=(t,e)=>{const n=aW(t);return{name:n.name,fn:n.fn,options:[t,e]}},xW=(t,e)=>{const n=hW(t);return{name:n.name,fn:n.fn,options:[t,e]}};var wW=Object.defineProperty,bW=(t,e)=>wW(t,"name",{value:e,configurable:!0});function Vx(t){const[e,n]=v.useState(void 0);return Pr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,c;if("borderBoxSize"in i){const u=i.borderBoxSize,f=Array.isArray(u)?u[0]:u;a=f.inlineSize,c=f.blockSize}else a=t.offsetWidth,c=t.offsetHeight;n({width:a,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}bW(Vx,"useSize");var SW=Object.defineProperty,ta=(t,e)=>SW(t,"name",{value:e,configurable:!0}),SR="Popper",[ER,x0]=xi(SR),[EW,CR]=ER(SR),CW=ta(t=>{const{__scopePopper:e,children:n}=t,[r,s]=v.useState(null),[i,a]=v.useState(void 0);return E.jsx(EW,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})},"Popper"),kW="PopperAnchor",PW=v.forwardRef(ta(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,a=CR(kW,r),c=v.useRef(null),u=a.onAnchorChange,f=v.useCallback(y=>{c.current=y,y&&u(y)},[u]),h=jt(n,f),p=v.useRef(null);v.useEffect(()=>{if(!s)return;const y=p.current;p.current=s.current,y!==p.current&&u(p.current)});const m=a.placementState&&w0(a.placementState),_=m==null?void 0:m[0],x=m==null?void 0:m[1];return s?null:E.jsx(on.div,{"data-radix-popper-side":_,"data-radix-popper-align":x,...i,ref:h})},"PopperAnchor")),kR="PopperContent",[TW,DJ]=ER(kR),RW=v.forwardRef(ta(function(e,n){var le,Fe,De,Pe,Qe,dt,qt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:x="optimized",onPlaced:y,...w}=e,S=CR(kR,r),[T,P]=v.useState(null),k=jt(n,P),[A,O]=v.useState(null),L=Vx(A),R=(L==null?void 0:L.width)??0,M=(L==null?void 0:L.height)??0,N=s+(a!=="center"?"-"+a:""),D=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},F=Array.isArray(h)?h:[h],q=F.length>0,X={padding:D,boundary:F.filter(PR),altBoundary:q},{refs:W,floatingStyles:G,placement:K,isPositioned:$,middlewareData:te}=fW({strategy:"fixed",placement:N,whileElementsMounted:ta((...xe)=>nW(...xe,{animationFrame:x==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[pW({mainAxis:i+M,alignmentAxis:c}),f&&mW({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?gW():void 0,...X}),f&&vW({...X}),yW({...X,apply:ta(({elements:xe,rects:$e,availableWidth:Be,availableHeight:ot})=>{const{width:Pt,height:tt}=$e.reference,Ye=xe.floating.style;Ye.setProperty("--radix-popper-available-width",`${Be}px`),Ye.setProperty("--radix-popper-available-height",`${ot}px`),Ye.setProperty("--radix-popper-anchor-width",`${Pt}px`),Ye.setProperty("--radix-popper-anchor-height",`${tt}px`)},"apply")}),A&&xW({element:A,padding:u}),AW({arrowWidth:R,arrowHeight:M}),_&&_W({strategy:"referenceHidden",...X,boundary:q?X.boundary:void 0})]}),H=S.setPlacementState;Pr(()=>(H(K),()=>{H(void 0)}),[K,H]);const[j,Y]=w0(K),ne=kl(y);Pr(()=>{$&&(ne==null||ne())},[$,ne]);const ie=(le=te.arrow)==null?void 0:le.x,J=(Fe=te.arrow)==null?void 0:Fe.y,ce=((De=te.arrow)==null?void 0:De.centerOffset)!==0,[we,oe]=v.useState();return Pr(()=>{T&&oe(window.getComputedStyle(T).zIndex)},[T]),E.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:$?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(Pe=te.transformOrigin)==null?void 0:Pe.x,(Qe=te.transformOrigin)==null?void 0:Qe.y].join(" "),...((dt=te.hide)==null?void 0:dt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(TW,{scope:r,placedSide:j,placedAlign:Y,onArrowChange:O,arrowX:ie,arrowY:J,shouldHideArrow:ce,children:E.jsx(on.div,{"data-side":j,"data-align":Y,...w,ref:k,style:{...w.style,animation:$?(qt=w.style)==null?void 0:qt.animation:"none"}})})})},"PopperContent"));function PR(t){return t!==null}ta(PR,"isNotNull");var AW=ta(t=>({name:"transformOrigin",options:t,fn(e){var w,S,T;const{placement:n,rects:r,middlewareData:s}=e,a=((w=s.arrow)==null?void 0:w.centerOffset)!==0,c=a?0:t.arrowWidth,u=a?0:t.arrowHeight,[f,h]=w0(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((S=s.arrow)==null?void 0:S.x)??0)+c/2,_=(((T=s.arrow)==null?void 0:T.y)??0)+u/2;let x="",y="";return f==="bottom"?(x=a?p:`${m}px`,y=`${-u}px`):f==="top"?(x=a?p:`${m}px`,y=`${r.floating.height+u}px`):f==="right"?(x=`${-u}px`,y=a?p:`${_}px`):f==="left"&&(x=`${r.floating.width+u}px`,y=a?p:`${_}px`),{data:{x,y}}}}),"transformOrigin");function w0(t){const[e,n="center"]=t.split("-");return[e,n]}ta(w0,"getSideAndAlignFromPlacement");var TR=CW,RR=PW,AR=RW,IW=Object.defineProperty,_a=(t,e)=>IW(t,"name",{value:e,configurable:!0}),$x="Popover",[IR,jJ]=xi($x,[x0]),Hx=x0(),[MW,pu]=IR($x),OW=_a(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,c=Hx(e),u=v.useRef(null),[f,h]=v.useState(!1),[p,m]=ma({prop:r,defaultProp:s??!1,onChange:i,caller:$x});return E.jsx(TR,{...c,children:E.jsx(MW,{scope:e,contentId:ea(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:v.useCallback(()=>m(_=>!_),[m]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:a,children:n})})},"Popover"),LW="PopoverTrigger",NW=v.forwardRef(_a(function(e,n){const{__scopePopover:r,...s}=e,i=pu(LW,r),a=Hx(r),c=jt(n,i.triggerRef),u=E.jsx(on.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":zx(i.open),...s,ref:c,onClick:Nt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:E.jsx(RR,{asChild:!0,...a,children:u})},"PopoverTrigger")),MR="PopoverPortal",[DW,jW]=IR(MR,{forceMount:void 0}),FW=_a(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=pu(MR,e);return E.jsx(DW,{scope:e,forceMount:n,children:E.jsx(ga,{present:n||i.open,children:E.jsx(yx,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),rf="PopoverContent",VW=v.forwardRef(_a(function(e,n){const r=jW(rf,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,a=pu(rf,e.__scopePopover);return E.jsx(ga,{present:s||a.open,children:a.modal?E.jsx(HW,{...i,ref:n}):E.jsx(zW,{...i,ref:n})})},"PopoverContent")),$W=la("PopoverContent.RemoveScroll"),HW=v.forwardRef(_a(function(e,n){const r=pu(rf,e.__scopePopover),s=v.useRef(null),i=jt(n,s),a=v.useRef(!1);return v.useEffect(()=>{const c=s.current;if(c)return c5(c)},[]),E.jsx(xx,{as:$W,allowPinchZoom:!0,children:E.jsx(OR,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Nt(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),a.current||(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Nt(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,h=u.button===2||f;a.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Nt(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),zW=v.forwardRef(_a(function(e,n){const r=pu(rf,e.__scopePopover),s=v.useRef(!1),i=v.useRef(!1);return E.jsx(OR,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"PopoverContentNonModal")),OR=v.forwardRef(_a(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,...m}=e,_=pu(rf,r),x=Hx(r);return d0(),E.jsx(BT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(mx,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>_.onOpenChange(!1),deferPointerDownOutside:!0,children:E.jsx(AR,{"data-state":zx(_.open),role:"dialog",id:_.contentId,...x,...m,ref:n,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function zx(t){return t?"open":"closed"}_a(zx,"getState");var LR=OW,NR=NW,DR=FW,jR=VW;const FR=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:a,dropdownAriaLabel:c="More actions",dropdownItems:u})=>{const[f,h]=v.useState(!1),p=i?a??t:t,m=u.length>0;return E.jsxs("div",{className:"flex items-stretch",children:[E.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?E.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?E.jsxs(LR,{open:f,onOpenChange:h,children:[E.jsx(NR,{asChild:!0,children:E.jsx("button",{"aria-label":c,disabled:s||i,title:c,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(Uz,{className:"h-3.5 w-3.5",weight:"bold"})})}),E.jsx(DR,{children:E.jsx(jR,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:u.map(_=>{const x=_.icon;return E.jsxs("button",{onClick:()=>{_.isDisabled||(_.onClick(),h(!1))},disabled:_.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[x?E.jsx(x,{className:"h-3.5 w-3.5",weight:"bold"}):null,_.label]},_.label)})})})]}):null]})};var UW=Object.defineProperty,BW=(t,e)=>UW(t,"name",{value:e,configurable:!0}),WW=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"}),GW=v.forwardRef(BW(function(e,n){return E.jsx(on.span,{...e,ref:n,style:{...WW,...e.style}})},"VisuallyHidden")),KW=GW,ZW=Object.defineProperty,Rn=(t,e)=>ZW(t,"name",{value:e,configurable:!0}),[Ux,FJ]=xi("Tooltip",[x0]),Bx=x0(),qW="TooltipProvider",YW=700,$_="tooltip.open",[XW,Wx]=Ux(qW),QW=Rn(t=>{const{__scopeTooltip:e,delayDuration:n=YW,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=v.useRef(!0),c=v.useRef(!1),u=v.useRef(0);return v.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),E.jsx(XW,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(u.current),a.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:c,onPointerInTransitChange:v.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),H_="Tooltip",[JW,Rf]=Ux(H_),eG=Rn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:c}=t,u=Wx(H_,t.__scopeTooltip),f=Bx(e),[h,p]=v.useState(null),[m,_]=v.useState(void 0),x=ea(),y=v.useRef(0),w=a??u.disableHoverableContent,S=c??u.delayDuration,T=v.useRef(!1),[P,k]=ma({prop:r,defaultProp:s??!1,onChange:Rn(N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent($_))):u.onClose(),i==null||i(N)},"onChange"),caller:H_}),A=v.useMemo(()=>P?T.current?"delayed-open":"instant-open":"closed",[P]),O=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T.current=!1,k(!0)},[k]),L=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k(!1)},[k]),R=v.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{T.current=!0,k(!0),y.current=0},S)},[S,k]);v.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const M=m??x;return E.jsx(TR,{...f,children:E.jsx(JW,{scope:e,contentId:M,setContentId:_,open:P,stateAttribute:A,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{u.isOpenDelayedRef.current?R():O()},[u.isOpenDelayedRef,R,O]),onTriggerLeave:v.useCallback(()=>{w?L():(window.clearTimeout(y.current),y.current=0)},[L,w]),onOpen:O,onClose:L,disableHoverableContent:w,children:n})})},"Tooltip"),yk="TooltipTrigger",tG=v.forwardRef(Rn(function(e,n){const{__scopeTooltip:r,...s}=e,i=Rf(yk,r),a=Wx(yk,r),c=Bx(r),u=v.useRef(null),f=jt(n,u,i.onTriggerChange),h=v.useRef(!1),p=v.useRef(!1),m=v.useCallback(()=>h.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),E.jsx(RR,{asChild:!0,...c,children:E.jsx(on.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:f,onPointerMove:Nt(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:Nt(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:Nt(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Nt(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:Nt(e.onBlur,i.onClose),onClick:Nt(e.onClick,i.onClose)})})},"TooltipTrigger")),VR="TooltipPortal",[nG,rG]=Ux(VR,{forceMount:void 0}),sG=Rn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Rf(VR,e);return E.jsx(nG,{scope:e,forceMount:n,children:E.jsx(ga,{present:n||i.open,children:E.jsx(yx,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),sf="TooltipContent",iG=v.forwardRef(Rn(function(e,n){const r=rG(sf,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...a}=e,c=Rf(sf,e.__scopeTooltip);return E.jsx(ga,{present:s||c.open,children:c.disableHoverableContent?E.jsx($R,{side:i,...a,ref:n}):E.jsx(oG,{side:i,...a,ref:n})})},"TooltipContent")),oG=v.forwardRef(Rn(function(e,n){const r=Rf(sf,e.__scopeTooltip),s=Wx(sf,e.__scopeTooltip),i=v.useRef(null),a=jt(n,i),[c,u]=v.useState(null),{trigger:f,onClose:h}=r,p=i.current,{onPointerInTransitChange:m}=s,_=v.useCallback(()=>{u(null),m(!1)},[m]),x=v.useCallback((y,w)=>{const S=y.currentTarget,T={x:y.clientX,y:y.clientY},P=HR(T,S.getBoundingClientRect()),k=zR(T,P),A=UR(w.getBoundingClientRect()),O=WR([...k,...A]);u(O),m(!0)},[m]);return v.useEffect(()=>()=>_(),[_]),v.useEffect(()=>{if(f&&p){const y=Rn(S=>x(S,p),"handleTriggerLeave"),w=Rn(S=>x(S,f),"handleContentLeave");return f.addEventListener("pointerleave",y),p.addEventListener("pointerleave",w),()=>{f.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",w)}}},[f,p,x,_]),v.useEffect(()=>{if(c){const y=Rn(w=>{const S=w.target,T={x:w.clientX,y:w.clientY},P=(f==null?void 0:f.contains(S))||(p==null?void 0:p.contains(S)),k=!BR(T,c);P?_():k&&(_(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[f,p,c,h,_]),E.jsx($R,{...e,ref:a})},"TooltipContentHoverable")),aG=LT("TooltipContent"),$R=v.forwardRef(Rn(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:a,onEscapeKeyDown:c,onPointerDownOutside:u,...f}=e,h=Rf(sf,r),p=Bx(r),{onClose:m}=h;v.useEffect(()=>(document.addEventListener($_,m),()=>document.removeEventListener($_,m)),[m]),v.useEffect(()=>{if(h.trigger){const x=Rn(y=>{y.target instanceof Node&&y.target.contains(h.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[h.trigger,m]);const{setContentId:_}=h;return Pr(()=>(_(a),()=>{_(void 0)}),[a,_]),E.jsx(mx,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:E.jsxs(AR,{"data-state":h.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:h.contentId,...p,...f,ref:n,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[E.jsx(aG,{children:s}),i?E.jsx(KW,{id:h.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function HR(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Rn(HR,"getExitSideFromRect");function zR(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Rn(zR,"getPaddedExitPoints");function UR(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}Rn(UR,"getPointsFromRect");function BR(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const c=e[i],u=e[a],f=c.x,h=c.y,p=u.x,m=u.y;h>r!=m>r&&n<(p-f)*(r-h)/(m-h)+f&&(s=!s)}return s}Rn(BR,"isPointInPolygon");function WR(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),GR(e)}Rn(WR,"getHull");function GR(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Rn(GR,"getHullPresorted");var lG=QW,cG=eG,uG=tG,dG=sG,fG=iG;const Ad={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},KR={pill:{item:"rounded-[20px]",bg:"rounded-[20px]",focusRing:"rounded-[22px]",mergedBg:"rounded-2xl",container:"rounded-3xl",button:"rounded-[20px]",input:"rounded-[20px]"},rounded:{item:"rounded-lg",bg:"rounded-lg",focusRing:"rounded-[10px]",mergedBg:"rounded-lg",container:"rounded-xl",button:"rounded-lg",input:"rounded-lg"}},ZR=v.createContext(null);function b0(){const t=v.useContext(ZR);return t?t.classes:KR.pill}function hG(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function pG({children:t,defaultShape:e="pill"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{hG(()=>r(i))},[]);return E.jsx(ZR.Provider,{value:{shape:n,setShape:s,classes:KR[n]},children:t})}const qR=v.createContext(null);function YR({value:t,children:e}){return E.jsx(qR.Provider,{value:t,children:e})}function mG(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function Gx({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:a,onOpenChange:c}){const[u,f]=v.useState(!1),h=a!==void 0?a:u,[p,m]=v.useState(!1),_=b0(),x=v.useContext(qR);v.useEffect(()=>{h&&m(!0)},[h]);const y=()=>{h||m(!1)},w=mG(n);return E.jsx(lG,{delayDuration:s,children:E.jsxs(cG,{open:h,onOpenChange:S=>{f(S),c==null||c(S)},children:[E.jsx(uG,{asChild:!0,children:e}),p&&E.jsx(dG,{forceMount:!0,container:x??void 0,children:E.jsx(fG,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:E.jsx(so.div,{className:dr("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",_.bg,i),style:{fontVariationSettings:Ad.medium},initial:{opacity:0,scale:.8,...w},animate:{opacity:h?1:0,scale:h?1:.9,x:0,y:0},transition:h?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:y,children:t})})})]})})}const to=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:a})=>i?E.jsx(E.Fragment,{children:e}):E.jsx(Gx,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),S0="/__rivet/preview",_k=`${S0}/variant/`,xk=`${S0}/history/`,XR=t=>t?t.startsWith("/")?t:`/${t}`:"/",gG=t=>`${S0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${XR(t.routePath)}`,vG=t=>`${S0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${XR(t.routePath)}`,yG=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(_k)||e.pathname.startsWith(xk)}catch{return t.startsWith(_k)||t.startsWith(xk)}},wk=t=>{var s,i,a,c;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?n.preview.url:e&&(((i=n.preview)==null?void 0:i.kind)==="dev_server"||typeof n.port=="number")?gG({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((a=r.executionPlan)==null?void 0:a.mode)!=="vite_app"&&((c=n.preview)==null?void 0:c.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},bk="/rivet/",QR=t=>{if(!t.startsWith(bk))return null;const e=t.slice(bk.length);return!e||e==="/"?null:`/${e}`},of=(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(()=>{})},_G=(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),of(r,e))}},Um=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},Sk=6,z_="original",Kx="Original",Zx="The original state of your app before any variants were generated.",Ek=200,fn=Ss("AgentVariantsPanel"),w1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},xG=t=>t?t.kind==="active"?t.variant.workItemId:`${t.entry.sessionId}:${t.entry.variantId}`:null,uc=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},wG=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function Rc(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}async function ji(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 bG=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},Id=t=>{var e,n;return t.status!=="succeeded"?!1:((n=(e=t.actions)==null?void 0:e.view)==null?void 0:n.enabled)??(!!t.preview||typeof t.port=="number")},JR=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},SG=t=>t.status==="succeeded"&&!Id(t)&&(!t.previewUnavailable||JR(t)),b1=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static_artifact"?"static_artifact":((n=t.preview)==null?void 0:n.kind)==="dev_server"||typeof t.port=="number"?"dev_server":"none"},Ck=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},EG=t=>{var e;return bG(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},kk=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),CG=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,a;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.label===s.label&&n.brief===s.brief&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((a=s.serve)==null?void 0:a.kind)&&n.hasTree===s.hasTree}),kG=()=>{var Ea,Fr,$f,hr;const t=et(Pf),e=et(aR),n=et(lR),r=et(Tf),s=et(j_),i=((Ea=s.deployPrototype)==null?void 0:Ea.isEnabled)??!1,a=((Fr=s.canvasShare)==null?void 0:Fr.isEnabled)??!1,c=(($f=s.variantSend)==null?void 0:$f.isEnabled)??!1,u=((hr=s.designContextViewer)==null?void 0:hr.isEnabled)??!1,f=et(uR),h=et(dR),p=at(M_),m=at(Fm),_=at(O_),x=at(L_),y=at(iR),w=at(oR),S=at(ef),T=at(Ix),P=at(nR);v.useEffect(()=>(P("Directions"),()=>P(null)),[P]);const k=et(lo),A=at(lo),O=v.useCallback((U=!1)=>{if(_G(k),A(null),U&&k){const ae=Um("ended",k);Se.capture(ae.event,ae.properties)}},[A,k]),L=et(N_),R=at(N_),M=et(D_),N=at(D_),D=M?`${M.sessionId}:${M.variantId}`:null,[F,q]=v.useState(""),[X,W]=v.useState(null),[G,K]=v.useState(null),[$,te]=v.useState({}),[H,j]=v.useState(null),[Y,ne]=v.useState({}),[ie,J]=v.useState(null),[ce,we]=v.useState([]),oe=v.useRef([]);oe.current=ce;const[le,Fe]=v.useState(!1),De=v.useRef(!1);De.current=M!==null||L!==null||le;const Pe=v.useMemo(()=>t.active?t.variants:[],[t]),Qe=v.useMemo(()=>Pe.filter(EG),[Pe]),dt=v.useMemo(()=>kk(Qe,$),[Qe,$]),qt=(H==null?void 0:H.key)===dt?H.shareUrl:null,xe=t.active?t.sessionId:null,$e=v.useMemo(()=>{const U=new Set;for(const ae of Pe)ae.adoptedSource&&U.add(`${ae.adoptedSource.sessionId}:${ae.adoptedSource.variantId}`);return U},[Pe]),Be=v.useMemo(()=>[...ce.filter(ae=>ae.sessionId!==xe&&!$e.has(`${ae.sessionId}:${ae.variantId}`))].sort((ae,Te)=>{const he=new Date(ae.createdAt).getTime(),pe=new Date(Te.createdAt).getTime();return(Number.isNaN(pe)?0:pe)-(Number.isNaN(he)?0:he)}),[$e,ce,xe]),ot=v.useMemo(()=>M?Pe.find(U=>{var ae,Te;return((ae=U.adoptedSource)==null?void 0:ae.sessionId)===M.sessionId&&((Te=U.adoptedSource)==null?void 0:Te.variantId)===M.variantId})??null:null,[M,Pe]),Pt=v.useMemo(()=>M?Be.find(U=>U.sessionId===M.sessionId&&U.variantId===M.variantId)??null:null,[M,Be]),tt=t.active?t.projectContext:null,Ye=(tt==null?void 0:tt.kind)==="fresh"?tt.workspacePath:n,At=!t.active&&Be.length>0&&Be.every(U=>U.projectKind==="fresh"),Bn=t.active?wG(tt):!!n&&!At,In=v.useMemo(()=>Ye?`?projectPath=${encodeURIComponent(Ye)}`:"",[Ye]),Es=v.useRef(null),Lr=v.useRef(null),Nr=typeof window>"u"?"/":QR(window.location.pathname)??"/",tr=v.useRef(null),wn=v.useRef(!1),Gs=v.useCallback((U,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),w1(),tr.current={kind:"live",variantId:U,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]),Ks=v.useCallback((U,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),w1(),tr.current={kind:"past",entry:U,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]);v.useEffect(()=>{const U=he=>{const pe=tr.current;if(!pe)return;const Ee=he.clientX-pe.startX,We=he.clientY-pe.startY;if(!pe.committed){if(Ee*Ee+We*We<Sk*Sk)return;if(w1(),pe.kind==="live"){const Ce=Pe.find(is=>is.workItemId===pe.variantId);if(!Ce||Ce.status!=="succeeded"){tr.current=null;return}const On=wk({sessionId:xe,variant:Ce,projectContext:tt,routePath:Nr});S({sessionId:xe??"",variantId:Ce.workItemId,label:Ce.label||"Direction",url:On,source:"live",runLabel:Ce.runLabel,description:Ce.description})}else{const{entry:Ce}=pe,On=uc(Ce),is=On?vG({sessionId:Ce.sessionId,variantId:Ce.variantId,routePath:Nr}):`/api/variants/history/${encodeURIComponent(Ce.sessionId)}/${encodeURIComponent(Ce.variantId)}/preview${In}`;if(S({sessionId:Ce.sessionId,variantId:Ce.variantId,label:Ce.label||"Direction",url:is,source:On?"history-dev-server":"history-static",runLabel:Ce.runLabel,description:Ce.brief}),On){const Ts=Ck(`/api/variants/history/${encodeURIComponent(Ce.sessionId)}/${encodeURIComponent(Ce.variantId)}/run${In}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Ts,{method:"POST"})).ok)return;const pr=Ck(is,"replay",String(Date.now()));S(cn=>!cn||cn.sessionId!==Ce.sessionId||cn.variantId!==Ce.variantId||cn.source!=="history-dev-server"?cn:{...cn,url:pr}),A(cn=>{if(!cn)return cn;const Ei=nt=>!nt||nt.sessionId!==Ce.sessionId||nt.variantId!==Ce.variantId?nt:{...nt,url:pr};return{...cn,left:Ei(cn.left),right:Ei(cn.right)}})}catch(Rs){fn.warn("history replay drag boot failed",Rs)}})()}}pe.committed=!0}T({x:he.clientX,y:he.clientY})},ae=()=>{const he=tr.current;he!=null&&he.committed&&(wn.current=!0),tr.current=null,T(null)},Te=he=>{if(he.key!=="Escape")return;const pe=tr.current;pe!=null&&pe.committed&&(pe.kind==="past"&&uc(pe.entry)&&of({sessionId:pe.entry.sessionId,variantId:pe.entry.variantId,source:"history-dev-server"}),tr.current=null,S(null),T(null))};return window.addEventListener("pointermove",U),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",ae),window.addEventListener("keydown",Te),()=>{window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",ae),window.removeEventListener("keydown",Te)}},[Pe,xe,tt,Nr,In,S,T,A]);const Mn=v.useMemo(()=>{var ae;if(le||D)return null;const U=L?Pe.find(Te=>Te.workItemId===L):null;return L&&!U?null:U?Id(U)?U.workItemId:null:t.active?((ae=Pe.find(Te=>{var he,pe;return Id(Te)&&(((he=Te.preview)==null?void 0:he.kind)==="static_artifact"||((pe=Te.preview)==null?void 0:pe.kind)==="dev_server")}))==null?void 0:ae.workItemId)??null:null},[L,D,le,t,Pe]),mo=le||Bn&&L===null&&D===null&&Mn===null,bi=v.useCallback(async U=>{var Te,he,pe,Ee;if(!xe)return;const ae=(U==null?void 0:U.workItemId)??null;W({kind:"switch",variantId:ae??void 0});try{if(((Te=U==null?void 0:U.preview)==null?void 0:Te.kind)==="static_artifact"){if(_(!1),x(null),((he=U.refinement)==null?void 0:he.status)==="succeeded"){const Ce=U.preview.url.includes("?")?"&":"?";m(`${U.preview.url}${Ce}refinement=${encodeURIComponent(U.refinement.workItemId)}`)}else m(U.preview.url);p(Ce=>Ce+1);return}if(ae&&xe&&t.active&&t.projectContext.kind==="fresh"&&((pe=t.projectContext.executionPlan)==null?void 0:pe.mode)!=="vite_app"&&((Ee=U==null?void 0:U.preview)==null?void 0:Ee.kind)!=="dev_server"){_(!1),x(null),m(`/api/variants/${xe}/static/${ae}`),p(Ce=>Ce+1);return}const We=U&&ae?wk({sessionId:xe,variant:U,projectContext:t.active?t.projectContext:null,routePath:Nr}):null;if(We){_(!1),x(null),m(We),p(Ce=>Ce+1);return}Se.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:ae,previewKind:U?b1(U):"none",hasPreview:!!(U!=null&&U.preview),hasPort:typeof(U==null?void 0:U.port)=="number",errorMessage:"No addressable dev-server preview URL"}),_(!1),x(null)}catch(We){fn.warn("preview display failed",We),Se.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:ae,previewKind:U?b1(U):"none",hasPreview:!!(U!=null&&U.preview),hasPort:typeof(U==null?void 0:U.port)=="number",errorMessage:We instanceof Error?We.message:String(We)}),_(!1),x(null)}finally{W(null)}},[xe,t,Nr,p,m,_,x]),Cs=v.useRef(!1),Zs=v.useRef(null),rs=v.useRef(0),gn=v.useCallback(()=>{if(rs.current++,y(!1),w(!1),!Cs.current)return;const U=Zs.current;Cs.current=!1,Zs.current=null;const ae=U?new URLSearchParams({sessionId:U.sessionId,variantId:U.variantId}):null,Te=ae?`/api/variants/history/replay/stop?${ae.toString()}`:"/api/variants/history/replay/stop";fetch(Te,{method:"POST"}).catch(he=>fn.warn("history replay stop failed",he))},[y,w]),go=v.useCallback(async U=>{if(xe){W({kind:"switch",variantId:U.workItemId});try{const ae=await fetch(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:U.workItemId})});if(!ae.ok){const Te=await ji(ae);throw new Error(Te.message??`Preview restoration failed (${ae.status})`)}}catch(ae){fn.warn("preview restoration failed",ae),Se.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:U.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:ae instanceof Error?ae.message:String(ae)})}finally{W(null)}}},[xe]),Dr=v.useCallback(U=>{var Ee,We,Ce,On,is;if(wn.current){wn.current=!1;return}const ae=Id(U),Te=U.status==="pending"||U.status==="running"||SG(U);gn();const he=b1(U),pe=Pe.find(Ts=>Ts.workItemId===L);Se.capture("variants_panel.preview_requested",{sessionId:xe,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:U.workItemId,variantStatus:U.status,isPreviewReady:ae,isArmed:Te,previewKind:he,hasPreview:!!U.preview,hasPort:typeof U.port=="number",viewEnabled:((We=(Ee=U.actions)==null?void 0:Ee.view)==null?void 0:We.enabled)??null,previewUnavailableReason:((Ce=U.previewUnavailable)==null?void 0:Ce.reason)??null}),R(U.workItemId),N(null),ae?(Lr.current=U.workItemId,Fe(!1),O(!0),bi(U)):(Lr.current=null,Fe(!1),m(null),_(!1),Te&&Se.capture("variants_panel.preview_armed",{sessionId:xe,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:U.workItemId,variantStatus:U.status,previewKind:he,hasPreview:!!U.preview,hasPort:typeof U.port=="number",viewEnabled:((is=(On=U.actions)==null?void 0:On.view)==null?void 0:is.enabled)??null}),JR(U)&&go(U)),Se.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:U.workItemId,armed:Te})},[L,xe,O,R,N,gn,go,bi,Pe,m,_]),ss=t.active?`${t.sessionId}:${t.stage}`:"inactive",Si=v.useRef(!1);v.useEffect(()=>{if(r)return;let U=!1;return(async()=>{try{const ae=await fetch(`/api/variants/history${In}`,{credentials:"same-origin"});if(!ae.ok)return;const Te=await ae.json();if(U)return;const he=(Te.variants??[]).filter(pe=>{var Ee,We;return((Ee=pe.preview)==null?void 0:Ee.kind)==="static"||((We=pe.serve)==null?void 0:We.kind)==="static"||uc(pe)});if(!Si.current&&!De.current&&ss==="inactive"&&he.length>0&&he.every(pe=>pe.projectKind==="fresh")){const pe=[...he].sort((Ee,We)=>new Date(We.createdAt).getTime()-new Date(Ee.createdAt).getTime()).find(Ee=>!uc(Ee));pe&&(Si.current=!0,N({sessionId:pe.sessionId,variantId:pe.variantId,previewKind:"static"}),Fe(!1),m(`/api/variants/history/${encodeURIComponent(pe.sessionId)}/${encodeURIComponent(pe.variantId)}/preview${In}`))}if(CG(oe.current,he))return;oe.current=he,we(he)}catch(ae){fn.warn("Failed to load past variants",ae)}})(),()=>{U=!0}},[r,ss,In]);const Ke=v.useCallback(()=>{Cs.current=!1,Zs.current=null,y(!1),w(!1),N(null),R(null),Fe(!0),_(!1),x(null),m(null),p(U=>U+1)},[R,y,w,p,m,x,N,_]),It=v.useCallback(U=>{if(wn.current){wn.current=!1;return}if(O(!0),N({sessionId:U.sessionId,variantId:U.variantId,previewKind:uc(U)?"dev_server":"static"}),R(null),Fe(!1),uc(U)){const ae=++rs.current;Cs.current=!0,Zs.current={sessionId:U.sessionId,variantId:U.variantId},y(!0),w(!0),(async()=>{W({kind:"switch"}),Se.capture("variants_panel.history_replay_started",{sessionId:U.sessionId,variantId:U.variantId});const Te=he=>Se.capture("variants_panel.history_replay_failed",{sessionId:U.sessionId,variantId:U.variantId,...he});try{const he=await fetch(`/api/variants/history/${encodeURIComponent(U.sessionId)}/${encodeURIComponent(U.variantId)}/run${In}`,{method:"POST"});if(ae!==rs.current)return;if(!he.ok){const{errorCode:pe}=await ji(he);fn.warn(`history replay failed: HTTP ${he.status} ${pe??""}`),Te({httpStatus:he.status,errorCode:pe}),Ke();return}w(!1),_(!0),x(null),m(null),p(pe=>pe+1),Se.capture("variants_panel.history_replay_ready",{sessionId:U.sessionId,variantId:U.variantId})}catch(he){if(ae!==rs.current)return;fn.warn("history replay failed",he),Te({errorMessage:he instanceof Error?he.message:String(he)}),Ke()}finally{W(null)}})();return}gn(),_(!1),x(null),m(`/api/variants/history/${encodeURIComponent(U.sessionId)}/${encodeURIComponent(U.variantId)}/preview${In}`)},[Ke,W,y,w,p,N,R,m,x,O,_,gn,In]),Ut=v.useCallback(async()=>{gn();const U=()=>{O(!0),R(null),N(null),Fe(!0),Lr.current=null,_(!1),x(null),m(null),p(ae=>ae+1)};if(!xe){U();return}W({kind:"switch"});try{const ae=await fetch(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!ae.ok){fn.warn(`switch to original failed: HTTP ${ae.status}`);return}U(),_(!0),Se.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:L,toVariantId:null,target:"original",armed:!1})}catch(ae){fn.warn("preview-port original switch failed",ae)}finally{W(null)}},[L,xe,R,N,p,m,x,O,_,gn]),bn=v.useCallback(async U=>{var Te,he;const ae=((he=(Te=U.actions)==null?void 0:Te.commit)==null?void 0:he.enabled)??U.status==="succeeded";if(!(!xe||!ae)){Se.capture("variants_panel.commit_clicked",{sessionId:xe,variantId:U.workItemId,variantLabel:U.label}),W({kind:"commit",variantId:U.workItemId});try{const pe=await fetch(`/api/variants/${xe}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:U.workItemId})});if(!pe.ok){const{message:We,errorCode:Ce}=await ji(pe);fn.warn(`commit failed: HTTP ${pe.status} ${Ce??""} ${We??""}`),Se.capture("variants_panel.commit_failed",{sessionId:xe,variantId:U.workItemId,httpStatus:pe.status,errorCode:Ce??null,errorMessage:We??null}),mt.error("Couldn't send direction",{description:We??`The server rejected the request (HTTP ${pe.status}). Try again, or pick a different direction.`});return}const Ee=await pe.json().catch(()=>null);Se.capture("variants_panel.commit_succeeded",{sessionId:xe,variantId:U.workItemId,payloadKind:(Ee==null?void 0:Ee.payloadKind)??null,duplicate:(Ee==null?void 0:Ee.duplicate)??!1}),mt.success(`Sent "${U.label}" to your project`,{description:(Ee==null?void 0:Ee.payloadKind)==="project-created"?`Project created at ${(Ee==null?void 0:Ee.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Ee==null?void 0:Ee.payloadKind)!=="project-created"&&(m(null),_(!1),p(We=>We+1))}catch(pe){fn.warn("commit failed",pe),Se.capture("variants_panel.commit_failed",{sessionId:xe,variantId:U.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),mt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{W(null)}}},[xe,p,m,_]),jr=v.useCallback(async(U,ae,Te)=>{Se.capture("variants_panel.deploy_clicked",{sessionId:U,variantId:ae,variantLabel:Te});try{const he=await fetch(`/api/variants/${U}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:ae,...n?{projectPath:n}:{}})});if(!he.ok){const{message:We,errorCode:Ce}=await ji(he);return fn.warn(`deploy failed: HTTP ${he.status} ${Ce??""} ${We??""}`),Se.capture("variants_panel.deploy_failed",{sessionId:U,variantId:ae,httpStatus:he.status,errorCode:Ce??null,errorMessage:We??null}),mt.error("Couldn't deploy this direction",{description:We??`The server rejected the request (HTTP ${he.status}). Try again.`}),null}const pe=await he.json().catch(()=>null),Ee=pe==null?void 0:pe.shareUrl;return Ee?(await navigator.clipboard.writeText(Ee).catch(()=>{}),Se.capture("variants_panel.deploy_succeeded",{sessionId:U,variantId:ae}),mt.success(`"${Te}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Ee,"_blank","noopener")}}),Ee):(mt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(he){return fn.warn("deploy failed",he),Se.capture("variants_panel.deploy_failed",{sessionId:U,variantId:ae,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),mt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),Yt=v.useCallback(async U=>{if(!xe)return;const ae=$[U.workItemId];if(ae){await navigator.clipboard.writeText(ae).catch(()=>{}),mt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ae,"_blank","noopener")}});return}W({kind:"deploy",variantId:U.workItemId});try{const Te=await jr(xe,U.workItemId,U.label);Te&&te(he=>({...he,[U.workItemId]:Te}))}finally{W(null)}},[xe,$,jr]),an=v.useCallback(async()=>{if(!(!xe||Qe.length===0)){if(qt){await navigator.clipboard.writeText(qt).catch(()=>{}),mt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(qt,"_blank","noopener")}});return}Se.capture("variants_panel.deploy_clicked",{sessionId:xe,variantId:"canvas",variantLabel:"Canvas",variantCount:Qe.length}),W({kind:"deploy-canvas"});try{const U=await fetch(`/api/variants/${xe}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Qe.map(Ee=>Ee.workItemId),...n?{projectPath:n}:{}})});if(!U.ok){const{message:Ee,errorCode:We}=await ji(U);fn.warn(`canvas deploy failed: HTTP ${U.status} ${We??""} ${Ee??""}`),Se.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:U.status,errorCode:We??null,errorMessage:Ee??null,variantCount:Qe.length}),mt.error("Couldn't share this canvas",{description:Ee??`The server rejected the request (HTTP ${U.status}). Try again.`});return}const ae=await U.json().catch(()=>null),Te=ae==null?void 0:ae.shareUrl;if(!Te){mt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const he=Object.fromEntries(((ae==null?void 0:ae.variants)??[]).filter(Ee=>typeof Ee.variantId=="string"&&typeof Ee.shareUrl=="string").map(Ee=>[Ee.variantId,Ee.shareUrl])),pe=Object.keys(he).length>0?{...$,...he}:$;pe!==$&&te(pe),await navigator.clipboard.writeText(Te).catch(()=>{}),j({key:kk(Qe,pe),shareUrl:Te}),Se.capture("variants_panel.deploy_succeeded",{sessionId:xe,variantId:"canvas",variantCount:Qe.length}),mt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Te,"_blank","noopener")}})}catch(U){fn.warn("canvas deploy failed",U),Se.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:U instanceof Error?U.message:String(U),variantCount:Qe.length}),mt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{W(null)}}},[qt,Qe,$,n,xe]),qs=v.useCallback(async U=>{const ae=`${U.sessionId}:${U.variantId}`,Te=Y[ae];if(Te){await navigator.clipboard.writeText(Te).catch(()=>{}),mt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Te,"_blank","noopener")}});return}J(ae);try{const he=await jr(U.sessionId,U.variantId,U.label);he&&ne(pe=>({...pe,[ae]:he}))}finally{J(null)}},[Y,jr]),ln=v.useCallback(async U=>{if(xe){Se.capture("variants_panel.remove_clicked",{sessionId:xe,variantId:U.workItemId,variantLabelLength:U.label.length}),W({kind:"remove",variantId:U.workItemId});try{const ae=await fetch(`/api/variants/${xe}/${U.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!ae.ok){const{message:Te}=await ji(ae);fn.warn(`remove failed: HTTP ${ae.status} ${Te??""}`),mt.error("Couldn't remove direction",{description:Te??`The server rejected the request (HTTP ${ae.status}). Try again.`});return}(U.workItemId===Mn||U.workItemId===L)&&(R(null),m(null),_(!1),p(Te=>Te+1))}catch(ae){fn.warn("remove failed",ae),mt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{W(null)}}},[xe,L,Mn,R,m,_,p]),Wn=v.useCallback(async U=>{if(!Ye){mt.error("Couldn't remove direction",{description:"No project path available."});return}Se.capture("variants_panel.remove_past_clicked",{sessionId:U.sessionId,variantId:U.variantId});const ae=`${U.sessionId}:${U.variantId}`,Te=he=>he.sessionId===U.sessionId&&he.variantId===U.variantId;W({kind:"remove",variantId:ae}),we(he=>he.filter(pe=>!Te(pe))),D===ae&&(N(null),m(null),_(!1),p(he=>he+1));try{const he=await fetch(`/api/variants/history/${encodeURIComponent(U.sessionId)}/${encodeURIComponent(U.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:Ye})});if(!he.ok){const{message:pe}=await ji(he);we(Ee=>Ee.some(Te)?Ee:[...Ee,U]),mt.error("Couldn't remove direction",{description:pe??`The server rejected the request (HTTP ${he.status}). Try again.`})}}catch(he){fn.warn("remove past failed",he),we(pe=>pe.some(Te)?pe:[...pe,U]),mt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{W(null)}},[Ye,D,N,m,_,p]),ks=v.useCallback(U=>{K(U)},[]),fr=v.useCallback(async()=>{if(G)try{G.kind==="active"?await ln(G.variant):await Wn(G.entry)}finally{K(null)}},[G,ln,Wn]),wa=xG(G),mu=(X==null?void 0:X.kind)==="remove"&&X.variantId===wa,[Lf,I0]=v.useState(null),[M0,Ps]=v.useState(null),Nf=v.useCallback(U=>{Ps(U)},[]),Df=v.useCallback(()=>{Ps(null)},[]),O0=v.useCallback(async U=>{const ae=U.trim();if(ae)try{await navigator.clipboard.writeText(ae),mt.success("Copied")}catch{mt.error("Couldn't copy")}},[]),jf=v.useCallback(async(U,ae)=>{Ps(null);const Te=ae.trim();if(!Te||U.kind==="original")return;if(U.kind==="active"){if(!xe||Te===U.variant.label)return;Se.capture("variants_panel.rename",{sessionId:xe,variantId:U.variant.workItemId,labelLength:Te.length,past:!1});try{const Ee=await fetch(`/api/variants/${xe}/${U.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Te})});if(!Ee.ok){const{message:We}=await ji(Ee);mt.error("Couldn't rename direction",{description:We??`The server rejected the request (HTTP ${Ee.status}). Try again.`})}}catch(Ee){fn.warn("rename failed",Ee),mt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:he}=U;if(Te===he.label.trim())return;if(!Ye){mt.error("Couldn't rename direction",{description:"No project path available."});return}Se.capture("variants_panel.rename",{sessionId:he.sessionId,variantId:he.variantId,labelLength:Te.length,past:!0});const pe=Ee=>Ee.sessionId===he.sessionId&&Ee.variantId===he.variantId;we(Ee=>Ee.map(We=>pe(We)?{...We,label:Te}:We));try{const Ee=await fetch(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Te,projectPath:Ye})});if(!Ee.ok){const{message:We}=await ji(Ee);we(Ce=>Ce.map(On=>pe(On)?{...On,label:he.label}:On)),mt.error("Couldn't rename direction",{description:We??`The server rejected the request (HTTP ${Ee.status}). Try again.`})}}catch(Ee){fn.warn("rename failed",Ee),we(We=>We.map(Ce=>pe(Ce)?{...Ce,label:he.label}:Ce)),mt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[xe,Ye]);v.useEffect(()=>{if(Es.current!==xe){const ae=Es.current===null;if(Es.current=xe,Lr.current=null,j(null),m(null),_(!1),x(null),O(),R(null),N(null),Fe(!1),Si.current=!1,!ae)return}if(D||le||!Mn||t.active!==!0||Lr.current===Mn)return;const U=Pe.find(ae=>ae.workItemId===Mn);U&&(Lr.current=Mn,O(),bi(U))},[xe,D,le,Mn,t,Pe,bi,O,R,N,m,x,_]),v.useEffect(()=>{!M||!ot||(Lr.current=null,N(null),R(ot.workItemId),Fe(!1))},[ot,M,xe,R,N]),v.useEffect(()=>{!M||ot||Pt||N(null)},[ot,M,Pt,xe,N,Be]),v.useEffect(()=>{const U=F.trim().toLowerCase(),ae=Pe.filter(Ce=>Rc(U,Ce.label,Ce.runLabel)),Te=Be.filter(Ce=>Rc(U,Ce.label,Ce.runLabel,Ce.brief)),he=Bn&&Rc(U,Kx,Zx);if(ae.length===0&&Te.length===0&&!he)return;const pe=[...ae.map(Ce=>({source:"live",variant:Ce})),...Te.map(Ce=>({source:"past",entry:Ce})),...he?[{source:"original"}]:[]],Ee=Ce=>Ce.source==="live"?`live:${Ce.variant.workItemId}`:Ce.source==="past"?`past:${Ce.entry.sessionId}:${Ce.entry.variantId}`:z_,We=Ce=>{if(hB())return;if(Ce.key==="Enter"){const nt=Pe.find(Hf=>Hf.workItemId===Lf);nt&&(Ce.preventDefault(),Dr(nt));return}if(Ce.key!=="ArrowUp"&&Ce.key!=="ArrowDown")return;Ce.preventDefault();const On=L??Mn;let Ts=On?`live:${On}`:null;D?Ts=`past:${D}`:mo&&(Ts=z_);const Rs=Ts?pe.findIndex(nt=>Ee(nt)===Ts):-1;let pr;if(Rs===-1?pr=Ce.key==="ArrowDown"?0:pe.length-1:Ce.key==="ArrowDown"?pr=Math.min(Rs+1,pe.length-1):pr=Math.max(Rs-1,0),pr===Rs)return;const cn=pe[pr];cn.source==="live"?Dr(cn.variant):cn.source==="past"?It(cn.entry):Ut();const Ei=document.querySelector(`[data-variant-key="${Ee(cn)}"]`);Ei instanceof HTMLElement&&Ei.focus({preventScroll:!0})};return window.addEventListener("keydown",We),()=>window.removeEventListener("keydown",We)},[Pe,Be,F,Bn,L,D,mo,Mn,Lf,Dr,It,Ut]);const Il=Pe.find(U=>U.workItemId===Mn)??null,Ml=D?Be.find(U=>`${U.sessionId}:${U.variantId}`===D)??null:null,gu=!!Ml,L0=t.active?t.artifacts??[]:[],_t=[...(t.active?Pe:[]).map(U=>({kind:"active",variant:U})),...Be.map(U=>({kind:"past",entry:U})),...Bn?[{kind:"original"}]:[]],Ff=F.trim().toLowerCase(),ba=Ff?_t.filter(U=>AG(U,Ff)):_t,Vf=new Set(Pe.map(U=>U.requestId).filter(Boolean)),Sa=e.filter(U=>!Vf.has(U.requestId)),Ol=Sa.length>0,Ll=r&&!Ol&&_t.length===0;return E.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[_t.length>0?E.jsx("div",{className:"px-3 pt-2 pb-1",children:E.jsxs("div",{className:"relative",children:[E.jsx(Wz,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),E.jsx("input",{type:"text",value:F,onChange:U=>q(U.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,E.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[Ol?E.jsx(BG,{groups:Sa}):null,Ll?E.jsx(WG,{}):null,t.active&&_t.length===0&&!Ol&&!Ll?E.jsx(GG,{}):null,!t.active&&!Ol&&!Ll&&Be.length===0&&!Bn?E.jsx(KG,{isMCPSession:f,mcpEditor:h}):null,_t.length>0&&ba.length===0?E.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",F.trim(),"”."]}):null,ba.length>0?E.jsx(LG,{rows:ba,activeVariantId:L??Mn,activePastKey:D,isOriginalSelected:mo,busy:X,editingKey:M0,onSelectActive:Dr,onSelectPast:It,onSelectOriginal:Ut,onActivePointerDown:Gs,onPastPointerDown:Ks,onHover:I0,onRemove:U=>ks({kind:"active",variant:U}),onRemovePast:U=>ks({kind:"past",entry:U}),onStartRename:Nf,onCommitRename:jf,onCancelRename:Df,onCopyVariantContext:O0,activeSessionId:t.active?t.sessionId:null,projectPath:Ye}):null,t.active&&u?E.jsx($G,{artifacts:L0}):null]}),gu&&Ml?E.jsx(jG,{entry:Ml,deploying:ie===D,deployedUrl:D?Y[D]??null:null,onDeploy:qs,isDeployDisabled:!i}):null,!gu&&t.active?E.jsx(UG,{selectedVariant:Il,busy:X,onSend:bn,onDeploy:Yt,onDeployCanvas:an,canDeploy:i&&(tt==null?void 0:tt.kind)==="fresh",canDeployCanvas:i&&a&&(tt==null?void 0:tt.kind)==="fresh",canSendToAgent:c,canvasVariantCount:Qe.length,canvasDeployedUrl:qt,deployedUrl:Il?$[Il.workItemId]??null:null}):null,E.jsx(TG,{target:G,isConfirming:mu,onCancel:()=>K(null),onConfirm:fr})]})},PG=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.entry.label.trim()||"this direction",TG=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=PG(t);return E.jsx(bx,{open:!0,onOpenChange:i=>{!i&&!e&&n()},children:E.jsxs(Sx,{children:[E.jsx(Ex,{className:"z-max fixed inset-0 bg-black/40"}),E.jsx(Cx,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:E.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[E.jsx(kx,{className:"text-content text-base font-medium",children:"Remove direction?"}),E.jsxs(Px,{className:"text-content-subtle text-sm leading-5",children:['This removes "',s,'" from the directions list.']}),E.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[E.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),E.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":"Remove direction"})]})]})})]})})},RG=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:z_,AG=(t,e)=>t.kind==="active"?Rc(e,t.variant.label,t.variant.runLabel):t.kind==="past"?Rc(e,t.entry.label,t.entry.runLabel,t.entry.brief):Rc(e,Kx,Zx),IG=t=>t.length<=Ek?t:`${t.slice(0,Ek-1)}…`,MG=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,OG=t=>{var i,a;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(c=>!!c).join(`
111
+ `);if(!t.reference)return e;const n=((a=t.projectPath)==null?void 0:a.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"",s=[`Rivet variant: ${t.reference}`,"To inspect the full variant context, run:",`rivet variants get ${t.reference}${r}`].join(`
112
+ `);return e?`${e}
113
+
114
+ ${s}`:s},LG=({rows:t,activeVariantId:e,activePastKey:n,isOriginalSelected:r,busy:s,editingKey:i,onSelectActive:a,onSelectPast:c,onSelectOriginal:u,onActivePointerDown:f,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:_,onStartRename:x,onCommitRename:y,onCancelRename:w,onCopyVariantContext:S,activeSessionId:T,projectPath:P})=>{const k=v.useRef(null),{activeIndex:A,itemRects:O,sessionRef:L,handlers:R,registerItem:M}=q5(k),N=A!==null?O[A]:null;return E.jsxs("div",{ref:k,className:"relative",onMouseEnter:R.onMouseEnter,onMouseMove:R.onMouseMove,onMouseLeave:R.onMouseLeave,children:[E.jsx(ro,{children:N&&E.jsx(xl.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:N.top,left:N.left,width:N.width,height:N.height},animate:{opacity:1,top:N.top,left:N.left,width:N.width,height:N.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Yd.fast,opacity:{duration:.08}}},L.current)}),E.jsx("ul",{className:"relative",children:t.map((D,F)=>{const q=RG(D);let X=!1;return D.kind==="active"?X=D.variant.workItemId===e:D.kind==="past"?X=`${D.entry.sessionId}:${D.entry.variantId}`===n:X=r,E.jsx(NG,{rowKey:q,row:D,index:F,isSelected:X,isEditing:i===q,busy:s,registerItem:M,onSelectActive:a,onSelectPast:c,onSelectOriginal:u,onActivePointerDown:f,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:_,onStartRename:x,onCommitRename:y,onCancelRename:w,onCopyVariantContext:S,activeSessionId:T,projectPath:P},q)})})]})},NG=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,busy:i,registerItem:a,onSelectActive:c,onSelectPast:u,onSelectOriginal:f,onActivePointerDown:h,onPastPointerDown:p,onHover:m,onRemove:_,onRemovePast:x,onStartRename:y,onCommitRename:w,onCancelRename:S,onCopyVariantContext:T,activeSessionId:P,projectPath:k})=>{var ne,ie;const A=v.useRef(null);zU(a,n,A);const O=e.kind==="active",L=e.kind==="original",R=e.kind==="active"?e.variant:null,M=e.kind==="past"?e.entry:null,N=O?R.status==="succeeded":!0,D=O?Id(R):!0,F=O&&(R.status==="pending"||R.status==="running"),q=O&&R.status==="failed",X=O&&R.status==="cancelled",W=O&&(i==null?void 0:i.kind)==="remove"&&i.variantId===R.workItemId,G=O&&(((ne=R.refinement)==null?void 0:ne.status)==="pending"||((ie=R.refinement)==null?void 0:ie.status)==="running");let K=Kx;O?K=R.label||`Direction ${n+1}`:M&&(K=M.label.trim()||"Untitled direction");let $;O?$=R.runLabel:M&&($=M.runLabel);let te=Zx;O?te=R.description:M&&(te=M.brief);const H=te?IG(te):null,j=MG(e,P),Y=j?"Copy variant reference":"Copy description";return s?E.jsx("li",{ref:A,"data-proximity-index":n,className:"group relative z-10",children:E.jsx("div",{className:"bg-main-input flex w-full items-start gap-2 rounded-md px-3 py-2",children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsx(DG,{initial:K,onCommit:J=>w(e,J),onCancel:S}),H&&E.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:H})]})})}):E.jsxs("li",{ref:A,"data-proximity-index":n,className:"group relative z-10",children:[E.jsx("div",{role:"button",tabIndex:0,"data-variant-id":O?R.workItemId:void 0,"data-variant-key":t,onClick:()=>{const J=window.getSelection();J&&!J.isCollapsed||(e.kind==="active"?c(e.variant):e.kind==="past"?u(e.entry):f())},onKeyDown:J=>{(J.key==="Enter"||J.key===" ")&&(J.preventDefault(),J.stopPropagation(),e.kind==="active"?c(e.variant):e.kind==="past"?u(e.entry):f())},onPointerDown:J=>{e.kind==="active"?D&&h(e.variant.workItemId,J):e.kind==="past"&&p(e.entry,J)},"aria-pressed":r,"aria-disabled":O?!1:void 0,"aria-busy":F||G,onMouseEnter:O?()=>m(R.workItemId):void 0,onMouseLeave:O?()=>m(null):void 0,className:dr("focus-visible:ring-content-muted/40 flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors focus:outline-none focus-visible:ring-1",r&&"bg-main-input ring-content-muted/40 ring-1 ring-inset",D&&"cursor-grab active:cursor-grabbing",!D&&"cursor-pointer"),style:D?{touchAction:"none"}:void 0,children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[(F||G)&&E.jsx(Mx,{className:"text-content-muted shrink-0 text-sm","data-testid":G&&!F?"variant-refining":void 0}),E.jsx(to,{label:"Double-click to rename",disabled:L,children:E.jsx("span",{onDoubleClick:J=>{J.stopPropagation(),L||y(t)},className:dr("min-w-0 flex-1 truncate text-sm font-medium select-text",L?"cursor-default":"cursor-text",N||r?"text-content":"text-content-muted"),children:K})}),q&&E.jsx(to,{label:R.errorMessage??R.errorCode??"Failed",disabled:!R.errorMessage&&!R.errorCode,children:E.jsx("span",{className:"shrink-0",children:E.jsx(Pk,{label:"Failed"})})}),X&&E.jsx(Pk,{label:"Cancelled"}),$&&E.jsx("span",{className:"ml-auto max-w-[8rem] shrink-0 truncate rounded px-1.5 py-0.5 text-[10px] font-medium opacity-100 transition-opacity duration-150 group-hover:opacity-0 group-has-[:focus-visible]:opacity-0",style:Z5($),children:$})]}),H&&E.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:H})]})}),E.jsxs("div",{className:dr("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100"),children:[te||j?E.jsx(to,{label:Y,children:E.jsx("button",{type:"button","aria-label":Y,onClick:J=>{J.stopPropagation(),T(OG({label:K,description:te,reference:j,projectPath:k}))},onPointerDown:J=>J.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:E.jsx(qd,{size:13,weight:"bold"})})}):null,!L&&E.jsx(to,{label:"Rename",children:E.jsx("button",{type:"button","aria-label":"Rename direction",onClick:J=>{J.stopPropagation(),y(t)},onPointerDown:J=>J.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:E.jsx(Gz,{size:13,weight:"bold"})})}),!L&&E.jsx(to,{label:"Remove",children:E.jsx("button",{type:"button","data-variant-remove-id":e.kind==="active"?e.variant.workItemId:void 0,"aria-label":"Remove direction",disabled:W,onClick:J=>{J.stopPropagation(),e.kind==="active"?_(e.variant):x(e.entry)},onPointerDown:J=>J.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 ml-1 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(qz,{size:13,weight:"bold"})})})]})]})},DG=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=v.useState(t),i=v.useRef(!1),a=v.useCallback(u=>{u&&(u.focus(),u.select())},[]),c=u=>{i.current||(i.current=!0,u?e(r):n())};return E.jsx("input",{ref:a,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:u=>s(u.target.value),onKeyDown:u=>{u.stopPropagation(),u.key==="Enter"?(u.preventDefault(),c(!0)):u.key==="Escape"&&(u.preventDefault(),c(!1))},onBlur:()=>c(!0),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},Pk=({label:t})=>E.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),jG=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const a=e?"Deploying…":n?"Copy link":"Share";return E.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[E.jsxs("div",{className:"min-w-0",children:[E.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?E.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),E.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?E.jsx(qd,{size:12,weight:"bold"}):null,a]})]})},FG={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},VG={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},$G=({artifacts:t})=>{const[e,n]=v.useState(null),r=v.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(a=>a===i?null:i)};return E.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[E.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:E.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),E.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>E.jsx(HG,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},HG=({artifact:t,isExpanded:e,onToggle:n})=>{const r=VG[t.kind],s=t.source?FG[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),a=t.kind==="design_context"&&!!t.viewUrl,c=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return a?E.jsx("li",{className:"border-main-border rounded-md border",children:E.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[E.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),E.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?E.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),E.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{Se.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:E.jsx(Hz,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):E.jsxs("li",{className:"border-main-border rounded-md border",children:[E.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":c,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[E.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),E.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?E.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),E.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?E.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:E.jsx(zG,{artifact:t})}):null]})},zG=({artifact:t})=>E.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?E.jsx("p",{children:t.summary}):null,t.path?E.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?E.jsx("p",{children:"No inline content available for this artifact."}):null]}),UG=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:c,canvasVariantCount:u,canvasDeployedUrl:f,deployedUrl:h})=>{var L,R,M,N;const p=t?((R=(L=t.actions)==null?void 0:L.commit)==null?void 0:R.enabled)??t.status==="succeeded":!1,m=p&&e===null,_=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),x=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),y=(e==null?void 0:e.kind)==="deploy-canvas",w=!i||!p||e!==null,S=a&&u>0,P=x?"Deploying…":h?"Copy link":"Share",A=y?"Sharing…":f?"Copy canvas link":"Share canvas",O=_?"Applying…":"Apply to project";return E.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[E.jsx("div",{className:"min-w-0",children:t?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),h?E.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),E.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[E.jsx(FR,{primaryLabel:P,primaryIcon:h&&!x?qd:void 0,primaryAction:()=>{t&&r(t)},isDisabled:w,isDropdownDisabled:e!==null,isLoading:x,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:S?[{label:A,icon:f&&!y?qd:void 0,onClick:s,isDisabled:e!==null}]:[]}),c?E.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!m,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]})]})},eA=()=>E.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx(Mx,{className:"text-content-muted shrink-0 text-sm"}),E.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),E.jsx("span",{className:"mt-1.5 flex",children:E.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),BG=({groups:t})=>E.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>E.jsx(eA,{},`${e.requestId}-${r}`)))}),WG=()=>E.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>E.jsx(eA,{},e))}),GG=()=>E.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[E.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),E.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),Tk="Try different ways to create a dropdown that feels fluid and dynamic",KG=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=v.useState(!1),s=pB(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(Tk).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return E.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[E.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),E.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),E.jsxs("div",{className:"w-full",children:[E.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),E.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[E.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",Tk,"”"]}),E.jsx("button",{type:"button",onClick:a,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?E.jsx(x5,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):E.jsx(qd,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},ZG=({onClose:t})=>{const e=et(nR);return t?E.jsxs("div",{className:"z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b border-main-border bg-main-light px-2.5 py-2.5",children:[e?E.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):E.jsx("span",{}),E.jsx(to,{label:"Close panel",side:"bottom",children:E.jsx("button",{onClick:t,className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 text-content-subtle transition-colors hover:bg-main-input hover:text-content",children:E.jsx(Kz,{className:"h-4 w-4",weight:"bold"})})})]}):null},qG='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',YG=({itemSelector:t=qG,loop:e=!1}={})=>{const n=v.useRef(null),r=v.useRef(null),s=v.useCallback(a=>{var c;n.current=a,a?r.current=fB():((c=r.current)==null||c.call(r),r.current=null)},[]),i=v.useCallback(a=>{var x;const{key:c}=a;if(c!=="ArrowDown"&&c!=="ArrowUp"&&c!=="Home"&&c!=="End")return;const u=n.current;if(!u)return;const f=Array.from(u.querySelectorAll(t));if(f.length===0)return;a.preventDefault(),a.stopPropagation();const h=f.indexOf(document.activeElement),p=f.length-1,m=y=>{if(h===-1)return y===1?0:p;const w=h+y;return e?(w+f.length)%f.length:Math.min(Math.max(w,0),p)};let _;c==="Home"?_=0:c==="End"?_=p:c==="ArrowDown"?_=m(1):_=m(-1),(x=f[_])==null||x.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},Rk="/assets/arena-Db0j1set.png",XG=Ss("useIntegrations"),S1=["integrations"],QG="rivet:connect-result",JG=t=>typeof t=="object"&&t!==null&&t.type===QG,eK=rt(null),Ak=async()=>{const t=await fetch("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},tK=()=>{const t=Z8(),[e,n]=HP(eK),r=sy({queryKey:S1,queryFn:Ak,staleTime:1e4}),s=v.useCallback(async()=>(await t.invalidateQueries({queryKey:S1,refetchType:"none"}),t.fetchQuery({queryKey:S1,queryFn:Ak})),[t]),i=v.useCallback(async c=>{const u=window.open("","_blank","width=560,height=720");if(!u)throw new Error("Popup blocked. Allow popups to connect.");n(c);try{const f=await fetch(`/api/integrations/${c}/connect`,{method:"POST"}),h=await f.json().catch(()=>({}));if(!f.ok||!h.authUrl)throw u.close(),new Error(h.error||`Could not connect ${c}`);return u.location.href=h.authUrl,await new Promise(p=>{let m=!1,_=null;const x=async(w,S=!1)=>{if(!m){m=!0,window.removeEventListener("message",y),_&&clearInterval(_);try{const P=(await s()).some(k=>k.provider===c&&k.status==="connected");p(S&&P?"connected":w)}catch{p(w)}}},y=w=>{if(JG(w.data)&&w.data.provider===c){if(w.data.status==="error"){XG.warn(`Connect failed for ${c}:`,w.data.message),x("failed");return}x("connected")}};window.addEventListener("message",y),_=setInterval(()=>{u.closed&&x("closed",!0)},500)})}finally{n(null)}},[s,n]),a=v.useCallback(async c=>{n(c);try{const u=await fetch(`/api/integrations/${c}`,{method:"DELETE"});if(!u.ok){const f=await u.json().catch(()=>({}));throw new Error(f.error||`Could not disconnect ${c}`)}await s()}finally{n(null)}},[s,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:a,refetch:s}},Ac=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:a="button","data-cy":c})=>{const u=E.jsx("button",{onClick:t,disabled:s,className:i,type:a,"data-cy":c,children:r});return e?E.jsx(Gx,{content:E.jsxs("div",{className:"flex flex-row items-center gap-2",children:[E.jsx("span",{children:e}),n?E.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:u}):u},Ga=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),Ik=Ss("ConnectorsModal"),nK=()=>E.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","aria-hidden":"true",children:E.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})}),rK=()=>E.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${Rk})`,maskImage:`url(${Rk})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),sK=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:E.jsx(nK,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:E.jsx(rK,{})}],iK=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const a=(e==null?void 0:e.status)==="connected",c=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return E.jsxs("article",{className:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,children:[E.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),E.jsxs("div",{className:"mt-4 flex-1",children:[E.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,a?E.jsx(x5,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),E.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),a&&c?E.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:c}):null]}),a?E.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push bg-main-input text-content-muted mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):E.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},U_=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:c,connect:u,disconnect:f}=tK(),h=r0(),[p,m]=v.useState(null),_=S=>s.find(T=>T.provider===S),x=v.useCallback(S=>{const T=Date.now(),P=Ga({action:"connect",outcome:"started",provider:S,entryPoint:n});h==null||h.capture(P.event,P.properties),u(S).then(k=>{const A=Date.now()-T;if(k==="connected"){const L=Ga({action:"connect",outcome:"completed",provider:S,entryPoint:n,durationMs:A});h==null||h.capture(L.event,L.properties);return}const O=Ga({action:"connect",outcome:"failed",provider:S,entryPoint:n,durationMs:A,failureReason:k==="closed"?"popup_closed":"provider_failed"});h==null||h.capture(O.event,O.properties)}).catch(k=>{const A=k instanceof Error?k.message:"Could not connect.",O=Ga({action:"connect",outcome:"failed",provider:S,entryPoint:n,durationMs:Date.now()-T,failureReason:A.includes("Popup blocked")?"popup_blocked":"request_failed"});h==null||h.capture(O.event,O.properties),Ik.warn(`Connect error for ${S}:`,A),mt.error(A)})},[u,n,h]),y=v.useCallback(S=>{const T=Date.now(),P=Ga({action:"disconnect",outcome:"started",provider:S,entryPoint:n});h==null||h.capture(P.event,P.properties),f(S).then(()=>{const k=Ga({action:"disconnect",outcome:"completed",provider:S,entryPoint:n,durationMs:Date.now()-T});h==null||h.capture(k.event,k.properties)}).catch(k=>{const A=k instanceof Error?k.message:"Could not disconnect.",O=Ga({action:"disconnect",outcome:"failed",provider:S,entryPoint:n,durationMs:Date.now()-T,failureReason:"request_failed"});h==null||h.capture(O.event,O.properties),Ik.warn(`Disconnect error for ${S}:`,A),mt.error(A)})},[n,f,h]),w=n==="onboarding";return E.jsx(bx,{open:t,onOpenChange:S=>!S&&e(),children:E.jsxs(Sx,{children:[E.jsx(Ex,{className:"z-max fixed inset-0 bg-black/40"}),E.jsx(Cx,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:E.jsxs(YR,{value:p,children:[E.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[E.jsx(kx,{className:"text-content text-base font-medium",children:"Connect design references"}),E.jsx(Ac,{onClick:e,title:"Close",className:"text-content-subtle hover:bg-main-hover hover:text-content rounded p-1 transition-colors",children:E.jsx(M5,{className:"h-4 w-4",weight:"bold"})})]}),E.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[E.jsx(Px,{className:"text-content-subtle text-sm",children:"Connect your design references to use them with Rivet’s MCP."}),a?E.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:a}):null,E.jsx("div",{className:"grid grid-cols-2 gap-4",children:sK.map(S=>E.jsx(iK,{meta:S,integration:_(S.provider),isPending:i||c===S.provider,isHighlighted:r===S.provider,onConnect:()=>x(S.provider),onDisconnect:()=>y(S.provider)},S.provider))}),w?E.jsxs("div",{className:"flex items-center justify-between gap-4",children:[E.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),E.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})})},Mk=({className:t=""})=>E.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),oK=Ss("SupportTicketModal"),Ok=5e3,E1="feedback",aK=t=>{var r;if(!t)return null;const e=(r=t.formErrors)==null?void 0:r[0];if(e)return e;const n=t.fieldErrors??{};for(const s of Object.values(n)){const i=s==null?void 0:s[0];if(i)return i}return null},lK=async t=>{let e;try{e=await t.json()}catch{e=void 0}if(t.status===400){if(typeof(e==null?void 0:e.details)=="string"&&e.details.trim())return e.details;if(typeof(e==null?void 0:e.details)=="object"&&e.details!==null){const n=aK(e.details);if(n)return n}return"Please check your feedback and try again."}return t.status>=500?typeof(e==null?void 0:e.details)=="string"&&e.details.trim()?e.details:"Could not send feedback right now. Please try again later.":typeof(e==null?void 0:e.error)=="string"&&e.error.trim()?e.error:`HTTP ${t.status}`},cK=({isOpen:t,onClose:e,contactEmail:n})=>{const r=r0(),[s,i]=v.useState(""),[a,c]=v.useState(!1),[u,f]=v.useState(null),h=v.useCallback(()=>{i("")},[]),p=v.useCallback(()=>{a||(h(),e())},[a,e,h]),m=v.useCallback(async()=>{const w=s.trim();if(!(!w||a)){c(!0);try{const S=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,T=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,P=n==null?void 0:n.trim(),k=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:E1,message:w,contactEmail:P||void 0,metadata:{posthogSessionId:S??void 0,posthogDistinctId:T??void 0,appVersion:"0.14.18",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!k.ok){const A=await lK(k);throw new Error(A)}r==null||r.capture("support_ticket_submitted",{ticket_type:E1,has_posthog_session_id:!!S}),mt.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(S){const T=S instanceof Error?S.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:E1,error:T}),oK.error("Failed to submit support ticket:",T),mt.error("Could not send feedback",{description:T})}finally{c(!1)}}},[n,a,s,e,r,h]),_=v.useCallback(w=>{w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())},[m]),x=Ok-s.length,y=a||s.trim().length===0;return E.jsx(bx,{open:t,onOpenChange:w=>!w&&p(),children:E.jsxs(Sx,{children:[E.jsx(Ex,{className:"fixed inset-0 z-max bg-black/40"}),E.jsx(Cx,{ref:f,className:"fixed left-1/2 top-1/2 z-max w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:E.jsxs(YR,{value:u,children:[E.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[E.jsx(kx,{className:"text-base font-medium text-content",children:"Send feedback"}),E.jsx(Ac,{onClick:p,disabled:a,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(M5,{className:"h-4 w-4",weight:"bold"})})]}),E.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[E.jsx(Px,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),E.jsxs("div",{className:"rounded-lg bg-main-input outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[E.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:w=>i(w.target.value),onKeyDown:_,maxLength:Ok,rows:6,disabled:a,placeholder:"What happened?",className:"max-h-64 w-full resize-none overflow-y-auto bg-transparent pb-1 pl-3 pr-3 pt-3 text-sm text-content placeholder-content-subtle focus:outline-none disabled:opacity-50"}),E.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[E.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),E.jsxs("div",{className:"flex items-center gap-2",children:[x<=500&&E.jsx("span",{className:"text-xs text-content-subtle",children:x}),E.jsx(Ac,{onClick:m,disabled:y,title:"Send feedback",shortcut:"⌘↵",className:"flex items-center justify-center rounded bg-primary p-1 text-content transition-colors hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-80",children:a?E.jsx(h0,{className:"h-5 w-5 animate-spin",weight:"bold"}):E.jsx(zz,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},uK=Ss("ProfileAvatar"),tA=(t,e)=>{const n=(t??"").trim();if(n)return n.split(/\s+/).filter(Boolean)[0]??"";const s=((e??"").split("@")[0]??"").split(/[._\-+]/).filter(Boolean)[0]??"";return s?s[0].toUpperCase()+s.slice(1):""},dK=(t,e)=>tA(t,e).charAt(0).toUpperCase(),fK=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=et(sR),i=et(cR),[a,c]=v.useState(!1),[u,f]=v.useState(!1),[h,p]=v.useState(!1),[m,_]=v.useState(!1),{containerRef:x,onKeyDown:y}=YG(),w=et(Tf),S=dK(r,s);if(!S)return w?E.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[E.jsx(Mk,{className:"h-7 w-7 rounded-full"}),E.jsx(Mk,{className:"h-3 w-16"})]}):null;const T=tA(r,s),P=(r==null?void 0:r.trim())||null,k=(s==null?void 0:s.trim())||null,A=async()=>{_(!0);try{const O=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!O.ok)throw new Error(`Logout failed: ${O.status}`)}catch(O){uK.warn("Logout request failed",O),mt.error("Could not log out. Please try again."),_(!1);return}window.location.reload()};return E.jsxs(E.Fragment,{children:[E.jsxs(LR,{open:a,onOpenChange:c,children:[E.jsx(NR,{asChild:!0,children:E.jsxs("button",{type:"button","aria-label":"Account",className:`text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[E.jsx("span",{className:"border-main-border bg-main-input flex h-7 w-7 items-center justify-center rounded-full border text-[11px] leading-none font-semibold",children:S}),T?E.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:T}):null]})}),E.jsx(DR,{children:E.jsxs(jR,{ref:x,onKeyDown:y,role:"menu",className:"bg-surface-2 z-[60] min-w-[180px] rounded-lg p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[P||k?E.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[P?E.jsx("div",{className:"text-content truncate text-xs font-medium",children:P}):null,k?E.jsx("div",{className:"text-content-muted truncate text-[11px]",children:k}):null]}):null,E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),f(!0)},disabled:!i,className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[E.jsx(R5,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),p(!0)},className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none",children:[E.jsx(Bz,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:A,disabled:m,className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[E.jsx(Zz,{className:"h-3.5 w-3.5",weight:"bold"}),m?"Logging out…":"Log out"]})]})})]}),E.jsx(U_,{isOpen:u,onClose:()=>f(!1)}),E.jsx(cK,{isOpen:h,onClose:()=>p(!1),contactEmail:s??void 0})]})},hK=({onClose:t})=>E.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[E.jsx(ZG,{onClose:t}),E.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:E.jsx(kG,{})}),E.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:E.jsx(fK,{side:"top",align:"start"})})]});async function pK(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(a){const c=n[i-1];if(c===void 0||r&&!r(a))throw a;s==null||s(a,i,c),await new Promise(u=>setTimeout(u,c))}}const Lk=Ss("useServerConfig"),nA=[250,500,1e3,2e3,4e3],Nk=nA.length+1,mK=async()=>{var n;const t=await fetch("/api/health");if(!t.ok)throw new Error(`Failed to fetch config: ${t.status}`);const e=await t.json();if(!e.framework)throw new Error("Server did not return framework information");return{userPort:((n=e.ports)==null?void 0:n.userDevServer)||3e3,framework:e.framework}},gK=()=>{const[t,e]=v.useState(null),[n,r]=v.useState(!0),[s,i]=v.useState(null),a=v.useCallback(async()=>{try{r(!0),i(null);const c=await pK(mK,{delaysMs:nA,onRetry:(u,f,h)=>{Lk.warn(`Server config fetch failed (attempt ${f}); retrying in ${h}ms`,u)}});return e(c),c}catch(c){const u=c instanceof Error?c.message:"Failed to fetch server config";throw i(u),Lk.warn("Error fetching server config:",c),c}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},vK="#1C1C20",Fi=[118,118,124],Dk=.85,yK=3,_K=.15,vp=36,xK=4.4,wK=.7,bK=3.5,SK=.8,jk=9,EK=11,CK=[1.35,1.12,.95,.85],kK=[0,1.1,2.3,3.1],PK=[0,.35,.16,.13],TK=[.9,.5,.4,.35],Ka=3,C1=[[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.23,level:1},{x1:.14,y1:.28,x2:.3,y2:.87,level:1},{x1:.34,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.155,x2:.225,y2:.205,level:2},{x1:.7,y1:.155,x2:.755,y2:.205,level:2},{x1:.775,y1:.155,x2:.83,y2:.205,level:2},{x1:.165,y1:.32,x2:.275,y2:.375,level:2},{x1:.165,y1:.415,x2:.275,y2:.47,level:2},{x1:.165,y1:.51,x2:.275,y2:.565,level:2},{x1:.37,y1:.32,x2:.585,y2:.56,level:2},{x1:.615,y1:.32,x2:.83,y2:.56,level:2},{x1:.37,y1:.61,x2:.83,y2:.83,level:2},{hline:!0,x1:.39,x2:.81,y:.685,level:3},{hline:!0,x1:.39,x2:.75,y:.755,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.16,y1:.17,x2:.52,y2:.45,level:1},{x1:.58,y1:.17,x2:.685,y2:.29,level:1},{x1:.715,y1:.17,x2:.84,y2:.29,level:1},{x1:.58,y1:.33,x2:.685,y2:.45,level:1},{x1:.715,y1:.33,x2:.84,y2:.45,level:1},{x1:.16,y1:.55,x2:.84,y2:.85,level:1},{x1:.19,y1:.21,x2:.36,y2:.33,level:2},{hline:!0,x1:.19,x2:.48,y:.37,level:3},{hline:!0,x1:.19,x2:.42,y:.42,level:3},{x1:.19,y1:.6,x2:.49,y2:.8,level:2},{hline:!0,x1:.53,x2:.8,y:.63,level:3},{hline:!0,x1:.53,x2:.76,y:.7,level:3},{hline:!0,x1:.53,x2:.79,y:.77,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.22,level:1},{x1:.14,y1:.28,x2:.36,y2:.87,level:1},{x1:.39,y1:.28,x2:.61,y2:.87,level:1},{x1:.64,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.15,x2:.225,y2:.2,level:2},{x1:.165,y1:.32,x2:.335,y2:.52,level:2},{x1:.415,y1:.32,x2:.585,y2:.52,level:2},{x1:.665,y1:.32,x2:.835,y2:.52,level:2},{hline:!0,x1:.165,x2:.335,y:.6,level:3},{hline:!0,x1:.165,x2:.3,y:.67,level:3},{hline:!0,x1:.415,x2:.585,y:.6,level:3},{hline:!0,x1:.415,x2:.55,y:.67,level:3},{hline:!0,x1:.665,x2:.835,y:.6,level:3},{hline:!0,x1:.665,x2:.8,y:.67,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.3,y1:.22,x2:.7,y2:.74,level:1},{x1:.34,y1:.27,x2:.55,y2:.34,level:2},{hline:!0,x1:.36,x2:.64,y:.42,level:3},{hline:!0,x1:.36,x2:.6,y:.49,level:3},{hline:!0,x1:.36,x2:.62,y:.56,level:3},{x1:.5,y1:.63,x2:.575,y2:.69,level:2},{x1:.595,y1:.63,x2:.66,y2:.69,level:2}]],yp=t=>{let e=t|0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),e^=e>>>16,(e>>>0)/4294967296},Up=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Za=(t,e)=>(Math.round(t/e-.5)+.5)*e,RK=Math.sin(Math.PI/3),Fk=(t,e,n,r,s)=>{if(t.beginPath(),e===0)t.arc(n,r,s,0,Math.PI*2);else if(e===1){const i=s*RK;t.moveTo(n,r-s),t.lineTo(n+i,r+s/2),t.lineTo(n-i,r+s/2),t.closePath()}else{const i=s*.85;t.rect(n-i,r-i,i*2,i*2)}t.fill()},AK=(t,e,n)=>{let r;if(n.hline){const s=Math.max(n.x1-t,t-n.x2,0),i=Math.abs(e-n.y1);r=Math.hypot(s,i)-jk}else{const s=Math.max(n.x1-t,t-n.x2,0),i=Math.max(n.y1-e,e-n.y2,0);s===0&&i===0?r=-Math.min(t-n.x1,n.x2-t,e-n.y1,n.y2-e):r=Math.hypot(s,i),r=Math.abs(r)-jk}return Up(.5-r/(2*EK))},rA=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=at(rR),r=v.useRef(null),s=v.useCallback(i=>{var N;if((N=r.current)==null||N.call(r),r.current=null,!i)return;const a=i.getContext("2d");if(!a)return;e&&n(D=>D+1);const c=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],f=0,h=0,p=vp,m=vp,_=null,x=null,y=0,w=-1;const S=new Array(33),T=D=>{const F=Math.round(D*32);let q=S[F];if(!q){const X=F/32,W=Math.round(Fi[0]+(255-Fi[0])*X),G=Math.round(Fi[1]+(255-Fi[1])*X),K=Math.round(Fi[2]+(255-Fi[2])*X);q=`rgba(${W}, ${G}, ${K}, ${Dk})`,S[F]=q}return q},P=D=>{const F=1-.35*D,q=Math.round(Fi[0]*F),X=Math.round(Fi[1]*F),W=Math.round(Fi[2]*F);return`rgba(${q}, ${X}, ${W}, ${Dk})`},k=D=>{let F=Math.floor(Math.random()*C1.length);F===w&&(F=(F+1)%C1.length),w=F;const q=[0,0,0,0],X=C1[F].map((j,Y)=>{const ne=j.level,ie=q[ne]++,J=kK[ne]+ie*PK[ne],ce=TK[ne]+yp(F*131+Y*17+5)*.2;if(j.hline){const le=Za((j.y??0)*h,m);return{hline:!0,x1:Za(j.x1*f,p),x2:Za(j.x2*f,p),y1:le,y2:le,level:ne,start:J,dur:ce}}const we=Za(j.x1*f,p),oe=Za((j.y1??0)*h,m);return{hline:!1,x1:we,y1:oe,x2:Math.max(Za(j.x2*f,p),we+p),y2:Math.max(Za((j.y2??0)*h,m),oe+m),level:ne,start:J,dur:ce}}),W=X.reduce((j,Y)=>Math.max(j,Y.start+Y.dur),0),G=u.length,K=new Float32Array(G*Ka),$=new Int16Array(G*Ka).fill(-1),te=new Uint8Array(G),H=X[0];for(let j=0;j<G;j++){const Y=u[j];Y.x>H.x1&&Y.x<H.x2&&Y.y>H.y1&&Y.y<H.y2&&(te[j]=1);const ne=j*Ka;for(let ie=0;ie<X.length;ie++){const J=AK(Y.x,Y.y,X[ie]);if(J<=.02)continue;let ce=ne;for(let we=ne;we<ne+Ka;we++){if($[we]===-1){ce=we;break}K[we]<K[ce]&&(ce=we)}($[ce]===-1||J>K[ce])&&(K[ce]=J,$[ce]=ie)}}return{startT:D,buildEnd:W,els:X,frame:H,cellQ:K,cellEl:$,inFrame:te}},A=()=>{const D=i.getBoundingClientRect();f=Math.max(1,D.width),h=Math.max(1,D.height);const F=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(f*F),i.height=Math.round(h*F),a.setTransform(F,0,0,F,0,0);const q=Math.max(8,Math.round(f/vp)),X=Math.max(6,Math.round(h/vp));p=f/q,m=h/X,u=[];for(let W=0;W<X;W++){const G=X>1?W/(X-1):.5,K=xK*(1+wK*.4*(G*2-1));for(let $=0;$<q;$++){const te=W*8191+$*131+1,H={x:($+.5)*p,y:(W+.5)*m,size:K,seed:te,phase:yp(te),kind:0};H.kind=Math.floor(yp(te*97)*3),u.push(H)}}x=null,_=null},O=new Float32Array(32),L=D=>{a.fillStyle=vK,a.fillRect(0,0,f,h),_||(_=k(D+.2)),D>=_.startT+_.buildEnd+bK&&(x=_,y=D,_=k(D+.2));let F=0;x&&(F=1-Up((D-y)/SK),F<=0&&(x=null));const q=_;for(let H=0;H<q.els.length;H++){const j=q.els[H];O[H]=Up(Math.min(1,Math.max(0,(D-q.startT-j.start)/j.dur)))}const X=O[0],W=P(0),G=P(X),K=F>0?P(F):W,$=F>0?P(Math.max(X,F)):G,te=u.length;for(let H=0;H<te;H++){const j=u[H];let Y=0,ne=0;const ie=H*Ka;for(let De=ie;De<ie+Ka;De++){const Pe=q.cellEl[De];if(Pe<0)break;const Qe=q.cellQ[De]*O[Pe];Qe>Y&&(Y=Qe,ne=q.els[Pe].level)}if(x)for(let De=ie;De<ie+Ka;De++){const Pe=x.cellEl[De];if(Pe<0)break;const Qe=x.cellQ[De]*F;Qe>Y&&(Y=Qe,ne=x.els[Pe].level)}const J=D/yK+j.phase,ce=Math.floor(J),we=J-ce,oe=Up(Math.min(we,1-we)/_K),le=Math.floor(yp(j.seed*97+ce*7919)*3);le!==j.kind&&Y<.02&&oe<.05&&(j.kind=le);const Fe=Math.max(oe*(1-Y),Y);if(!(Fe<.01))if(Y<.02){const De=q.inFrame[H]===1,Pe=x?x.inFrame[H]===1:!1;De?a.fillStyle=Pe?$:G:a.fillStyle=Pe?K:W;const Qe=Math.max(De?X:0,Pe?F:0);Fk(a,j.kind,j.x,j.y,j.size*Fe*(1-.2*Qe))}else{a.fillStyle=T(Y);const De=1+(CK[ne]-1)*Y;Fk(a,j.kind,j.x,j.y,j.size*Fe*De)}}};A();let R=0;if(c)_=k(-100),L(0);else{const D=performance.now(),F=q=>{L((q-D)/1e3),R=requestAnimationFrame(F)};R=requestAnimationFrame(F)}const M=new ResizeObserver(()=>{A(),c&&(_=k(-100),L(0))});M.observe(i),r.current=()=>{cancelAnimationFrame(R),M.disconnect(),e&&n(D=>D-1)}},[e,n]);return E.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},IK=async(t=null)=>{if(t)return MK(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return _p();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return _p()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable",upstreamStatus:null}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable",upstreamStatus:null}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable",upstreamStatus:null}:_p()},sA=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},MK=t=>sA(t),_p=()=>sA("/"),k1=Ss("usePreviewUpstreamHealth"),OK=500,LK=4e3,NK=15e3,DK=3,jK=(t,e={})=>{const n=v.useRef(null),r=v.useRef(null),s=e.probeMsWhileDown??OK,i=e.probeMsWhileUp??LK,a=e.firstUnreachableCaptureAfterMs??NK,c=e.rerunProbeImmediatelyOnVersion,u=e.probePath??null,f=e.skip??!1,h=v.useRef(e.onPersistentUpstreamServerErrors);h.current=e.onPersistentUpstreamServerErrors;const[p,m]=v.useState(t==="static"),[_,x]=v.useState(0),[y,w]=v.useState(null),[S,T]=v.useState(0),[P,k]=v.useState(!1),[A,O]=v.useState(!1),[L,R]=v.useState(t==="static"?null:"upstream_unreachable");return v.useEffect(()=>{if(t==="static"){m(!0),w(null),T(0),k(!1),O(!0),R(null);return}if(f){m(!1),w(null),T(0),k(!1),O(!0),R("upstream_unreachable"),n.current=null;return}let M=!0;const N=Date.now();w(N),T(0),k(!1),m(!1),O(!1),R("upstream_unreachable");const D={current:!1},F={current:!1},q={current:!1},X={current:null},W={current:!1},G={current:!1},K={current:0},$={current:!1},te={current:null};let H=null;const j=()=>{q.current||(q.current=!0,M&&O(!0))},Y=()=>{H!==null&&(clearTimeout(H),H=null)},ne=(J,ce)=>{Y(),H=setTimeout(ce,J)},ie=async()=>{var Qe;if(!M)return;T(dt=>dt+1);const{isOk:J,unavailableReason:ce,upstreamStatus:we}=await IK(u);if(!M)return;j(),te.current=we;const oe=J&&we!==null&&we>=500;oe&&G.current?K.current+=1:J&&!oe&&(K.current=0);const le=K.current>=DK;if(le&&!$.current&&we!==null&&($.current=!0,Se==null||Se.capture("preview_upstream_error_responses",{framework:t,upstream_status:we,consecutive_count:K.current}),k1.warn(`Preview upstream is listening but has served ${K.current} consecutive ${we} responses`),(Qe=h.current)==null||Qe.call(h,{upstreamStatus:we,consecutiveCount:K.current})),J&&!le){oe||(G.current=!0,$.current=!1);const dt=!W.current;W.current=!0,m(!0),R(null),X.current=null,F.current=!1,k(!1),D.current?dt&&(Se==null||Se.capture("preview_upstream_restored",{framework:t})):(D.current=!0,Se==null||Se.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-N})),ne(i,ie);return}const De=W.current;W.current=!1,m(!1),R(ce),X.current===null&&(X.current=Date.now(),F.current=!1,k(!1)),De&&(Se==null||Se.capture("preview_upstream_lost",{framework:t,upstream_status:we}),x(dt=>dt+1),k1.warn("Preview upstream became unavailable after it was ready"));const Pe=Date.now()-X.current;Pe>=a&&!F.current&&(F.current=!0,k(!0),Se==null||Se.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Pe,upstream_status:te.current}),k1.warn("Dev server did not become ready within timeout window")),ne(s,ie)};return n.current=()=>ne(0,ie),ne(0,ie),()=>{M=!1,n.current=null,Y()}},[t,s,i,a,u,f]),v.useEffect(()=>{var N;if(t==="static"||c===void 0)return;const M=r.current;r.current=c,M!==null&&M!==c&&((N=n.current)==null||N.call(n))},[t,c]),{isUpstreamReady:p,iframeRemountKey:_,probeStartedAt:y,probeAttemptCount:S,isFirstUnreachableWindowExceeded:P,initialProbeComplete:A,unavailableReason:L}};function FK(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const iA=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}`},oA=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${iA(t)}${e}`:e,VK="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",$K=t=>VK,HK=Ss("PreviewSurface"),Vk=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",aA=({target:t,src:e,framework:n,remountKey:r})=>(et(p0),E.jsx("div",{className:"relative h-full w-full",children:E.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:$K(),onLoad:()=>{Se==null||Se.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Se==null||Se.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Vk(e,t),framework:n}))},onError:()=>{Se==null||Se.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Se==null||Se.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Vk(e,t),framework:n})),HK.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),zK="modulepreload",UK=function(t){return"/"+t},$k={},BK=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=a(n.map(f=>{if(f=UK(f),f in $k)return;$k[f]=!0;const h=f.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":zK,h||(m.as="script"),m.crossOrigin="",m.href=f,u&&m.setAttribute("nonce",u),document.head.appendChild(m),h)return new Promise((_,x)=>{m.addEventListener("load",_),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function i(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return s.then(a=>{for(const c of a||[])c.status==="rejected"&&i(c.reason);return e().catch(i)})},WK=v.lazy(()=>BK(()=>Promise.resolve().then(()=>kq),void 0)),GK={surface:"relative flex h-full w-full items-center justify-center bg-main px-6",overlay:"absolute inset-0 z-10 flex items-center justify-center bg-main/90 px-6",page:"relative flex h-screen w-full items-center justify-center bg-main px-6"},KK={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},ZK={neutral:"rounded-md border border-divider bg-transparent px-5 py-2 text-sm font-medium text-content transition-colors hover:bg-surface-3",ghost:"rounded-md px-5 py-2 text-sm font-medium text-content-muted transition-colors hover:text-content"},Ic=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:c="md",children:u,state:f,role:h="status",busy:p=!1,className:m=""})=>{const _=v.useCallback(y=>{y&&f&&(Se==null||Se.capture("status_surface_shown",{state:f,tone:i,fill:a}))},[f,i,a]),x=!!(e||n||r||u||s!=null&&s.length);return E.jsxs("div",{ref:_,className:`${GK[a]} ${m}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":f,children:[t?E.jsx("div",{className:"absolute inset-0",children:t}):null,x?E.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?E.jsx("h2",{className:KK[c],children:n}):null,r?E.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?E.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(y=>E.jsx("button",{type:"button",onClick:y.onClick,className:ZK[y.variant??"neutral"],children:y.label},y.label))}):null]}):null]})},B_=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?E.jsx(Ic,{...r,size:n,busy:!0,backdrop:E.jsx(rA,{trackGlobalLoaderCount:e})}):t==="logo"?E.jsx(Ic,{...r,size:n,busy:!0,backdrop:E.jsx(v.Suspense,{fallback:null,children:E.jsx(WK,{className:"absolute inset-0"})})}):E.jsx(Ic,{...r,size:n,busy:!0,media:E.jsx(h0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),lA=({icon:t,...e})=>E.jsx(Ic,{...e,tone:"neutral",media:t?E.jsx("div",{className:"text-content-muted",children:t}):void 0}),qx=t=>E.jsx(Ic,{...t,tone:"error",role:"alert"}),Hk="/static/",qK=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(Hk)}catch{return t.endsWith(Hk)}},YK=t=>t==="spawn_error"?"The direction is saved, but its preview process didn’t start.":t==="exited"?"The direction is saved, but its preview stopped before it was ready.":t==="timeout"?"The direction is saved, but its preview took too long to become ready.":t==="missing_dev_script"?"The direction is saved, but Rivet couldn’t find a dev script to preview it.":t==="missing_static_entry"?"The direction is saved, but Rivet couldn’t find an HTML entry to preview it.":"The direction is saved, but Rivet couldn’t prepare its preview.",XK=t=>t.status==="failed"?{state:"variant_failed",title:"Rivet couldn’t build this direction",description:"Something stopped before a preview was ready. Pick another direction or remove this one.",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:YK(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,QK=({issue:t})=>E.jsx(Ic,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,children:t.detail?E.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:t.detail}):null}),JK=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{const r=et(M_),s=at(M_),i=et(Fm),a=at(Fm),c=et(Pf),u=et(p0),f=et(O_),h=et(L_),p=et(iR),m=et(oR),_=at(L_),x=et(lo),y=et(D_),w=at(O_),S=c.active&&c.projectContext.kind==="fresh",T=et(N_),P=c.active?c.variants.find($e=>$e.workItemId===T&&($e.status==="pending"||$e.status==="running"||$e.status==="succeeded"&&!$e.preview&&typeof $e.port!="number"&&(!$e.previewUnavailable||$e.previewUnavailable.reason==="idle_timeout")))??null:null,k=c.active&&c.variants.some($e=>$e.status==="pending"||$e.status==="running"),A=S||k,O=c.active?c.variants.find($e=>$e.workItemId===T)??null:null,L=O?XK(O):null,R=e==="static"&&i!==null&&qK(i);v.useEffect(()=>{c.active||w(!1)},[c.active,w]);const M=v.useRef(!1);v.useEffect(()=>{const $e=!!(x!=null&&x.left||x!=null&&x.right),Be=$e&&!M.current;M.current=$e;const ot=c.active?c.sessionId:null;!ot||!FK({enteringSplit:Be,isExistingSession:c.active&&c.projectContext.kind==="existing",hasActiveVariantProxy:f&&h!==null})||(w(!1),_(null),s(Pt=>Pt+1),fetch(`/api/variants/${encodeURIComponent(ot)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[x,c,f,h,w,_,s]);const D=v.useMemo(()=>{var Ye;if(f||i&&!R||!c.active)return null;const{stage:$e,variants:Be}=c,ot=$e==="ready"||$e==="degraded",Pt=Be.some(At=>{var Bn,In;return((Bn=At.refinement)==null?void 0:Bn.status)==="pending"||((In=At.refinement)==null?void 0:In.status)==="running"});if(!ot&&!Pt)return null;const tt=Be.find(At=>{var Bn;return At.status==="succeeded"&&((Bn=At.preview)==null?void 0:Bn.kind)==="static_artifact"});return((Ye=tt==null?void 0:tt.preview)==null?void 0:Ye.kind)==="static_artifact"?tt.preview.url:null},[R,i,f,c])??i,F=v.useMemo(()=>!c.active||!D?null:c.variants.find($e=>{var Be;return((Be=$e.preview)==null?void 0:Be.kind)==="static_artifact"&&D.startsWith($e.preview.url)})??null,[D,c]),q=v.useMemo(()=>{if((y==null?void 0:y.previewKind)==="static")return{kind:"variant",sessionId:y.sessionId,variantId:y.variantId};if(!c.active)return jm;if(F)return{kind:"variant",sessionId:c.sessionId,variantId:F.workItemId};if(D){const Be=D.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),ot=Be!=null&&Be[1]?decodeURIComponent(Be[1]):null,Pt=Be!=null&&Be[2]?decodeURIComponent(Be[2]):null;if(ot===c.sessionId&&Pt&&c.variants.some(At=>At.workItemId===Pt))return{kind:"variant",sessionId:c.sessionId,variantId:Pt};const tt=D.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Ye=tt!=null&&tt[1]?decodeURIComponent(tt[1]):null;if(Ye&&c.variants.some(At=>At.workItemId===Ye))return{kind:"variant",sessionId:c.sessionId,variantId:Ye}}const $e=!!(x!=null&&x.left||x!=null&&x.right);return(!$e||S)&&!D&&f&&h&&c.variants.some(Be=>Be.workItemId===h)?{kind:"variant",sessionId:c.sessionId,variantId:h}:(!$e||S)&&!D&&T&&c.variants.some(Be=>Be.workItemId===T)?{kind:"variant",sessionId:c.sessionId,variantId:T}:jm},[y,F,c,f,h,D,x,S,T]),X=v.useRef(null);v.useEffect(()=>{var Pt,tt;if(!F||((Pt=F.preview)==null?void 0:Pt.kind)!=="static_artifact"||((tt=F.refinement)==null?void 0:tt.status)!=="succeeded")return;const $e=`${F.workItemId}:${F.refinement.workItemId}`;if(X.current===$e)return;X.current=$e;const Be=F.preview.url.includes("?")?"&":"?",ot=`${F.preview.url}${Be}refinement=${encodeURIComponent(F.refinement.workItemId)}`;D!==ot&&(a(ot),s(Ye=>Ye+1))},[D,F,s,a,c]);const W=D!==null&&yG(D),G=D!==null&&!W||S&&!f&&!W,{isUpstreamReady:K,iframeRemountKey:$,probeAttemptCount:te,initialProbeComplete:H}=jK(e,{rerunProbeImmediatelyOnVersion:r,probePath:W?D:null,skip:G}),[j,Y]=v.useState(()=>p&&K?r:null),ne=v.useRef(null);v.useEffect(()=>{if(!p){ne.current=null,Y(null);return}if(j===r){ne.current=null;return}const $e=ne.current;if(!$e||$e.remountKey!==r){ne.current={remountKey:r,probeAttemptCount:te};return}K&&te>$e.probeAttemptCount&&(ne.current=null,Y(r))},[j,r,p,te,K]);const J=D!==null&&!W||K,we=m||p&&j!==r||p&&!J,oe=`${$}:${r}`,le=QR(window.location.pathname),Fe=e==="static"?`/static${le??"/"}`:le??"/",De=iA(u);let Pe=null;D&&(Pe=oA({agentApplyMode:u,url:D}));const dt=P||L||we?"about:blank":(W&&!J?"about:blank":Pe)??(J?`${De}${Fe}`:"about:blank"),qt=!!P||!!L||!J&&H;let xe=null;return we?xe=E.jsx(B_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):P?xe=E.jsx(B_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:E.jsx("span",{className:"sr-only",children:"Building your direction"})}):L?xe=E.jsx(QK,{issue:L}):qt&&(xe=A?E.jsx(lA,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):E.jsx(qx,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),E.jsxs("div",{className:"relative h-full w-full",children:[xe,E.jsx(aA,{target:q,src:dt,framework:e,remountKey:oe})]})};function zk({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var P;const c=et(lo),u=at(lo),f=r0(),h=et(Pf),p=et(p0),m=v.useRef(!1),_=v.useCallback(()=>{m.current||(m.current=!0,of({source:i,sessionId:e,variantId:n}))},[i,e,n]),x=v.useCallback(()=>{if(a){u(null);const L=Um("ended",c);f==null||f.capture(L.event,L.properties);return}_();const k={...c};delete k[t];const A=k.left||k.right?k:null;u(A);const O=Um(A?"updated":"ended",A??c);f==null||f.capture(O.event,O.properties)},[a,f,u,t,c,_]),y=v.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),w=v.useMemo(()=>!h.active||h.sessionId!==e?null:h.variants.find(k=>k.workItemId===n)??null,[e,n,h]),S=v.useMemo(()=>{var A,O;let k=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 L=w.preview.url.includes("?")?"&":"?";k=`${w.preview.url}${L}refinement=${encodeURIComponent(w.refinement.workItemId)}`}return oA({agentApplyMode:p,url:k})},[p,w,r]),T=((P=w==null?void 0:w.refinement)==null?void 0:P.status)==="succeeded"?`${n}:${w.refinement.workItemId}`:n;return E.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[E.jsxs("div",{className:"variant-split-secondary-toolbar",children:[E.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),E.jsx(to,{label:"Collapse",children:E.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:x,"aria-label":"Collapse split view",children:E.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:E.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),E.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:E.jsx(aA,{target:y,src:S,framework:"static",remountKey:T})})]})}const Uk=240;function eZ(){const t=et(ef),e=et(Ix),n=v.useRef(null);return v.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-Uk/2,s=e.y-22;n.current.style.transform=`translate3d(${r}px, ${s}px, 0)`},[t,e]),!t||!e?null:E.jsx("div",{ref:n,"aria-hidden":"true",className:"variant-drag-ghost",style:{width:Uk},children:E.jsxs("div",{className:"variant-drag-ghost-body",children:[E.jsxs("div",{className:"variant-drag-ghost-row",children:[E.jsx("div",{className:"variant-drag-ghost-title",children:t.label}),t.runLabel?E.jsx("div",{className:"variant-drag-ghost-tag",style:Z5(t.runLabel),children:t.runLabel}):null]}),t.description?E.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function tZ(){const t=et(ef),e=et(Ix),n=et(lo),r=at(ef),s=at(lo),i=r0(),a=v.useRef(null),[c,u]=v.useState(null),[f,h]=v.useState("hidden");v.useEffect(()=>{if(!t){h("hidden"),u(null);return}const _=requestAnimationFrame(()=>h("visible"));return()=>cancelAnimationFrame(_)},[t]);const p=v.useCallback((_,x)=>{const y=a.current;if(!y)return null;const w=y.getBoundingClientRect();return _<w.left||_>w.right||x<w.top||x>w.bottom?null:_<(w.left+w.right)/2?"left":"right"},[]);if(v.useEffect(()=>{if(!t||!e)return;const _=p(e.x,e.y);u(x=>x===_?x:_)},[t,e,p]),v.useEffect(()=>{if(!t)return;const _=x=>{const y=p(x.clientX,x.clientY);if(y&&t.url){const w={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},S=n==null?void 0:n[y];S&&(S.sessionId!==w.sessionId||S.variantId!==w.variantId)&&of(S);const T={...n??{},[y]:w};s(T);const P=Um(n?"updated":"started",T);i==null||i.capture(P.event,P.properties),h("exiting"),window.setTimeout(()=>r(null),220)}else of(t),h("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_)}},[t,p,i,r,s,n]),!t)return null;const m=["variant-drop-zones",f==="visible"&&"is-visible",f==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return E.jsxs("div",{ref:a,className:m,"aria-hidden":"true",children:[E.jsx(Bk,{side:"left",hovered:c==="left",canDrop:!!t.url,label:t.label}),E.jsx(Bk,{side:"right",hovered:c==="right",canDrop:!!t.url,label:t.label})]})}function Bk({side:t,hovered:e,canDrop:n,label:r}){return E.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[E.jsxs("div",{className:"variant-drop-zone-inner",children:[E.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),E.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),E.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:E.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),E.jsx("div",{className:"variant-drop-zone-border"})]})}const cA=(t,e,n)=>{var i,a;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(c=>c.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((a=r.refinement)==null?void 0:a.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},Wk=(t,e)=>{if(!t)return;const n=cA(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},nZ=()=>E.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:E.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:E.jsx(rA,{trackGlobalLoaderCount:!1})})}),rZ=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=gK();return v.useEffect(()=>{r().catch(a=>{Se==null||Se.capture("preview_config_load_failed",{message:a instanceof Error?a.message:"unknown_error",attempts:Nk})})},[r]),s?E.jsx(nZ,{}):i||!n?E.jsx(qx,{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:()=>{Se==null||Se.capture("preview_config_retry_clicked"),r().catch(a=>{Se==null||Se.capture("preview_config_load_failed",{message:a instanceof Error?a.message:"unknown_error",attempts:Nk})})}}]}):E.jsx(sZ,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function sZ(t){const e=et(lo),n=et(ef),r=et(Pf),s=et(Fm),i=e==null?void 0:e.left,a=e==null?void 0:e.right,c=v.useMemo(()=>{var A,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const y=(A=i??a)==null?void 0:A.variantId,w=r.variants.filter(L=>{var R;return L.status==="succeeded"&&((R=L.preview)==null?void 0:R.kind)==="static_artifact"&&L.workItemId!==y}),S=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),P=w.find(L=>{var R;return((R=L.preview)==null?void 0:R.kind)==="static_artifact"&&L.preview.url===S})??w[0];if(((O=P==null?void 0:P.preview)==null?void 0:O.kind)!=="static_artifact")return;const k=cA(r,r.sessionId,P.workItemId);if(k)return{sessionId:r.sessionId,variantId:P.workItemId,label:P.label,url:k,source:"live"}},[r,i,a,s]),u=Wk(i,r)??(a?c:void 0),f=Wk(a,r)??(i?c:void 0),h=!i&&!!u,p=!a&&!!f,m=!!(u||f),_=E.jsx(JK,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return E.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:E.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[E.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&E.jsx(zk,{side:"left",sessionId:u.sessionId,variantId:u.variantId,url:u.url,label:u.label,source:u.source,isFallback:h},`left-${u.sessionId}:${u.variantId}:${u.url}`),!(u&&f)&&E.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:_}),f&&E.jsx(zk,{side:"right",sessionId:f.sessionId,variantId:f.variantId,url:f.url,label:f.label,source:f.source,isFallback:p},`right-${f.sessionId}:${f.variantId}:${f.url}`)]}),E.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),E.jsx(tZ,{}),E.jsx(eZ,{})]})})}function Gi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
115
+ * GSAP 3.15.0
116
+ * https://gsap.com
117
+ *
118
+ * @license Copyright 2008-2026, GreenSock. All rights reserved.
119
+ * Subject to the terms at https://gsap.com/standard-license
120
+ * @author: Jack Doyle, jack@greensock.com
121
+ */var Jr={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},af={duration:.5,overwrite:!1,delay:0},Yx,zn,zt,_s=1e8,Et=1/_s,W_=Math.PI*2,iZ=W_/4,oZ=0,dA=Math.sqrt,aZ=Math.cos,lZ=Math.sin,An=function(e){return typeof e=="string"},tn=function(e){return typeof e=="function"},uo=function(e){return typeof e=="number"},Xx=function(e){return typeof e>"u"},_i=function(e){return typeof e=="object"},Rr=function(e){return e!==!1},Qx=function(){return typeof window<"u"},xp=function(e){return tn(e)||An(e)},fA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},er=Array.isArray,cZ=/random\([^)]+\)/g,uZ=/,\s*/g,Gk=/(?:-?\.?\d|\.)+/gi,hA=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Sc=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,P1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,pA=/[+-]=-?[.\d]+/,dZ=/[^,'"\[\]\s]+/gi,fZ=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Kt,ii,G_,Jx,ts={},Bm={},mA,gA=function(e){return(Bm=ru(e,ts))&&Or},ew=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},lf=function(e,n){return!n&&console.warn(e)},vA=function(e,n){return e&&(ts[e]=n)&&Bm&&(Bm[e]=n)||ts},cf=function(){return 0},hZ={suppressEvents:!0,isStart:!0,kill:!1},Bp={suppressEvents:!0,kill:!1},pZ={suppressEvents:!0},tw={},na=[],K_={},yA,Gr={},T1={},Kk=30,Wp=[],nw="",rw=function(e){var n=e[0],r,s;if(_i(n)||tn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Wp.length;s--&&!Wp[s].targetTest(n););r=Wp[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new $A(e[s],r)))||e.splice(s,1);return e},wl=function(e){return e._gsap||rw(xs(e))[0]._gsap},_A=function(e,n,r){return(r=e[n])&&tn(r)?e[n]():Xx(r)&&e.getAttribute&&e.getAttribute(n)||r},Ar=function(e,n){return(e=e.split(",")).forEach(n)||e},sn=function(e){return Math.round(e*1e5)/1e5||0},Gt=function(e){return Math.round(e*1e7)/1e7||0},Mc=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},mZ=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Wm=function(){var e=na.length,n=na.slice(0),r,s;for(K_={},na.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},sw=function(e){return!!(e._initted||e._startAt||e.add)},xA=function(e,n,r,s){na.length&&!zn&&Wm(),e.render(n,r,!!(zn&&n<0&&sw(e))),na.length&&!zn&&Wm()},wA=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(dZ).length<2?n:An(e)?e.trim():e},bA=function(e){return e},ns=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},gZ=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},ru=function(e,n){for(var r in n)e[r]=n[r];return e},Zk=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=_i(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Gm=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Md=function(e){var n=e.parent||Kt,r=e.keyframes?gZ(er(e.keyframes)):ns;if(Rr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},vZ=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},SA=function(e,n,r,s,i){var a=e[s],c;if(i)for(c=n[i];a&&a[i]>c;)a=a._prev;return a?(n._next=a._next,a._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=a,n.parent=n._dp=e,n},E0=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,a=n._next;i?i._next=a:e[r]===n&&(e[r]=a),a?a._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},da=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},bl=function(e,n){if(e&&(!n||n._end>e._dur||n._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},yZ=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},Z_=function(e,n,r,s){return e._startAt&&(zn?e._startAt.revert(Bp):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},_Z=function t(e){return!e||e._ts&&t(e.parent)},qk=function(e){return e._repeat?su(e._tTime,e=e.duration()+e._rDelay)*e:0},su=function(e,n){var r=Math.floor(e=Gt(e/n));return e&&r===e?r-1:r},Km=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},C0=function(e){return e._end=Gt(e._start+(e._tDur/Math.abs(e._ts||e._rts||Et)||0))},k0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Gt(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),C0(e),r._dirty||bl(r,e)),e},EA=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Km(e.rawTime(),n),(!n._dur||Af(0,n.totalDuration(),r)-n._tTime>Et)&&n.render(r,!0)),bl(e,n)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-Et}},di=function(e,n,r,s){return n.parent&&da(n),n._start=Gt((uo(r)?r:r||e!==Kt?ps(e,r,n):e._time)+n._delay),n._end=Gt(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),SA(e,n,"_first","_last",e._sort?"_start":0),q_(n)||(e._recent=n),s||EA(e,n),e._ts<0&&k0(e,e._tTime),e},CA=function(e,n){return(ts.ScrollTrigger||ew("scrollTrigger",n))&&ts.ScrollTrigger.create(n,e)},kA=function(e,n,r,s,i){if(ow(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!zn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&yA!==Kr.frame)return na.push(e),e._lazy=[i,s],1},xZ=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},q_=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},wZ=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&xZ(e)&&!(!e._initted&&q_(e))||(e._ts<0||e._dp._ts<0)&&!q_(e))?0:1,c=e._rDelay,u=0,f,h,p;if(c&&e._repeat&&(u=Af(0,e._tDur,n),h=su(u,c),e._yoyo&&h&1&&(a=1-a),h!==su(e._tTime,c)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||zn||s||e._zTime===Et||!n&&e._zTime){if(!e._initted&&kA(e,n,s,r,u))return;for(p=e._zTime,e._zTime=n||(r?Et:0),r||(r=n&&!p),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=u,f=e._pt;f;)f.r(a,f.d),f=f._next;n<0&&Z_(e,n,r,!0),e._onUpdate&&!r&&qr(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&qr(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&da(e,1),!r&&!zn&&(qr(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},bZ=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}},iu=function(e,n,r,s){var i=e._repeat,a=Gt(n)||0,c=e._tTime/e._tDur;return c&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:Gt(a*(i+1)+e._rDelay*i):a,c>0&&!s&&k0(e,e._tTime=e._tDur*c),e.parent&&C0(e),r||bl(e.parent,e),e},Yk=function(e){return e instanceof Cr?bl(e):iu(e,e._dur)},SZ={_start:0,endTime:cf,totalDuration:cf},ps=function t(e,n,r){var s=e.labels,i=e._recent||SZ,a=e.duration()>=_s?i.endTime(!1):e._dur,c,u,f;return An(n)&&(isNaN(n)||n in s)?(u=n.charAt(0),f=n.substr(-1)==="%",c=n.indexOf("="),u==="<"||u===">"?(c>=0&&(n=n.replace(/=/,"")),(u==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(f?(c<0?i:r).totalDuration()/100:1)):c<0?(n in s||(s[n]=a),s[n]):(u=parseFloat(n.charAt(c-1)+n.substr(c+1)),f&&r&&(u=u/100*(er(r)?r[0]:r).totalDuration()),c>1?t(e,n.substr(0,c-1),r)+u:a+u)):n==null?a:+n},Od=function(e,n,r){var s=uo(n[1]),i=(s?2:1)+(e<2?0:1),a=n[i],c,u;if(s&&(a.duration=n[1]),a.parent=r,e){for(c=a,u=r;u&&!("immediateRender"in c);)c=u.vars.defaults||{},u=Rr(u.vars.inherit)&&u.parent;a.immediateRender=Rr(c.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new mn(n[0],a,n[i+1])},xa=function(e,n){return e||e===0?n(e):n},Af=function(e,n,r){return r<e?e:r>n?n:r},Qn=function(e,n){return!An(e)||!(n=fZ.exec(e))?"":n[1]},EZ=function(e,n,r){return xa(r,function(s){return Af(e,n,s)})},Y_=[].slice,PA=function(e,n){return e&&_i(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&_i(e[0]))&&!e.nodeType&&e!==ii},CZ=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return An(s)&&!n||PA(s,1)?(i=r).push.apply(i,xs(s)):r.push(s)})||r},xs=function(e,n,r){return zt&&!n&&zt.selector?zt.selector(e):An(e)&&!r&&(G_||!ou())?Y_.call((n||Jx).querySelectorAll(e),0):er(e)?CZ(e,r):PA(e)?Y_.call(e,0):e?[e]:[]},X_=function(e){return e=xs(e)[0]||lf("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return xs(n,r.querySelectorAll?r:r===e?lf("Invalid scope")||Jx.createElement("div"):e)}},TA=function(e){return e.sort(function(){return .5-Math.random()})},RA=function(e){if(tn(e))return e;var n=_i(e)?e:{each:e},r=Sl(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},c=s>0&&s<1,u=isNaN(s)||c,f=n.axis,h=s,p=s;return An(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!c&&u&&(h=s[0],p=s[1]),function(m,_,x){var y=(x||n).length,w=a[y],S,T,P,k,A,O,L,R,M;if(!w){if(M=n.grid==="auto"?0:(n.grid||[1,_s])[1],!M){for(L=-_s;L<(L=x[M++].getBoundingClientRect().left)&&M<y;);M<y&&M--}for(w=a[y]=[],S=u?Math.min(M,y)*h-.5:s%M,T=M===_s?0:u?y*p/M-.5:s/M|0,L=0,R=_s,O=0;O<y;O++)P=O%M-S,k=T-(O/M|0),w[O]=A=f?Math.abs(f==="y"?k:P):dA(P*P+k*k),A>L&&(L=A),A<R&&(R=A);s==="random"&&TA(w),w.max=L-R,w.min=R,w.v=y=(parseFloat(n.amount)||parseFloat(n.each)*(M>y?y-1:f?f==="y"?y/M:M:Math.max(M,y/M))||0)*(s==="edges"?-1:1),w.b=y<0?i-y:i,w.u=Qn(n.amount||n.each)||0,r=r&&y<0?FZ(r):r}return y=(w[m]-w.min)/w.max||0,Gt(w.b+(r?r(y):y)*w.v)+w.u}},Q_=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Gt(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(uo(r)?0:Qn(r))}},AA=function(e,n){var r=er(e),s,i;return!r&&_i(e)&&(s=r=e.radius||_s,e.values?(e=xs(e.values),(i=!uo(e[0]))&&(s*=s)):e=Q_(e.increment)),xa(n,r?tn(e)?function(a){return i=e(a),Math.abs(i-a)<=s?i:a}:function(a){for(var c=parseFloat(i?a.x:a),u=parseFloat(i?a.y:0),f=_s,h=0,p=e.length,m,_;p--;)i?(m=e[p].x-c,_=e[p].y-u,m=m*m+_*_):m=Math.abs(e[p]-c),m<f&&(f=m,h=p);return h=!s||f<=s?e[h]:a,i||h===a||uo(a)?h:h+Qn(a)}:Q_(e))},IA=function(e,n,r,s){return xa(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})},kZ=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,a){return a(i)},s)}},PZ=function(e,n){return function(r){return e(parseFloat(r))+(n||Qn(r))}},TZ=function(e,n,r){return OA(e,n,0,1,r)},MA=function(e,n,r){return xa(r,function(s){return e[~~n(s)]})},RZ=function t(e,n,r){var s=n-e;return er(e)?MA(e,t(0,e.length),n):xa(r,function(i){return(s+(i-e)%s)%s+e})},AZ=function t(e,n,r){var s=n-e,i=s*2;return er(e)?MA(e,t(0,e.length-1),n):xa(r,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},uf=function(e){return e.replace(cZ,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(uZ);return IA(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},OA=function(e,n,r,s,i){var a=n-e,c=s-r;return xa(i,function(u){return r+((u-e)/a*c||0)})},IZ=function t(e,n,r,s){var i=isNaN(e+n)?0:function(_){return(1-_)*e+_*n};if(!i){var a=An(e),c={},u,f,h,p,m;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(er(e)&&!er(n)){for(h=[],p=e.length,m=p-2,f=1;f<p;f++)h.push(t(e[f-1],e[f]));p--,i=function(x){x*=p;var y=Math.min(m,~~x);return h[y](x-y)},r=n}else s||(e=ru(er(e)?[]:{},e));if(!h){for(u in n)iw.call(c,e,u,"get",n[u]);i=function(x){return cw(x,c)||(a?e.p:e)}}}return xa(r,i)},Xk=function(e,n,r){var s=e.labels,i=_s,a,c,u;for(a in s)c=s[a]-n,c<0==!!r&&c&&i>(c=Math.abs(c))&&(u=a,i=c);return u},qr=function(e,n,r){var s=e.vars,i=s[n],a=zt,c=e._ctx,u,f,h;if(i)return u=s[n+"Params"],f=s.callbackScope||e,r&&na.length&&Wm(),c&&(zt=c),h=u?i.apply(f,u):i.call(f),zt=a,h},yd=function(e){return da(e),e.scrollTrigger&&e.scrollTrigger.kill(!!zn),e.progress()<1&&qr(e,"onInterrupt"),e},Ec,LA=[],NA=function(e){if(e)if(e=!e.name&&e.default||e,Qx()||e.headless){var n=e.name,r=tn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:cf,render:cw,add:iw,kill:ZZ,modifier:KZ,rawVars:0},a={targetTest:0,get:0,getSetter:lw,aliases:{},register:0};if(ou(),e!==s){if(Gr[n])return;ns(s,ns(Gm(e,i),a)),ru(s.prototype,ru(i,Gm(e,a))),Gr[s.prop=n]=s,e.targetTest&&(Wp.push(s),tw[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}vA(n,s),e.register&&e.register(Or,s,Ir)}else LA.push(e)},bt=255,_d={aqua:[0,bt,bt],lime:[0,bt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,bt],navy:[0,0,128],white:[bt,bt,bt],olive:[128,128,0],yellow:[bt,bt,0],orange:[bt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[bt,0,0],pink:[bt,192,203],cyan:[0,bt,bt],transparent:[bt,bt,bt,0]},R1=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)*bt+.5|0},DA=function(e,n,r){var s=e?uo(e)?[e>>16,e>>8&bt,e&bt]:0:_d.black,i,a,c,u,f,h,p,m,_,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),_d[e])s=_d[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),c=e.charAt(3),e="#"+i+i+a+a+c+c+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&bt,s&bt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&bt,e&bt]}else if(e.substr(0,3)==="hsl"){if(s=x=e.match(Gk),!n)u=+s[0]%360/360,f=+s[1]/100,h=+s[2]/100,a=h<=.5?h*(f+1):h+f-h*f,i=h*2-a,s.length>3&&(s[3]*=1),s[0]=R1(u+1/3,i,a),s[1]=R1(u,i,a),s[2]=R1(u-1/3,i,a);else if(~e.indexOf("="))return s=e.match(hA),r&&s.length<4&&(s[3]=1),s}else s=e.match(Gk)||_d.transparent;s=s.map(Number)}return n&&!x&&(i=s[0]/bt,a=s[1]/bt,c=s[2]/bt,p=Math.max(i,a,c),m=Math.min(i,a,c),h=(p+m)/2,p===m?u=f=0:(_=p-m,f=h>.5?_/(2-p-m):_/(p+m),u=p===i?(a-c)/_+(a<c?6:0):p===a?(c-i)/_+2:(i-a)/_+4,u*=60),s[0]=~~(u+.5),s[1]=~~(f*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},jA=function(e){var n=[],r=[],s=-1;return e.split(ra).forEach(function(i){var a=i.match(Sc)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},Qk=function(e,n,r){var s="",i=(e+s).match(ra),a=n?"hsla(":"rgba(",c=0,u,f,h,p;if(!i)return e;if(i=i.map(function(m){return(m=DA(m,n,1))&&a+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(h=jA(e),u=r.c,u.join(s)!==h.c.join(s)))for(f=e.replace(ra,"1").split(Sc),p=f.length-1;c<p;c++)s+=f[c]+(~u.indexOf(c)?i.shift()||a+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!f)for(f=e.split(ra),p=f.length-1;c<p;c++)s+=f[c]+i[c];return s+f[p]},ra=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in _d)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),MZ=/hsl[a]?\(/,FA=function(e){var n=e.join(" "),r;if(ra.lastIndex=0,ra.test(n))return r=MZ.test(n),e[1]=Qk(e[1],r),e[0]=Qk(e[0],r,jA(e[1])),!0},df,Kr=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,c=[],u,f,h,p,m,_,x=function y(w){var S=t()-s,T=w===!0,P,k,A,O;if((S>e||S<0)&&(r+=S-n),s+=S,A=s-r,P=A-a,(P>0||T)&&(O=++p.frame,m=A-p.time*1e3,p.time=A=A/1e3,a+=P+(P>=i?4:i-P),k=1),T||(u=f(y)),k)for(_=0;_<c.length;_++)c[_](A,m,O,w)};return p={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(w){return m/(1e3/(w||60))},wake:function(){mA&&(!G_&&Qx()&&(ii=G_=window,Jx=ii.document||{},ts.gsap=Or,(ii.gsapVersions||(ii.gsapVersions=[])).push(Or.version),gA(Bm||ii.GreenSockGlobals||!ii.gsap&&ii||{}),LA.forEach(NA)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&p.sleep(),f=h||function(w){return setTimeout(w,a-p.time*1e3+1|0)},df=1,x(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(u),df=0,f=cf},lagSmoothing:function(w,S){e=w||1/0,n=Math.min(S||33,e)},fps:function(w){i=1e3/(w||240),a=p.time*1e3+i},add:function(w,S,T){var P=S?function(k,A,O,L){w(k,A,O,L),p.remove(P)}:w;return p.remove(w),c[T?"unshift":"push"](P),ou(),P},remove:function(w,S){~(S=c.indexOf(w))&&c.splice(S,1)&&_>=S&&_--},_listeners:c},p})(),ou=function(){return!df&&Kr.wake()},ut={},OZ=/^[\d.\-M][\d.\-,\s]/,LZ=/["']/g,NZ=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,a=r.length,c,u,f;i<a;i++)u=r[i],c=i!==a-1?u.lastIndexOf(","):u.length,f=u.substr(0,c),n[s]=isNaN(f)?f.replace(LZ,"").trim():+f,s=u.substr(c+1).trim();return n},DZ=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)},jZ=function(e){var n=(e+"").split("("),r=ut[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[NZ(n[1])]:DZ(e).split(",").map(wA)):ut._CE&&OZ.test(e)?ut._CE("",e):r},FZ=function(e){return function(n){return 1-e(1-n)}},Sl=function(e,n){return e&&(tn(e)?e:ut[e]||jZ(e))||n},Al=function(e,n,r,s){r===void 0&&(r=function(u){return 1-n(1-u)}),s===void 0&&(s=function(u){return u<.5?n(u*2)/2:1-n((1-u)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},a;return Ar(e,function(c){ut[c]=ts[c]=i,ut[a=c.toLowerCase()]=r;for(var u in i)ut[a+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=ut[c+"."+u]=i[u]}),i},VA=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},A1=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/W_*(Math.asin(1/s)||0),c=function(h){return h===1?1:s*Math.pow(2,-10*h)*lZ((h-a)*i)+1},u=e==="out"?c:e==="in"?function(f){return 1-c(1-f)}:VA(c);return i=W_/i,u.config=function(f,h){return t(e,f,h)},u},I1=function t(e,n){n===void 0&&(n=1.70158);var r=function(a){return a?--a*a*((n+1)*a+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:VA(r);return s.config=function(i){return t(e,i)},s};Ar("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Al(t+",Power"+(n-1),e?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});ut.Linear.easeNone=ut.none=ut.Linear.easeIn;Al("Elastic",A1("in"),A1("out"),A1());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(c){return c<n?t*c*c:c<r?t*Math.pow(c-1.5/e,2)+.75:c<s?t*(c-=2.25/e)*c+.9375:t*Math.pow(c-2.625/e,2)+.984375};Al("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);Al("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Al("Circ",function(t){return-(dA(1-t*t)-1)});Al("Sine",function(t){return t===1?1:-aZ(t*iZ)+1});Al("Back",I1("in"),I1("out"),I1());ut.SteppedEase=ut.steps=ts.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,a=1-Et;return function(c){return((s*Af(0,a,c)|0)+i)*r}}};af.ease=ut["quad.out"];Ar("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return nw+=t+","+t+"Params,"});var $A=function(e,n){this.id=oZ++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:_A,this.set=n?n.getSetter:lw},ff=(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,iu(this,+n.duration,1,1),this.data=n.data,zt&&(this._ctx=zt,zt.data.push(this)),df||Kr.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,iu(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(ou(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(k0(this,r),!i._dp||i.parent||EA(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)&&di(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Et||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),xA(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+qk(this))%(this._dur+this._rDelay)||(r?this._dur:0),s):this._time},e.totalProgress=function(r,s){return arguments.length?this.totalTime(this.totalDuration()*r,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+qk(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,s){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,s):this._repeat?su(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-Et?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Km(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Et?0:this._rts,this.totalTime(Af(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),C0(this),yZ(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):(ou(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Et&&(this._tTime-=Et)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=Gt(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&di(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Rr(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var s=this.parent||this._dp;return s?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Km(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=pZ);var s=zn;return zn=r,sw(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),zn=s,this},e.globalTime=function(r){for(var s=this,i=arguments.length?r:s.rawTime();s;)i=s._start+i/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,Yk(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,Yk(this),s?this.time(s):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,s){return this.totalTime(ps(this,r),Rr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Rr(s)),this._dur||(this._zTime=-Et),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?-Et:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Et,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)-Et)},e.eventCallback=function(r,s,i){var a=this.vars;return arguments.length>1?(s?(a[r]=s,i&&(a[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete a[r],this):a[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(a){var c=tn(r)?r:bA,u=function(){var h=s.then;s.then=null,i&&i(),tn(c)&&(c=c(s))&&(c.then||c===s)&&(s.then=h),a(c),s.then=h};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?u():s._prom=u})},e.kill=function(){yd(this)},t})();ns(ff.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:-Et,_prom:0,_ps:!1,_rts:1});var Cr=(function(t){uA(e,t);function e(r,s){var i;return r===void 0&&(r={}),i=t.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=Rr(r.sortChildren),Kt&&di(r.parent||Kt,Gi(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&CA(Gi(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return Od(0,arguments,this),this},n.from=function(s,i,a){return Od(1,arguments,this),this},n.fromTo=function(s,i,a,c){return Od(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,Md(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new mn(s,i,ps(this,a),1),this},n.call=function(s,i,a){return di(this,mn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,c,u,f,h){return a.duration=i,a.stagger=a.stagger||c,a.onComplete=f,a.onCompleteParams=h,a.parent=this,new mn(s,a,ps(this,u)),this},n.staggerFrom=function(s,i,a,c,u,f,h){return a.runBackwards=1,Md(a).immediateRender=Rr(a.immediateRender),this.staggerTo(s,i,a,c,u,f,h)},n.staggerFromTo=function(s,i,a,c,u,f,h,p){return c.startAt=a,Md(c).immediateRender=Rr(c.immediateRender),this.staggerTo(s,i,c,u,f,h,p)},n.render=function(s,i,a){var c=this._time,u=this._dirty?this.totalDuration():this._tDur,f=this._dur,h=s<=0?0:Gt(s),p=this._zTime<0!=s<0&&(this._initted||!f),m,_,x,y,w,S,T,P,k,A,O,L;if(this!==Kt&&h>u&&s>=0&&(h=u),h!==this._tTime||a||p){if(c!==this._time&&f&&(h+=this._time-c,s+=this._time-c),m=h,k=this._start,P=this._ts,S=!P,p&&(f||(c=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(O=this._yoyo,w=f+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(w*100+s,i,a);if(m=Gt(h%w),h===u?(y=this._repeat,m=f):(A=Gt(h/w),y=~~A,y&&y===A&&(m=f,y--),m>f&&(m=f)),A=su(this._tTime,w),!c&&this._tTime&&A!==y&&this._tTime-A*w-this._dur<=0&&(A=y),O&&y&1&&(m=f-m,L=1),y!==A&&!this._lock){var R=O&&A&1,M=R===(O&&y&1);if(y<A&&(R=!R),c=R?0:h%f?f:h,this._lock=1,this.render(c||(L?0:Gt(y*w)),i,!f)._lock=0,this._tTime=h,!i&&this.parent&&qr(this,"onRepeat"),this.vars.repeatRefresh&&!L&&(this.invalidate()._lock=1,A=y),c&&c!==this._time||S!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(f=this._dur,u=this._tDur,M&&(this._lock=2,c=R?f:-1e-4,this.render(c,!0),this.vars.repeatRefresh&&!L&&this.invalidate()),this._lock=0,!this._ts&&!S)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(T=bZ(this,Gt(c),Gt(m)),T&&(h-=m-(m=T._start))),this._tTime=h,this._time=m,this._act=!!P,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,c=0),!c&&h&&f&&!i&&!A&&(qr(this,"onStart"),this._tTime!==h))return this;if(m>=c&&s>=0)for(_=this._first;_;){if(x=_._next,(_._act||m>=_._start)&&_._ts&&T!==_){if(_.parent!==this)return this.render(s,i,a);if(_.render(_._ts>0?(m-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(m-_._start)*_._ts,i,a),m!==this._time||!this._ts&&!S){T=0,x&&(h+=this._zTime=-Et);break}}_=x}else{_=this._last;for(var N=s<0?s:m;_;){if(x=_._prev,(_._act||N<=_._end)&&_._ts&&T!==_){if(_.parent!==this)return this.render(s,i,a);if(_.render(_._ts>0?(N-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(N-_._start)*_._ts,i,a||zn&&sw(_)),m!==this._time||!this._ts&&!S){T=0,x&&(h+=this._zTime=N?-Et:Et);break}}_=x}}if(T&&!i&&(this.pause(),T.render(m>=c?0:-Et)._zTime=m>=c?1:-1,this._ts))return this._start=k,C0(this),this.render(s,i,a);this._onUpdate&&!i&&qr(this,"onUpdate",!0),(h===u&&this._tTime>=this.totalDuration()||!h&&c)&&(k===this._start||Math.abs(P)!==Math.abs(this._ts))&&(this._lock||((s||!f)&&(h===u&&this._ts>0||!h&&this._ts<0)&&da(this,1),!i&&!(s<0&&!c)&&(h||c||!u)&&(qr(this,h===u&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<u&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var a=this;if(uo(i)||(i=ps(this,i,s)),!(s instanceof ff)){if(er(s))return s.forEach(function(c){return a.add(c,i)}),this;if(An(s))return this.addLabel(s,i);if(tn(s))s=mn.delayedCall(0,s);else return this}return this!==s?di(this,s,i):this},n.getChildren=function(s,i,a,c){s===void 0&&(s=!0),i===void 0&&(i=!0),a===void 0&&(a=!0),c===void 0&&(c=-_s);for(var u=[],f=this._first;f;)f._start>=c&&(f instanceof mn?i&&u.push(f):(a&&u.push(f),s&&u.push.apply(u,f.getChildren(!0,i,a)))),f=f._next;return u},n.getById=function(s){for(var i=this.getChildren(1,1,1),a=i.length;a--;)if(i[a].vars.id===s)return i[a]},n.remove=function(s){return An(s)?this.removeLabel(s):tn(s)?this.killTweensOf(s):(s.parent===this&&E0(this,s),s===this._recent&&(this._recent=this._last),bl(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Gt(Kr.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]=ps(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var c=mn.delayedCall(0,i||cf,a);return c.data="isPause",this._hasPause=1,di(this,c,ps(this,s))},n.removePause=function(s){var i=this._first;for(s=ps(this,s);i;)i._start===s&&i.data==="isPause"&&da(i),i=i._next},n.killTweensOf=function(s,i,a){for(var c=this.getTweensOf(s,a),u=c.length;u--;)Yo!==c[u]&&c[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],c=xs(s),u=this._first,f=uo(i),h;u;)u instanceof mn?mZ(u._targets,c)&&(f?(!Yo||u._initted&&u._ts)&&u.globalTime(0)<=i&&u.globalTime(u.totalDuration())>i:!i||u.isActive())&&a.push(u):(h=u.getTweensOf(c,i)).length&&a.push.apply(a,h),u=u._next;return a},n.tweenTo=function(s,i){i=i||{};var a=this,c=ps(a,s),u=i,f=u.startAt,h=u.onStart,p=u.onStartParams,m=u.immediateRender,_,x=mn.to(a,ns({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:c,overwrite:"auto",duration:i.duration||Math.abs((c-(f&&"time"in f?f.time:a._time))/a.timeScale())||Et,onStart:function(){if(a.pause(),!_){var w=i.duration||Math.abs((c-(f&&"time"in f?f.time:a._time))/a.timeScale());x._dur!==w&&iu(x,w,0,1).render(x._time,!0,!0),_=1}h&&h.apply(x,p||[])}},i));return m?x.render(0):x},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,ns({startAt:{time:ps(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),Xk(this,ps(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),Xk(this,ps(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Et)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var c=this._first,u=this.labels,f;for(s=Gt(s);c;)c._start>=a&&(c._start+=s,c._end+=s),c=c._next;if(i)for(f in u)u[f]>=a&&(u[f]+=s);return bl(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,a;i;)a=i._next,this.remove(i),i=a;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),bl(this)},n.totalDuration=function(s){var i=0,a=this,c=a._last,u=_s,f,h,p;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-s:s));if(a._dirty){for(p=a.parent;c;)f=c._prev,c._dirty&&c.totalDuration(),h=c._start,h>u&&a._sort&&c._ts&&!a._lock?(a._lock=1,di(a,c,h-c._delay,1)._lock=0):u=h,h<0&&c._ts&&(i-=h,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=Gt(h/a._ts),a._time-=h,a._tTime-=h),a.shiftChildren(-h,!1,-1/0),u=0),c._end>i&&c._ts&&(i=c._end),c=f;iu(a,a===Kt&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(Kt._ts&&(xA(Kt,Km(s,Kt)),yA=Kr.frame),Kr.frame>=Kk){Kk+=Jr.autoSleep||120;var i=Kt._first;if((!i||!i._ts)&&Jr.autoSleep&&Kr._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Kr.sleep()}}},e})(ff);ns(Cr.prototype,{_lock:0,_hasPause:0,_forcing:0});var VZ=function(e,n,r,s,i,a,c){var u=new Ir(this._pt,e,n,0,1,GA,null,i),f=0,h=0,p,m,_,x,y,w,S,T;for(u.b=r,u.e=s,r+="",s+="",(S=~s.indexOf("random("))&&(s=uf(s)),a&&(T=[r,s],a(T,e,n),r=T[0],s=T[1]),m=r.match(P1)||[];p=P1.exec(s);)x=p[0],y=s.substring(f,p.index),_?_=(_+1)%5:y.substr(-5)==="rgba("&&(_=1),x!==m[h++]&&(w=parseFloat(m[h-1])||0,u._pt={_next:u._pt,p:y||h===1?y:",",s:w,c:x.charAt(1)==="="?Mc(w,x)-w:parseFloat(x)-w,m:_&&_<4?Math.round:0},f=P1.lastIndex);return u.c=f<s.length?s.substring(f,s.length):"",u.fp=c,(pA.test(s)||S)&&(u.e=0),this._pt=u,u},iw=function(e,n,r,s,i,a,c,u,f,h){tn(s)&&(s=s(i||0,e,a));var p=e[n],m=r!=="get"?r:tn(p)?f?e[n.indexOf("set")||!tn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](f):e[n]():p,_=tn(p)?f?BZ:BA:aw,x;if(An(s)&&(~s.indexOf("random(")&&(s=uf(s)),s.charAt(1)==="="&&(x=Mc(m,s)+(Qn(m)||0),(x||x===0)&&(s=x))),!h||m!==s||J_)return!isNaN(m*s)&&s!==""?(x=new Ir(this._pt,e,n,+m||0,s-(m||0),typeof p=="boolean"?GZ:WA,0,_),f&&(x.fp=f),c&&x.modifier(c,this,e),this._pt=x):(!p&&!(n in e)&&ew(n,s),VZ.call(this,e,n,m,s,_,u||Jr.stringFilter,f))},$Z=function(e,n,r,s,i){if(tn(e)&&(e=Ld(e,i,n,r,s)),!_i(e)||e.style&&e.nodeType||er(e)||fA(e))return An(e)?Ld(e,i,n,r,s):e;var a={},c;for(c in e)a[c]=Ld(e[c],i,n,r,s);return a},HA=function(e,n,r,s,i,a){var c,u,f,h;if(Gr[e]&&(c=new Gr[e]).init(i,c.rawVars?n[e]:$Z(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=u=new Ir(r._pt,i,e,0,1,c.render,c,0,c.priority),r!==Ec))for(f=r._ptLookup[r._targets.indexOf(i)],h=c._props.length;h--;)f[c._props[h]]=u;return c},Yo,J_,ow=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,c=s.immediateRender,u=s.lazy,f=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,m=s.keyframes,_=s.autoRevert,x=e._dur,y=e._startAt,w=e._targets,S=e.parent,T=S&&S.data==="nested"?S.vars.targets:w,P=e._overwrite==="auto"&&!Yx,k=e.timeline,A=s.easeReverse||p,O,L,R,M,N,D,F,q,X,W,G,K,$;if(k&&(!m||!i)&&(i="none"),e._ease=Sl(i,af.ease),e._rEase=A&&(Sl(A)||e._ease),e._from=!k&&!!s.runBackwards,e._from&&(e.ratio=1),!k||m&&!s.stagger){if(q=w[0]?wl(w[0]).harness:0,K=q&&s[q.prop],O=Gm(s,tw),y&&(y._zTime<0&&y.progress(1),n<0&&h&&c&&!_?y.render(-1,!0):y.revert(h&&x?Bp:hZ),y._lazy=0),a){if(da(e._startAt=mn.set(w,ns({data:"isStart",overwrite:!1,parent:S,immediateRender:!0,lazy:!y&&Rr(u),startAt:null,delay:0,onUpdate:f&&function(){return qr(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(zn||!c&&!_)&&e._startAt.revert(Bp),c&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&x&&!y){if(n&&(c=!1),R=ns({overwrite:!1,data:"isFromStart",lazy:c&&!y&&Rr(u),immediateRender:c,stagger:0,parent:S},O),K&&(R[q.prop]=K),da(e._startAt=mn.set(w,R)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(zn?e._startAt.revert(Bp):e._startAt.render(-1,!0)),e._zTime=n,!c)t(e._startAt,Et,Et);else if(!n)return}for(e._pt=e._ptCache=0,u=x&&Rr(u)||u&&!x,L=0;L<w.length;L++){if(N=w[L],F=N._gsap||rw(w)[L]._gsap,e._ptLookup[L]=W={},K_[F.id]&&na.length&&Wm(),G=T===w?L:T.indexOf(N),q&&(X=new q).init(N,K||O,e,G,T)!==!1&&(e._pt=M=new Ir(e._pt,N,X.name,0,1,X.render,X,0,X.priority),X._props.forEach(function(te){W[te]=M}),X.priority&&(D=1)),!q||K)for(R in O)Gr[R]&&(X=HA(R,O,e,G,N,T))?X.priority&&(D=1):W[R]=M=iw.call(e,N,R,"get",O[R],G,T,0,s.stringFilter);e._op&&e._op[L]&&e.kill(N,e._op[L]),P&&e._pt&&(Yo=e,Kt.killTweensOf(N,W,e.globalTime(n)),$=!e.parent,Yo=0),e._pt&&u&&(K_[F.id]=1)}D&&KA(e),e._onInit&&e._onInit(e)}e._onUpdate=f,e._initted=(!e._op||e._pt)&&!$,m&&n<=0&&k.render(_s,!0,!0)},HZ=function(e,n,r,s,i,a,c,u){var f=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,m,_;if(!f)for(f=e._ptCache[n]=[],m=e._ptLookup,_=e._targets.length;_--;){if(h=m[_][n],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==n&&h.fp!==n;)h=h._next;if(!h)return J_=1,e.vars[n]="+=0",ow(e,c),J_=0,u?lf(n+" not eligible for reset. Try splitting into individual properties"):1;f.push(h)}for(_=f.length;_--;)p=f[_],h=p._pt||p,h.s=(s||s===0)&&!i?s:h.s+(s||0)+a*h.c,h.c=r-h.s,p.e&&(p.e=sn(r)+Qn(p.e)),p.b&&(p.b=h.s+Qn(p.b))},zZ=function(e,n){var r=e[0]?wl(e[0]).harness:0,s=r&&r.aliases,i,a,c,u;if(!s)return n;i=ru({},n);for(a in s)if(a in i)for(u=s[a].split(","),c=u.length;c--;)i[u[c]]=i[a];return i},UZ=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,c;if(er(n))c=r[e]||(r[e]=[]),n.forEach(function(u,f){return c.push({t:f/(n.length-1)*100,v:u,e:i})});else for(a in n)c=r[a]||(r[a]=[]),a==="ease"||c.push({t:parseFloat(e),v:n[a],e:i})},Ld=function(e,n,r,s,i){return tn(e)?e.call(n,r,s,i):An(e)&&~e.indexOf("random(")?uf(e):e},zA=nw+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",UA={};Ar(zA+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return UA[t]=1});var mn=(function(t){uA(e,t);function e(r,s,i,a){var c;typeof s=="number"&&(i.duration=s,s=i,i=null),c=t.call(this,a?s:Md(s))||this;var u=c.vars,f=u.duration,h=u.delay,p=u.immediateRender,m=u.stagger,_=u.overwrite,x=u.keyframes,y=u.defaults,w=u.scrollTrigger,S=s.parent||Kt,T=(er(r)||fA(r)?uo(r[0]):"length"in s)?[r]:xs(r),P,k,A,O,L,R,M,N;if(c._targets=T.length?rw(T):lf("GSAP target "+r+" not found. https://gsap.com",!Jr.nullTargetWarn)||[],c._ptLookup=[],c._overwrite=_,x||m||xp(f)||xp(h)){s=c.vars;var D=s.easeReverse||s.yoyoEase;if(P=c.timeline=new Cr({data:"nested",defaults:y||{},targets:S&&S.data==="nested"?S.vars.targets:T}),P.kill(),P.parent=P._dp=Gi(c),P._start=0,m||xp(f)||xp(h)){if(O=T.length,M=m&&RA(m),_i(m))for(L in m)~zA.indexOf(L)&&(N||(N={}),N[L]=m[L]);for(k=0;k<O;k++)A=Gm(s,UA),A.stagger=0,D&&(A.easeReverse=D),N&&ru(A,N),R=T[k],A.duration=+Ld(f,Gi(c),k,R,T),A.delay=(+Ld(h,Gi(c),k,R,T)||0)-c._delay,!m&&O===1&&A.delay&&(c._delay=h=A.delay,c._start+=h,A.delay=0),P.to(R,A,M?M(k,R,T):0),P._ease=ut.none;P.duration()?f=h=0:c.timeline=0}else if(x){Md(ns(P.vars.defaults,{ease:"none"})),P._ease=Sl(x.ease||s.ease||"none");var F=0,q,X,W;if(er(x))x.forEach(function(G){return P.to(T,G,">")}),P.duration();else{A={};for(L in x)L==="ease"||L==="easeEach"||UZ(L,x[L],A,x.easeEach);for(L in A)for(q=A[L].sort(function(G,K){return G.t-K.t}),F=0,k=0;k<q.length;k++)X=q[k],W={ease:X.e,duration:(X.t-(k?q[k-1].t:0))/100*f},W[L]=X.v,P.to(T,W,F),F+=W.duration;P.duration()<f&&P.to({},{duration:f-P.duration()})}}f||c.duration(f=P.duration())}else c.timeline=0;return _===!0&&!Yx&&(Yo=Gi(c),Kt.killTweensOf(T),Yo=0),di(S,Gi(c),i),s.reversed&&c.reverse(),s.paused&&c.paused(!0),(p||!f&&!x&&c._start===Gt(S._time)&&Rr(p)&&_Z(Gi(c))&&S.data!=="nested")&&(c._tTime=-Et,c.render(Math.max(0,-h)||0)),w&&CA(Gi(c),w),c}var n=e.prototype;return n.render=function(s,i,a){var c=this._time,u=this._tDur,f=this._dur,h=s<0,p=s>u-Et&&!h?u:s<Et?0:s,m,_,x,y,w,S,T,P;if(!f)wZ(this,s,i,a);else if(p!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(m=p,P=this.timeline,this._repeat){if(y=f+this._rDelay,this._repeat<-1&&h)return this.totalTime(y*100+s,i,a);if(m=Gt(p%y),p===u?(x=this._repeat,m=f):(w=Gt(p/y),x=~~w,x&&x===w?(m=f,x--):m>f&&(m=f)),S=this._yoyo&&x&1,S&&(m=f-m),w=su(this._tTime,y),m===c&&!a&&this._initted&&x===w)return this._tTime=p,this;x!==w&&this.vars.repeatRefresh&&!S&&!this._lock&&m!==y&&this._initted&&(this._lock=a=1,this.render(Gt(y*x),!0).invalidate()._lock=0)}if(!this._initted){if(kA(this,h?s:m,a,i,p))return this._tTime=0,this;if(c!==this._time&&!(a&&this.vars.repeatRefresh&&x!==w))return this;if(f!==this._dur)return this.render(s,i,a)}if(this._rEase){var k=m<c;if(k!==this._inv){var A=k?c:f-c;this._inv=k,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=c,this._invRecip=A?(k?-1:1)/A:0,this._invScale=k?-this.ratio:1-this.ratio,this._invEase=k?this._rEase:this._ease}this.ratio=T=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=T=this._ease(m/f);if(this._from&&(this.ratio=T=1-T),this._tTime=p,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!c&&p&&!i&&!w&&(qr(this,"onStart"),this._tTime!==p))return this;for(_=this._pt;_;)_.r(T,_.d),_=_._next;P&&P.render(s<0?s:P._dur*P._ease(m/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(h&&Z_(this,s,i,a),qr(this,"onUpdate")),this._repeat&&x!==w&&this.vars.onRepeat&&!i&&this.parent&&qr(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&Z_(this,s,!0,!0),(s||!f)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&da(this,1),!i&&!(h&&!c)&&(p||c||S)&&(qr(this,p===u?"onComplete":"onReverseComplete",!0),this._prom&&!(p<u&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,a,c,u){df||Kr.wake(),this._ts||this.play();var f=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||ow(this,f),h=this._ease(f/this._dur),HZ(this,s,i,a,c,h,f,u)?this.resetTo(s,i,a,c,1):(k0(this,0),this.parent||SA(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?yd(this):this.scrollTrigger&&this.scrollTrigger.kill(!!zn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Yo&&Yo.vars.overwrite!==!0)._first||yd(this),this.parent&&a!==this.timeline.totalDuration()&&iu(this,this._dur*this.timeline._tDur/a,0,1),this}var c=this._targets,u=s?xs(s):c,f=this._ptLookup,h=this._pt,p,m,_,x,y,w,S;if((!i||i==="all")&&vZ(c,u))return i==="all"&&(this._pt=0),yd(this);for(p=this._op=this._op||[],i!=="all"&&(An(i)&&(y={},Ar(i,function(T){return y[T]=1}),i=y),i=zZ(c,i)),S=c.length;S--;)if(~u.indexOf(c[S])){m=f[S],i==="all"?(p[S]=i,x=m,_={}):(_=p[S]=p[S]||{},x=i);for(y in x)w=m&&m[y],w&&((!("kill"in w.d)||w.d.kill(y)===!0)&&E0(this,w,"_pt"),delete m[y]),_!=="all"&&(_[y]=1)}return this._initted&&!this._pt&&h&&yd(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Od(1,arguments)},e.delayedCall=function(s,i,a,c){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:c})},e.fromTo=function(s,i,a){return Od(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,a){return Kt.killTweensOf(s,i,a)},e})(ff);ns(mn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Ar("staggerTo,staggerFrom,staggerFromTo",function(t){mn[t]=function(){var e=new Cr,n=Y_.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var aw=function(e,n,r){return e[n]=r},BA=function(e,n,r){return e[n](r)},BZ=function(e,n,r,s){return e[n](s.fp,r)},WZ=function(e,n,r){return e.setAttribute(n,r)},lw=function(e,n){return tn(e[n])?BA:Xx(e[n])&&e.setAttribute?WZ:aw},WA=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},GZ=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},GA=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)},cw=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},KZ=function(e,n,r,s){for(var i=this._pt,a;i;)a=i._next,i.p===s&&i.modifier(e,n,r),i=a},ZZ=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?E0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},qZ=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},KA=function(e){for(var n=e._pt,r,s,i,a;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:a)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:a=n,n=r}e._pt=i},Ir=(function(){function t(n,r,s,i,a,c,u,f,h){this.t=r,this.s=i,this.c=a,this.p=s,this.r=c||WA,this.d=u||this,this.set=f||aw,this.pr=h||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=qZ,this.m=r,this.mt=i,this.tween=s},t})();Ar(nw+"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 tw[t]=1});ts.TweenMax=ts.TweenLite=mn;ts.TimelineLite=ts.TimelineMax=Cr;Kt=new Cr({sortChildren:!1,defaults:af,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Jr.stringFilter=FA;var El=[],Gp={},YZ=[],Jk=0,XZ=0,M1=function(e){return(Gp[e]||YZ).map(function(n){return n()})},e2=function(){var e=Date.now(),n=[];e-Jk>2&&(M1("matchMediaInit"),El.forEach(function(r){var s=r.queries,i=r.conditions,a,c,u,f;for(c in s)a=ii.matchMedia(s[c]).matches,a&&(u=1),a!==i[c]&&(i[c]=a,f=1);f&&(r.revert(),u&&n.push(r))}),M1("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),Jk=e,M1("matchMedia"))},ZA=(function(){function t(n,r){this.selector=r&&X_(r),this.data=[],this._r=[],this.isReverted=!1,this.id=XZ++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){tn(r)&&(i=s,s=r,r=tn);var a=this,c=function(){var f=zt,h=a.selector,p;return f&&f!==a&&f.data.push(a),i&&(a.selector=X_(i)),zt=a,p=s.apply(a,arguments),tn(p)&&a._r.push(p),zt=f,a.selector=h,a.isReverted=!1,p};return a.last=c,r===tn?c(a,function(u){return a.add(null,u)}):r?a[r]=c:c},e.ignore=function(r){var s=zt;zt=null,r(this),zt=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof mn&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var c=i.getTweens(),u=i.data.length,f;u--;)f=i.data[u],f.data==="isFlip"&&(f.revert(),f.getChildren(!0,!0,!1).forEach(function(h){return c.splice(c.indexOf(h),1)}));for(c.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,p){return p.g-h.g||-1/0}).forEach(function(h){return h.t.revert(r)}),u=i.data.length;u--;)f=i.data[u],f instanceof Cr?f.data!=="nested"&&(f.scrollTrigger&&f.scrollTrigger.revert(),f.kill()):!(f instanceof mn)&&f.revert&&f.revert(r);i._r.forEach(function(h){return h(r,i)}),i.isReverted=!0})():this.data.forEach(function(c){return c.kill&&c.kill()}),this.clear(),s)for(var a=El.length;a--;)El[a].id===this.id&&El.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),QZ=(function(){function t(n){this.contexts=[],this.scope=n,zt&&zt.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){_i(r)||(r={matches:r});var a=new ZA(0,i||this.scope),c=a.conditions={},u,f,h;zt&&!a.selector&&(a.selector=zt.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=r;for(f in r)f==="all"?h=1:(u=ii.matchMedia(r[f]),u&&(El.indexOf(a)<0&&El.push(a),(c[f]=u.matches)&&(h=1),u.addListener?u.addListener(e2):u.addEventListener("change",e2)));return h&&s(a,function(p){return a.add(null,p)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),Zm={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 NA(s)})},timeline:function(e){return new Cr(e)},getTweensOf:function(e,n){return Kt.getTweensOf(e,n)},getProperty:function(e,n,r,s){An(e)&&(e=xs(e)[0]);var i=wl(e||{}).get,a=r?bA:wA;return r==="native"&&(r=""),e&&(n?a((Gr[n]&&Gr[n].get||i)(e,n,r,s)):function(c,u,f){return a((Gr[c]&&Gr[c].get||i)(e,c,u,f))})},quickSetter:function(e,n,r){if(e=xs(e),e.length>1){var s=e.map(function(h){return Or.quickSetter(h,n,r)}),i=s.length;return function(h){for(var p=i;p--;)s[p](h)}}e=e[0]||{};var a=Gr[n],c=wl(e),u=c.harness&&(c.harness.aliases||{})[n]||n,f=a?function(h){var p=new a;Ec._pt=0,p.init(e,r?h+r:h,Ec,0,[e]),p.render(1,p),Ec._pt&&cw(1,Ec)}:c.set(e,u);return a?f:function(h){return f(e,u,r?h+r:h,c,1)}},quickTo:function(e,n,r){var s,i=Or.to(e,ns((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(u,f,h){return i.resetTo(n,u,f,h)};return a.tween=i,a},isTweening:function(e){return Kt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Sl(e.ease,af.ease)),Zk(af,e||{})},config:function(e){return Zk(Jr,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,a=e.extendTimeline;(s||"").split(",").forEach(function(c){return c&&!Gr[c]&&!ts[c]&&lf(n+" effect requires "+c+" plugin.")}),T1[n]=function(c,u,f){return r(xs(c),ns(u||{},i),f)},a&&(Cr.prototype[n]=function(c,u,f){return this.add(T1[n](c,_i(u)?u:(f=u)&&{},this),f)})},registerEase:function(e,n){ut[e]=Sl(n)},parseEase:function(e,n){return arguments.length?Sl(e,n):ut},getById:function(e){return Kt.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Cr(e),s,i;for(r.smoothChildTiming=Rr(e.smoothChildTiming),Kt.remove(r),r._dp=0,r._time=r._tTime=Kt._time,s=Kt._first;s;)i=s._next,(n||!(!s._dur&&s instanceof mn&&s.vars.onComplete===s._targets[0]))&&di(r,s,s._start-s._delay),s=i;return di(Kt,r,0),r},context:function(e,n){return e?new ZA(e,n):zt},matchMedia:function(e){return new QZ(e)},matchMediaRefresh:function(){return El.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||e2()},addEventListener:function(e,n){var r=Gp[e]||(Gp[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Gp[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:RZ,wrapYoyo:AZ,distribute:RA,random:IA,snap:AA,normalize:TZ,getUnit:Qn,clamp:EZ,splitColor:DA,toArray:xs,selector:X_,mapRange:OA,pipe:kZ,unitize:PZ,interpolate:IZ,shuffle:TA},install:gA,effects:T1,ticker:Kr,updateRoot:Cr.updateRoot,plugins:Gr,globalTimeline:Kt,core:{PropTween:Ir,globals:vA,Tween:mn,Timeline:Cr,Animation:ff,getCache:wl,_removeLinkedListItem:E0,reverting:function(){return zn},context:function(e){return e&&zt&&(zt.data.push(e),e._ctx=zt),zt},suppressOverwrites:function(e){return Yx=e}}};Ar("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Zm[t]=mn[t]});Kr.add(Cr.updateRoot);Ec=Zm.to({},{duration:0});var JZ=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},eq=function(e,n){var r=e._targets,s,i,a;for(s in n)for(i=r.length;i--;)a=e._ptLookup[i][s],a&&(a=a.d)&&(a._pt&&(a=JZ(a,s)),a&&a.modifier&&a.modifier(n[s],e,r[i],s))},O1=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(c){var u,f;if(An(i)&&(u={},Ar(i,function(h){return u[h]=1}),i=u),n){u={};for(f in i)u[f]=n(i[f]);i=u}eq(c,i)}}}},Or=Zm.registerPlugin({name:"attr",init:function(e,n,r,s,i){var a,c,u;this.tween=r;for(a in n)u=e.getAttribute(a)||"",c=this.add(e,"setAttribute",(u||0)+"",n[a],s,i,0,0,a),c.op=a,c.b=u,this._props.push(a)},render:function(e,n){for(var r=n._pt;r;)zn?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)}},O1("roundProps",Q_),O1("modifiers"),O1("snap",AA))||Zm;mn.version=Cr.version=Or.version="3.15.0";mA=1;Qx()&&ou();ut.Power0;ut.Power1;ut.Power2;ut.Power3;ut.Power4;ut.Linear;ut.Quad;ut.Cubic;ut.Quart;ut.Quint;ut.Strong;ut.Elastic;ut.Back;ut.SteppedEase;ut.Bounce;ut.Sine;ut.Expo;ut.Circ;/*!
122
+ * CSSPlugin 3.15.0
123
+ * https://gsap.com
124
+ *
125
+ * Copyright 2008-2026, GreenSock. All rights reserved.
126
+ * Subject to the terms at https://gsap.com/standard-license
127
+ * @author: Jack Doyle, jack@greensock.com
128
+ */var e8,Xo,Oc,uw,al,t8,dw,tq=function(){return typeof window<"u"},fo={},tl=180/Math.PI,Lc=Math.PI/180,dc=Math.atan2,n8=1e8,fw=/([A-Z])/g,nq=/(left|right|width|margin|padding|x)/i,rq=/[\s,\(]\S/,pi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},t2=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},sq=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)},iq=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)},oq=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)},aq=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},qA=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},YA=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},lq=function(e,n,r){return e.style[n]=r},cq=function(e,n,r){return e.style.setProperty(n,r)},uq=function(e,n,r){return e._gsap[n]=r},dq=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},fq=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},hq=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},Zt="transform",Mr=Zt+"Origin",pq=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in fo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=pi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(c){return r.tfm[c]=Zi(s,c)}):this.tfm[e]=a.x?a[e]:Zi(s,e),e===Mr&&(this.tfm.zOrigin=a.zOrigin);else return pi.transform.split(",").forEach(function(c){return t.call(r,c,n)});if(this.props.indexOf(Zt)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Mr,n,"")),e=Zt}(i||n)&&this.props.push(e,n,i[e])},XA=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},mq=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,a;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(fw,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)s[a]=this.tfm[a];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=dw(),(!i||!i.isStart)&&!r[Zt]&&(XA(r),s.zOrigin&&r[Mr]&&(r[Mr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},QA=function(e,n){var r={target:e,props:[],revert:mq,save:pq};return e._gsap||Or.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},JA,n2=function(e,n){var r=Xo.createElementNS?Xo.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Xo.createElement(e);return r&&r.style?r:Xo.createElement(e)},Yr=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(fw,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,au(n)||n,1)||""},r8="O,Moz,ms,Ms,Webkit".split(","),au=function(e,n,r){var s=n||al,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(r8[a]+e in i););return a<0?null:(a===3?"ms":a>=0?r8[a]:"")+e},r2=function(){tq()&&window.document&&(e8=window,Xo=e8.document,Oc=Xo.documentElement,al=n2("div")||{style:{}},n2("div"),Zt=au(Zt),Mr=Zt+"Origin",al.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",JA=!!au("perspective"),dw=Or.core.reverting,uw=1)},s8=function(e){var n=e.ownerSVGElement,r=n2("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Oc.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Oc.removeChild(r),i},i8=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},eI=function(e){var n,r;try{n=e.getBBox()}catch{n=s8(e),r=1}return n&&(n.width||n.height)||r||(n=s8(e)),n&&!n.width&&!n.x&&!n.y?{x:+i8(e,["x","cx","x1"])||0,y:+i8(e,["y","cy","y1"])||0,width:0,height:0}:n},tI=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&eI(e))},fa=function(e,n){if(n){var r=e.style,s;n in fo&&n!==Mr&&(n=Zt),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(fw,"-$1").toLowerCase())):r.removeAttribute(n)}},Qo=function(e,n,r,s,i,a){var c=new Ir(e._pt,n,r,0,1,a?YA:qA);return e._pt=c,c.b=s,c.e=i,e._props.push(r),c},o8={deg:1,rad:1,turn:1},gq={grid:1,flex:1},ha=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",c=al.style,u=nq.test(n),f=e.tagName.toLowerCase()==="svg",h=(f?"client":"offset")+(u?"Width":"Height"),p=100,m=s==="px",_=s==="%",x,y,w,S;if(s===a||!i||o8[s]||o8[a])return i;if(a!=="px"&&!m&&(i=t(e,n,r,"px")),S=e.getCTM&&tI(e),(_||a==="%")&&(fo[n]||~n.indexOf("adius")))return x=S?e.getBBox()[u?"width":"height"]:e[h],sn(_?i/x*p:i/100*x);if(c[u?"width":"height"]=p+(m?a:s),y=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!f?e:e.parentNode,S&&(y=(e.ownerSVGElement||{}).parentNode),(!y||y===Xo||!y.appendChild)&&(y=Xo.body),w=y._gsap,w&&_&&w.width&&u&&w.time===Kr.time&&!w.uncache)return sn(i/w.width*p);if(_&&(n==="height"||n==="width")){var T=e.style[n];e.style[n]=p+s,x=e[h],T?e.style[n]=T:fa(e,n)}else(_||a==="%")&&!gq[Yr(y,"display")]&&(c.position=Yr(e,"position")),y===e&&(c.position="static"),y.appendChild(al),x=al[h],y.removeChild(al),c.position="absolute";return u&&_&&(w=wl(y),w.time=Kr.time,w.width=y[h]),sn(m?x*i/p:x&&i?p/x*i:0)},Zi=function(e,n,r,s){var i;return uw||r2(),n in pi&&n!=="transform"&&(n=pi[n],~n.indexOf(",")&&(n=n.split(",")[0])),fo[n]&&n!=="transform"?(i=pf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Ym(Yr(e,Mr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=qm[n]&&qm[n](e,n,r)||Yr(e,n)||_A(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?ha(e,n,i,r)+r:i},vq=function(e,n,r,s){if(!r||r==="none"){var i=au(n,e,1),a=i&&Yr(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=Yr(e,"borderTopColor"))}var c=new Ir(this._pt,e.style,n,0,1,GA),u=0,f=0,h,p,m,_,x,y,w,S,T,P,k,A;if(c.b=r,c.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=Yr(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(y=e.style[n],e.style[n]=s,s=Yr(e,n)||s,y?e.style[n]=y:fa(e,n)),h=[r,s],FA(h),r=h[0],s=h[1],m=r.match(Sc)||[],A=s.match(Sc)||[],A.length){for(;p=Sc.exec(s);)w=p[0],T=s.substring(u,p.index),x?x=(x+1)%5:(T.substr(-5)==="rgba("||T.substr(-5)==="hsla(")&&(x=1),w!==(y=m[f++]||"")&&(_=parseFloat(y)||0,k=y.substr((_+"").length),w.charAt(1)==="="&&(w=Mc(_,w)+k),S=parseFloat(w),P=w.substr((S+"").length),u=Sc.lastIndex-P.length,P||(P=P||Jr.units[n]||k,u===s.length&&(s+=P,c.e+=P)),k!==P&&(_=ha(e,n,y,P)||0),c._pt={_next:c._pt,p:T||f===1?T:",",s:_,c:S-_,m:x&&x<4||n==="zIndex"?Math.round:0});c.c=u<s.length?s.substring(u,s.length):""}else c.r=n==="display"&&s==="none"?YA:qA;return pA.test(s)&&(c.e=0),this._pt=c,c},a8={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},yq=function(e){var n=e.split(" "),r=n[0],s=n[1]||"50%";return(r==="top"||r==="bottom"||s==="left"||s==="right")&&(e=r,r=s,s=e),n[0]=a8[r]||r,n[1]=a8[s]||s,n.join(" ")},_q=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,a=r._gsap,c,u,f;if(i==="all"||i===!0)s.cssText="",u=1;else for(i=i.split(","),f=i.length;--f>-1;)c=i[f],fo[c]&&(u=1,c=c==="transformOrigin"?Mr:Zt),fa(r,c);u&&(fa(r,Zt),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",pf(r,1),a.uncache=1,XA(s)))}},qm={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new Ir(e._pt,n,r,0,0,_q);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},hf=[1,0,0,1,0,0],nI={},rI=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},l8=function(e){var n=Yr(e,Zt);return rI(n)?hf:n.substr(7).match(hA).map(sn)},hw=function(e,n){var r=e._gsap||wl(e),s=e.style,i=l8(e),a,c,u,f;return r.svg&&e.getAttribute("transform")?(u=e.transform.baseVal.consolidate().matrix,i=[u.a,u.b,u.c,u.d,u.e,u.f],i.join(",")==="1,0,0,1,0,0"?hf:i):(i===hf&&!e.offsetParent&&e!==Oc&&!r.svg&&(u=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(f=1,c=e.nextElementSibling,Oc.appendChild(e)),i=l8(e),u?s.display=u:fa(e,"display"),f&&(c?a.insertBefore(e,c):a?a.appendChild(e):Oc.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},s2=function(e,n,r,s,i,a){var c=e._gsap,u=i||hw(e,!0),f=c.xOrigin||0,h=c.yOrigin||0,p=c.xOffset||0,m=c.yOffset||0,_=u[0],x=u[1],y=u[2],w=u[3],S=u[4],T=u[5],P=n.split(" "),k=parseFloat(P[0])||0,A=parseFloat(P[1])||0,O,L,R,M;r?u!==hf&&(L=_*w-x*y)&&(R=k*(w/L)+A*(-y/L)+(y*T-w*S)/L,M=k*(-x/L)+A*(_/L)-(_*T-x*S)/L,k=R,A=M):(O=eI(e),k=O.x+(~P[0].indexOf("%")?k/100*O.width:k),A=O.y+(~(P[1]||P[0]).indexOf("%")?A/100*O.height:A)),s||s!==!1&&c.smooth?(S=k-f,T=A-h,c.xOffset=p+(S*_+T*y)-S,c.yOffset=m+(S*x+T*w)-T):c.xOffset=c.yOffset=0,c.xOrigin=k,c.yOrigin=A,c.smooth=!!s,c.origin=n,c.originIsAbsolute=!!r,e.style[Mr]="0px 0px",a&&(Qo(a,c,"xOrigin",f,k),Qo(a,c,"yOrigin",h,A),Qo(a,c,"xOffset",p,c.xOffset),Qo(a,c,"yOffset",m,c.yOffset)),e.setAttribute("data-svg-origin",k+" "+A)},pf=function(e,n){var r=e._gsap||new $A(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,a="px",c="deg",u=getComputedStyle(e),f=Yr(e,Mr)||"0",h,p,m,_,x,y,w,S,T,P,k,A,O,L,R,M,N,D,F,q,X,W,G,K,$,te,H,j,Y,ne,ie,J;return h=p=m=y=w=S=T=P=k=0,_=x=1,r.svg=!!(e.getCTM&&tI(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(s[Zt]=(u.translate!=="none"?"translate3d("+(u.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(u.rotate!=="none"?"rotate("+u.rotate+") ":"")+(u.scale!=="none"?"scale("+u.scale.split(" ").join(",")+") ":"")+(u[Zt]!=="none"?u[Zt]:"")),s.scale=s.rotate=s.translate="none"),L=hw(e,r.svg),r.svg&&(r.uncache?($=e.getBBox(),f=r.xOrigin-$.x+"px "+(r.yOrigin-$.y)+"px",K=""):K=!n&&e.getAttribute("data-svg-origin"),s2(e,K||f,!!K||r.originIsAbsolute,r.smooth!==!1,L)),A=r.xOrigin||0,O=r.yOrigin||0,L!==hf&&(D=L[0],F=L[1],q=L[2],X=L[3],h=W=L[4],p=G=L[5],L.length===6?(_=Math.sqrt(D*D+F*F),x=Math.sqrt(X*X+q*q),y=D||F?dc(F,D)*tl:0,T=q||X?dc(q,X)*tl+y:0,T&&(x*=Math.abs(Math.cos(T*Lc))),r.svg&&(h-=A-(A*D+O*q),p-=O-(A*F+O*X))):(J=L[6],ne=L[7],H=L[8],j=L[9],Y=L[10],ie=L[11],h=L[12],p=L[13],m=L[14],R=dc(J,Y),w=R*tl,R&&(M=Math.cos(-R),N=Math.sin(-R),K=W*M+H*N,$=G*M+j*N,te=J*M+Y*N,H=W*-N+H*M,j=G*-N+j*M,Y=J*-N+Y*M,ie=ne*-N+ie*M,W=K,G=$,J=te),R=dc(-q,Y),S=R*tl,R&&(M=Math.cos(-R),N=Math.sin(-R),K=D*M-H*N,$=F*M-j*N,te=q*M-Y*N,ie=X*N+ie*M,D=K,F=$,q=te),R=dc(F,D),y=R*tl,R&&(M=Math.cos(R),N=Math.sin(R),K=D*M+F*N,$=W*M+G*N,F=F*M-D*N,G=G*M-W*N,D=K,W=$),w&&Math.abs(w)+Math.abs(y)>359.9&&(w=y=0,S=180-S),_=sn(Math.sqrt(D*D+F*F+q*q)),x=sn(Math.sqrt(G*G+J*J)),R=dc(W,G),T=Math.abs(R)>2e-4?R*tl:0,k=ie?1/(ie<0?-ie:ie):0),r.svg&&(K=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!rI(Yr(e,Zt)),K&&e.setAttribute("transform",K))),Math.abs(T)>90&&Math.abs(T)<270&&(i?(_*=-1,T+=y<=0?180:-180,y+=y<=0?180:-180):(x*=-1,T+=T<=0?180:-180)),n=n||r.uncache,r.x=h-((r.xPercent=h&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+a,r.y=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+a,r.z=m+a,r.scaleX=sn(_),r.scaleY=sn(x),r.rotation=sn(y)+c,r.rotationX=sn(w)+c,r.rotationY=sn(S)+c,r.skewX=T+c,r.skewY=P+c,r.transformPerspective=k+a,(r.zOrigin=parseFloat(f.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Mr]=Ym(f)),r.xOffset=r.yOffset=0,r.force3D=Jr.force3D,r.renderTransform=r.svg?wq:JA?sI:xq,r.uncache=0,r},Ym=function(e){return(e=e.split(" "))[0]+" "+e[1]},L1=function(e,n,r){var s=Qn(n);return sn(parseFloat(n)+parseFloat(ha(e,"x",r+"px",s)))+s},xq=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,sI(e,n)},qa="0deg",cd="0px",Ya=") ",sI=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,c=r.y,u=r.z,f=r.rotation,h=r.rotationY,p=r.rotationX,m=r.skewX,_=r.skewY,x=r.scaleX,y=r.scaleY,w=r.transformPerspective,S=r.force3D,T=r.target,P=r.zOrigin,k="",A=S==="auto"&&e&&e!==1||S===!0;if(P&&(p!==qa||h!==qa)){var O=parseFloat(h)*Lc,L=Math.sin(O),R=Math.cos(O),M;O=parseFloat(p)*Lc,M=Math.cos(O),a=L1(T,a,L*M*-P),c=L1(T,c,-Math.sin(O)*-P),u=L1(T,u,R*M*-P+P)}w!==cd&&(k+="perspective("+w+Ya),(s||i)&&(k+="translate("+s+"%, "+i+"%) "),(A||a!==cd||c!==cd||u!==cd)&&(k+=u!==cd||A?"translate3d("+a+", "+c+", "+u+") ":"translate("+a+", "+c+Ya),f!==qa&&(k+="rotate("+f+Ya),h!==qa&&(k+="rotateY("+h+Ya),p!==qa&&(k+="rotateX("+p+Ya),(m!==qa||_!==qa)&&(k+="skew("+m+", "+_+Ya),(x!==1||y!==1)&&(k+="scale("+x+", "+y+Ya),T.style[Zt]=k||"translate(0, 0)"},wq=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,c=r.y,u=r.rotation,f=r.skewX,h=r.skewY,p=r.scaleX,m=r.scaleY,_=r.target,x=r.xOrigin,y=r.yOrigin,w=r.xOffset,S=r.yOffset,T=r.forceCSS,P=parseFloat(a),k=parseFloat(c),A,O,L,R,M;u=parseFloat(u),f=parseFloat(f),h=parseFloat(h),h&&(h=parseFloat(h),f+=h,u+=h),u||f?(u*=Lc,f*=Lc,A=Math.cos(u)*p,O=Math.sin(u)*p,L=Math.sin(u-f)*-m,R=Math.cos(u-f)*m,f&&(h*=Lc,M=Math.tan(f-h),M=Math.sqrt(1+M*M),L*=M,R*=M,h&&(M=Math.tan(h),M=Math.sqrt(1+M*M),A*=M,O*=M)),A=sn(A),O=sn(O),L=sn(L),R=sn(R)):(A=p,R=m,O=L=0),(P&&!~(a+"").indexOf("px")||k&&!~(c+"").indexOf("px"))&&(P=ha(_,"x",a,"px"),k=ha(_,"y",c,"px")),(x||y||w||S)&&(P=sn(P+x-(x*A+y*L)+w),k=sn(k+y-(x*O+y*R)+S)),(s||i)&&(M=_.getBBox(),P=sn(P+s/100*M.width),k=sn(k+i/100*M.height)),M="matrix("+A+","+O+","+L+","+R+","+P+","+k+")",_.setAttribute("transform",M),T&&(_.style[Zt]=M)},bq=function(e,n,r,s,i){var a=360,c=An(i),u=parseFloat(i)*(c&&~i.indexOf("rad")?tl:1),f=u-s,h=s+f+"deg",p,m;return c&&(p=i.split("_")[1],p==="short"&&(f%=a,f!==f%(a/2)&&(f+=f<0?a:-a)),p==="cw"&&f<0?f=(f+a*n8)%a-~~(f/a)*a:p==="ccw"&&f>0&&(f=(f-a*n8)%a-~~(f/a)*a)),e._pt=m=new Ir(e._pt,n,r,s,f,sq),m.e=h,m.u="deg",e._props.push(r),m},c8=function(e,n){for(var r in n)e[r]=n[r];return e},Sq=function(e,n,r){var s=c8({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,c,u,f,h,p,m,_,x;s.svg?(f=r.getAttribute("transform"),r.setAttribute("transform",""),a[Zt]=n,c=pf(r,1),fa(r,Zt),r.setAttribute("transform",f)):(f=getComputedStyle(r)[Zt],a[Zt]=n,c=pf(r,1),a[Zt]=f);for(u in fo)f=s[u],h=c[u],f!==h&&i.indexOf(u)<0&&(_=Qn(f),x=Qn(h),p=_!==x?ha(r,u,f,x):parseFloat(f),m=parseFloat(h),e._pt=new Ir(e._pt,c,u,p,m-p,t2),e._pt.u=x||0,e._props.push(u));c8(c,s)};Ar("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",a=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(c){return e<2?t+c:"border"+c+t});qm[e>1?"border"+t:t]=function(c,u,f,h,p){var m,_;if(arguments.length<4)return m=a.map(function(x){return Zi(c,x,f)}),_=m.join(" "),_.split(m[0]).length===5?m[0]:_;m=(h+"").split(" "),_={},a.forEach(function(x,y){return _[x]=m[y]=m[y]||m[(y-1)/2|0]}),c.init(u,_,p)}});var iI={name:"css",register:r2,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var a=this._props,c=e.style,u=r.vars.startAt,f,h,p,m,_,x,y,w,S,T,P,k,A,O,L,R,M;uw||r2(),this.styles=this.styles||QA(e),R=this.styles.props,this.tween=r;for(y in n)if(y!=="autoRound"&&(h=n[y],!(Gr[y]&&HA(y,n,r,s,e,i)))){if(_=typeof h,x=qm[y],_==="function"&&(h=h.call(r,s,e,i),_=typeof h),_==="string"&&~h.indexOf("random(")&&(h=uf(h)),x)x(this,e,y,h,r)&&(L=1);else if(y.substr(0,2)==="--")f=(getComputedStyle(e).getPropertyValue(y)+"").trim(),h+="",ra.lastIndex=0,ra.test(f)||(w=Qn(f),S=Qn(h),S?w!==S&&(f=ha(e,y,f,S)+S):w&&(h+=w)),this.add(c,"setProperty",f,h,s,i,0,0,y),a.push(y),R.push(y,0,c[y]);else if(_!=="undefined"){if(u&&y in u?(f=typeof u[y]=="function"?u[y].call(r,s,e,i):u[y],An(f)&&~f.indexOf("random(")&&(f=uf(f)),Qn(f+"")||f==="auto"||(f+=Jr.units[y]||Qn(Zi(e,y))||""),(f+"").charAt(1)==="="&&(f=Zi(e,y))):f=Zi(e,y),m=parseFloat(f),T=_==="string"&&h.charAt(1)==="="&&h.substr(0,2),T&&(h=h.substr(2)),p=parseFloat(h),y in pi&&(y==="autoAlpha"&&(m===1&&Zi(e,"visibility")==="hidden"&&p&&(m=0),R.push("visibility",0,c.visibility),Qo(this,c,"visibility",m?"inherit":"hidden",p?"inherit":"hidden",!p)),y!=="scale"&&y!=="transform"&&(y=pi[y],~y.indexOf(",")&&(y=y.split(",")[0]))),P=y in fo,P){if(this.styles.save(y),M=h,_==="string"&&h.substring(0,6)==="var(--"){if(h=Yr(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var N=e.style.perspective;e.style.perspective=h,h=Yr(e,"perspective"),N?e.style.perspective=N:fa(e,"perspective")}p=parseFloat(h)}if(k||(A=e._gsap,A.renderTransform&&!n.parseTransform||pf(e,n.parseTransform),O=n.smoothOrigin!==!1&&A.smooth,k=this._pt=new Ir(this._pt,c,Zt,0,1,A.renderTransform,A,0,-1),k.dep=1),y==="scale")this._pt=new Ir(this._pt,A,"scaleY",A.scaleY,(T?Mc(A.scaleY,T+p):p)-A.scaleY||0,t2),this._pt.u=0,a.push("scaleY",y),y+="X";else if(y==="transformOrigin"){R.push(Mr,0,c[Mr]),h=yq(h),A.svg?s2(e,h,0,O,0,this):(S=parseFloat(h.split(" ")[2])||0,S!==A.zOrigin&&Qo(this,A,"zOrigin",A.zOrigin,S),Qo(this,c,y,Ym(f),Ym(h)));continue}else if(y==="svgOrigin"){s2(e,h,1,O,0,this);continue}else if(y in nI){bq(this,A,y,m,T?Mc(m,T+h):h);continue}else if(y==="smoothOrigin"){Qo(this,A,"smooth",A.smooth,h);continue}else if(y==="force3D"){A[y]=h;continue}else if(y==="transform"){Sq(this,h,e);continue}}else y in c||(y=au(y)||y);if(P||(p||p===0)&&(m||m===0)&&!rq.test(h)&&y in c)w=(f+"").substr((m+"").length),p||(p=0),S=Qn(h)||(y in Jr.units?Jr.units[y]:w),w!==S&&(m=ha(e,y,f,S)),this._pt=new Ir(this._pt,P?A:c,y,m,(T?Mc(m,T+p):p)-m,!P&&(S==="px"||y==="zIndex")&&n.autoRound!==!1?aq:t2),this._pt.u=S||0,P&&M!==h?(this._pt.b=f,this._pt.e=M,this._pt.r=oq):w!==S&&S!=="%"&&(this._pt.b=f,this._pt.r=iq);else if(y in c)vq.call(this,e,y,f,T?T+h:h);else if(y in e)this.add(e,y,f||e[y],T?T+h:h,s,i);else if(y!=="parseTransform"){ew(y,h);continue}P||(y in c?R.push(y,0,c[y]):typeof e[y]=="function"?R.push(y,2,e[y]()):R.push(y,1,f||e[y])),a.push(y)}}L&&KA(this)},render:function(e,n){if(n.tween._time||!dw())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Zi,aliases:pi,getSetter:function(e,n,r){var s=pi[n];return s&&s.indexOf(",")<0&&(n=s),n in fo&&n!==Mr&&(e._gsap.x||Zi(e,"x"))?r&&t8===r?n==="scale"?dq:uq:(t8=r||{})&&(n==="scale"?fq:hq):e.style&&!Xx(e.style[n])?lq:~n.indexOf("-")?cq:lw(e,n)},core:{_removeProperty:fa,_getMatrix:hw}};Or.utils.checkPrefix=au;Or.core.getStyleSaver=QA;(function(t,e,n,r){var s=Ar(t+","+e+","+n,function(i){fo[i]=1});Ar(e,function(i){Jr.units[i]="deg",nI[i]=1}),pi[s[13]]=t+","+e,Ar(r,function(i){var a=i.split(":");pi[a[1]]=s[a[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");Ar("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Jr.units[t]="px"});Or.registerPlugin(iI);var js=Or.registerPlugin(iI)||Or;js.core.Tween;const Kp="/assets/logo-animation",N1=1280,Eq=[{id:"eraser",src:`${Kp}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${Kp}/clasp.png`,cssW:170,cssH:170,rot:-248,fit:205,flip:!0,localX:188,localY:97,seaX:.8,seaY:.24,seaRot:-18},{id:"ball",src:`${Kp}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],Cq=[{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}],i2=({className:t})=>{const e=v.useRef(null),n=v.useRef(null),r=v.useRef(null);return v.useEffect(()=>{const s=e.current,i=n.current,a=r.current;if(!s||!i||!a)return;const c=window.matchMedia("(prefers-reduced-motion: reduce)").matches,u=(S,T)=>S+Math.random()*(T-S);let f=null,h,p=1;const m=Eq.map(S=>({...S})),_=()=>{s.querySelectorAll(".la-obj").forEach(R=>R.remove());const S=s.getBoundingClientRect(),T=S.width||N1,P=S.height||N1*.64;p=T/N1,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const A=250*p/337,O=[],L=(R,M,N)=>{const D=document.createElement("div");return D.className="la-obj",D.style.width=`${M}px`,D.innerHTML=`<img src="${R}" alt="" style="${N?"transform:scaleX(-1)":""}">`,s.appendChild(D),D};return Cq.forEach((R,M)=>{const N=R.w*p,D=L(`${Kp}/sea/${R.k}.png`,N,M%2===0);js.set(D,{x:R.x*T-N/2,y:R.y*P-N/2,rotation:R.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),O.push({el:D,hero:!1,rest:1})}),m.forEach(R=>{const M=R.cssW*p;R.el=L(R.src,M,!!R.flip),R.finalScale=R.fit*A/(R.cssW*p),js.set(R.el,{x:R.seaX*T-M/2,y:R.seaY*P-R.cssH*p/2,rotation:R.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),O.push({el:R.el,hero:!0,rest:150/R.cssW})}),O},x=(S,T)=>{const P=s.getBoundingClientRect(),k=a.getBoundingClientRect();return{x:k.left-P.left+S/326*k.width,y:k.top-P.top+T/337*k.height}},y=()=>{f&&f.revert();const S=_();if(c){f=js.context(()=>{S.filter(k=>!k.hero).forEach(k=>js.set(k.el,{scale:0})),m.forEach(k=>{if(!k.el)return;const A=x(k.localX,k.localY);js.set(k.el,{x:A.x-k.cssW*p/2,y:A.y-k.cssH*p/2,rotation:k.rot,scale:k.finalScale})})},s);return}const T=[],P=[];f=js.context(()=>{const k=js.timeline();k.to(S.map(A=>A.el),{scale:A=>S[A].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),k.add(()=>{S.forEach(({el:A,hero:O},L)=>{const R=O?T:P,M=L%2?1:-1;R.push(js.to(A,{rotation:"+="+u(2.5,6)*M,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),js.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"),k.to({},{duration:1.1}),k.add("pick"),m.forEach((A,O)=>{A.el&&k.to(A.el,{scale:150/A.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+O*.08)}),k.add("clear","pick+=0.7"),k.add(()=>P.forEach(A=>A.kill()),"clear"),k.to(S.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"),k.add("assemble","clear+=0.25"),k.add(()=>T.forEach(A=>A.kill()),"assemble"),m.forEach((A,O)=>{if(!A.el||A.finalScale===void 0)return;const L=x(A.localX,A.localY);k.to(A.el,{x:L.x-A.cssW*p/2,y:L.y-A.cssH*p/2,rotation:A.rot,scale:A.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+O*.12)}),m.forEach(A=>{!A.el||A.finalScale===void 0||k.to(A.el,{scale:A.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};js.ticker.fps(12),y();const w=()=>{clearTimeout(h),h=setTimeout(y,250)};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),clearTimeout(h),f==null||f.revert(),s.querySelectorAll(".la-obj").forEach(S=>S.remove())}},[]),E.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:E.jsx("div",{ref:n,className:"la-logo-stage",children:E.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},kq=Object.freeze(Object.defineProperty({__proto__:null,default:i2},Symbol.toStringTag,{value:"Module"})),u8=({isSigningIn:t})=>t?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),E.jsx("span",{children:"Signing in..."})]}):E.jsxs(E.Fragment,{children:[E.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),E.jsx("span",{children:"Sign in with Google"})]}),Pq=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,isDesktopShell:r=!1,displayMode:s="full"})=>s==="modal"?E.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[E.jsx(i2,{className:"relative z-0 h-44 w-full"}),E.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[E.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[E.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),E.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),E.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(u8,{isSigningIn:t})}),n?E.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):E.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[r?E.jsx("div",{className:"fixed left-0 right-0 top-0 z-10 h-8",style:{WebkitAppRegion:"drag"}}):null,E.jsx(i2,{className:"absolute inset-0 z-0"}),E.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[E.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[E.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),E.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),E.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(u8,{isSigningIn:t})}),n?E.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),Tq="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",Rq=({message:t})=>E.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:E.jsxs("div",{className:"flex flex-col items-center gap-10",children:[E.jsx("img",{src:Tq,alt:"Rivet",className:"h-8 w-auto object-contain"}),E.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[E.jsx(h0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),E.jsx("span",{children:t})]})]})}),Aq="data:image/svg+xml,%3csvg%20width='548'%20height='565'%20viewBox='0%200%20548%20565'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M136.53%20-0.00177124C170.301%20-0.00177124%20197.687%2027.3551%20197.724%2061.1255L198.089%20394.976C198.189%20486.214%20124.253%20560.23%2033.0153%20560.23C14.7818%20560.23%200.000557184%20545.449%200.000557184%20527.216V61.1923C0.000557184%2027.3957%2027.3981%20-0.00177124%2061.1947%20-0.00177124H136.53Z'%20fill='white'/%3e%3cpath%20d='M271.092%20463.876C271.092%20530.762%20310.368%20564.205%20388.919%20564.205C468.248%20564.205%20507.913%20530.762%20507.913%20463.876C507.913%20426.545%20498.191%20400.88%20478.748%20386.88C460.082%20372.103%20430.139%20364.715%20388.919%20364.715C350.032%20364.715%20320.478%20372.103%20300.257%20386.88C280.814%20400.88%20271.092%20426.545%20271.092%20463.876Z'%20fill='white'/%3e%3cpath%20d='M405.25%200.917969C408.273%200.917973%20411.331%201.11183%20414.358%201.66895C437.891%205.99962%20471.151%2018.8698%20498.612%2044.5137C526.065%2070.1496%20547.676%20108.515%20547.992%20163.691C547.992%20163.693%20547.994%20163.695%20547.997%20163.695C547.999%20163.695%20548.001%20163.697%20548.001%20163.7L547.996%20164.612L548.001%20165.526C548.001%20165.528%20547.999%20165.53%20547.997%20165.53C547.994%20165.53%20547.992%20165.532%20547.992%20165.535C547.665%20222.498%20524.643%20261.54%20495.935%20287.156C467.223%20312.776%20432.863%20324.939%20409.917%20328.291C409.844%20328.302%20409.769%20328.308%20409.695%20328.308H283.146C254.52%20328.308%20231.314%20305.102%20231.314%20276.477C231.315%20244.265%20255.799%20218.161%20287.447%20213.026C309.663%20209.422%20329.612%20204.399%20344.084%20196.322C354.361%20190.586%20359.717%20184.074%20362.521%20178.421C365.332%20172.756%20365.636%20167.843%20365.636%20165.225V163.994C365.635%20161.374%20365.33%20156.465%20362.521%20150.805C359.717%20145.152%20354.361%20138.639%20344.084%20132.903C329.612%20124.826%20309.663%20119.803%20287.447%20116.199C255.799%20111.065%20231.315%2084.9602%20231.314%2052.749C231.314%2024.1235%20254.52%200.917969%20283.146%200.917969H405.25Z'%20fill='white'/%3e%3c/svg%3e",Xm=44,ud=8,wp=16,Iq=4,d8=-18,Mq=.18,Oq=[.22,1,.36,1],f8=.92,Lq=1,Nq=.95,Dq=.4,jq=[.19,1,.22,1],D1=0,Fq=1,Vq=0,$q=0,Hq=0,oI=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+ud,s=Math.max(r,e.width-Xm-ud),i=Math.max(ud,e.height-Xm-ud);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(ud,t.y))}},pw=()=>({width:window.innerWidth,height:window.innerHeight}),zq=({position:t,boundsLeftPx:e=0})=>oI({position:t,viewport:pw(),boundsLeft:e}),Uq=()=>{if(typeof window>"u")return{x:wp,y:wp};const t=pw();return{x:t.width-Xm-wp,y:t.height-Xm-wp}},Bq=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=Iq,Wq=t=>t.button===void 0||t.button<=Hq,h8=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},Gq=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:a})=>{const c=v.useRef(null),u=v.useRef(!1),[f,h]=v.useState(!1),[p,m]=v.useState(!1),_=n?!1:{opacity:D1,scale:f8,x:d8},x=n?{opacity:D1}:{opacity:D1,scale:f8,x:d8},y=n?{duration:$q}:{duration:Mq,ease:Oq,scale:{duration:Dq,ease:jq}},w=v.useCallback(()=>{const A=c.current;A&&(u.current=A.hasMoved),c.current=null,h(!1)},[]),S=v.useCallback(A=>{const O=c.current;if(!O)return;const L=h8(A),R=L.x-O.startPointer.x,M=L.y-O.startPointer.y,N=O.hasMoved||Bq({deltaX:R,deltaY:M});c.current={...O,hasMoved:N},N&&a(oI({position:{x:O.startPosition.x+R,y:O.startPosition.y+M},viewport:pw(),boundsLeft:s}))},[a,s]),T=v.useCallback(A=>{if(c.current||!Wq(A))return;const O=h8(A);c.current={startPointer:O,startPosition:r,hasMoved:!1},h(!0)},[r]),P=v.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),k=e?"Close panel":"Open panel";return E.jsxs(E.Fragment,{children:[f?E.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:S,onPointerUp:w,onPointerCancel:w,onMouseMove:S,onMouseUp:w}):null,E.jsx(ro,{children:t?E.jsx(to,{label:k,side:"top",forceOpen:p&&!f?void 0:!1,children:E.jsx(xl.button,{type:"button","aria-label":k,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:_,animate:{opacity:Fq,scale:Lq,x:Vq},whileTap:{scale:Nq},exit:x,transition:y,onPointerDown:T,onMouseDown:T,onPointerMove:S,onPointerUp:w,onPointerCancel:w,onMouseMove:S,onMouseUp:w,onClick:P,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${f?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:E.jsx("img",{src:Aq,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},j1=Ss("useConfig"),Kq=300*1e3,Zq=1800*1e3,qq=60*1e3,Yq=300*1e3,Xq=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},Qq=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},Jq=t=>({...eR,...t??{}}),eY=()=>{const t=et(j_),e=at(j_),n=at(uR),r=at(dR),s=at(p0),i=at(iB),a=at(cR),c=at(rB),u=at(Tf),f=at(sR),h=v.useCallback(S=>{a(S.agentModeAvailable),f({name:S.name??null,email:S.email??null}),S.isMCPSession&&n(!0),S.mcpEditor&&r(S.mcpEditor),s(S.agentApplyMode??Qq()??null),i(S.queueAccessToken??Xq())},[s,a,n,r,i,f]),p=sy({queryKey:["rivet-config"],queryFn:async()=>{const S=await fetch("/api/config");if(!S.ok)throw new Error(`Failed to fetch config: ${S.statusText}`);return await S.json()},staleTime:Kq,gcTime:Zq}),m=sy({queryKey:["rivet-feature-flags"],queryFn:async()=>{const S=await fetch("/api/feature-flags");if(!S.ok)throw new Error(`Failed to fetch feature flags: ${S.statusText}`);return await S.json()},staleTime:qq,gcTime:Yq}),{refetch:_}=p,{refetch:x}=m;v.useLayoutEffect(()=>{p.data&&(h(p.data),u(!1),j1.info("Config loaded:",p.data)),m.data&&(e(Jq(m.data.featureFlags)),c(!0))},[p.data,m.data,h,u,e,c]),v.useLayoutEffect(()=>{p.error&&(c(!0),u(!1),j1.warn("Failed to load config:",p.error instanceof Error?p.error.message:"Failed to load config")),m.error&&(c(!0),j1.warn("Failed to load feature flags:",m.error instanceof Error?m.error.message:"Failed to load feature flags"))},[p.error,m.error,u,c]);const y=v.useCallback(async()=>{const[S]=await Promise.all([_(),x()]);return S.data?S.data:null},[_,x]);let w=null;return p.error instanceof Error?w=p.error.message:p.error&&(w="Failed to load config"),{config:p.data??null,featureFlags:t,loading:p.isPending||!p.error&&m.isPending,error:w,refetchConfig:y}},Zp="rivet_just_signed_in",fc=Ss("useOAuthCallback"),tY="https://rivet-proxy.onrender.com",nY=()=>{const[t,e]=v.useState({isProcessing:!1,isComplete:!1,error:null});return v.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var c,u,f;const i=window.location.hash,a=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{fc.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),m=h.get("refresh_token"),x=new URLSearchParams(a).get("session");if(!p)throw new Error("No access token found in URL");if(!x)throw new Error("No session ID found in URL");fc.info(`Completing OAuth with session: ${x}`);const y=await fetch(`${tY}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:p,refreshToken:m}),signal:n.signal}),w=await y.json();if(!y.ok||!w.success)throw new Error(w.error||w.message||"Failed to complete authentication");if(fc.info("OAuth authentication completed successfully"),r)return;if((c=w.user)!=null&&c.id?(Se.identify(w.user.id,{...w.user.email?{email:w.user.email}:{}}),w.user.email&&Se.alias(w.user.email,w.user.id)):(u=w.user)!=null&&u.email&&Se.identify(w.user.email,{email:w.user.email}),(f=w.user)!=null&&f.email&&p)try{const T=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w.user.email,token:p,refreshToken:m,userId:w.user.id}),signal:n.signal});T.ok||fc.warn(`Local auth store returned ${T.status}`)}catch(T){if(r)return;fc.warn("Failed to store auth locally:",T)}if(r)return;window.sessionStorage.setItem(Zp,"1");const S=window.location.pathname;window.history.replaceState({},document.title,S),e({isProcessing:!1,isComplete:!0,error:null})}catch(h){if(r)return;const p=h instanceof Error?h.message:"Unknown error occurred";fc.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},F1=Ss("useAgentVariantsSession"),rY=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,p8=(t,e,n)=>{e.size===0&&!n||t.set(Jd,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[a,c]of r)c.status==="sending"&&c.variantRequestId&&(e.has(c.variantRequestId)||n&&c.variantRequest!==void 0)&&(s.delete(a),i=!0);return i?s:r})},sY=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,a]of t){if(a.status!=="sending"||!a.awaitingSnapshotOutcome||a.variantRequest!==void 0)continue;const c=a.target;if(!c||c.kind!=="variant"||c.sessionId!==e.sessionId)continue;const u=(s=e.variants.find(f=>f.workItemId===c.variantId))==null?void 0:s.refinement;u&&(u.status==="succeeded"?(r.set(i,{...a,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(u.status==="failed"||u.status==="cancelled")&&(r.set(i,{...a,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},iY=({enabled:t=!0}={})=>{const e=at(Pf),n=at(tR),r=at(QU),s=at(aR),i=at(nB),a=j2(),c=v.useRef(null);v.useEffect(()=>{if(!t)return;const u=new EventSource("/api/variants/events");return u.onmessage=f=>{try{const h=JSON.parse(f.data),p=c.current;if(h.active){const x=new Set(h.variants.map(y=>y.requestId).filter(y=>!!y));s(y=>y.filter(S=>!x.has(S.requestId))),p8(a,x,!1),a.set(Jd,y=>{let w=y;for(const S of h.variants){const T=S.adoptedSource;T&&(w=tB(w,{kind:"variant",sessionId:T.sessionId,variantId:T.variantId},{kind:"variant",sessionId:h.sessionId,variantId:S.workItemId}))}return w}),a.set(Jd,y=>sY(y,h)),h.sessionId!==c.current&&(c.current=h.sessionId,n(!0),r("directions"))}else c.current=null,p8(a,new Set,rY(h));e(h);const m=!h.active&&p!==null,_=h.active&&h.sessionId!==p;if(_&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(x=>F1.warn("failed to reset preview-port on session switch",x)),m||_){const x=new Set;if(h.active)for(const w of h.variants)x.add(Xd({kind:"variant",sessionId:h.sessionId,variantId:w.workItemId}));const y=a.get(lo);for(const w of[y==null?void 0:y.left,y==null?void 0:y.right])w&&x.add(Xd({kind:"variant",sessionId:w.sessionId,variantId:w.variantId}));i(x)}}catch(h){F1.warn("failed to parse SSE event payload",h)}},u.onerror=f=>{F1.warn("SSE error (auto-reconnects)",f)},()=>{u.close()}},[t,e,n,r,s,i,a])};var oY=Object.defineProperty,Tn=(t,e)=>oY(t,"name",{value:e,configurable:!0});function mw(t){const e=t+"CollectionProvider",[n,r]=xi(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=Tn(y=>{const{scope:w,children:S}=y,T=v.useRef(null),P=v.useRef(new Map).current;return E.jsx(s,{scope:w,itemMap:P,collectionRef:T,children:S})},"CollectionProvider");a.displayName=e;const c=t+"CollectionSlot",u=la(c),f=v.forwardRef((y,w)=>{const{scope:S,children:T}=y,P=i(c,S),k=jt(w,P.collectionRef);return E.jsx(u,{ref:k,children:T})});f.displayName=c;const h=t+"CollectionItemSlot",p="data-radix-collection-item",m=la(h),_=v.forwardRef((y,w)=>{const{scope:S,children:T,...P}=y,k=v.useRef(null),A=jt(w,k),O=i(h,S);return v.useEffect(()=>(O.itemMap.set(k,{ref:k,...P}),()=>void O.itemMap.delete(k))),E.jsx(m,{[p]:"",ref:A,children:T})});_.displayName=h;function x(y){const w=i(t+"CollectionConsumer",y);return v.useCallback(()=>{const T=w.collectionRef.current;if(!T)return[];const P=Array.from(T.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((O,L)=>P.indexOf(O.ref.current)-P.indexOf(L.ref.current))},[w.collectionRef,w.itemMap])}return Tn(x,"useCollection"),[{Provider:a,Slot:f,ItemSlot:_},x,r]}Tn(mw,"createCollection");var m8=new WeakMap,hn,Br,V1=(Br=class extends Map{constructor(n){super(n);He(this,hn);ke(this,hn,[...super.keys()]),m8.set(this,!0)}set(n,r){return m8.get(this)&&(this.has(n)?z(this,hn)[z(this,hn).indexOf(n)]=n:z(this,hn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),a=z(this,hn).length,c=gw(n);let u=c>=0?c:a+c;const f=u<0||u>=a?-1:u;if(f===this.size||i&&f===this.size-1||f===-1)return this.set(r,s),this;const h=this.size+(i?0:1);c<0&&u++;const p=[...z(this,hn)];let m,_=!1;for(let x=u;x<h;x++)if(u===x){let y=p[x];p[x]===r&&(y=p[x+1]),i&&this.delete(r),m=this.get(y),this.set(r,s)}else{!_&&p[x-1]===r&&(_=!0);const y=p[_?x:x-1],w=m;m=this.get(y),this.delete(y),this.set(y,w)}return this}with(n,r,s){const i=new Br(this);return i.insert(n,r,s),i}before(n){const r=z(this,hn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=z(this,hn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=z(this,hn).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=z(this,hn).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ke(this,hn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&z(this,hn).splice(z(this,hn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=qp(z(this,hn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=qp(z(this,hn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return z(this,hn).indexOf(n)}keyAt(n){return qp(z(this,hn),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const a of this)Reflect.apply(n,r,[a,i,this])&&s.push(a),i++;return new Br(s)}map(n,r){const s=[];let i=0;for(const a of this)s.push([a[0],Reflect.apply(n,r,[a,i,this])]),i++;return new Br(s)}reduce(...n){const[r,s]=n;let i=0,a=s??this.at(0);for(const c of this)i===0&&n.length===1?a=c:a=Reflect.apply(r,this,[a,c,i,this]),i++;return a}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let a=this.size-1;a>=0;a--){const c=this.at(a);a===this.size-1&&n.length===1?i=c:i=Reflect.apply(r,this,[i,c,a,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new Br(r)}toReversed(){const n=new Br;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 Br(r)}slice(n,r){const s=new Br;let i=this.size-1;if(n===void 0)return s;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let a=n;a<=i;a++){const c=this.keyAt(a),u=this.get(c);s.set(c,u)}return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},hn=new WeakMap,Tn(Br,"OrderedDict"),Br);function qp(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=aI(t,e);return n===-1?void 0:t[n]}Tn(qp,"at");function aI(t,e){const n=t.length,r=gw(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}Tn(aI,"toSafeIndex");function gw(t){return t!==t||t===0?0:Math.trunc(t)}Tn(gw,"toSafeInteger");function aY(t){const e=t+"CollectionProvider",[n,r]=xi(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new V1,setItemMap:Tn(()=>{},"setItemMap")}),a=Tn(({state:P,...k})=>P?E.jsx(u,{...k,state:P}):E.jsx(c,{...k}),"CollectionProvider");a.displayName=e;const c=Tn(P=>{const k=w();return E.jsx(u,{...P,state:k})},"CollectionInit");c.displayName=e+"Init";const u=Tn(P=>{const{scope:k,children:A,state:O}=P,L=v.useRef(null),[R,M]=v.useState(null),N=jt(L,M),[D,F]=O;return v.useEffect(()=>{if(!R)return;const q=uI(()=>{});return q.observe(R,{childList:!0,subtree:!0}),()=>{q.disconnect()}},[R]),E.jsx(s,{scope:k,itemMap:D,setItemMap:F,collectionRef:N,collectionRefObject:L,collectionElement:R,children:A})},"CollectionProviderImpl");u.displayName=e+"Impl";const f=t+"CollectionSlot",h=la(f),p=v.forwardRef((P,k)=>{const{scope:A,children:O}=P,L=i(f,A),R=jt(k,L.collectionRef);return E.jsx(h,{ref:R,children:O})});p.displayName=f;const m=t+"CollectionItemSlot",_="data-radix-collection-item",x=la(m),y=v.forwardRef((P,k)=>{const{scope:A,children:O,...L}=P,R=v.useRef(null),[M,N]=v.useState(null),D=jt(k,R,N),F=i(m,A),{setItemMap:q}=F,X=v.useRef(L);lI(X.current,L)||(X.current=L);const W=X.current;return v.useEffect(()=>{const G=W;return q(K=>M?K.has(M)?K.set(M,{...G,element:M}).toSorted(o2):(K.set(M,{...G,element:M}),K.toSorted(o2)):K),()=>{q(K=>!M||!K.has(M)?K:(K.delete(M),new V1(K)))}},[M,W,q]),E.jsx(x,{[_]:"",ref:D,children:O})});y.displayName=m;function w(){return v.useState(new V1)}Tn(w,"useInitCollection");function S(P){const{itemMap:k}=i(t+"CollectionConsumer",P);return k}return Tn(S,"useCollection"),[{Provider:a,Slot:p,ItemSlot:y},{createCollectionScope:r,useCollection:S,useInitCollection:w}]}Tn(aY,"createCollection");function lI(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}Tn(lI,"shallowEqual");function cI(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Tn(cI,"isElementPreceding");function o2(t,e){return!t[1].element||!e[1].element?0:cI(t[1].element,e[1].element)?-1:1}Tn(o2,"sortByDocumentPosition");function uI(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Tn(uI,"getChildListObserver");var lY=Object.defineProperty,If=(t,e)=>lY(t,"name",{value:e,configurable:!0}),vw="Collapsible",[cY,dI]=xi(vw),[uY,yw]=cY(vw),dY=v.forwardRef(If(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:a,onOpenChange:c,...u}=e,[f,h]=ma({prop:s,defaultProp:i??!1,onChange:c,caller:vw});return E.jsx(uY,{scope:r,disabled:a,contentId:ea(),open:f,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),children:E.jsx(on.div,{"data-state":P0(f),"data-disabled":a?"":void 0,...u,ref:n})})},"Collapsible")),fY="CollapsibleTrigger",hY=v.forwardRef(If(function(e,n){const{__scopeCollapsible:r,...s}=e,i=yw(fY,r);return E.jsx(on.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":P0(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Nt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),fI="CollapsibleContent",pY=v.forwardRef(If(function(e,n){const{forceMount:r,...s}=e,i=yw(fI,e.__scopeCollapsible);return E.jsx(ga,{present:r||i.open,children:({present:a})=>E.jsx(mY,{...s,ref:n,present:a})})},"CollapsibleContent")),mY=v.forwardRef(If(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...a}=e,c=yw(fI,r),[u,f]=v.useState(s),h=v.useRef(null),p=jt(n,h),m=v.useRef(0),_=m.current,x=v.useRef(0),y=x.current,w=c.open||u,S=v.useRef(w),T=v.useRef(void 0);return v.useEffect(()=>{const P=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(P)},[]),Pr(()=>{const P=h.current;if(P){T.current=T.current||{transitionDuration:P.style.transitionDuration,animationName:P.style.animationName},P.style.transitionDuration="0s",P.style.animationName="none";const k=P.getBoundingClientRect();m.current=k.height,x.current=k.width,S.current||(P.style.transitionDuration=T.current.transitionDuration,P.style.animationName=T.current.animationName),f(s)}},[c.open,s]),E.jsx(on.div,{"data-state":P0(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!w,...a,ref:p,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:w&&i})},"CollapsibleContentImpl"));function P0(t){return t?"open":"closed"}If(P0,"getState");var gY=dY,vY=hY,yY=pY,_Y=Object.defineProperty,xY=(t,e)=>_Y(t,"name",{value:e,configurable:!0}),wY=v.createContext(void 0);function _w(t){const e=v.useContext(wY);return t||e||"ltr"}xY(_w,"useDirection");var bY=Object.defineProperty,es=(t,e)=>bY(t,"name",{value:e,configurable:!0}),wi="Accordion",SY=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[xw,EY,CY]=mw(wi),[T0,VJ]=xi(wi,[CY,dI]),ww=dI(),kY=v.forwardRef(es(function(e,n){const{type:r,...s}=e,i=s,a=s;return E.jsx(xw.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?E.jsx(AY,{...a,ref:n}):E.jsx(RY,{...i,ref:n})})},"Accordion")),[hI,PY]=T0(wi),[pI,TY]=T0(wi,{collapsible:!1}),RY=v.forwardRef(es(function(e,n){const{value:r,defaultValue:s,onValueChange:i=es(()=>{},"onValueChange"),collapsible:a=!1,...c}=e,[u,f]=ma({prop:r,defaultProp:s??"",onChange:i,caller:wi});return E.jsx(hI,{scope:e.__scopeAccordion,value:v.useMemo(()=>u?[u]:[],[u]),onItemOpen:f,onItemClose:v.useCallback(()=>a&&f(""),[a,f]),children:E.jsx(pI,{scope:e.__scopeAccordion,collapsible:a,children:E.jsx(mI,{...c,ref:n})})})},"AccordionImplSingle")),AY=v.forwardRef(es(function(e,n){const{value:r,defaultValue:s,onValueChange:i=es(()=>{},"onValueChange"),...a}=e,[c,u]=ma({prop:r,defaultProp:s??[],onChange:i,caller:wi}),f=v.useCallback(p=>u((m=[])=>[...m,p]),[u]),h=v.useCallback(p=>u((m=[])=>m.filter(_=>_!==p)),[u]);return E.jsx(hI,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:h,children:E.jsx(pI,{scope:e.__scopeAccordion,collapsible:!0,children:E.jsx(mI,{...a,ref:n})})})},"AccordionImplMultiple")),[IY,R0]=T0(wi),mI=v.forwardRef(es(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:a="vertical",...c}=e,u=v.useRef(null),f=jt(u,n),h=EY(r),m=_w(i)==="ltr",_=Nt(e.onKeyDown,x=>{var M;if(!SY.includes(x.key))return;const y=x.target,w=h().filter(N=>{var D;return!((D=N.ref.current)!=null&&D.disabled)}),S=w.findIndex(N=>N.ref.current===y),T=w.length;if(S===-1)return;x.preventDefault();let P=S;const k=0,A=T-1,O=es(()=>{P=S+1,P>A&&(P=k)},"moveNext"),L=es(()=>{P=S-1,P<k&&(P=A)},"movePrev");switch(x.key){case"Home":P=k;break;case"End":P=A;break;case"ArrowRight":a==="horizontal"&&(m?O():L());break;case"ArrowDown":a==="vertical"&&O();break;case"ArrowLeft":a==="horizontal"&&(m?L():O());break;case"ArrowUp":a==="vertical"&&L();break}const R=P%T;(M=w[R].ref.current)==null||M.focus()});return E.jsx(IY,{scope:r,disabled:s,direction:i,orientation:a,children:E.jsx(xw.Slot,{scope:r,children:E.jsx(on.div,{...c,"data-orientation":a,ref:f,onKeyDown:s?void 0:_})})})},"AccordionImpl")),a2="AccordionItem",[MY,bw]=T0(a2),OY=v.forwardRef(es(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,a=R0(a2,r),c=PY(a2,r),u=ww(r),f=ea(),h=s&&c.value.includes(s)||!1,p=a.disabled||e.disabled;return E.jsx(MY,{scope:r,open:h,disabled:p,triggerId:f,children:E.jsx(gY,{"data-orientation":a.orientation,"data-state":Sw(h),...u,...i,ref:n,disabled:p,open:h,onOpenChange:m=>{m?c.onItemOpen(s):c.onItemClose(s)}})})},"AccordionItem")),LY="AccordionHeader",NY=v.forwardRef(es(function(e,n){const{__scopeAccordion:r,...s}=e,i=R0(wi,r),a=bw(LY,r);return E.jsx(on.h3,{"data-orientation":i.orientation,"data-state":Sw(a.open),"data-disabled":a.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),g8="AccordionTrigger",DY=v.forwardRef(es(function(e,n){const{__scopeAccordion:r,...s}=e,i=R0(wi,r),a=bw(g8,r),c=TY(g8,r),u=ww(r);return E.jsx(xw.ItemSlot,{scope:r,children:E.jsx(vY,{"aria-disabled":a.open&&!c.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),jY="AccordionContent",FY=v.forwardRef(es(function(e,n){const{__scopeAccordion:r,...s}=e,i=R0(wi,r),a=bw(jY,r),c=ww(r);return E.jsx(yY,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...c,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function Sw(t){return t?"open":"closed"}es(Sw,"getState");var gI=kY,VY=OY,$Y=NY,HY=DY,zY=FY;/**
129
+ * @license lucide-react v1.28.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */const vI=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
134
+ * @license lucide-react v1.28.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ */const UY=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
139
+ * @license lucide-react v1.28.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */const BY=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
144
+ * @license lucide-react v1.28.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */const v8=t=>{const e=BY(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
149
+ * @license lucide-react v1.28.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ */var $1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
154
+ * @license lucide-react v1.28.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */const WY=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},GY=v.createContext({}),KY=()=>v.useContext(GY),ZY=v.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...c},u)=>{const{size:f=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:_=""}=KY()??{},x=r??p?Number(n??h)*24/Number(e??f):n??h;return v.createElement("svg",{ref:u,...$1,width:e??f??$1.width,height:e??f??$1.height,stroke:t??m,strokeWidth:x,className:vI("lucide",_,s),...!i&&!WY(c)&&{"aria-hidden":"true"},...c},[...a.map(([y,w])=>v.createElement(y,w)),...Array.isArray(i)?i:[i]])});/**
159
+ * @license lucide-react v1.28.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const qe=(t,e)=>{const n=v.forwardRef(({className:r,...s},i)=>v.createElement(ZY,{ref:i,iconNode:e,className:vI(`lucide-${UY(v8(t))}`,`lucide-${t}`,r),...s}));return n.displayName=v8(t),n};/**
164
+ * @license lucide-react v1.28.0 - ISC
165
+ *
166
+ * This source code is licensed under the ISC license.
167
+ * See the LICENSE file in the root directory of this source tree.
168
+ */const qY=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],YY=qe("arrow-left",qY);/**
169
+ * @license lucide-react v1.28.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 XY=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],QY=qe("arrow-right",XY);/**
174
+ * @license lucide-react v1.28.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 JY=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],eX=qe("arrow-up",JY);/**
179
+ * @license lucide-react v1.28.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 tX=[["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"}]],nX=qe("bell",tX);/**
184
+ * @license lucide-react v1.28.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 rX=[["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"}]],sX=qe("brain",rX);/**
189
+ * @license lucide-react v1.28.0 - ISC
190
+ *
191
+ * This source code is licensed under the ISC license.
192
+ * See the LICENSE file in the root directory of this source tree.
193
+ */const iX=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],oX=qe("check",iX);/**
194
+ * @license lucide-react v1.28.0 - ISC
195
+ *
196
+ * This source code is licensed under the ISC license.
197
+ * See the LICENSE file in the root directory of this source tree.
198
+ */const aX=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],lX=qe("chevron-down",aX);/**
199
+ * @license lucide-react v1.28.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 cX=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],uX=qe("chevron-right",cX);/**
204
+ * @license lucide-react v1.28.0 - ISC
205
+ *
206
+ * This source code is licensed under the ISC license.
207
+ * See the LICENSE file in the root directory of this source tree.
208
+ */const dX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fX=qe("circle",dX);/**
209
+ * @license lucide-react v1.28.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 hX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],pX=qe("clock",hX);/**
214
+ * @license lucide-react v1.28.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 mX=[["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"}]],gX=qe("copy",mX);/**
219
+ * @license lucide-react v1.28.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 vX=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],yX=qe("dot",vX);/**
224
+ * @license lucide-react v1.28.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 _X=[["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"}]],xX=qe("globe",_X);/**
229
+ * @license lucide-react v1.28.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 wX=[["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"}]],bX=qe("heart",wX);/**
234
+ * @license lucide-react v1.28.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 SX=[["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"}]],EX=qe("house",SX);/**
239
+ * @license lucide-react v1.28.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 CX=[["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"}]],kX=qe("image",CX);/**
244
+ * @license lucide-react v1.28.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 PX=[["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"}]],TX=qe("inbox",PX);/**
249
+ * @license lucide-react v1.28.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 RX=[["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"}]],AX=qe("lightbulb",RX);/**
254
+ * @license lucide-react v1.28.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 IX=[["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"}]],MX=qe("link",IX);/**
259
+ * @license lucide-react v1.28.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 OX=[["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"}]],LX=qe("loader",OX);/**
264
+ * @license lucide-react v1.28.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 NX=[["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"}]],DX=qe("lock",NX);/**
269
+ * @license lucide-react v1.28.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 jX=[["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"}]],FX=qe("mail",jX);/**
274
+ * @license lucide-react v1.28.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 VX=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],$X=qe("menu",VX);/**
279
+ * @license lucide-react v1.28.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 HX=[["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"}]],zX=qe("message-circle",HX);/**
284
+ * @license lucide-react v1.28.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 UX=[["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"}]],BX=qe("monitor",UX);/**
289
+ * @license lucide-react v1.28.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 WX=[["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"}]],GX=qe("moon",WX);/**
294
+ * @license lucide-react v1.28.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 KX=[["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"}]],ZX=qe("paintbrush",KX);/**
299
+ * @license lucide-react v1.28.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 qX=[["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"}]],YX=qe("palette",qX);/**
304
+ * @license lucide-react v1.28.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 XX=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],QX=qe("pause",XX);/**
309
+ * @license lucide-react v1.28.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 JX=[["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"}]],eQ=qe("pencil",JX);/**
314
+ * @license lucide-react v1.28.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 tQ=[["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"}]],nQ=qe("pipette",tQ);/**
319
+ * @license lucide-react v1.28.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 rQ=[["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"}]],sQ=qe("play",rQ);/**
324
+ * @license lucide-react v1.28.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 iQ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],oQ=qe("plus",iQ);/**
329
+ * @license lucide-react v1.28.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 aQ=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],lQ=qe("rectangle-horizontal",aQ);/**
334
+ * @license lucide-react v1.28.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 cQ=[["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"}]],uQ=qe("rocket",cQ);/**
339
+ * @license lucide-react v1.28.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 dQ=[["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"}]],fQ=qe("rotate-ccw",dQ);/**
344
+ * @license lucide-react v1.28.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 hQ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],pQ=qe("search",hQ);/**
349
+ * @license lucide-react v1.28.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 mQ=[["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"}]],gQ=qe("settings",mQ);/**
354
+ * @license lucide-react v1.28.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 vQ=[["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"}]],yQ=qe("shield",vQ);/**
359
+ * @license lucide-react v1.28.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 _Q=[["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"}]],xQ=qe("skip-forward",_Q);/**
364
+ * @license lucide-react v1.28.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 wQ=[["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"}]],bQ=qe("square-library",wQ);/**
369
+ * @license lucide-react v1.28.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 SQ=[["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"}]],EQ=qe("star",SQ);/**
374
+ * @license lucide-react v1.28.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 CQ=[["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"}]],kQ=qe("sun",CQ);/**
379
+ * @license lucide-react v1.28.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 PQ=[["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"}]],TQ=qe("user",PQ);/**
384
+ * @license lucide-react v1.28.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 RQ=[["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"}]],AQ=qe("users",RQ);/**
389
+ * @license lucide-react v1.28.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 IQ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],MQ=qe("x",IQ),OQ={"chevron-right":uX,"chevron-down":lX,pipette:nQ,x:MQ,copy:gX,menu:$X,dot:yX,monitor:BX,sun:kQ,moon:GX,"rectangle-horizontal":lQ,circle:fX,"square-library":bQ,clock:pX,star:EQ,settings:gQ,plus:oQ,"arrow-left":YY,"arrow-right":QY,"arrow-up":eX,search:pQ,loader:LX,users:AQ,lock:DX,mail:FX,bell:nX,shield:yQ,palette:YX,lightbulb:AX,rocket:uQ,heart:bX,paintbrush:ZX,brain:sX,globe:xX,user:TQ,image:kX,link:MX,check:oX,"rotate-ccw":fQ,play:sQ,pause:QX,home:EX,"message-circle":zX,inbox:TX,pencil:eQ,"skip-forward":xQ},y8={lucide:OQ},yI=v.createContext(null);function LQ(t){const e=v.useContext(yI);return e?y8[e.iconLibrary][t]:y8.lucide[t]}function NQ({children:t,defaultLibrary:e="lucide"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{r(i)},[]);return E.jsx(yI.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const _I=v.createContext(null);function Ew(){return v.useContext(_I)}const xI=v.createContext(null);function wI(){const t=v.useContext(xI);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const DQ=v.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,a=v.useRef(null),c=v.useRef(new Map),[u,f]=v.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:m,sessionRef:_,handlers:x,registerItem:y,measureItems:w}=q5(a),S=v.useCallback((oe,le)=>{le?c.current.set(oe,le):c.current.delete(oe)},[]),T=v.useCallback(()=>{if(!a.current)return;const oe=new Map;c.current.forEach((le,Fe)=>{oe.set(Fe,{top:le.offsetTop,left:le.offsetLeft,width:le.offsetWidth,height:le.offsetHeight})}),f(oe)},[]),[P,k]=v.useState(()=>r==="single"?t.defaultValue??"":""),[A,O]=v.useState(()=>r==="multiple"?t.defaultValue??[]:[]),L=t.onValueChange,R=t.onValueChange,M=t.value,N=new Set(r==="multiple"?t.value??A:(()=>{const oe=t.value??P;return oe?[oe]:[]})()),D=v.useCallback(oe=>{const le=t;le.onValueChange?le.onValueChange(oe):k(oe)},[L]),F=v.useCallback(oe=>{const le=t;le.onValueChange?le.onValueChange(oe):O(oe)},[R]),q=v.useCallback(oe=>{if(r==="multiple"){const le=t.value??A;F(le.filter(Fe=>Fe!==oe))}else D("")},[r,D,F,A,M]);v.useEffect(()=>{w(),T()},[w,T,n]);const X=[...N].join(",");v.useEffect(()=>{w(),T()},[w,T,X]);const[W,G]=v.useState(null),K=h!==null?m[h]:null,$=W!==null?m[W]:null,te=h!==null&&!u.has(h),H=b0(),{value:j,defaultValue:Y,onValueChange:ne,collapsible:ie,type:J,...ce}=i,we=r==="multiple"?{type:"multiple",value:t.value??A,onValueChange:F}:{type:"single",collapsible:t.collapsible??!0,value:t.value??P,onValueChange:D};return E.jsx(_I.Provider,{value:{registerItem:y,registerFullItem:S,activeIndex:h,grouped:!0,remeasure:()=>{w(),T()},openValues:N,openItemRects:u,toggleValue:q},children:E.jsx(gI,{...we,asChild:!0,children:E.jsxs("div",{ref:oe=>{a.current=oe,typeof e=="function"?e(oe):e&&(e.current=oe)},onMouseEnter:x.onMouseEnter,onMouseMove:oe=>{const le=a.current;if(le){const Fe=le.getBoundingClientRect(),De=le.offsetHeight,Pe=Fe.height,Qe=De>0?Pe/De:1,dt=(oe.clientY-Fe.top)/Qe+le.scrollTop;for(const[qt,xe]of u){const $e=m[qt];if(!$e)continue;const Be=$e.top+$e.height,ot=xe.top+xe.height;if(dt>=Be&&dt<=ot){p(null);return}}}x.onMouseMove(oe)},onMouseLeave:x.onMouseLeave,onFocus:oe=>{var Fe;const le=(Fe=oe.target.closest("[data-proximity-index]"))==null?void 0:Fe.getAttribute("data-proximity-index");if(le!=null){const De=Number(le);p(De),G(oe.target.matches(":focus-visible")?De:null)}},onBlur:oe=>{var le;(le=a.current)!=null&&le.contains(oe.relatedTarget)||(G(null),p(null))},className:dr("relative flex flex-col gap-0.5 w-72 max-w-full",s),...ce,children:[E.jsx(ro,{children:[...u.entries()].map(([oe,le])=>E.jsx(so.div,{className:`absolute ${H.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:le.top,left:le.left,width:le.width,height:le.height,opacity:te?.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-${oe}`))}),E.jsx(ro,{children:K&&E.jsx(so.div,{className:`absolute ${H.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:K.top,left:K.left,width:K.width,height:K.height},animate:{opacity:1,top:K.top,left:K.left,width:K.width,height:K.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Yd.fast,opacity:{duration:.08}}},_.current)}),E.jsx(ro,{children:$&&E.jsx(so.div,{className:`absolute ${H.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:$.left-2,top:$.top-2,width:$.width+4,height:$.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...Yd.fast,opacity:{duration:.08}}})}),n]})})})});DQ.displayName="AccordionGroup";const bI=v.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...c},u)=>{const[f,h]=v.useState(()=>e==="single"?r??"":""),[p,m]=v.useState(()=>e==="multiple"?r??[]:[]),_=new Set(e==="multiple"?s??p:(()=>{const T=s??f;return T?[T]:[]})()),x=v.useCallback(T=>{i?i(T):h(T)},[i]),y=v.useCallback(T=>{i?i(T):m(T)},[i]),w=v.useCallback(T=>{e==="multiple"?y((s??p).filter(k=>k!==T)):x("")},[e,s,p,x,y]),S=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:y}:{type:"single",collapsible:n,value:s??f,defaultValue:r,onValueChange:x};return E.jsx(gI,{...S,asChild:!0,children:E.jsx("div",{ref:u,className:dr("w-72 max-w-full flex flex-col gap-0.5",a),...c,children:E.jsx(SI.Provider,{value:_,children:E.jsx(EI.Provider,{value:w,children:t})})})})});bI.displayName="Accordion";const SI=v.createContext(new Set),EI=v.createContext(()=>{}),CI=v.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const c=v.useRef(null),u=Ew(),f=v.useContext(SI),h=v.useContext(EI),p=b0(),m=u!=null&&u.grouped?u.openValues.has(t):f.has(t),_=v.useRef(null),x=v.useCallback(()=>{u!=null&&u.grouped?u.toggleValue(t):h(t)},[u,h,t]);return v.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return u.registerItem(e,_.current),()=>u.registerItem(e,null)},[e,u]),v.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return m?u.registerFullItem(e,c.current):u.registerFullItem(e,null),()=>u.registerFullItem(e,null)},[e,u,m]),E.jsx(xI.Provider,{value:{index:e,value:t,isOpen:m,onToggle:x,triggerRef:_},children:E.jsxs(VY,{ref:y=>{c.current=y,typeof a=="function"?a(y):a&&(a.current=y)},value:t,disabled:n,"data-proximity-index":e,className:dr(!(u!=null&&u.grouped)&&"relative",s),...i,children:[!(u!=null&&u.grouped)&&E.jsx(ro,{children:m&&E.jsx(so.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]})})});CI.displayName="AccordionItem";const kI=v.forwardRef(({children:t,className:e,...n},r)=>{const s=LQ("chevron-right"),i=Ew(),{index:a,isOpen:c,triggerRef:u}=wI(),f=b0(),[h,p]=v.useState(!1),m=i!=null&&i.grouped?i.activeIndex===a:h,_=E.jsx($Y,{asChild:!0,children:E.jsx("div",{children:E.jsxs(HY,{ref:r,className:dr(`relative z-10 flex items-center gap-2.5 ${f.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[E.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[E.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Ad.semibold},"aria-hidden":"true",children:t}),E.jsx("span",{className:dr("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",c||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:c?Ad.semibold:Ad.normal},children:t})]}),E.jsx(so.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:c?90:0},transition:Yd.fast,children:E.jsx(s,{size:16,strokeWidth:c||m?2:1.5,className:dr("transition-[color,stroke-width] duration-80",c||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?E.jsx("div",{ref:u,children:_}):E.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[E.jsx(ro,{children:h&&E.jsx(so.div,{className:`absolute inset-0 ${f.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),_]})});kI.displayName="AccordionTrigger";const PI=v.forwardRef(({children:t,className:e,...n},r)=>{const s=Ew(),{isOpen:i}=wI();return E.jsx(ro,{initial:!1,children:i&&E.jsx(zY,{forceMount:!0,asChild:!0,...n,children:E.jsx(so.div,{ref:r,className:dr("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Yd.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:E.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});PI.displayName="AccordionContent";const Yp=({children:t,defaultValue:e=[],className:n=""})=>E.jsx(bI,{type:"multiple",defaultValue:e,className:dr("w-full",n),children:t}),jQ=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const c=a.includes("first-item");return E.jsxs(CI,{value:t,className:dr("w-full",!c&&"border-t border-main-border"),children:[E.jsxs(kI,{"data-cy":r,children:[s?E.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),E.jsxs(PI,{children:[n?E.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};Yp.Item=jQ;const FQ=({message:t,isLoading:e=!0})=>E.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?E.jsx(h0,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,E.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),VQ=()=>{const t=v.useRef(Date.now()),[e,n]=v.useState(0);return v.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},$Q=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},_8="M 12 8 C 14.21 8 16 9.79 16 12 C 16 14.21 14.21 16 12 16 C 9.79 16 8 14.21 8 12 C 8 9.79 9.79 8 12 8 Z",x8="M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",HQ="M 12 16 C 14.21 16 16 14.21 16 12 C 16 9.79 14.21 8 12 8 C 9.79 8 8 9.79 8 12 C 8 14.21 9.79 16 12 16 Z",Xp=["Applying","Thinking","Planning","Crafting"],zQ=Xp.reduce((t,e)=>t.length>=e.length?t:e),UQ=20,BQ="Still working — runs can take a few minutes.",WQ=({hint:t,showElapsed:e=!0})=>{const[n,r]=v.useState(0),s=VQ();v.useEffect(()=>{const a=setInterval(()=>{r(c=>(c+1)%Xp.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=UQ?BQ:null);return E.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[E.jsx(xl.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:E.jsx(xl.path,{animate:{d:[_8,x8,HQ,x8,_8]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),E.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Ad.medium},children:[E.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:zQ}),E.jsx(ro,{mode:"popLayout",initial:!1,children:E.jsx(xl.span,{className:"shimmer-text col-start-1 row-start-1",initial:{y:"80%",opacity:0},animate:{y:0,opacity:1,transition:{duration:.24,ease:[.4,0,.2,1]}},exit:{y:"-80%",opacity:0,transition:{duration:.16,ease:[.4,0,.2,1]}},children:Xp[n]},Xp[n])})]}),e?E.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:$Q(s)}):null,i?E.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var GQ=Object.defineProperty,KQ=(t,e)=>GQ(t,"name",{value:e,configurable:!0});function Cw(t,[e,n]){return Math.min(n,Math.max(e,t))}KQ(Cw,"clamp");var ZQ=Object.defineProperty,qQ=(t,e)=>ZQ(t,"name",{value:e,configurable:!0});function TI(t){const e=v.useRef({value:t,previous:t});return v.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}qQ(TI,"usePrevious");var YQ=Object.defineProperty,pt=(t,e)=>YQ(t,"name",{value:e,configurable:!0}),RI=["PageUp","PageDown"],AI=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],II={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Mf="Slider",[l2,XQ,QQ]=mw(Mf),[kw,$J]=xi(Mf,[QQ]),[JQ,Of]=kw(Mf),eJ=v.forwardRef(pt(function(e,n){const{name:r,min:s=0,max:i=100,step:a=1,orientation:c="horizontal",disabled:u=!1,minStepsBetweenThumbs:f=0,defaultValue:h=[s],value:p,onValueChange:m=pt(()=>{},"onValueChange"),onValueCommit:_=pt(()=>{},"onValueCommit"),inverted:x=!1,form:y,...w}=e,S=v.useRef(new Set),T=v.useRef(0),P=v.useRef(!1),A=c==="horizontal"?tJ:nJ,[O,L]=v.useState(null),R=jt(n,L),[M=[],N]=ma({prop:p,defaultProp:h,onChange:pt(K=>{var te;(te=[...S.current][T.current])==null||te.focus({preventScroll:!0,focusVisible:P.current}),P.current=!1,m(K)},"onChange")}),D=v.useRef(M),F=v.useRef(M);v.useEffect(()=>{const K=y?O==null?void 0:O.ownerDocument.getElementById(y):O==null?void 0:O.closest("form");if(K instanceof HTMLFormElement){const $=pt(()=>N(F.current),"reset");return K.addEventListener("reset",$),()=>K.removeEventListener("reset",$)}},[O,y,N]);function q(K){const $=VI(M,K);G(K,$)}pt(q,"handleSlideStart");function X(K){G(K,T.current)}pt(X,"handleSlideMove");function W(){String(M)!==String(D.current)&&_(M)}pt(W,"handleSlideEnd");function G(K,$,{commit:te}={commit:!1}){const H=Tw(a),j=Nd(Math.round((K-s)/a)*a+s,H),Y=Cw(j,[s,i]);N((ne=[])=>{const ie=jI(ne,Y,$);if(zI(ie,f*a)){T.current=ie.indexOf(Y);const J=String(ie)!==String(ne);return J&&te&&_(ie),J?ie:ne}else return ne})}return pt(G,"updateValues"),E.jsx(JQ,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:T,thumbs:S.current,values:M,orientation:c,form:y,children:E.jsx(l2.Provider,{scope:e.__scopeSlider,children:E.jsx(l2.Slot,{scope:e.__scopeSlider,children:E.jsx(A,{"aria-disabled":u,"data-disabled":u?"":void 0,...w,ref:R,onPointerDown:Nt(w.onPointerDown,()=>{u||(D.current=M,P.current=!1)}),min:s,max:i,inverted:x,onSlideStart:u?void 0:q,onSlideMove:u?void 0:X,onSlideEnd:u?void 0:W,onHomeKeyDown:()=>{u||(P.current=!0,G(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(P.current=!0,G(i,M.length-1,{commit:!0}))},onStepKeyDown:({event:K,direction:$})=>{if(!u){P.current=!0;const j=RI.includes(K.key)||K.shiftKey&&AI.includes(K.key)?10:1,Y=T.current,ne=M[Y],ie=UI(ne,{min:s,step:a,direction:$,multiplier:j});G(ie,Y,{commit:!0})}}})})})})},"Slider")),[MI,OI]=kw(Mf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tJ=v.forwardRef(pt(function(e,n){const{min:r,max:s,dir:i,inverted:a,onSlideStart:c,onSlideMove:u,onSlideEnd:f,onStepKeyDown:h,...p}=e,[m,_]=v.useState(null),x=jt(n,_),y=v.useRef(void 0),w=_w(i),S=w==="ltr",T=S&&!a||!S&&a;function P(k){const A=y.current||m.getBoundingClientRect(),O=[0,A.width],R=A0(O,T?[r,s]:[s,r]);return y.current=A,R(k-A.left)}return pt(P,"getValueFromPointer"),E.jsx(MI,{scope:e.__scopeSlider,startEdge:T?"left":"right",endEdge:T?"right":"left",direction:T?1:-1,size:"width",children:E.jsx(LI,{dir:w,"data-orientation":"horizontal",...p,ref:x,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:k=>{const A=P(k.clientX);c==null||c(A)},onSlideMove:k=>{const A=P(k.clientX);u==null||u(A)},onSlideEnd:()=>{y.current=void 0,f==null||f()},onStepKeyDown:k=>{const O=II[T?"from-left":"from-right"].includes(k.key);h==null||h({event:k,direction:O?-1:1})}})})},"SliderHorizontal")),nJ=v.forwardRef(pt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:a,onSlideMove:c,onSlideEnd:u,onStepKeyDown:f,...h}=e,p=v.useRef(null),m=jt(n,p),_=v.useRef(void 0),x=!i;function y(w){const S=_.current||p.current.getBoundingClientRect(),T=[0,S.height],k=A0(T,x?[s,r]:[r,s]);return _.current=S,k(w-S.top)}return pt(y,"getValueFromPointer"),E.jsx(MI,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:E.jsx(LI,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const S=y(w.clientY);a==null||a(S)},onSlideMove:w=>{const S=y(w.clientY);c==null||c(S)},onSlideEnd:()=>{_.current=void 0,u==null||u()},onStepKeyDown:w=>{const T=II[x?"from-bottom":"from-top"].includes(w.key);f==null||f({event:w,direction:T?-1:1})}})})},"SliderVertical")),LI=v.forwardRef(pt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:c,onEndKeyDown:u,onStepKeyDown:f,...h}=e,p=Of(Mf,r);return E.jsx(on.span,{...h,ref:n,onKeyDown:Nt(e.onKeyDown,m=>{m.key==="Home"?(c(m),m.preventDefault()):m.key==="End"?(u(m),m.preventDefault()):RI.concat(AI).includes(m.key)&&(f(m),m.preventDefault())}),onPointerDown:Nt(e.onPointerDown,m=>{const _=m.target;_.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(_)?_.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:Nt(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:Nt(e.onPointerUp,m=>{const _=m.target;_.hasPointerCapture(m.pointerId)&&(_.releasePointerCapture(m.pointerId),a(m))})})},"SliderImpl")),rJ="SliderTrack",sJ=v.forwardRef(pt(function(e,n){const{__scopeSlider:r,...s}=e,i=Of(rJ,r);return E.jsx(on.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),w8="SliderRange",iJ=v.forwardRef(pt(function(e,n){const{__scopeSlider:r,...s}=e,i=Of(w8,r),a=OI(w8,r),c=v.useRef(null),u=jt(n,c),f=i.values.length,h=i.values.map(_=>Pw(_,i.min,i.max)),p=f>1?Math.min(...h):0,m=100-Math.max(...h);return E.jsx(on.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:u,style:{...e.style,[a.startEdge]:p+"%",[a.endEdge]:m+"%"}})},"SliderRange")),oJ="SliderThumb",[aJ,NI]=kw(oJ),lJ="SliderThumbProvider";function DI(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=Of(lJ,e),a=XQ(e),[c,u]=v.useState(null),f=v.useMemo(()=>c?a().findIndex(w=>w.ref.current===c):-1,[a,c]),h=Vx(c),p=c?!!i.form||!!c.closest("form"):!0,m=i.values[f],_=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),x=m===void 0?0:Pw(m,i.min,i.max);v.useEffect(()=>{if(c)return i.thumbs.add(c),()=>{i.thumbs.delete(c)}},[c,i.thumbs]);const y={value:m,name:_,form:i.form,isFormControl:p,index:f,thumb:c,onThumbChange:u,percent:x,size:h};return E.jsx(aJ,{scope:e,...y,children:BI(s)?s(y):r})}pt(DI,"SliderThumbProvider");var H1="SliderThumbTrigger",cJ=v.forwardRef(pt(function(e,n){const{__scopeSlider:r,...s}=e,i=Of(H1,r),a=OI(H1,r),{index:c,value:u,percent:f,size:h,onThumbChange:p}=NI(H1,r),m=jt(n,p),_=FI(c,i.values.length),x=h==null?void 0:h[a.size],y=x?$I(x,f,a.direction):0;return E.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${f}% + ${y}px)`},children:E.jsx(l2.ItemSlot,{scope:r,children:E.jsx(on.span,{role:"slider","aria-label":e["aria-label"]||_,"aria-valuemin":i.min,"aria-valuenow":u,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:u===void 0?{display:"none"}:e.style,onFocus:Nt(e.onFocus,()=>{i.valueIndexToChangeRef.current=c})})})})},"SliderThumbTrigger")),uJ=v.forwardRef(pt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return E.jsx(DI,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:a,isFormControl:c})=>E.jsxs(E.Fragment,{children:[E.jsx(cJ,{...i,ref:n,__scopeSlider:r}),c?E.jsx(fJ,{__scopeSlider:r},a):null]})})},"SliderThumb")),dJ="SliderBubbleInput",fJ=v.forwardRef(pt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:a}=NI(dJ,e),c=v.useRef(null),u=jt(c,r),f=TI(s);return v.useEffect(()=>{const h=c.current;if(!h)return;const p=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(p,"value").set;if(f!==s&&_){const x=new Event("input",{bubbles:!0});_.call(h,s),h.dispatchEvent(x)}},[f,s]),E.jsx(on.input,{style:{display:"none"},name:i,form:a,...n,ref:u,defaultValue:s})},"SliderBubbleInput"));function jI(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}pt(jI,"getNextSortedValues");function Pw(t,e,n){const i=100/(n-e)*(t-e);return Cw(i,[0,100])}pt(Pw,"convertValueToPercentage");function FI(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}pt(FI,"getLabel");function VI(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)}pt(VI,"getClosestValueIndex");function $I(t,e,n){const r=t/2,i=A0([0,50],[0,r]);return(r-i(e)*n)*n}pt($I,"getThumbInBoundsOffset");function HI(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}pt(HI,"getStepsBetweenValues");function zI(t,e){if(e>0){const n=HI(t);return Math.min(...n)>=e}return!0}pt(zI,"hasMinStepsBetweenValues");function A0(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])}}pt(A0,"linearScale");function Tw(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",a=Number(s);return Math.max(0,i.length-a)}const n=e.split(".")[1];return n?n.length:0}pt(Tw,"getDecimalCount");function Nd(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}pt(Nd,"roundValue");function UI(t,{min:e,step:n,direction:r,multiplier:s}){const i=Tw(n),a=(t-e)/n,c=Math.round(a),u=Nd(c*n+e,i)===Nd(t,i);let f;return u?f=c+s*r:r>0?f=Math.ceil(a):f=Math.floor(a),Nd(f*n+e,i)}pt(UI,"getNextStepValue");function BI(t){return typeof t=="function"}pt(BI,"isFunction");const c2=v.forwardRef(({className:t,...e},n)=>E.jsxs(eJ,{ref:n,className:dr("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[E.jsx(sJ,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:E.jsx(iJ,{className:"absolute h-full bg-primary"})}),E.jsx(uJ,{className:dr("block h-3.5 w-3.5 rounded-full border border-border bg-foreground shadow-sm","transition-transform hover:scale-110 active:scale-95","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#6B97FF]","disabled:pointer-events-none")})]}));c2.displayName="Slider";const hJ=[{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"}],pJ=[{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"}],mJ=[{name:"gap-1",className:"w-1"},{name:"gap-2",className:"w-2"},{name:"gap-3",className:"w-3"},{name:"gap-4",className:"w-4"},{name:"gap-6",className:"w-6"},{name:"gap-8",className:"w-8"}],bp=[{name:"Accordion",path:"components/Accordion.tsx",status:"showcased",note:"Reusable primitive shown with local item composition."},{name:"AgentVariantsPanel",path:"components/AgentVariantsPanel.tsx",status:"feature-only",note:"Requires live variant session state and editor atoms."},{name:"AuthProgressScreen",path:"components/AuthProgressScreen.tsx",status:"feature-only",note:"Auth flow surface; represented through progress treatment."},{name:"AuthScreenView",path:"components/AuthScreenView.tsx",status:"feature-only",note:"Auth flow surface that depends on sign-in actions."},{name:"Button",path:"components/Button.tsx",status:"showcased",note:"Reusable tooltip-wrapped button shown in multiple states."},{name:"CommentCarouselLayer",path:"components/CommentCarouselLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to iframe geometry."},{name:"CommentMarker",path:"components/CommentMarker.tsx",status:"feature-only",note:"Preview overlay marker tied to comment positions."},{name:"CommentMarkerLayer",path:"components/CommentMarkerLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to comment collections."},{name:"CommentPopover",path:"components/CommentPopover.tsx",status:"feature-only",note:"Comment workflow popover tied to editor state."},{name:"CommentReferenceChip",path:"components/CommentReferenceChip.tsx",status:"feature-only",note:"Comment workflow chip tied to selected references."},{name:"CommentReferencePicker",path:"components/CommentReferencePicker.tsx",status:"feature-only",note:"Comment workflow picker tied to preview elements."},{name:"ElementInspector",path:"components/ElementInspector.tsx",status:"feature-only",note:"Primary editor surface with many app-level dependencies."},{name:"GitHome",path:"components/GitHome.tsx",status:"feature-only",note:"Git dashboard tied to repository state."},{name:"IframePreview",path:"components/IframePreview.tsx",status:"unsuitable",note:"Needs live iframe target and cross-window integration."},{name:"PreviewFrame",path:"components/PreviewFrame.tsx",status:"unsuitable",note:"Requires proxied app URL and iframe lifecycle."},{name:"PreviewSurface",path:"components/PreviewSurface.tsx",status:"unsuitable",note:"Requires preview iframe and overlay orchestration."},{name:"ProfileAvatar",path:"components/ProfileAvatar.tsx",status:"feature-only",note:"Account chrome tied to user identity data."},{name:"Progress",path:"components/Progress.tsx",status:"showcased",note:"Reusable inline loading/status primitive."},{name:"SecondaryVariantIframe",path:"components/SecondaryVariantIframe.tsx",status:"unsuitable",note:"Requires variant preview iframe lifecycle."},{name:"SparkleLoader",path:"components/SparkleLoader.tsx",status:"showcased",note:"Reusable loading animation shown in feedback states."},{name:"SplitButton",path:"components/SplitButton.tsx",status:"showcased",note:"Reusable compound action button shown with dropdown."},{name:"StatusSurface",path:"components/StatusSurface.tsx",status:"showcased",note:"Unified full-surface primitive: LoadingSurface / EmptyState / ErrorState."},{name:"SupportTicketModal",path:"components/SupportTicketModal.tsx",status:"feature-only",note:"Support workflow modal tied to form submission."},{name:"ThinkingIndicator",path:"components/ThinkingIndicator.tsx",status:"showcased",note:"Reusable thinking/loading indicator shown in feedback states."},{name:"Tooltip",path:"components/Tooltip.tsx",status:"showcased",note:"Reusable tooltip API shown with hover target."},{name:"VariantDragGhost",path:"components/VariantDragGhost.tsx",status:"feature-only",note:"Drag visual tied to variant split interactions."},{name:"VariantSplitDropZones",path:"components/VariantSplitDropZones.tsx",status:"feature-only",note:"Drop-zone visual tied to variant split interactions."},{name:"ui/accordion",path:"components/ui/accordion.tsx",status:"showcased",note:"Radix accordion primitive backing the local Accordion showcase."},{name:"ui/slider",path:"components/ui/slider.tsx",status:"showcased",note:"Radix slider primitive shown in enabled and disabled states."},{name:"ui/tooltip",path:"components/ui/tooltip.tsx",status:"showcased",note:"Radix tooltip primitive shown with forced-open preview."}],gJ=()=>{window.location.hash=""},Vi=({title:t,eyebrow:e,description:n,children:r})=>E.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[E.jsxs("div",{className:"mb-5 max-w-2xl",children:[E.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),E.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),E.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),b8=({swatches:t})=>E.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[E.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),E.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[E.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),E.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),vJ=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",yJ=()=>{const t=bp.filter(n=>n.status==="showcased").length,e=bp.filter(n=>n.status==="cataloged").length;return E.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:E.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[E.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[E.jsxs("button",{type:"button",onClick:gJ,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[E.jsx($z,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),E.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[E.jsxs("div",{className:"max-w-3xl",children:[E.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),E.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),E.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),E.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:E.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[E.jsx(R5,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",E.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),E.jsx(Vi,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"The gallery uses Rivet's tooltip-wrapped button, compound split button, and the lower-level Radix tooltip wrapper so the reusable control APIs are visible.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button wrapper"}),E.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[E.jsx(Ac,{title:"Primary action",shortcut:"D",className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Design action"}),E.jsx(Ac,{title:"Secondary action",className:"border-border bg-surface-4 text-content hover:bg-surface-5 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",children:"Secondary"}),E.jsx(Ac,{title:"Disabled action",disabled:!0,className:"border-border bg-muted text-muted-foreground rounded-lg border px-4 py-2 text-sm font-medium opacity-60",children:"Disabled"}),E.jsx(FR,{primaryLabel:"Ship",primaryIcon:g1,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),E.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[E.jsx(to,{label:"Rivet tooltip API",side:"bottom",children:E.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),E.jsx(Gx,{content:"Forced open preview",forceOpen:!0,side:"right",children:E.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),E.jsx(Vi,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:E.jsx(b8,{swatches:hJ})}),E.jsx(Vi,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:E.jsx(b8,{swatches:pJ})}),E.jsx(Vi,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),E.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),E.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),E.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),E.jsx(Vi,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:E.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:E.jsx("div",{className:"flex flex-col gap-3",children:mJ.map(n=>E.jsxs("div",{className:"flex items-center gap-4",children:[E.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),E.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),E.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),E.jsx(Vi,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[E.jsxs(Yp,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[E.jsx(Yp.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:E.jsx(g1,{className:"text-primary h-4 w-4"}),children:E.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),E.jsx(Yp.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:E.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[E.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),E.jsxs("div",{className:"space-y-6",children:[E.jsx(c2,{defaultValue:[64],max:100,step:1}),E.jsx(c2,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),E.jsx(Vi,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:E.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),E.jsx(FQ,{message:"Applying visual change..."})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),E.jsx(Mx,{className:"text-primary text-xl"})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),E.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),E.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:E.jsx(WQ,{hint:"Reading selected elements"})})]})}),E.jsx(Vi,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:E.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(B_,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(lA,{icon:E.jsx(g1,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(qx,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),E.jsxs(Vi,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[E.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),E.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:bp.length})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),E.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),E.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),E.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[E.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[E.jsx("span",{children:"Component"}),E.jsx("span",{children:"Status"}),E.jsx("span",{children:"Coverage note"})]}),E.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:bp.map(n=>E.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[E.jsxs("div",{children:[E.jsx("p",{className:"text-foreground font-medium",children:n.name}),E.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),E.jsx("div",{children:E.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${vJ(n.status)}`,children:n.status})}),E.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},_J=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",xJ=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"},z1=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:"editor_gate",method:"google_oauth",...s?{failure_reason:s}:{}}}),S8=Ss("App"),wJ=2e3,bJ=60,E8="Connecting to Google...",C8="https://rivet-proxy.onrender.com",SJ=`<!doctype html>
394
+ <html lang="en">
395
+ <head>
396
+ <meta charset="utf-8" />
397
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
398
+ <title>${E8}</title>
399
+ <style>
400
+ :root { color-scheme: light dark; }
401
+ body {
402
+ margin: 0;
403
+ min-height: 100vh;
404
+ display: grid;
405
+ place-items: center;
406
+ font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
407
+ background: #111215;
408
+ color: #f3f4f6;
409
+ }
410
+ .panel {
411
+ border: 1px solid rgba(255, 255, 255, 0.16);
412
+ border-radius: 12px;
413
+ padding: 18px 22px;
414
+ background: rgba(255, 255, 255, 0.06);
415
+ font-size: 14px;
416
+ }
417
+ </style>
418
+ </head>
419
+ <body>
420
+ <div class="panel">${E8}</div>
421
+ </body>
422
+ </html>`,u2=274,Qm=395,U1=Math.min(Qm,Math.round((u2+Qm)/2*1.1)),k8="rivet:panelWidth:v2",EJ=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},CJ=({projectPath:t})=>{const e=et(rR)>0,[n,r]=HP(tR),s=x$(),[i,a]=v.useState(()=>{if(typeof window>"u")return U1;const k=Number(window.localStorage.getItem(k8));return Number.isFinite(k)&&k>=u2&&k<=Qm?k:U1}),[c,u]=v.useState(!1),[f,h]=v.useState(Uq),p=n?i:0,[m,_]=v.useState(n);v.useEffect(()=>{if(!n){_(!1);return}h(k=>zq({position:k,boundsLeftPx:i}))},[n,i]),v.useEffect(()=>{window.localStorage.setItem(k8,String(i))},[i]),v.useEffect(()=>{if(!n)return;const k=A=>{A.key==="Escape"&&(EJ(A.target)||(A.preventDefault(),r(!1)))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[n,r]);const x=v.useCallback(k=>{k.preventDefault(),k.stopPropagation();const A=k.clientX,O=i;u(!0);const L=M=>{const N=Math.min(Qm,Math.max(u2,O+(M.clientX-A)));a(N)},R=()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",R),u(!1)};window.addEventListener("pointermove",L),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",R)},[i]),y=v.useCallback(()=>a(U1),[]),w=nY(),S=et(Tf);iY({enabled:!S});const T=w.isProcessing?"Completing authentication...":null,P=at(lR);return v.useEffect(()=>{P(t??null)},[t,P]),E.jsxs(xl.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[T!==null?E.jsx("div",{className:"absolute inset-0 z-50",children:E.jsx(Rq,{message:T})}):null,E.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col",children:E.jsx(rZ,{})}),E.jsx(E.Fragment,{children:e?null:E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:m?i:0},children:E.jsxs(xl.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:n?0:-i},transition:s?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{n&&_(!0)},style:{width:i,willChange:"transform"},children:[E.jsx(hK,{onClose:()=>r(!1)}),E.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:x,onDoubleClick:y,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:E.jsx("span",{className:`h-full transition-all duration-150 ${c?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),c&&E.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),E.jsx(Gq,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!s,position:f,dragBoundsLeftPx:p,onPositionChange:h,onToggle:()=>r(k=>!k)})]})}),E.jsx(Z$,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},d2="rivet_connect_deep_link",kJ=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(d2);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(d2,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},PJ=kJ(),TJ=()=>{const[t,e]=v.useState(window.location.hash),[n]=v.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Zp)==="1"),[r,s]=v.useState(!1),[i,a]=v.useState(PJ);v.useEffect(()=>{n&&window.sessionStorage.removeItem(Zp)},[n]);const{config:c,refetchConfig:u,loading:f,error:h}=eY(),p=at(Tf),[m,_]=v.useState(!1),[x,y]=v.useState(null),[w,S]=v.useState(!1);v.useEffect(()=>{c!=null&&c.userId?(Se.identify(c.userId,{...c.email?{email:c.email}:{}}),c.email&&Se.alias(c.email,c.userId)):c!=null&&c.email&&Se.identify(c.email,{email:c.email})},[c==null?void 0:c.userId,c==null?void 0:c.email]),v.useEffect(()=>{c&&Se.register({source:"visual_editor",surface:"visual_editor"})},[c]);const T=v.useCallback(async()=>{var q;const M=globalThis.crypto.randomUUID(),N=Date.now();_(!0),y(null);const D=z1({outcome:"started",authAttemptId:M,startedAt:N,now:N});Se.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(SJ),F.document.close()}catch(G){S8.warn("Failed to render loading state in auth popup:",G)}const X=await fetch(`${C8}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),W=await X.json();if(!X.ok||!W.success||!W.authUrl||!W.sessionId||!W.pollSecret)throw new Error(W.error||W.message||"Failed to start Google login");if(F.closed)throw new Error("Sign-in window was closed before Google login started.");F.location.href=W.authUrl;for(let G=0;G<bJ;G+=1){if(F.closed)throw new Error("Sign-in window was closed before authentication completed.");const $=await(await fetch(`${C8}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:W.sessionId,pollSecret:W.pollSecret})})).json();if($.success&&$.token&&((q=$.user)!=null&&q.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:$.user.email,token:$.token,refreshToken:$.refreshToken,userId:$.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");F.close(),window.sessionStorage.setItem(Zp,"1");const H=z1({outcome:"completed",authAttemptId:M,startedAt:N,now:Date.now()});Se.capture(H.event,H.properties),window.location.reload();return}if($.error&&$.error!=="Pending")throw new Error($.error||"Google login failed");await new Promise(te=>setTimeout(te,wJ))}throw new Error("Authentication timed out. Please try again.")}catch(X){F&&!F.closed&&F.close();const W=X instanceof Error?X.message:"Failed to start login flow";S8.warn("Login failed:",W);const G=z1({outcome:"failed",authAttemptId:M,startedAt:N,now:Date.now(),failureReason:xJ(W)});Se.capture(G.event,G.properties),y(W),_(!1)}},[]),P=c!=null&&c.agentModeAvailable!==!0,k=_J(t),A=v.useCallback(async()=>{S(!0),p(!0);try{await u()}finally{p(!1),S(!1)}},[u,p]);if(v.useEffect(()=>{const M=()=>{const N=window.location.hash;e(N)};return window.addEventListener("hashchange",M),()=>window.removeEventListener("hashchange",M)},[]),k==="design-system")return E.jsx(yJ,{});if(!f&&c===null&&!w){const M=h||"Could not load Rivet configuration.";return E.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:E.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[E.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),E.jsx("p",{className:"text-content-dim mt-2 text-xs",children:M}),E.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{A()},children:"Retry"})]})})}if(P)return E.jsx(Pq,{isSigningIn:m,onStartSignIn:()=>{T()},errorMessage:x,displayMode:"full"});const L=(c==null?void 0:c.agentModeAvailable)===!0&&i!==null,R=(c==null?void 0:c.agentModeAvailable)===!0&&n&&!r&&!L;return E.jsxs(E.Fragment,{children:[E.jsx(CJ,{projectPath:c==null?void 0:c.projectPath}),E.jsx(U_,{context:"onboarding",isOpen:R,onClose:()=>s(!0)}),E.jsx(U_,{context:"menu",isOpen:L,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(d2),a(null)}})]})},RJ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",AJ=new eL,IJ={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},MJ=()=>E.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:E.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})});WD.createRoot(document.getElementById("root")).render(E.jsx(ve.StrictMode,{children:E.jsx(ND,{apiKey:RJ,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",...IJ,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.14.18",env:"production"})}},children:E.jsx(VD,{fallback:E.jsx(MJ,{}),children:E.jsx(tL,{client:AJ,children:E.jsx(pG,{defaultShape:"rounded",children:E.jsx(NQ,{defaultLibrary:"lucide",children:E.jsx(TJ,{})})})})})})}));