rivet-design 0.14.6 → 0.14.8

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.
Files changed (40) hide show
  1. package/dist/cli/commands/evidence.js +1 -1
  2. package/dist/cli/commands/evidence.js.map +1 -1
  3. package/dist/cli/commands/mcpServe.d.ts.map +1 -1
  4. package/dist/cli/commands/mcpServe.js +152 -1
  5. package/dist/cli/commands/mcpServe.js.map +1 -1
  6. package/dist/cli/commands/open.js +2 -2
  7. package/dist/cli/commands/open.js.map +1 -1
  8. package/dist/cli/commands/reference.d.ts.map +1 -1
  9. package/dist/cli/commands/reference.js +78 -4
  10. package/dist/cli/commands/reference.js.map +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +74 -20
  13. package/dist/index.js.map +1 -1
  14. package/dist/services/AuthService.d.ts +41 -0
  15. package/dist/services/AuthService.d.ts.map +1 -1
  16. package/dist/services/AuthService.js +208 -44
  17. package/dist/services/AuthService.js.map +1 -1
  18. package/dist/services/IntegrationsClient.d.ts +5 -0
  19. package/dist/services/IntegrationsClient.d.ts.map +1 -1
  20. package/dist/services/IntegrationsClient.js.map +1 -1
  21. package/dist/services/pendingLogin.d.ts +24 -0
  22. package/dist/services/pendingLogin.d.ts.map +1 -0
  23. package/dist/services/pendingLogin.js +56 -0
  24. package/dist/services/pendingLogin.js.map +1 -0
  25. package/dist/utils/skills/claude-skill.d.ts +1 -1
  26. package/dist/utils/skills/claude-skill.d.ts.map +1 -1
  27. package/dist/utils/skills/cli-guidance.d.ts +2 -2
  28. package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
  29. package/dist/utils/skills/cli-guidance.js +4 -4
  30. package/dist/utils/skills/cursor-rules.d.ts +2 -2
  31. package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
  32. package/dist/utils/skills/cursor-rules.js +1 -1
  33. package/package.json +1 -1
  34. package/src/ui/dist/assets/main-Be9y99Zr.js +422 -0
  35. package/src/ui/dist/index.html +1 -1
  36. package/dist/onboarding/signin.d.ts +0 -41
  37. package/dist/onboarding/signin.d.ts.map +0 -1
  38. package/dist/onboarding/signin.js +0 -273
  39. package/dist/onboarding/signin.js.map +0 -1
  40. package/src/ui/dist/assets/main-Dms3EyUm.js +0 -422
@@ -1,422 +0,0 @@
1
- var YM=Object.defineProperty;var TS=t=>{throw TypeError(t)};var XM=(t,e,n)=>e in t?YM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ao=(t,e,n)=>XM(t,typeof e!="symbol"?e+"":e,n),ev=(t,e,n)=>e.has(t)||TS("Cannot "+n);var B=(t,e,n)=>(ev(t,e,"read from private field"),n?n.call(t):e.get(t)),Be=(t,e,n)=>e.has(t)?TS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ie=(t,e,n,r)=>(ev(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),at=(t,e,n)=>(ev(t,e,"access private method"),n);var jh=(t,e,n,r)=>({set _(s){Ie(t,e,s,n)},get _(){return B(t,e,r)}});function QM(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 Gm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var tv={exports:{}},Wc={},nv={exports:{}},rt={};/**
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 RS;function JM(){if(RS)return rt;RS=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"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function x(D,Y,te){this.props=D,this.context=Y,this.refs=_,this.updater=te||y}x.prototype.isReactComponent={},x.prototype.setState=function(D,Y){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,Y,"setState")},x.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=x.prototype;function k(D,Y,te){this.props=D,this.context=Y,this.refs=_,this.updater=te||y}var P=k.prototype=new E;P.constructor=k,w(P,x.prototype),P.isPureReactComponent=!0;var T=Array.isArray,A=Object.prototype.hasOwnProperty,L={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function R(D,Y,te){var ie,ae={},ue=null,Ce=null;if(Y!=null)for(ie in Y.ref!==void 0&&(Ce=Y.ref),Y.key!==void 0&&(ue=""+Y.key),Y)A.call(Y,ie)&&!O.hasOwnProperty(ie)&&(ae[ie]=Y[ie]);var oe=arguments.length-2;if(oe===1)ae.children=te;else if(1<oe){for(var se=Array(oe),he=0;he<oe;he++)se[he]=arguments[he+2];ae.children=se}if(D&&D.defaultProps)for(ie in oe=D.defaultProps,oe)ae[ie]===void 0&&(ae[ie]=oe[ie]);return{$$typeof:t,type:D,key:ue,ref:Ce,props:ae,_owner:L.current}}function M(D,Y){return{$$typeof:t,type:D.type,key:Y,ref:D.ref,props:D.props,_owner:D._owner}}function N(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function j(D){var Y={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(te){return Y[te]})}var F=/\/+/g;function q(D,Y){return typeof D=="object"&&D!==null&&D.key!=null?j(""+D.key):Y.toString(36)}function G(D,Y,te,ie,ae){var ue=typeof D;(ue==="undefined"||ue==="boolean")&&(D=null);var Ce=!1;if(D===null)Ce=!0;else switch(ue){case"string":case"number":Ce=!0;break;case"object":switch(D.$$typeof){case t:case e:Ce=!0}}if(Ce)return Ce=D,ae=ae(Ce),D=ie===""?"."+q(Ce,0):ie,T(ae)?(te="",D!=null&&(te=D.replace(F,"$&/")+"/"),G(ae,Y,te,"",function(he){return he})):ae!=null&&(N(ae)&&(ae=M(ae,te+(!ae.key||Ce&&Ce.key===ae.key?"":(""+ae.key).replace(F,"$&/")+"/")+D)),Y.push(ae)),1;if(Ce=0,ie=ie===""?".":ie+":",T(D))for(var oe=0;oe<D.length;oe++){ue=D[oe];var se=ie+q(ue,oe);Ce+=G(ue,Y,te,se,ae)}else if(se=m(D),typeof se=="function")for(D=se.call(D),oe=0;!(ue=D.next()).done;)ue=ue.value,se=ie+q(ue,oe++),Ce+=G(ue,Y,te,se,ae);else if(ue==="object")throw Y=String(D),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return Ce}function W(D,Y,te){if(D==null)return D;var ie=[],ae=0;return G(D,ie,"","",function(ue){return Y.call(te,ue,ae++)}),ie}function K(D){if(D._status===-1){var Y=D._result;Y=Y(),Y.then(function(te){(D._status===0||D._status===-1)&&(D._status=1,D._result=te)},function(te){(D._status===0||D._status===-1)&&(D._status=2,D._result=te)}),D._status===-1&&(D._status=0,D._result=Y)}if(D._status===1)return D._result.default;throw D._result}var X={current:null},$={transition:null},ee={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:$,ReactCurrentOwner:L};function z(){throw Error("act(...) is not supported in production builds of React.")}return rt.Children={map:W,forEach:function(D,Y,te){W(D,function(){Y.apply(this,arguments)},te)},count:function(D){var Y=0;return W(D,function(){Y++}),Y},toArray:function(D){return W(D,function(Y){return Y})||[]},only:function(D){if(!N(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},rt.Component=x,rt.Fragment=n,rt.Profiler=s,rt.PureComponent=k,rt.StrictMode=r,rt.Suspense=c,rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,rt.act=z,rt.cloneElement=function(D,Y,te){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var ie=w({},D.props),ae=D.key,ue=D.ref,Ce=D._owner;if(Y!=null){if(Y.ref!==void 0&&(ue=Y.ref,Ce=L.current),Y.key!==void 0&&(ae=""+Y.key),D.type&&D.type.defaultProps)var oe=D.type.defaultProps;for(se in Y)A.call(Y,se)&&!O.hasOwnProperty(se)&&(ie[se]=Y[se]===void 0&&oe!==void 0?oe[se]:Y[se])}var se=arguments.length-2;if(se===1)ie.children=te;else if(1<se){oe=Array(se);for(var he=0;he<se;he++)oe[he]=arguments[he+2];ie.children=oe}return{$$typeof:t,type:D.type,key:ae,ref:ue,props:ie,_owner:Ce}},rt.createContext=function(D){return D={$$typeof:a,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:i,_context:D},D.Consumer=D},rt.createElement=R,rt.createFactory=function(D){var Y=R.bind(null,D);return Y.type=D,Y},rt.createRef=function(){return{current:null}},rt.forwardRef=function(D){return{$$typeof:u,render:D}},rt.isValidElement=N,rt.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:K}},rt.memo=function(D,Y){return{$$typeof:d,type:D,compare:Y===void 0?null:Y}},rt.startTransition=function(D){var Y=$.transition;$.transition={};try{D()}finally{$.transition=Y}},rt.unstable_act=z,rt.useCallback=function(D,Y){return X.current.useCallback(D,Y)},rt.useContext=function(D){return X.current.useContext(D)},rt.useDebugValue=function(){},rt.useDeferredValue=function(D){return X.current.useDeferredValue(D)},rt.useEffect=function(D,Y){return X.current.useEffect(D,Y)},rt.useId=function(){return X.current.useId()},rt.useImperativeHandle=function(D,Y,te){return X.current.useImperativeHandle(D,Y,te)},rt.useInsertionEffect=function(D,Y){return X.current.useInsertionEffect(D,Y)},rt.useLayoutEffect=function(D,Y){return X.current.useLayoutEffect(D,Y)},rt.useMemo=function(D,Y){return X.current.useMemo(D,Y)},rt.useReducer=function(D,Y,te){return X.current.useReducer(D,Y,te)},rt.useRef=function(D){return X.current.useRef(D)},rt.useState=function(D){return X.current.useState(D)},rt.useSyncExternalStore=function(D,Y,te){return X.current.useSyncExternalStore(D,Y,te)},rt.useTransition=function(){return X.current.useTransition()},rt.version="18.3.1",rt}var AS;function Y_(){return AS||(AS=1,nv.exports=JM()),nv.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 IS;function eO(){if(IS)return Wc;IS=1;var t=Y_(),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(u,c,d){var h,p={},m=null,y=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(y=c.ref);for(h in c)r.call(c,h)&&!i.hasOwnProperty(h)&&(p[h]=c[h]);if(u&&u.defaultProps)for(h in c=u.defaultProps,c)p[h]===void 0&&(p[h]=c[h]);return{$$typeof:e,type:u,key:m,ref:y,props:p,_owner:s.current}}return Wc.Fragment=n,Wc.jsx=a,Wc.jsxs=a,Wc}var MS;function tO(){return MS||(MS=1,tv.exports=eO()),tv.exports}var S=tO(),v=Y_();const _e=Gm(v),_f=QM({__proto__:null,default:_e},[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(){}},el,Lo,ku,a8,nO=(a8=class extends wf{constructor(){super();Be(this,el);Be(this,Lo);Be(this,ku);Ie(this,ku,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){B(this,Lo)||this.setEventListener(B(this,ku))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,Lo))==null||e.call(this),Ie(this,Lo,void 0))}setEventListener(e){var n;Ie(this,ku,e),(n=B(this,Lo))==null||n.call(this),Ie(this,Lo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){B(this,el)!==e&&(Ie(this,el,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof B(this,el)=="boolean"?B(this,el):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},el=new WeakMap,Lo=new WeakMap,ku=new WeakMap,a8),X_=new nO,rO={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},No,q_,l8,sO=(l8=class{constructor(){Be(this,No,rO);Be(this,q_,!1)}setTimeoutProvider(t){Ie(this,No,t)}setTimeout(t,e){return B(this,No).setTimeout(t,e)}clearTimeout(t){B(this,No).clearTimeout(t)}setInterval(t,e){return B(this,No).setInterval(t,e)}clearInterval(t){B(this,No).clearInterval(t)}},No=new WeakMap,q_=new WeakMap,l8),qa=new sO;function iO(t){setTimeout(t,0)}var oO=typeof window>"u"||"Deno"in globalThis;function Er(){}function aO(t,e){return typeof t=="function"?t(e):t}function A1(t){return typeof t=="number"&&t>=0&&t!==1/0}function v8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Zo(t,e){return typeof t=="function"?t(e):t}function zr(t,e){return typeof t=="function"?t(e):t}function OS(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==Q_(a,e.options))return!1}else if(!Vu(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||s&&s!==e.state.fetchStatus||i&&!i(e))}function LS(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Od(e.options.mutationKey)!==Od(i))return!1}else if(!Vu(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function Q_(t,e){return((e==null?void 0:e.queryKeyHashFn)||Od)(t)}function Od(t){return JSON.stringify(t,(e,n)=>M1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Vu(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(!Vu(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Vu(t[r],e[r]))return!1;return!0}return!1}var lO=Object.prototype.hasOwnProperty;function y8(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=NS(t)&&NS(e);if(!r&&!(M1(t)&&M1(e)))return e;const i=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),u=a.length,c=r?new Array(u):{};let d=0;for(let h=0;h<u;h++){const p=r?h:a[h],m=t[p],y=e[p];if(m===y){c[p]=m,(r?h<i:lO.call(t,p))&&d++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){c[p]=y;continue}const w=y8(m,y,n+1);c[p]=w,w===m&&d++}return i===u&&d===i?t:c}function I1(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 NS(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function M1(t){if(!DS(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!DS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function DS(t){return Object.prototype.toString.call(t)==="[object Object]"}function uO(t){return new Promise(e=>{qa.setTimeout(e,t)})}function O1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?y8(t,e):e}function cO(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function dO(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var J_=Symbol();function _8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===J_?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function w8(t,e){return typeof t=="function"?t(...e):!!t}function fO(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 Ld=(()=>{let t=()=>oO;return{isServer(){return t()},setIsServer(e){t=e}}})();function L1(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var hO=iO;function pO(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=hO;const i=u=>{e?t.push(u):s(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&s(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;e++;try{c=u()}finally{e--,e||a()}return c},batchCalls:u=>(...c)=>{i(()=>{u(...c)})},schedule:i,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var jn=pO(),Pu,Do,Tu,u8,mO=(u8=class extends wf{constructor(){super();Be(this,Pu,!0);Be(this,Do);Be(this,Tu);Ie(this,Tu,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(){B(this,Do)||this.setEventListener(B(this,Tu))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,Do))==null||e.call(this),Ie(this,Do,void 0))}setEventListener(e){var n;Ie(this,Tu,e),(n=B(this,Do))==null||n.call(this),Ie(this,Do,e(this.setOnline.bind(this)))}setOnline(e){B(this,Pu)!==e&&(Ie(this,Pu,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return B(this,Pu)}},Pu=new WeakMap,Do=new WeakMap,Tu=new WeakMap,u8),Wp=new mO;function gO(t){return Math.min(1e3*2**t,3e4)}function x8(t){return(t??"online")==="online"?Wp.isOnline():!0}var N1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function b8(t){let e=!1,n=0,r;const s=L1(),i=()=>s.status!=="pending",a=_=>{var x;if(!i()){const E=new N1(_);m(E),(x=t.onCancel)==null||x.call(t,E)}},u=()=>{e=!0},c=()=>{e=!1},d=()=>X_.isFocused()&&(t.networkMode==="always"||Wp.isOnline())&&t.canRun(),h=()=>x8(t.networkMode)&&t.canRun(),p=_=>{i()||(r==null||r(),s.resolve(_))},m=_=>{i()||(r==null||r(),s.reject(_))},y=()=>new Promise(_=>{var x;r=E=>{(i()||d())&&_(E)},(x=t.onPause)==null||x.call(t)}).then(()=>{var _;r=void 0,i()||(_=t.onContinue)==null||_.call(t)}),w=()=>{if(i())return;let _;const x=n===0?t.initialPromise:void 0;try{_=x??t.fn()}catch(E){_=Promise.reject(E)}Promise.resolve(_).then(p).catch(E=>{var L;if(i())return;const k=t.retry??(Ld.isServer()?0:3),P=t.retryDelay??gO,T=typeof P=="function"?P(n,E):P,A=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,E);if(e||!A){m(E);return}n++,(L=t.onFail)==null||L.call(t,n,E),uO(T).then(()=>d()?void 0:y()).then(()=>{e?m(E):w()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?w():y().then(w),s)}}var tl,c8,S8=(c8=class{constructor(){Be(this,tl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),A1(this.gcTime)&&Ie(this,tl,qa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ld.isServer()?1/0:300*1e3))}clearGcTimeout(){B(this,tl)!==void 0&&(qa.clearTimeout(B(this,tl)),Ie(this,tl,void 0))}},tl=new WeakMap,c8);function vO(t){return{onFetch:(e,n)=>{var h,p,m,y,w;const r=e.options,s=(m=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((y=e.state.data)==null?void 0:y.pages)||[],a=((w=e.state.data)==null?void 0:w.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const d=async()=>{let _=!1;const x=P=>{fO(P,()=>e.signal,()=>_=!0)},E=_8(e.options,e.fetchOptions),k=async(P,T,A)=>{if(_)return Promise.reject(e.signal.reason);if(T==null&&P.pages.length)return Promise.resolve(P);const O=(()=>{const j={client:e.client,queryKey:e.queryKey,pageParam:T,direction:A?"backward":"forward",meta:e.options.meta};return x(j),j})(),R=await E(O),{maxPages:M}=e.options,N=A?dO:cO;return{pages:N(P.pages,R,M),pageParams:N(P.pageParams,T,M)}};if(s&&i.length){const P=s==="backward",T=P?yO:jS,A={pages:i,pageParams:a},L=T(r,A);u=await k(A,L,P)}else{const P=t??i.length;do{const T=c===0?a[0]??r.initialPageParam:jS(r,u);if(c>0&&T==null)break;u=await k(u,T),c++}while(c<P)}return u};e.options.persister?e.fetchFn=()=>{var _,x;return(x=(_=e.options).persister)==null?void 0:x.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function jS(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 yO(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 Ru,nl,Au,cs,rl,kn,pf,sl,Hr,E8,ji,d8,_O=(d8=class extends S8{constructor(e){super();Be(this,Hr);Be(this,Ru);Be(this,nl);Be(this,Au);Be(this,cs);Be(this,rl);Be(this,kn);Be(this,pf);Be(this,sl);Ie(this,sl,!1),Ie(this,pf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ie(this,rl,e.client),Ie(this,cs,B(this,rl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ie(this,nl,VS(this.options)),this.state=e.state??B(this,nl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return B(this,Ru)}get promise(){var e;return(e=B(this,kn))==null?void 0:e.promise}setOptions(e){if(this.options={...B(this,pf),...e},e!=null&&e._type&&Ie(this,Ru,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=VS(this.options);n.data!==void 0&&(this.setState(FS(n.data,n.dataUpdatedAt)),Ie(this,nl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&B(this,cs).remove(this)}setData(e,n){const r=O1(this.state.data,e,this.options);return at(this,Hr,ji).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){at(this,Hr,ji).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=B(this,kn))==null?void 0:r.promise;return(s=B(this,kn))==null||s.cancel(e),n?n.then(Er).catch(Er):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return B(this,nl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>zr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===J_||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Zo(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:!v8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=B(this,kn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=B(this,kn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),B(this,cs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(B(this,kn)&&(B(this,sl)||at(this,Hr,E8).call(this)?B(this,kn).cancel({revert:!0}):B(this,kn).cancelRetry()),this.scheduleGc()),B(this,cs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||at(this,Hr,ji).call(this,{type:"invalidate"})}async fetch(e,n){var d,h,p,m,y,w,_,x,E,k,P;if(this.state.fetchStatus!=="idle"&&((d=B(this,kn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(B(this,kn))return B(this,kn).continueRetry(),B(this,kn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(A=>A.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Ie(this,sl,!0),r.signal)})},i=()=>{const T=_8(this.options,n),L=(()=>{const O={client:B(this,rl),queryKey:this.queryKey,meta:this.meta};return s(O),O})();return Ie(this,sl,!1),this.options.persister?this.options.persister(T,L,this):T(L)},u=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:B(this,rl),state:this.state,fetchFn:i};return s(T),T})(),c=B(this,Ru)==="infinite"?vO(this.options.pages):this.options.behavior;c==null||c.onFetch(u,this),Ie(this,Au,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=u.fetchOptions)==null?void 0:h.meta))&&at(this,Hr,ji).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),Ie(this,kn,b8({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:T=>{T instanceof N1&&T.revert&&this.setState({...B(this,Au),fetchStatus:"idle"}),r.abort()},onFail:(T,A)=>{at(this,Hr,ji).call(this,{type:"failed",failureCount:T,error:A})},onPause:()=>{at(this,Hr,ji).call(this,{type:"pause"})},onContinue:()=>{at(this,Hr,ji).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const T=await B(this,kn).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(m=B(this,cs).config).onSuccess)==null||y.call(m,T,this),(_=(w=B(this,cs).config).onSettled)==null||_.call(w,T,this.state.error,this),T}catch(T){if(T instanceof N1){if(T.silent)return B(this,kn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw at(this,Hr,ji).call(this,{type:"error",error:T}),(E=(x=B(this,cs).config).onError)==null||E.call(x,T,this),(P=(k=B(this,cs).config).onSettled)==null||P.call(k,this.state.data,T,this),T}finally{this.scheduleGc()}}},Ru=new WeakMap,nl=new WeakMap,Au=new WeakMap,cs=new WeakMap,rl=new WeakMap,kn=new WeakMap,pf=new WeakMap,sl=new WeakMap,Hr=new WeakSet,E8=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ji=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,...C8(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...FS(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ie(this,Au,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),jn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),B(this,cs).notify({query:this,type:"updated",action:e})})},d8);function C8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:x8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function FS(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function VS(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 xr,lt,mf,sr,il,Iu,Gi,jo,gf,Mu,Ou,ol,al,Fo,Lu,mt,ld,D1,j1,F1,V1,$1,H1,z1,k8,f8,wO=(f8=class extends wf{constructor(e,n){super();Be(this,mt);Be(this,xr);Be(this,lt);Be(this,mf);Be(this,sr);Be(this,il);Be(this,Iu);Be(this,Gi);Be(this,jo);Be(this,gf);Be(this,Mu);Be(this,Ou);Be(this,ol);Be(this,al);Be(this,Fo);Be(this,Lu,new Set);this.options=n,Ie(this,xr,e),Ie(this,jo,null),Ie(this,Gi,L1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(B(this,lt).addObserver(this),$S(B(this,lt),this.options)?at(this,mt,ld).call(this):this.updateResult(),at(this,mt,V1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return U1(B(this,lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return U1(B(this,lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,at(this,mt,$1).call(this),at(this,mt,H1).call(this),B(this,lt).removeObserver(this)}setOptions(e){const n=this.options,r=B(this,lt);if(this.options=B(this,xr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof zr(this.options.enabled,B(this,lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");at(this,mt,z1).call(this),B(this,lt).setOptions(this.options),n._defaulted&&!I1(this.options,n)&&B(this,xr).getQueryCache().notify({type:"observerOptionsUpdated",query:B(this,lt),observer:this});const s=this.hasListeners();s&&HS(B(this,lt),r,this.options,n)&&at(this,mt,ld).call(this),this.updateResult(),s&&(B(this,lt)!==r||zr(this.options.enabled,B(this,lt))!==zr(n.enabled,B(this,lt))||Zo(this.options.staleTime,B(this,lt))!==Zo(n.staleTime,B(this,lt)))&&at(this,mt,D1).call(this);const i=at(this,mt,j1).call(this);s&&(B(this,lt)!==r||zr(this.options.enabled,B(this,lt))!==zr(n.enabled,B(this,lt))||i!==B(this,Fo))&&at(this,mt,F1).call(this,i)}getOptimisticResult(e){const n=B(this,xr).getQueryCache().build(B(this,xr),e),r=this.createResult(n,e);return bO(this,r)&&(Ie(this,sr,r),Ie(this,Iu,this.options),Ie(this,il,B(this,lt).state)),r}getCurrentResult(){return B(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&&B(this,Gi).status==="pending"&&B(this,Gi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){B(this,Lu).add(e)}getCurrentQuery(){return B(this,lt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=B(this,xr).defaultQueryOptions(e),r=B(this,xr).getQueryCache().build(B(this,xr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return at(this,mt,ld).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),B(this,sr)))}createResult(e,n){var M;const r=B(this,lt),s=this.options,i=B(this,sr),a=B(this,il),u=B(this,Iu),d=e!==r?e.state:B(this,mf),{state:h}=e;let p={...h},m=!1,y;if(n._optimisticResults){const N=this.hasListeners(),j=!N&&$S(e,n),F=N&&HS(e,r,n,s);(j||F)&&(p={...p,...C8(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:_,status:x}=p;y=p.data;let E=!1;if(n.placeholderData!==void 0&&y===void 0&&x==="pending"){let N;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(N=i.data,E=!0):N=typeof n.placeholderData=="function"?n.placeholderData((M=B(this,Ou))==null?void 0:M.state.data,B(this,Ou)):n.placeholderData,N!==void 0&&(x="success",y=O1(i==null?void 0:i.data,N,n),m=!0)}if(n.select&&y!==void 0&&!E)if(i&&y===(a==null?void 0:a.data)&&n.select===B(this,gf))y=B(this,Mu);else try{Ie(this,gf,n.select),y=n.select(y),y=O1(i==null?void 0:i.data,y,n),Ie(this,Mu,y),Ie(this,jo,null)}catch(N){Ie(this,jo,N)}B(this,jo)&&(w=B(this,jo),y=B(this,Mu),_=Date.now(),x="error");const k=p.fetchStatus==="fetching",P=x==="pending",T=x==="error",A=P&&k,L=y!==void 0,R={status:x,fetchStatus:p.fetchStatus,isPending:P,isSuccess:x==="success",isError:T,isInitialLoading:A,isLoading:A,data:y,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:k,isRefetching:k&&!P,isLoadingError:T&&!L,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:T&&L,isStale:e2(e,n),refetch:this.refetch,promise:B(this,Gi),isEnabled:zr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const N=R.data!==void 0,j=R.status==="error"&&!N,F=W=>{j?W.reject(R.error):N&&W.resolve(R.data)},q=()=>{const W=Ie(this,Gi,R.promise=L1());F(W)},G=B(this,Gi);switch(G.status){case"pending":e.queryHash===r.queryHash&&F(G);break;case"fulfilled":(j||R.data!==G.value)&&q();break;case"rejected":(!j||R.error!==G.reason)&&q();break}}return R}updateResult(){const e=B(this,sr),n=this.createResult(B(this,lt),this.options);if(Ie(this,il,B(this,lt).state),Ie(this,Iu,this.options),B(this,il).data!==void 0&&Ie(this,Ou,B(this,lt)),I1(n,e))return;Ie(this,sr,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!B(this,Lu).size)return!0;const a=new Set(i??B(this,Lu));return this.options.throwOnError&&a.add("error"),Object.keys(B(this,sr)).some(u=>{const c=u;return B(this,sr)[c]!==e[c]&&a.has(c)})};at(this,mt,k8).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&at(this,mt,V1).call(this)}},xr=new WeakMap,lt=new WeakMap,mf=new WeakMap,sr=new WeakMap,il=new WeakMap,Iu=new WeakMap,Gi=new WeakMap,jo=new WeakMap,gf=new WeakMap,Mu=new WeakMap,Ou=new WeakMap,ol=new WeakMap,al=new WeakMap,Fo=new WeakMap,Lu=new WeakMap,mt=new WeakSet,ld=function(e){at(this,mt,z1).call(this);let n=B(this,lt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Er)),n},D1=function(){at(this,mt,$1).call(this);const e=Zo(this.options.staleTime,B(this,lt));if(Ld.isServer()||B(this,sr).isStale||!A1(e))return;const r=v8(B(this,sr).dataUpdatedAt,e)+1;Ie(this,ol,qa.setTimeout(()=>{B(this,sr).isStale||this.updateResult()},r))},j1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(B(this,lt)):this.options.refetchInterval)??!1},F1=function(e){at(this,mt,H1).call(this),Ie(this,Fo,e),!(Ld.isServer()||zr(this.options.enabled,B(this,lt))===!1||!A1(B(this,Fo))||B(this,Fo)===0)&&Ie(this,al,qa.setInterval(()=>{(this.options.refetchIntervalInBackground||X_.isFocused())&&at(this,mt,ld).call(this)},B(this,Fo)))},V1=function(){at(this,mt,D1).call(this),at(this,mt,F1).call(this,at(this,mt,j1).call(this))},$1=function(){B(this,ol)!==void 0&&(qa.clearTimeout(B(this,ol)),Ie(this,ol,void 0))},H1=function(){B(this,al)!==void 0&&(qa.clearInterval(B(this,al)),Ie(this,al,void 0))},z1=function(){const e=B(this,xr).getQueryCache().build(B(this,xr),this.options);if(e===B(this,lt))return;const n=B(this,lt);Ie(this,lt,e),Ie(this,mf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},k8=function(e){jn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(B(this,sr))}),B(this,xr).getQueryCache().notify({query:B(this,lt),type:"observerResultsUpdated"})})},f8);function xO(t,e){return zr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&zr(e.retryOnMount,t)===!1)}function $S(t,e){return xO(t,e)||t.state.data!==void 0&&U1(t,e,e.refetchOnMount)}function U1(t,e,n){if(zr(e.enabled,t)!==!1&&Zo(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&e2(t,e)}return!1}function HS(t,e,n,r){return(t!==e||zr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&e2(t,n)}function e2(t,e){return zr(e.enabled,t)!==!1&&t.isStaleByTime(Zo(e.staleTime,t))}function bO(t,e){return!I1(t.getCurrentResult(),e)}var vf,ni,qn,ll,ri,Mo,h8,SO=(h8=class extends S8{constructor(e){super();Be(this,ri);Be(this,vf);Be(this,ni);Be(this,qn);Be(this,ll);Ie(this,vf,e.client),this.mutationId=e.mutationId,Ie(this,qn,e.mutationCache),Ie(this,ni,[]),this.state=e.state||EO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){B(this,ni).includes(e)||(B(this,ni).push(e),this.clearGcTimeout(),B(this,qn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ie(this,ni,B(this,ni).filter(n=>n!==e)),this.scheduleGc(),B(this,qn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){B(this,ni).length||(this.state.status==="pending"?this.scheduleGc():B(this,qn).remove(this))}continue(){var e;return((e=B(this,ll))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,u,c,d,h,p,m,y,w,_,x,E,k,P,T,A,L,O;const n=()=>{at(this,ri,Mo).call(this,{type:"continue"})},r={client:B(this,vf),meta:this.options.meta,mutationKey:this.options.mutationKey};Ie(this,ll,b8({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,M)=>{at(this,ri,Mo).call(this,{type:"failed",failureCount:R,error:M})},onPause:()=>{at(this,ri,Mo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>B(this,qn).canRun(this)}));const s=this.state.status==="pending",i=!B(this,ll).canStart();try{if(s)n();else{at(this,ri,Mo).call(this,{type:"pending",variables:e,isPaused:i}),B(this,qn).config.onMutate&&await B(this,qn).config.onMutate(e,this,r);const M=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,e,r));M!==this.state.context&&at(this,ri,Mo).call(this,{type:"pending",context:M,variables:e,isPaused:i})}const R=await B(this,ll).start();return await((d=(c=B(this,qn).config).onSuccess)==null?void 0:d.call(c,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((y=(m=B(this,qn).config).onSettled)==null?void 0:y.call(m,R,null,this.state.variables,this.state.context,this,r)),await((_=(w=this.options).onSettled)==null?void 0:_.call(w,R,null,e,this.state.context,r)),at(this,ri,Mo).call(this,{type:"success",data:R}),R}catch(R){try{await((E=(x=B(this,qn).config).onError)==null?void 0:E.call(x,R,e,this.state.context,this,r))}catch(M){Promise.reject(M)}try{await((P=(k=this.options).onError)==null?void 0:P.call(k,R,e,this.state.context,r))}catch(M){Promise.reject(M)}try{await((A=(T=B(this,qn).config).onSettled)==null?void 0:A.call(T,void 0,R,this.state.variables,this.state.context,this,r))}catch(M){Promise.reject(M)}try{await((O=(L=this.options).onSettled)==null?void 0:O.call(L,void 0,R,e,this.state.context,r))}catch(M){Promise.reject(M)}throw at(this,ri,Mo).call(this,{type:"error",error:R}),R}finally{B(this,qn).runNext(this)}}},vf=new WeakMap,ni=new WeakMap,qn=new WeakMap,ll=new WeakMap,ri=new WeakSet,Mo=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),jn.batch(()=>{B(this,ni).forEach(r=>{r.onMutationUpdate(e)}),B(this,qn).notify({mutation:this,type:"updated",action:e})})},h8);function EO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ki,Ls,yf,p8,CO=(p8=class extends wf{constructor(e={}){super();Be(this,Ki);Be(this,Ls);Be(this,yf);this.config=e,Ie(this,Ki,new Set),Ie(this,Ls,new Map),Ie(this,yf,0)}build(e,n,r){const s=new SO({client:e,mutationCache:this,mutationId:++jh(this,yf)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){B(this,Ki).add(e);const n=Fh(e);if(typeof n=="string"){const r=B(this,Ls).get(n);r?r.push(e):B(this,Ls).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(B(this,Ki).delete(e)){const n=Fh(e);if(typeof n=="string"){const r=B(this,Ls).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&B(this,Ls).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Fh(e);if(typeof n=="string"){const r=B(this,Ls).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=Fh(e);if(typeof n=="string"){const s=(r=B(this,Ls).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){jn.batch(()=>{B(this,Ki).forEach(e=>{this.notify({type:"removed",mutation:e})}),B(this,Ki).clear(),B(this,Ls).clear()})}getAll(){return Array.from(B(this,Ki))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>LS(n,r))}findAll(e={}){return this.getAll().filter(n=>LS(e,n))}notify(e){jn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return jn.batch(()=>Promise.all(e.map(n=>n.continue().catch(Er))))}},Ki=new WeakMap,Ls=new WeakMap,yf=new WeakMap,p8);function Fh(t){var e;return(e=t.options.scope)==null?void 0:e.id}var si,m8,kO=(m8=class extends wf{constructor(e={}){super();Be(this,si);this.config=e,Ie(this,si,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??Q_(s,n);let a=this.get(i);return a||(a=new _O({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){B(this,si).has(e.queryHash)||(B(this,si).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=B(this,si).get(e.queryHash);n&&(e.destroy(),n===e&&B(this,si).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){jn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return B(this,si).get(e)}getAll(){return[...B(this,si).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>OS(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>OS(e,r)):n}notify(e){jn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){jn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){jn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},si=new WeakMap,m8),Xt,Vo,$o,Nu,Du,Ho,ju,Fu,g8,PO=(g8=class{constructor(t={}){Be(this,Xt);Be(this,Vo);Be(this,$o);Be(this,Nu);Be(this,Du);Be(this,Ho);Be(this,ju);Be(this,Fu);Ie(this,Xt,t.queryCache||new kO),Ie(this,Vo,t.mutationCache||new CO),Ie(this,$o,t.defaultOptions||{}),Ie(this,Nu,new Map),Ie(this,Du,new Map),Ie(this,Ho,0)}mount(){jh(this,Ho)._++,B(this,Ho)===1&&(Ie(this,ju,X_.subscribe(async t=>{t&&(await this.resumePausedMutations(),B(this,Xt).onFocus())})),Ie(this,Fu,Wp.subscribe(async t=>{t&&(await this.resumePausedMutations(),B(this,Xt).onOnline())})))}unmount(){var t,e;jh(this,Ho)._--,B(this,Ho)===0&&((t=B(this,ju))==null||t.call(this),Ie(this,ju,void 0),(e=B(this,Fu))==null||e.call(this),Ie(this,Fu,void 0))}isFetching(t){return B(this,Xt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return B(this,Vo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=B(this,Xt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=B(this,Xt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Zo(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return B(this,Xt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=B(this,Xt).get(r.queryHash),i=s==null?void 0:s.state.data,a=aO(e,i);if(a!==void 0)return B(this,Xt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return jn.batch(()=>B(this,Xt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=B(this,Xt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=B(this,Xt);jn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=B(this,Xt);return jn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=jn.batch(()=>B(this,Xt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Er).catch(Er)}invalidateQueries(t,e={}){return jn.batch(()=>(B(this,Xt).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=jn.batch(()=>B(this,Xt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Er)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Er)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=B(this,Xt).build(this,e);return n.isStaleByTime(Zo(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 Wp.isOnline()?B(this,Vo).resumePausedMutations():Promise.resolve()}getQueryCache(){return B(this,Xt)}getMutationCache(){return B(this,Vo)}getDefaultOptions(){return B(this,$o)}setDefaultOptions(t){Ie(this,$o,t)}setQueryDefaults(t,e){B(this,Nu).set(Od(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...B(this,Nu).values()],n={};return e.forEach(r=>{Vu(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){B(this,Du).set(Od(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...B(this,Du).values()],n={};return e.forEach(r=>{Vu(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...B(this,$o).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Q_(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===J_&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...B(this,$o).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){B(this,Xt).clear(),B(this,Vo).clear()}},Xt=new WeakMap,Vo=new WeakMap,$o=new WeakMap,Nu=new WeakMap,Du=new WeakMap,Ho=new WeakMap,ju=new WeakMap,Fu=new WeakMap,g8),P8=v.createContext(void 0),T8=t=>{const e=v.useContext(P8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},TO=({client:t,children:e})=>(v.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(P8.Provider,{value:t,children:e})),R8=v.createContext(!1),RO=()=>v.useContext(R8);R8.Provider;function AO(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var IO=v.createContext(AO()),MO=()=>v.useContext(IO),OO=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?w8(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},LO=t=>{v.useEffect(()=>{t.clearReset()},[t])},NO=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||w8(n,[t.error,r])),DO=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))}},jO=(t,e)=>t.isLoading&&t.isFetching&&!e,FO=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,zS=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function VO(t,e,n){var y,w,_,x;const r=RO(),s=MO(),i=T8(),a=i.defaultQueryOptions(t);(w=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||w.call(y,a);const u=i.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,DO(a),OO(a,s,u),LO(s);const d=!i.getQueryCache().get(a.queryHash),[h]=v.useState(()=>new e(i,a)),p=h.getOptimisticResult(a),m=!r&&c;if(v.useSyncExternalStore(v.useCallback(E=>{const k=m?h.subscribe(jn.batchCalls(E)):Er;return h.updateResult(),k},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),v.useEffect(()=>{h.setOptions(a)},[a,h]),FO(a,p))throw zS(a,h,s);if(NO({result:p,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw p.error;if((x=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||x.call(_,a,p),a.experimental_prefetchInRender&&!Ld.isServer()&&jO(p,r)){const E=d?zS(a,h,s):u==null?void 0:u.promise;E==null||E.catch(Er).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?p:h.trackResult(p)}function B1(t,e){return VO(t,wO)}var ne=typeof window<"u"?window:void 0,Xn=typeof globalThis<"u"?globalThis:ne,or=Xn==null?void 0:Xn.navigator,Se=Xn==null?void 0:Xn.document,on=Xn==null?void 0:Xn.location,t2=Xn==null?void 0:Xn.fetch,W1=Xn!=null&&Xn.XMLHttpRequest&&"withCredentials"in new Xn.XMLHttpRequest?Xn.XMLHttpRequest:void 0,US=Xn==null?void 0:Xn.AbortController,$O=Xn==null?void 0:Xn.CompressionStream,br=or==null?void 0:or.userAgent;function A8(){return!(!ne||ne.navigator.onLine===!1)}var Gc=typeof globalThis<"u"?globalThis:ne;Gc&&typeof self>"u"&&(Gc.self=Gc),Gc&&typeof File>"u"&&(Gc.File=function(){});var He=ne??{},BS="0.2.0",wt={DEBUG:!1,LIB_VERSION:BS,LIB_NAME:"browser-common",JS_SDK_VERSION:BS};function WS(t,e,n,r,s,i,a){try{var u=t[i](a),c=u.value}catch(d){return void n(d)}u.done?e(c):Promise.resolve(c).then(r,s)}function Jt(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(c){WS(i,r,s,a,u,"next",c)}function u(c){WS(i,r,s,a,u,"throw",c)}a(void 0)}))}}function de(){return de=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},de.apply(null,arguments)}function I8(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 GS=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function KS(t){return typeof t=="string"||t}function ZS(t){return typeof t=="string"?t:void 0}var Kc,HO=["$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"],Hi=(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})({}),qS=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),zO=["$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"],UO=["token"],M8="NativeGzipValidationError",G1=t=>t.length>=2&&t[0]===31&&t[1]===139,YS=(t,e)=>t===qS.GZipJS||e===qS.GZipJS||e==="gzip",XS=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Vh=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=M8,e},BO=(function(){var t=Jt((function*(e,n){18>e.size&&Vh("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());G1(r)&&r[2]===8||Vh("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var u=(()=>{if(Kc)return Kc;Kc=[];for(var h=0;256>h;h++){for(var p=h,m=0;8>m;m++)p=1&p?3988292384^p>>>1:p>>>1;Kc[h]=p>>>0}return Kc})(),c=4294967295,d=0;a.length>d;d++)c=u[255&(c^a[d])]^c>>>8;return(4294967295^c)>>>0})(n)&&Vh("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Vh("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function K1(){return K1=Jt((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),i=s.writable.getWriter(),a=i.write(r).then((()=>i.close())).catch((function(){var d=Jt((function*(h){try{yield i.abort(h)}catch{}throw h}));return function(h){return d.apply(this,arguments)}})()),u=new Response(s.readable).blob(),c=(yield Promise.all([u,a]))[0];return yield BO(c,r),c}catch(d){if(n!=null&&n.rethrow)throw d;return e&&console.error("Failed to gzip compress data",d),null}})),K1.apply(this,arguments)}var WO=["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"],QS=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return WO.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Ge(t,e){return t.indexOf(e)!==-1}var Km=function(t){return t.trim()},Z1=function(t){return t.replace(/^\$/,"")};function O8(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 L8=Object.prototype,N8=L8.hasOwnProperty,Zm=L8.toString,et=Array.isArray||function(t){return Zm.call(t)==="[object Array]"},Ns=t=>typeof t=="function",Ot=t=>t===Object(t)&&!et(t),zo=t=>{if(Ot(t)){for(var e in t)if(N8.call(t,e))return!1;return!0}return!1},ye=t=>t===void 0,xt=t=>Zm.call(t)=="[object String]",q1=t=>xt(t)&&t.trim().length===0,cr=t=>t===null,Xe=t=>ye(t)||cr(t),Vn=t=>Zm.call(t)=="[object Number]"&&t==t,Fi=t=>Vn(t)&&t>0,Ds=t=>Zm.call(t)==="[object Boolean]",GO=t=>t instanceof FormData,KO=t=>Ge(zO,t),ZO=t=>Ge(UO,t);function D8(t){return t===null||typeof t!="object"}function Gp(t,e){return{}.toString.call(t)==="[object "+e+"]"}function n2(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var qO=[!0,"true",1,"1","yes"],rv=t=>Ge(qO,t),YO=[!1,"false",0,"0","no"];function li(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Vn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),li(s||n,e,n,r))}class XO{constructor(e){this.$e={},this.ze=e.ze,this.Ze=li(e.bucketSize,0,100,e.Ge),this.Qe=li(e.refillRate,0,this.Ze,e.Ge),this.Je=li(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 Zr="Mobile",Kp="iOS",Qi="Android",$u="Tablet",j8=Qi+" "+$u,F8="iPad",V8="Apple",$8=V8+" Watch",vd="Safari",Hu="BlackBerry",H8="Samsung",z8=H8+"Browser",U8=H8+" Internet",ul="Chrome",QO=ul+" OS",B8=ul+" "+Kp,r2="Internet Explorer",W8=r2+" "+Zr,s2="Opera",JO=s2+" Mini",i2="Edge",G8="Microsoft "+i2,vu="Firefox",K8=vu+" "+Kp,Nd="Nintendo",Dd="PlayStation",yu="Xbox",Z8=Qi+" "+Zr,q8=Zr+" "+vd,ud="Windows",Y1=ud+" Phone",JS="Nokia",X1="Ouya",Y8="Generic",eL=Y8+" "+Zr.toLowerCase(),X8=Y8+" "+$u.toLowerCase(),Q1="Konqueror",Q8="Oculus Browser",Zp="Vivaldi",J8="Yandex",qp="Whale",J1="DuckDuckGo",e6="Pale Moon",Yp="Waterfox",yd="Brave",t6="Google Search App",$t="(\\d+(\\.\\d+)?)",sv=new RegExp("Version/"+$t),tL=new RegExp(yu,"i"),nL=new RegExp(Dd+" \\w+","i"),rL=new RegExp(Nd+" \\w+","i"),o2=new RegExp(Hu+"|PlayBook|BB10","i"),sL={"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"},n6=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?yd:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Ge(t,"GSA/")?t6:Ge(t," OPR/")&&Ge(t,"Mini")?JO:Ge(t," OPR/")?s2:o2.test(t)?Hu:Ge(t,"IE"+Zr)||Ge(t,"WPDesktop")?W8:Ge(t,"OculusBrowser")?Q8:Ge(t,z8)?U8:Ge(t,i2)||Ge(t,"Edg/")?G8:Ge(t,Zp+"/")?Zp:Ge(t,"YaBrowser/")?J8:Ge(t,qp+"/")?qp:Ge(t,J1+"/")||Ge(t,"Ddg/")?J1:Ge(t,"FBIOS")?"Facebook "+Zr:Ge(t,"UCWEB")||Ge(t,"UCBrowser")?"UC Browser":Ge(t,"CriOS")?B8:Ge(t,"CrMo")||Ge(t,ul)?ul:Ge(t,Qi)&&Ge(t,vd)?Z8:Ge(t,"FxiOS")?K8:Ge(t.toLowerCase(),Q1.toLowerCase())?Q1:Ge(t,yd+"/")?yd:((i,a)=>a&&Ge(a,V8)||(function(u){return Ge(u,vd)&&!Ge(u,ul)&&!Ge(u,Qi)})(i))(t,e)?Ge(t,Zr)?q8:vd:Ge(t,"PaleMoon/")?e6:Ge(t,Yp+"/")?Yp:Ge(t,vu)?vu:Ge(t,"MSIE")||Ge(t,"Trident/")?r2:Ge(t,"Gecko")?vu:"")},iL={[W8]:[new RegExp("rv:"+$t)],[G8]:[new RegExp(i2+"?\\/"+$t)],[ul]:[new RegExp("("+ul+"|CrMo)\\/"+$t)],[B8]:[new RegExp("CriOS\\/"+$t)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+$t)],[vd]:[sv],[q8]:[sv],[s2]:[new RegExp("(Opera|OPR)\\/"+$t)],[vu]:[new RegExp(vu+"\\/"+$t)],[K8]:[new RegExp("FxiOS\\/"+$t)],[Q1]:[new RegExp("Konqueror[:/]?"+$t,"i")],[Hu]:[new RegExp(Hu+" "+$t),sv],[Z8]:[new RegExp("android\\s"+$t,"i")],[U8]:[new RegExp(z8+"\\/"+$t)],[Q8]:[new RegExp("OculusBrowser\\/"+$t)],[Zp]:[new RegExp(Zp+"\\/"+$t)],[J8]:[new RegExp("YaBrowser\\/"+$t)],[qp]:[new RegExp(qp+"\\/"+$t)],[yd]:[new RegExp(yd+"\\/"+$t)],[J1]:[new RegExp("(DuckDuckGo|Ddg)\\/"+$t)],[e6]:[new RegExp("PaleMoon\\/"+$t)],[Yp]:[new RegExp(Yp+"\\/"+$t)],[t6]:[new RegExp("GSA\\/"+$t)],[r2]:[new RegExp("(rv:|MSIE )"+$t)],Mozilla:[new RegExp("rv:"+$t)]},oL=function(t,e,n,r){var s=n6(t,e,n,r),i=iL[s];if(ye(i))return null;for(var a=0;i.length>a;a++){var u=t.match(i[a]);if(u)return parseFloat(u[u.length-2])}return null},eE=[[new RegExp(yu+"; "+yu+" (.*?)[);]","i"),t=>[yu,t&&t[1]||""]],[new RegExp(Nd,"i"),[Nd,""]],[new RegExp(Dd,"i"),[Dd,""]],[o2,[Hu,""]],[new RegExp(ud,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Y1,""];if(new RegExp(Zr).test(e)&&!/IEMobile\b/.test(e))return[ud+" "+Zr,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=sL[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[ud,r]}return[ud,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Kp,[t[3],t[4],t[5]||"0"].join(".")]:[Kp,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ye(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Qi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Qi+")","i"),t=>t&&t[2]?[Qi,[t[2],t[3],t[4]||"0"].join(".")]:[Qi,""]],[/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/,[QO,""]],[/Linux|debian/i,["Linux",""]]],tE=function(t){return rL.test(t)?Nd:nL.test(t)?Dd:tL.test(t)?yu:new RegExp(X1,"i").test(t)?X1:new RegExp("("+Y1+"|WPDesktop)","i").test(t)?Y1:/iPad/.test(t)?F8:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?$8:o2.test(t)?Hu:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(JS,"i").test(t)?JS:/(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(Zr).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)?Qi:j8:new RegExp("(pda|"+Zr+")","i").test(t)?eL:new RegExp($u,"i").test(t)&&!new RegExp($u+" pc","i").test(t)?X8:""},aL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function nE(t,e){return typeof(n=t)=="string"&&aL.test(n)?t:e();var n}function Qo(t){return t&&t.split("#")[0]}function vp(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}var lL=t=>t instanceof Error,r6={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}},uL=r6.info;function s6(t){if(Ds(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(et(t))return{arrayValue:{values:t.map((e=>s6(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function Xp(t){var e=[];for(var n in t){var r=t[n];cr(r)||ye(r)||e.push({key:n,value:s6(r)})}return e}function cL(t,e){var n=r6[t.level||"info"]||uL,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),Xe(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Xe(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 u=de({},a,t.attributes||{}),c={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:Xp(u)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),ye(t.trace_flags)||(c.flags=t.trace_flags),c}function i6(t,e,n){return de({},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 o6(t,e,n,r){return{resourceLogs:[{resource:{attributes:Xp(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let dL=class{constructor(t,e,n,r,s,i,a){var u;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((u=e.maxQueueSize)!==null&&u!==void 0?u: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:cL(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=et(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ge.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.Ge.error("Error in beforeSend function for log:",a),null}return r}xt(){if(this.yt===void 0)return!0;var t=Date.now(),e=t-this.st;return this.ft>e&&e>=0||(this.st=t,this.ot=0,this.ut=!1),this.yt>this.ot?(this.ot++,!0):(this.ut||(this.Ge.warn("captureLog dropping logs: exceeded "+this.yt+" logs per "+this.ft+"ms"),this.ut=!0),!1)}flush(){var t=this;return Jt((function*(){if(!t._instance.isDisabled)return t.rt||(t.rt=t.St().finally((()=>{t.rt=null}))),t.rt}))()}St(){var t=this;return Jt((function*(){var e;t.bt();var n=(e=t._instance.getPersistedProperty(Hi.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 u=Math.min(n.length,t.vt),c=n.slice(0,u),d=o6(c.map((p=>p.record)),t.Ct(),(i=t.tt)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.It(d);if(h.kind==="too-large"&&c.length>1)t.vt=Math.max(1,Math.floor(c.length/2)),t.Ge.warn("Received 413 when sending logs batch of size "+c.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.Tt(c.length),n=(a=t._instance.getPersistedProperty(Hi.LogsQueue))!==null&&a!==void 0?a:[],s+=c.length,h.kind==="fatal"))throw h.error}}))()}Tt(t){var e=this;return Jt((function*(){var n,r=Math.max(0,t-e.it),s=(n=e._instance.getPersistedProperty(Hi.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Hi.LogsQueue,s.slice(r)),yield e.et()}))()}Ct(){return i6(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}kt(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Hi.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(Hi.LogsQueue,n),this.ht>n.length?this.Mt():this._t()}}Mt(t){t===void 0&&(t=this.ct),this.Et||(this.Et=vp((()=>{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(Hi.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Jt((function*(){e.bt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((r=>vp(r,t)))]):yield n}))()}flushWithTimeout(t){var e=this;return Jt((function*(){var n=!1,r=e.flush(),s=new Promise((i=>vp((()=>{n=!0,i()}),t)));try{yield Promise.race([r,s])}finally{n&&r.catch((()=>{}))}}))()}_t(){this.flush().then((()=>{this.nt=0}),(t=>{this.nt++,this.Ge.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.Pt()&&this.Mt(this.Rt())}))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}};var iv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function rE(t){return String(t)+"000000"}function sE(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 fL=class{constructor(t,e,n){this._instance=t,this.Te=e,this.Ge=n,this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.At=0}count(t,e,n){e===void 0&&(e=1),this.Nt({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Nt({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Nt({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this,e=this.rt,n=(function(){var s=Jt((function*(){e&&(yield e.catch((()=>{}))),yield t.Dt()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.rt===r&&(this.rt=null)}));return this.rt=r,r}drainWindow(){if(this.Ot.size===0)return null;var t=this.Ot;return this.Ot=new Map,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.qt(t)}reset(){this.At++,this.bt(),this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set}Nt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.wt(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.Ge.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?de({},e.attributes):void 0,r=sE(e.type,e.name,e.unit,n)}catch(a){return void this.Ge.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var s=this.Ot.get(r);if(!s){if(!this.jt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Ot.set(r,s)}var i=this.Lt.get(e.name);i===void 0?this.Lt.set(e.name,e.type):i===e.type||this.$t.has(e.name)||(this.$t.add(e.name),this.Ge.warn("Metric name '"+e.name+"' is already used as a "+i+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Ht(s,e.value),this.Mt()}else this.Ge.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.Ge.warn("Dropping metric with empty name")}}jt(){return this.Te.maxSeriesPerFlush>this.Ot.size||(this.Ft||(this.Ft=!0,this.Ge.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ht(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(iv.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,iv)]+=1}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var n=et(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ge.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.Ge.error("Error in beforeSend function for metric:",a),null}return r}Mt(){this.Et||(this.Et=vp((()=>{this.Et=void 0,this.flush().catch((t=>{this.Ge.error("Metrics flush failed:",t)}))}),this.Te.flushIntervalMs))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}Dt(){var t=this;return Jt((function*(){if(t.Ot.size!==0){var e=t.Ot;t.Ot=new Map,t.Ft=!1,t.Lt=new Map,t.$t=new Set;var n=t.At,r=yield t._instance.Bt(t.qt(e));if(n===t.At)switch(r.kind){case"ok":return;case"retry-later":return t.Ut(e),void t.Mt();case"too-large":return void t.Ge.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.Ge.error("Failed to send metrics batch:",r.error)}}}))()}qt(t){return e=this.zt(t),n=(function(i,a,u){return de({},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":u})})(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Xp(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}zt(t){var e=rE(Date.now()),n=new Map;for(var r of t.values()){var s,i=sE(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=de({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 u=Xp((s=r.attributes)!==null&&s!==void 0?s:{}),c=rE(r.windowStartMs);if(r.type==="count"){var d,h={attributes:u,startTimeUnixNano:c,timeUnixNano:e,asDouble:(d=r.total)!==null&&d!==void 0?d:0};a.sum.dataPoints.push(h)}else if(r.type==="gauge"){var p,m={attributes:u,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:u,startTimeUnixNano:c,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:iv})}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 u=0;a.hist.bucketCounts.length>u;u++)a.hist.bucketCounts[u]+=i.hist.bucketCounts[u]}else a.hist=i.hist}else this.jt()&&this.Ot.set(s,i)}}};var $h,iE,ov;function hL(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return ov&&n.length===iE||(iE=n.length,ov=n.reduce(((r,s)=>{$h||($h={});var i=$h[s];if(i)r[i[0]]=i[1];else for(var a=t(s),u=a.length-1;u>=0;u--){var c=a[u],d=c==null?void 0:c.filename,h=e[s];if(d&&h){r[d]=h,$h[s]=[d,h];break}}return r}),{})),ov}}class pL{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),i=this.buildParsingContext(n),a=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var n=this;return Jt((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&et(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)),de({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Jt((function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r}))()}convertToExceptionList(e,n){var r,s,i,a={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var u=[a];return e.cause!=null&&u.push(...this.convertToExceptionList(e.cause,de({},n,{handled:!0}))),u}buildParsingContext(e){var n;return{chunkIdMap:hL(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(i,a)=>{if(4>=a){var u=this.buildCoercingContext(e,n,a);return this.applyCoercers(i,u)}};return de({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var zu="?";function ey(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?zu:n,in_app:!0};return ye(r)||(i.lineno=r),ye(s)||(i.colno=s),i}var a6=(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]:zu,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},mL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,gL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,vL=/\((\S*)(?::(\d+))(?::(\d+))\)/,yL=(t,e)=>{var n=mL.exec(t);if(n)return ey(e,n[1],zu,+n[2],+n[3]);var r=gL.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=vL.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=a6(r[1]||zu,r[2]);return ey(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},_L=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,xL=(t,e)=>{var n=_L.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=wL.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]||zu,a=a6(i,s);return ey(e,s=a[1],i=a[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},oE=/\(error: (.*)\)/;class bL{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 Gp(e,"DOMException")}isDOMError(e){return Gp(e,"DOMError")}}class SL{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 EL{constructor(){}match(e){return Gp(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 CL=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class kL{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(CL);return s&&(n=s[1],r=s[2]),[n,r]}}var PL=["fatal","error","warning","log","info","debug"];function l6(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 TL{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 n2(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: "+l6(e)}isSeverityLevel(e){return xt(e)&&!q1(e)&&PL.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(lL(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class RL{match(e){return n2(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+l6(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class AL{match(e){return D8(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 IL{match(e){return Gp(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!n2(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 D8(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 Qp="$message",Jp="$timestamp",ML=new Set([Qp,Jp]),av={enabled:!0,max_bytes:32768};function em(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:av.enabled,max_bytes:LL(t.max_bytes,av.max_bytes)}:de({},av)}class OL{constructor(e){this.Vt=[],this.Wt=0,this.Te=em(e)}setConfig(e){this.Te=em(e),this.Zt()}add(e){var n=(function(s){var i;try{i=O8(s)}catch{return}try{var a=JSON.parse(i);if(!Ot(a))return;var u=a,c=u[Qp],d=u[Jp];return!xt(c)||c.trim().length===0||!xt(d)&&!Vn(d)?void 0:{step:u,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,u=0;i.length>u;u++)i[u]==="%"?(a+=1,u+=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 LL(t,e){if(!Vn(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var u6=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={k(s){if(ne&&(wt.DEBUG||ne.POSTHOG_DEBUG||n)&&!ye(ne.console)&&ne.console){for(var i=("__rrweb_original__"in ne.console[s])?ne.console[s].__rrweb_original__:ne.console[s],a=arguments.length,u=new Array(a>1?a-1:0),c=1;a>c;c++)u[c-1]=arguments[c];i(t,...u)}},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)=>u6(t+" "+s,i)};return r},xe=u6("[PostHog.js]"),Dt=xe.createLogger,NL=Dt("[ExternalScriptsLoader]"),lv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return NL.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Se==null?void 0:Se.querySelectorAll("script");if(r){for(var s,i=function(){if(r[a].src===e){var c=r[a];return c.__posthog_loading_callback_fired?{v:n()}:(c.addEventListener("load",(d=>{c.__posthog_loading_callback_fired=!0,n(void 0,d)})),c.onerror=d=>n(d),{v:void 0})}},a=0;r.length>a;a++)if(s=i())return s.v}var u=()=>{if(!Se)return n("document not found");var c=Se.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=e,c.onload=p=>{c.__posthog_loading_callback_fired=!0,n(void 0,p)},c.onerror=p=>n(p),t.config.prepare_external_dependency_script&&(c=t.config.prepare_external_dependency_script(c)),!c)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")Se.head.appendChild(c);else{var d,h=Se.querySelectorAll("body > script");h.length>0?(d=h[0].parentNode)==null||d.insertBefore(c,h[0]):Se.body.appendChild(c)}};Se!=null&&Se.body?u():Se==null||Se.addEventListener("DOMContentLoaded",u)};He.__PosthogExtensions__=He.__PosthogExtensions__||{},He.__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)}lv(t,r,n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");lv(t,a,n)}},He.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);lv(t,r,n)};var aE="1.406.2";wt.DEBUG=!1,wt.LIB_VERSION=aE,wt.LIB_NAME="web",wt.JS_SDK_VERSION=aE;var c6="$people_distinct_id",tm="$device_id",uv="$device_model",cd="__alias",dd="__timers",ty="$autocapture_disabled_server_side",ny="$heatmaps_enabled_server_side",ry="$exception_capture_enabled_server_side",sy="$error_tracking_suppression_rules",iy="$error_tracking_capture_extension_exceptions",oy="$web_vitals_enabled_server_side",a2="$dead_clicks_enabled_server_side",l2="$product_tours_enabled_server_side",ay="$web_vitals_allowed_metrics",Ya="$session_recording_remote_config",d6="$replay_sample_rate",f6="$replay_override_sampling",h6="$replay_override_linked_flag",p6="$replay_override_url_trigger",m6="$replay_override_event_trigger",cu="$sesid",u2="$session_is_sampled",Ka="$enabled_feature_flags",yp="$active_feature_flags",fd="$early_access_features",ly="$feature_flag_details",_p="$feature_flag_payloads",uy="$feature_flag_request_id",nm="$minimal_flag_called_events",Vi="$override_feature_flags",iu="$override_feature_flag_payloads",za="$stored_person_properties",Ua="$stored_group_properties",cy="$surveys",rm="$surveys_loaded_at",dy="$surveys_activated",hd="ph_product_tours",_d="$flag_call_reported",fy="$flag_call_reported_session_id",hy="$feature_flag_errors",jd="$feature_flag_evaluated_at",Is="$user_state",py="$client_session_props",my="$capture_rate_limit",gy="$initial_campaign_params",vy="$initial_referrer_info",sm="$initial_person_info",im="$epp",Hh="$posthog_cookieless",g6="$cookieless_mode",v6="$sdk_debug_extensions_init_method",y6="$sdk_debug_extensions_init_time_ms",_6="$sdk_debug_recording_script_not_loaded",c2="PostHog loadExternalDependency extension not found.",Ba="on_reject",Zi="always",Zl="anonymous",ql="identified",yy="identified_only",om="visibilitychange",am="beforeunload",ou="$pageview",cv="$pageleave",dv="$identify",lE="$groupidentify";function zh(t,e){et(t)&&t.forEach(e)}function bt(t,e){if(!Xe(t))if(et(t))t.forEach(e);else if(GO(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)N8.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 wp(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 uE=function(t){try{return t()}catch{return}},DL=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){xe.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),xe.critical(s)}}},d2=function(t){var e={};return bt(t,(function(n,r){(xt(n)&&n.length>0||Vn(n))&&(e[r]=n)})),e},jL=["herokuapp.com","vercel.app","netlify.app"];function FL(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 jL)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 w6(t){return t.name==="ph_toolbar_internal"}var x6=t=>{if(Se){try{for(var e=t+"=",n=Se.cookie.split(";").filter((i=>i.length)),r=0;n.length>r;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Vn(t)&&isFinite(t)&&Math.floor(t)===t});class lm{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 lm(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 lm(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 VL{generate(){var e=this.generateOrAbort();if(!ye(e))return e;this.S=0;var n=this.generateOrAbort();if(ye(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return lm.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.M.nextUint32())}C(){this.I=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}constructor(){this.S=0,this.I=0,this.M=new $L}}var cE,b6=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};ne&&!ye(ne.crypto)&&crypto.getRandomValues&&(b6=t=>crypto.getRandomValues(t));class $L{nextUint32(){return this.R.length>this.O||(b6(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var Bi=()=>HL().toString(),HL=()=>(cE||(cE=new VL)).generate(),Zc="",zL=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,qi={N:()=>!!Se,D(t){xe.error("cookieStore error: "+t)},A:x6,F(t){var e;try{e=JSON.parse(qi.A(t))||{}}catch{}return e},q(t,e,n,r,s){if(!Se)return!1;try{var i="",a="",u=(function(h,p){if(p){var m=(function(w,_){if(_===void 0&&(_=Se),Zc)return Zc;if(!_||["localhost","127.0.0.1"].includes(w))return"";for(var x=w.split("."),E=Math.min(x.length,8),k="dmn_chk_"+Bi();!Zc&&E--;){var P=x.slice(E).join("."),T=k+"=1;domain=."+P+";path=/";_.cookie=T+";max-age=3",_.cookie.includes(k)&&(_.cookie=T+";max-age=0",Zc=P)}return Zc})(h);if(!m){var y=(w=>{var _=w.match(zL);return _?_[0]:""})(h);y!==m&&xe.info("Warning: cookie subdomain discovery mismatch",y,m),m=y}return m?"; domain=."+m:""}return""})(Se.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),i="; expires="+c.toUTCString()}s&&(a="; secure");var d=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+u+a;return d.length>3686.4&&xe.warn("cookieStore warning: large cookie, len="+d.length),Se.cookie=d,!0}catch{return!1}},P(t,e){if(Se!=null&&Se.cookie)try{qi.q(t,"",-1,e)}catch{return}}},fv=null,Et={N(){if(!cr(fv))return fv;var t=!0;if(ye(ne))t=!1;else try{var e="__mplssupport__";Et.q(e,"xyz"),Et.A(e)!=='"xyz"'&&(t=!1),Et.P(e)}catch{t=!1}return t||xe.error("localStorage unsupported; falling back to cookie store"),fv=t,t},D(t){xe.error("localStorage error: "+t)},A(t){try{return ne==null?void 0:ne.localStorage.getItem(t)}catch(e){Et.D(e)}return null},F(t){try{return JSON.parse(Et.A(t))||{}}catch{}return null},q(t,e){try{return ne==null||ne.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Et.D(n)}return!1},P(t){try{ne==null||ne.localStorage.removeItem(t)}catch(e){Et.D(e)}}},UL=[tm,"distinct_id",cu,u2,im,sm,Is],Uh={},BL={N:()=>!0,D(t){xe.error("memoryStorage error: "+t)},A:t=>Uh[t]||null,F:t=>Uh[t]||null,q:(t,e)=>(Uh[t]=e,!0),P(t){delete Uh[t]}},Aa=null,Dn={N(){if(!cr(Aa))return Aa;if(Aa=!0,ye(ne))Aa=!1;else try{var t="__support__";Dn.q(t,"xyz"),Dn.A(t)!=='"xyz"'&&(Aa=!1),Dn.P(t)}catch{Aa=!1}return Aa},D(t){xe.error("sessionStorage error: ",t)},A(t){try{return ne==null?void 0:ne.sessionStorage.getItem(t)}catch(e){Dn.D(e)}return null},F(t){try{return JSON.parse(Dn.A(t))||null}catch{}return null},q(t,e){try{return ne==null||ne.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Dn.D(n)}return!1},P(t){try{ne==null||ne.sessionStorage.removeItem(t)}catch(e){Dn.D(e)}}};class WL{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===Zi||this.isRejected()||this.consent===-1&&this.Te.cookieless_mode===Ba}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 rv(e)?1:Ge(YO,e)?0:-1}get Jt(){var e=this.Te.opt_out_capturing_persistence_type,n=e==="localStorage"?Et:qi;if(!this.Yt||this.Yt!==n){this.Yt=n;var r=e==="localStorage"?qi:Et;r.A(this.Kt)&&(this.Yt.A(this.Kt)||this.optInOut(rv(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,He.doNotTrack].some((e=>rv(e)))}}function S6(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!Ns(r))return e;try{var s=r(e);return xt(s)&&s?s:e}catch(i){return xe.error("Error in get_current_url, falling back to window.location.href",i),e}}var E6="__POSTHOG_TOOLBAR__",GL=1,KL=3,ZL=11;function dE(t){return t instanceof Element&&(t.id===E6||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Jo(t){return!!t&&t.nodeType===GL}function Wr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function C6(t){return!!t&&t.nodeType===KL}function k6(t){return!!t&&t.nodeType===ZL&&Jo(t.host)}var P6=1e3;function f2(t){return t?Km(t).split(/\s+/):[]}function fE(t,e){var n=(function(r){var s,i=ne==null||(s=ne.location)==null?void 0:s.href;return ye(i)?void 0:S6(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function um(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 f2(e)}function T6(t){return Xe(t)?null:Km(t).split(/(\s+)/).filter((e=>wd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Fd(t){var e="";return wy(t)&&!M6(t)&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;C6(n)&&n.textContent&&(e+=(r=T6(n.textContent))!==null&&r!==void 0?r:"")})),Km(e)}function hv(t){var e;return ye(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var h2=["a","button","form","input","select","textarea","label"];function _y(t,e){if(ye(e))return!0;var n,r=function(i){if(e.some((a=>(function(u,c){var d=u.matches||u.matchesSelector||u.msMatchesSelector||u.mozMatchesSelector||u.webkitMatchesSelector||u.oMatchesSelector;try{return!!d&&d.call(u,c)}catch{return!1}})(i,a))))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function R6(t){var e=t.parentNode;return!(!e||!Jo(e))&&e}var qL=[".ph-no-autocapture","[data-ph-no-autocapture]"],A6=["next","previous","prev",">","<"],YL=[...A6,"+","-","−","–"],hE=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,pE=[".ph-no-rageclick",".ph-no-capture"],XL=["","text","search","email","password","url","tel","number"];function mE(t,e){if(!ne||p2(t))return!1;var n,r,s,i,a;if(Ds(e)?(n=!!e&&pE,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:pE,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(c){return!(!c||!Jo(c))&&(!!Wr(c,"textarea")||(Wr(c,"input")?Ge(XL,(c.getAttribute("type")||"").toLowerCase()):(function(d){if(d.isContentEditable)return!0;var h=d.getAttribute==null?void 0:d.getAttribute("contenteditable");return h==="true"||h===""})(c)))})(t))return!1;var u=I6(t,!1).targetElementList;return!(function(c,d){if(c===!1||ye(c))return!1;var h;if(c===!0)h=A6;else{if(!et(c))return!1;if(c.length>10)return xe.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;h=c.map((p=>p.toLowerCase()))}return d.some((p=>{var m=p.safeText,y=p.ariaLabel;return h.some((w=>hE(m,w)||hE(y,w)))}))})(r,u.map((c=>{var d;return{safeText:Fd(c).toLowerCase(),ariaLabel:((d=c.getAttribute("aria-label"))==null?void 0:d.toLowerCase().trim())||""}})))&&!_y(u,n)}var p2=t=>!t||Wr(t,"html")||!Jo(t),I6=(t,e)=>{if(!ne||p2(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Wr(s,"body");)if(k6(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=R6(s);if(!i)break;if(e||h2.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var a=ne.getComputedStyle(i);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function wy(t){for(var e=new Set,n=0,r=t;r.parentNode&&!Wr(r,"body");r=r.parentNode){if(n++>=P6||e.has(r))return!1;e.add(r);var s=um(r);if(Ge(s,"ph-sensitive")||Ge(s,"ph-no-capture"))return!1}if(Ge(um(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 M6(t){return!!(Wr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Wr(t,"select")||Wr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var O6="(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})",QL=new RegExp("^(?:"+O6+")$"),JL=new RegExp(O6),L6="\\d{3}-?\\d{2}-?\\d{4}",eN=new RegExp("^("+L6+")$"),tN=new RegExp("("+L6+")");function wd(t,e){return e===void 0&&(e=!0),!(Xe(t)||xt(t)&&(t=Km(t),(e?QL:JL).test((t||"").replace(/[- ]/g,""))||(e?eN:tN).test(t)))}function gE(t){var e=Fd(t);return wd(e=(e+" "+N6(t)).trim())?e:""}function N6(t){var e="";return t&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Fd(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+N6(n)).trim())}catch(i){xe.error("[AutoCapture]",i)}})),e}function vE(t){return t.replace(/"|\\"/g,'\\"')}function nN(t){var e=t.attr__class;if(e)return et(e)?e:f2(e)}var Bh=Dt("[Dead Clicks]"),rN=()=>!0,sN=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(a2)),r=t.instance.config.capture_dead_clicks;return Ds(r)?r:!!Ot(r)||n};class yE{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({[a2]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.er((()=>{this.tr()})):this.stop()}er(e){var n,r;(n=He.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=He.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Bh.error("failed to load script",s):e()}))}tr(){var e;if(Se){if(!this.Xt&&(e=He.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Ot(this.instance.config.capture_dead_clicks)?de({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Xt=He.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Xt.start(Se),Bh.info("starting...")}}else Bh.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,Bh.info("stopping..."))}}var pv=Dt("[SegmentIntegration]"),D6="posthog-js";function j6(t,e){var n=e===void 0?{}:e,r=n.organization,s=n.projectId,i=n.prefix,a=n.severityAllowList,u=a===void 0?["error"]:a,c=n.sendExceptionsToPostHog,d=c===void 0||c;return h=>{var p,m,y,w,_;if(u!=="*"&&!u.includes(h.level)||!t.__loaded)return h;h.tags||(h.tags={});var x=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());h.tags["PostHog Person URL"]=x,t.sessionRecordingStarted()&&(h.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var E,k=((p=h.exception)==null?void 0:p.values)||[],P=k.map((A=>de({},A,{stacktrace:A.stacktrace?de({},A.stacktrace,{type:"raw",frames:(A.stacktrace.frames||[]).map((L=>de({},L,{platform:"web:javascript"})))}):void 0}))),T={$exception_message:((m=k[0])==null?void 0:m.value)||h.message,$exception_type:(y=k[0])==null?void 0:y.type,$exception_level:h.level,$exception_list:P,$sentry_event_id:h.event_id,$sentry_exception:h.exception,$sentry_exception_message:((w=k[0])==null?void 0:w.value)||h.message,$sentry_exception_type:(_=k[0])==null?void 0:_.type,$sentry_tags:h.tags};return r&&s&&(T.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+h.event_id),d&&((E=t.exceptions)==null||E.sendExceptionEvent(T)),h}}class iN{constructor(e,n,r,s,i,a){this.name=D6,this.setupOnce=function(u){u(j6(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)&&(xe.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=ne==null?void 0:ne.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,u=i.lastScrollY,c=i.maxScrollY,d=i.maxContentHeight,h=i.lastContentY,p=i.maxContentY;if(!(ye(a)||ye(u)||ye(c)||ye(d)||ye(h)||ye(p))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d),h=Math.ceil(h),p=Math.ceil(p);var m=a>1?li(u/a,0,1,xe):1,y=a>1?li(c/a,0,1,xe):1,w=d>1?li(h/d,0,1,xe):1,_=d>1?li(p/d,0,1,xe):1;s=Rt(s,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:m,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:y,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:w,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var mv=["flags","surveys"],oN={[c6]:{exposure:"hidden"},[cd]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[dd]:{exposure:"hidden"},[ty]:{exposure:"event"},[ny]:{exposure:"hidden"},[ry]:{exposure:"event"},[sy]:{exposure:"hidden"},[iy]:{exposure:"event"},[oy]:{exposure:"event"},[a2]:{exposure:"event"},[l2]:{exposure:"hidden"},[ay]:{exposure:"event"},[Ya]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[cu]:{exposure:"hidden"},[u2]:{exposure:"event"},[d6]:{exposure:"event",shouldSkipFromEventProperties:t=>cr(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"},[Ka]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Ot(t))return{};for(var e={},n=Object.keys(t),r=0;n.length>r;r++)e["$feature/"+n[r]]=t[n[r]];return e}},[yp]:{exposure:"event",storageGroup:"flags"},[fd]:{exposure:"hidden"},[ly]:{exposure:"hidden",storageGroup:"flags"},[_p]:{exposure:"event",storageGroup:"flags"},[uy]:{exposure:"event",storageGroup:"flags",volatile:!0},[nm]:{exposure:"hidden",storageGroup:"flags"},[Vi]:{exposure:"event"},[iu]:{exposure:"hidden"},[za]:{exposure:"hidden"},[Ua]:{exposure:"hidden"},[cy]:{exposure:"hidden",storageGroup:"surveys"},[rm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[dy]:{exposure:"event"},[hd]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[_d]:{exposure:"hidden"},[fy]:{exposure:"hidden"},[hy]:{exposure:"hidden"},[jd]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Is]:{exposure:"hidden"},[py]:{exposure:"hidden"},[my]:{exposure:"hidden"},[gy]:{exposure:"hidden"},[vy]:{exposure:"hidden"},[sm]:{exposure:"hidden"},[im]:{exposure:"hidden"},[f6]:{exposure:"event"},[h6]:{exposure:"event"},[p6]:{exposure:"event"},[m6]:{exposure:"event"},[v6]:{exposure:"event"},[y6]:{exposure:"event"},[_6]:{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"}},aN=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Ia=t=>{var e=oN[t];if(e)return e;for(var n of aN){var r=n[1];if(t.indexOf(n[0])===0)return r}},du=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return O8(t)}},Vd=t=>{var e=Se==null?void 0:Se.createElement("a");return ye(e)?null:(e.href=t,e)},Uu=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(!et(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{xe.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},$d=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],u=i[0],c=(a||"").split("&"),d=[],h=0;c.length>h;h++){var p=c[h].split("=");et(p)&&(e.includes(p[0])?d.push(p[0]+"="+n):d.push(c[h]))}var m=u;return a!=null&&(m+="?"+d.join("&")),s!=null&&(m+="#"+s),m},cm=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},F6=(t,e)=>t>=e&&A8(),V6=(t,e,n,r)=>{if(t===0){if(A8()){var s=e+1;return s===n&&r(),s}return e}return 0},Wh="https?://(.*)",Bu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],lN=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Bu],Hd="<masked>",uN=["li_fat_id"];function $6(t,e,n){if(!Se)return{};var r,s=e?[...Bu,...n||[]]:[],i=H6($d(Se.URL,s,Hd),t),a=(r={},bt(uN,(function(u){var c=x6(u);r[u]=c||null})),r);return Rt(a,i)}function H6(t,e){var n=lN.concat(e||[]),r={};return bt(n,(function(s){var i=Uu(t,s);r[s]=i||null})),r}function z6(t){var e=(function(i){return i?i.search(Wh+"google.([^/?]*)")===0?"google":i.search(Wh+"bing.com")===0?"bing":i.search(Wh+"yahoo.com")===0?"yahoo":i.search(Wh+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!cr(e)){r.$search_engine=e;var s=Se?Uu(Se.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function wE(){return navigator.language||navigator.userLanguage}var dm="$direct";function U6(){return(Se==null?void 0:Se.referrer)||dm}function B6(t,e,n){n===void 0&&(n=!1);var r=t?[...Bu,...e||[]]:[],s=n?Qo(on==null?void 0:on.href):on==null?void 0:on.href,i=s==null?void 0:s.substring(0,1e3);return{r:U6().substring(0,1e3),u:i?$d(i,r,Hd):void 0}}function W6(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?Qo(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==dm?dm:(n=Vd(r))==null?void 0:n.host};if(i){a.$current_url=i;var u=Vd(i);a.$host=u==null?void 0:u.host,a.$pathname=u==null?void 0:u.pathname;var c=H6(i);Rt(a,c)}if(r){var d=z6(r);Rt(a,d)}return a}function G6(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function cN(){try{return new Date().getTimezoneOffset()}catch{return}}var dN={flags:jd,surveys:rm},fN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Yl="main";class gv{constructor(e,n,r){if(r===void 0&&(r=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=r,this.props={},this.cr=!1,this.vr=(i=>{var a="";return i.token&&(a=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+a+"_posthog"})(e),this.Jt=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&xe.info("Persistence loaded",e.persistence,de({},this.props)),this.update_config(e,e,n),this.save(),ne){var s=()=>this.flush();Ht(ne,"beforeunload",s,{capture:!1}),Ht(ne,"pagehide",s,{capture:!1})}}mr(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Vn(n)&&n>0?n:0}isDisabled(){return!!this.yr}pr(e){fN.indexOf(e.persistence.toLowerCase())===-1&&(xe.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=(function(a,u){a===void 0&&(a=[]),u===void 0&&(u=!1);var c=[...UL,...a];return de({},Et,{F(d){try{var h={};try{h=qi.F(d)||{}}catch{}var p,m=JSON.parse(Et.A(d)||"{}");if(u){var y={};for(var w in h){var _=h[w];cr(_)||_===""||(y[w]=_)}p=Rt(m,y)}else p=Rt(h,m);return Et.q(d,p),p}catch{}return null},q(d,h,p,m,y,w){var _=Et.q(d,h,void 0,void 0,w);try{var x={};c.forEach((E=>{h[E]&&(x[E]=h[E])})),Object.keys(x).length&&qi.q(d,x,p,m,y,w)}catch(E){Et.D(E)}return _},P(d,h){try{ne==null||ne.localStorage.removeItem(d),qi.P(d,h)}catch(p){Et.D(p)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&Et.N()?(n=Et,s=!0):i==="localstorage+cookie"&&r.N()?(n=r,s=!0):i==="sessionstorage"&&Dn.N()?n=Dn:i==="memory"?n=BL: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[jd];return!r||typeof r!="number"||Date.now()-r>n}properties(){var e={};return bt(this.props,((n,r)=>{var s=Ia(r);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,r===Ka?()=>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 mv){var n=Et.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.Ir(e,n)||Rt(this.props,n)}}}Sr(e){return Object.keys(this.props).some((n=>{var r;return((r=Ia(n))==null?void 0:r.storageGroup)===e}))}Ir(e,n){var r=dN[e];if(!r)return!1;var s=n[r],i=this.props[r];return Vn(s)&&Vn(i)&&i>s}refreshKey(e){var n;if(!this.yr){var r=this.hr?(n=Ia(e))==null?void 0:n.storageGroup:void 0,s=r?Et.F(this.br(r)):this.Jt.F(this.vr);if(s&&e in s)this.Tr(e,s[e]);else{if(r){var i=this.Jt.F(this.vr);if(i&&e in i)return void this.Tr(e,i[e])}this.Mr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?ye(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),e)):this.Rr()}}flush(){ye(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,Yl))}Pr(){var e=this.Fr(),n=e.main,r=e.groups;for(var s of(this.Or(this.Jt,this.vr,n,Yl),mv)){var i,a=r[s];(!zo(a)||(i=this.lr[s])!=null&&i.persisted)&&this.Or(Et,this.br(s),a,s)}}Fr(){var e={},n={flags:{},surveys:{}};return bt(this.props,((r,s)=>{var i,a=(i=Ia(s))==null?void 0:i.storageGroup;a?n[a][s]=r:e[s]=r})),{main:e,groups:n}}Cr(e,n){if(n===Yl)return JSON.stringify(e)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return bt(e,((s,i)=>{var a;r[i]=(a=Ia(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}Or(e,n,r,s){var i=this.kr(s);if(s===Yl||i.dirty||ye(i.fingerprint)){var a;try{if((a=this.Cr(r,s))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(n,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(i.dirty=!1,s!==Yl&&(i.persisted=!0),ye(a)||(i.fingerprint=a)):this.Te.debug&&xe.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(ye(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 mv)Et.P(this.br(s));r?delete this.lr[Yl]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Ot(e)){ye(n)&&(n="None"),this.Lr=ye(r)?this.Nr:r;var s=!1;if(bt(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.Tr(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(Ot(e)){this.Lr=ye(n)?this.Nr:n;var r=!1;if(bt(e,((s,i)=>{e.hasOwnProperty(i)&&this.props[i]!==s&&(this.Tr(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Mr(e),this.save())}update_campaign_params(){if(!this.cr){var e=$6(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);zo(d2(e))||this.register(e),this.cr=!0}}update_search_keyword(){var e;this.register((e=Se==null?void 0:Se.referrer)?z6(e):{})}update_referrer_info(){var e;this.register_once({$referrer:U6(),$referring_domain:Se!=null&&Se.referrer&&((e=Vd(Se.referrer))==null?void 0:e.host)||dm},void 0)}set_initial_person_info(){this.props[gy]||this.props[vy]||this.register_once({[sm]:B6(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={};bt([vy,gy],(s=>{var i=this.props[s];i&&bt(i,(function(a,u){e["$initial_"+Z1(u)]=a}))}));var n=this.props[sm];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=W6(s,i),u={};return bt(a,(function(c,d){u["$initial_"+Z1(d)]=c})),u})(n,this.Te.disable_capture_url_hashes);Rt(e,r)}return e}safe_merge(e){return bt(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){this.Nr=this.Lr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==n.persistence||!((c,d)=>{if(c.length!==d.length)return!1;var h=[...c].sort(),p=[...d].sort();return h.every(((m,y)=>m===p[y]))})(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 u=this.props;this.clear(),this.Jt=i,this.hr=a,this.props=u,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ar&&(this.Ar=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[dd]||{};r[e]=n,this.Tr(dd,r),this.save()}remove_event_timer(e){var n=this.props[dd]||{},r=n[e];return ye(r)||(delete n[e],this.Tr(dd,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.Tr(e,n),this.save()}Tr(e,n){var r;this.props[e]=n,(r=Ia(e))!=null&&r.volatile||this.Dr(e)}Mr(e){delete this.props[e],this.Dr(e)}Dr(e){var n,r=(n=Ia(e))==null?void 0:n.storageGroup;r&&(this.kr(r).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var qc={Activation:"events",Cancellation:"cancelEvents"},vv={Popover:"popover",API:"api",Widget:"widget"},Yi={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},yv={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},xy={Popover:"popover",Inline:"inline"},hN={SHOWN:"product tour shown"},xE={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},bE=Dt("[RateLimiter]");class pN{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=>{bE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void bE.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,u=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(my))!==null&&n!==void 0?n:{tokens:i,last:u};c.tokens+=(u-c.last)/1e3*a,c.last=u,c.tokens>i&&(c.tokens=i);var d=1>c.tokens;return d||e||(c.tokens=Math.max(0,c.tokens-1)),!d||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=d,(s=this.instance.persistence)==null||s.set_property(my,c),{isRateLimited:d,remainingTokens:c.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Yc=Dt("[RemoteConfig]");class K6{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=He._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}qr(e){var n,r;(n=He.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=He.__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 Yc.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void Yc.warn("Remote config is disabled. Falling back to local config.");this.qr((e=>{if(!e)return Yc.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){Yc.error("Error loading remote config",e)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&Se&&Se.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.zr=setInterval((()=>{this.refresh()}),n))}}Hr(e){var n;e||Yc.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 ir={GZipJS:"gzip-js",Base64:"base64"},ms=Uint8Array,kr=Uint16Array,Wu=Uint32Array,m2=new ms([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]),g2=new ms([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]),SE=new ms([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Z6=function(t,e){for(var n=new kr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new Wu(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]},q6=Z6(m2,2),by=q6[1];q6[0][28]=258,by[258]=28;for(var EE=Z6(g2,0)[1],Y6=new kr(32768),Nt=0;32768>Nt;++Nt){var Xl=(43690&Nt)>>>1|(21845&Nt)<<1;Y6[Nt]=((65280&(Xl=(61680&(Xl=(52428&Xl)>>>2|(13107&Xl)<<2))>>>4|(3855&Xl)<<4))>>>8|(255&Xl)<<8)>>>1}var xd=function(t,e,n){for(var r=t.length,s=0,i=new kr(e);r>s;++s)++i[t[s]-1];var a,u=new kr(e);for(s=0;e>s;++s)u[s]=u[s-1]+i[s-1]<<1;for(a=new kr(r),s=0;r>s;++s)a[s]=Y6[u[t[s]-1]++]>>>15-t[s];return a},yl=new ms(288);for(Nt=0;144>Nt;++Nt)yl[Nt]=8;for(Nt=144;256>Nt;++Nt)yl[Nt]=9;for(Nt=256;280>Nt;++Nt)yl[Nt]=7;for(Nt=280;288>Nt;++Nt)yl[Nt]=8;var fm=new ms(32);for(Nt=0;32>Nt;++Nt)fm[Nt]=5;var mN=xd(yl,9),gN=xd(fm,5),X6=function(t){return(t/8>>0)+(7&t&&1)},Q6=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof kr?kr:t instanceof Wu?Wu:ms)(n-e);return r.set(t.subarray(e,n)),r},Ai=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},Xc=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},_v=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 ms(0),0];if(s==1){var a=new ms(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(A,L){return A.f-L.f})),n.push({s:-1,f:25001});var u=n[0],c=n[1],d=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=s-1;)u=n[n[p].f>n[d].f?d++:p++],c=n[d!=h&&n[p].f>n[d].f?d++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var y=new kr(m+1),w=Sy(n[h-1],y,0);if(w>e){r=0;var _=0,x=w-e,E=1<<x;for(i.sort((function(A,L){return y[L.s]-y[A.s]||A.f-L.f}));s>r;++r){var k=i[r].s;if(e>=y[k])break;_+=E-(1<<w-y[k]),y[k]=e}for(_>>>=x;_>0;){var P=i[r].s;e>y[P]?_-=1<<e-y[P]++-1:++r}for(;r>=0&&_;--r){var T=i[r].s;y[T]==e&&(--y[T],++_)}w=e}return[new ms(y),w]},Sy=function(t,e,n){return t.s==-1?Math.max(Sy(t.l,e,n+1),Sy(t.r,e,n+1)):e[t.s]=n},CE=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(c){n[r++]=c},u=1;e>=u;++u)if(t[u]==s&&u!=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[u]}return[n.subarray(0,r),e]},Qc=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},Ey=function(t,e,n){var r=n.length,s=X6(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,u,c,d,h){Ai(e,h++,n),++s[256];for(var p=_v(s,15),m=p[0],y=p[1],w=_v(i,15),_=w[0],x=w[1],E=CE(m),k=E[0],P=E[1],T=CE(_),A=T[0],L=T[1],O=new kr(19),R=0;k.length>R;++R)O[31&k[R]]++;for(R=0;A.length>R;++R)O[31&A[R]]++;for(var M=_v(O,7),N=M[0],j=M[1],F=19;F>4&&!N[SE[F-1]];--F);var q,G,W,K,X=d+5<<3,$=Qc(s,yl)+Qc(i,fm)+a,ee=Qc(s,m)+Qc(i,_)+a+14+3*F+Qc(O,N)+(2*O[16]+3*O[17]+7*O[18]);if($>=X&&ee>=X)return Ey(e,h,t.subarray(c,c+d));if(Ai(e,h,1+($>ee)),h+=2,$>ee){q=xd(m,y),G=m,W=xd(_,x),K=_;var z=xd(N,j);for(Ai(e,h,P-257),Ai(e,h+5,L-1),Ai(e,h+10,F-4),h+=14,R=0;F>R;++R)Ai(e,h+3*R,N[SE[R]]);h+=3*F;for(var D=[k,A],Y=0;2>Y;++Y){var te=D[Y];for(R=0;te.length>R;++R)Ai(e,h,z[ie=31&te[R]]),h+=N[ie],ie>15&&(Ai(e,h,te[R]>>>5&127),h+=te[R]>>>12)}}else q=mN,G=yl,W=gN,K=fm;for(R=0;u>R;++R)if(r[R]>255){var ie;Xc(e,h,q[257+(ie=r[R]>>>18&31)]),h+=G[ie+257],ie>7&&(Ai(e,h,r[R]>>>23&31),h+=m2[ie]);var ae=31&r[R];Xc(e,h,W[ae]),h+=K[ae],ae>3&&(Xc(e,h,r[R]>>>5&8191),h+=g2[ae])}else Xc(e,h,q[r[R]]),h+=G[r[R]];return Xc(e,h,q[256]),h+G[256]},vN=new Wu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),yN=(function(){for(var t=new Wu(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),wv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function _N(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(m){for(var y=p,w=0;m.length>w;++w)y=yN[255&y^m[w]]^y>>>8;p=y},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,a,u,c,d=(u=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(p,m,y,w,_,x){var E=p.length,k=new ms(w+E+5*(1+Math.floor(E/7e3))+_),P=k.subarray(w,k.length-_),T=0;if(!m||8>E)for(var A=0;E>=A;A+=65535){var L=A+65535;E>L?T=Ey(P,T,p.subarray(A,L)):(P[A]=!0,T=Ey(P,T,p.subarray(A,E)))}else{for(var O=vN[m-1],R=O>>>13,M=8191&O,N=(1<<y)-1,j=new kr(32768),F=new kr(N+1),q=Math.ceil(y/3),G=2*q,W=function(_t){return(p[_t]^p[_t+1]<<q^p[_t+2]<<G)&N},K=new Wu(25e3),X=new kr(288),$=new kr(32),ee=0,z=0,D=(A=0,0),Y=0,te=0;E>A;++A){var ie=W(A),ae=32767&A,ue=F[ie];if(j[ae]=ue,F[ie]=ae,A>=Y){var Ce=E-A;if((ee>7e3||D>24576)&&Ce>423){T=kE(p,P,0,K,X,$,z,D,te,A-te,T),D=ee=z=0,te=A;for(var oe=0;286>oe;++oe)X[oe]=0;for(oe=0;30>oe;++oe)$[oe]=0}var se=2,he=0,Pe=M,be=ae-ue&32767;if(Ce>2&&ie==W(A-be))for(var $e=Math.min(R,Ce)-1,ot=Math.min(32767,A),Zt=Math.min(258,Ce);ot>=be&&--Pe&&ae!=ue;){if(p[A+se]==p[A+se-be]){for(var ge=0;Zt>ge&&p[A+ge]==p[A+ge-be];++ge);if(ge>se){if(se=ge,he=be,ge>$e)break;var gt=Math.min(be,ge-2),dt=0;for(oe=0;gt>oe;++oe){var je=A-be+oe+32768&32767,Je=je-j[je]+32768&32767;Je>dt&&(dt=Je,ue=je)}}}be+=(ae=ue)-(ue=j[ae])+32768&32767}if(he){K[D++]=268435456|by[se]<<18|EE[he];var it=31&by[se],Ze=31&EE[he];z+=m2[it]+g2[Ze],++X[257+it],++$[Ze],Y=A+se,++ee}else K[D++]=p[A],++X[p[A]]}}T=kE(p,P,!0,K,X,$,z,D,te,A-te,T)}return Q6(k,0,w+X6(T)+_)})(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,u,c)),h=d.length;return(function(p,m){var y=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&&wv(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),y){p[3]=8;for(var w=0;y.length>=w;++w)p[w+10]=y.charCodeAt(w)}})(d,e),wv(d,h-8,n.d()),wv(d,h-4,r),d}var wN=!!W1||!!t2,J6="text/plain",xp=!1,Cy=(t,e)=>{var n=t.split("#"),r=n[1],s=n[0].split("?"),i=s[0],a=s[1];if(!a)return t;var u=a.split("&").filter((c=>c.split("=")[0]!==e)).join("&");return i+(u?"?"+u:"")+(r?"#"+r:"")},v2=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],a=s[1],u=de({},e),c=(r=a==null?void 0:a.split("&").map((h=>{var p,m=h.split("="),y=m[0],w=n&&(p=u[y])!==null&&p!==void 0?p:m[1];return delete u[y],y+"="+w})))!==null&&r!==void 0?r:[],d=(function(h,p){var m,y;p===void 0&&(p="&");var w=[];return bt(h,(function(_,x){ye(_)||ye(x)||x==="undefined"||(m=encodeURIComponent((E=>E instanceof File)(_)?_.name:_.toString()),y=encodeURIComponent(x),w[w.length]=y+"="+m)})),w.join(p)})(u);return d&&c.push(d),i+"?"+c.join("&")},xv=t=>{if(t.Vr)return t.Vr;var e=t.data,n=t.compression;if(e){if(n===ir.GZipJS){var r=_N((function(u,c){var d=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var h=new ms(u.length+(u.length>>>1)),p=0,m=function(x){h[p++]=x},y=0;d>y;++y){if(p+5>h.length){var w=new ms(p+8+(d-y<<1));w.set(h),h=w}var _=u.charCodeAt(y);128>_?m(_):2048>_?(m(192|_>>>6),m(128|63&_)):_>55295&&57344>_?(m(240|(_=65536+(1047552&_)|1023&u.charCodeAt(++y))>>>18),m(128|_>>>12&63),m(128|_>>>6&63),m(128|63&_)):(m(224|_>>>12),m(128|_>>>6&63),m(128|63&_))}return Q6(h,0,p)})(du(e)),{mtime:0});return{contentType:J6,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===ir.Base64){var s=(function(u){return u&&btoa(encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,((c,d)=>String.fromCharCode(parseInt(d,16)))))})(du(e)),i=(u=>"data="+encodeURIComponent(typeof u=="string"?u:du(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=du(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},eP=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:v2(t.url,{compression:ir.Base64}),encodedBody:xv(de({},t,{compression:ir.Base64,Vr:void 0}))}:{url:Cy(t.url,"compression"),encodedBody:xv(de({},t,{compression:void 0,Vr:void 0}))};try{e=xv(t)}catch(s){if(YS(t.compression,Uu(t.url,"compression")))return xe.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&YS(t.compression,Uu(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?G1(new Uint8Array(n)):ArrayBuffer.isView(n)&&G1(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(xp=!0,r()):{url:t.url,encodedBody:e}},tP=t=>{try{return eP(t)}catch(e){return xe.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},xN=(function(){var t=Jt((function*(e){var n=du(e.data),r=yield(function(i,a,u){return K1.apply(this,arguments)})(n,wt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return de({},e,{Vr:{contentType:J6,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),bN=/Failed to fetch|NetworkError|Load failed/i,nP=t=>{var e=tP(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},i=s.contentType,a=s.body,u=s.estimatedSize,c=new Headers;bt(t.headers,(function(w,_){c.append(_,w)})),i&&c.append("Content-Type",i);var d=null,h=!1;if(US){var p=new US;d={signal:p.signal,timeout:setTimeout((()=>{var w,_;h=!0,p.abort((w=t.timeout,(_=new Error("PostHog request timed out"+(w?" after "+w+"ms":""))).name="AbortError",_))}),t.timeout)}}var m=w=>{h&&(w==null?void 0:w.name)==="AbortError"||(_=>(_==null?void 0:_.name)==="TypeError"&&bN.test((_==null?void 0:_.message)||""))(w)?xe.warn(w):xe.error(w),t.callback==null||t.callback({statusCode:0,error:w})};try{var y;t2(n,de({method:(t==null?void 0:t.method)||"GET",headers:c,keepalive:t.method==="POST"&&!t.Wr&&52428.8>(u||0),body:a,signal:(y=d)==null?void 0:y.signal},t.fetchOptions)).then((w=>w.text().then((_=>{var x={statusCode:w.status,text:_};if(w.status===200)try{x.json=JSON.parse(_)}catch(E){xe.error(E)}t.callback==null||t.callback(x)})))).catch(m).finally((()=>d?clearTimeout(d.timeout):null))}catch(w){d&&clearTimeout(d.timeout),m(w)}}},ky=t=>{try{var e=eP(t),n=e.url,r=e.encodedBody,s=r??{},i=s.body,a=s.estimatedSize;if(!i)return;var u=i instanceof Blob?i:new Blob([i],{type:s.contentType});if(or.sendBeacon(n,u))return;if(et(t.data)&&t.data.length>1&&(a??0)>16384){var c=Math.ceil(t.data.length/2);return ky(de({},t,{data:t.data.slice(0,c)})),void ky(de({},t,{data:t.data.slice(c)}))}xe.warn("Beacon of ~"+(a??0)+" bytes was rejected by the browser, falling back to fetch"),nP(de({},t,{Wr:!0}))}catch(d){xe.warn("Beacon send failed",d)}},SN=["/e/","/s/"],PE=(t,e)=>{var n=(s=>{var i=(a=>{var u=Vd(a),c=(u==null?void 0:u.pathname)||a.split(/[?#]/)[0];return c?c[0]==="/"?c:"/"+c:"/"})(s);return SN.some((a=>((u,c)=>u.slice(u.length-c.length)===c)(i,a)))})(t),r=n?Cy(t,"ver"):t;return v2(e===ir.GZipJS?Cy(r,"compression"):r,de({_:new Date().getTime().toString()},n?{}:{ver:wt.JS_SDK_VERSION},e===ir.GZipJS?{}:{compression:e}))},bp=[];t2&&bp.push({transport:"fetch",method:nP}),W1&&bp.push({transport:"XHR",method(t){var e=tP(t);if(e){var n=new W1,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,a=s.body;bt(t.headers,(function(u,c){n.setRequestHeader(c,u)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(u)}},n.send(a)}}}),or!=null&&or.sendBeacon&&bp.push({transport:"sendBeacon",method:ky});var Py=3e3;class EN{constructor(e,n){this.Zr=!0,this.Gr=[],this.Qr=li((n==null?void 0:n.flush_interval_ms)||Py,250,5e3,xe.createLogger("flush interval"),Py),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(de({},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&&et(i.data)&&bt(i.data,(u=>{u.offset=Math.abs(u.timestamp-a),delete u.timestamp})),e.ti(i)};for(var s in n)r()}}),this.Qr))}ti(e){try{this.Jr(e)}catch(n){xe.error(n)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ei(){var e={};return bt(this.Gr,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;ye(e[i])&&(e[i]=de({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.Gr=[],e}}var CN=["retriesPerformedSoFar"];class kN{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!ye(ne)&&"onLine"in ne.navigator&&(this.ni=ne.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},Ht(ne,"online",this.si),Ht(ne,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=I8(e,CN);Fi(n)&&(r.url=v2(r.url,{retry_count:n})),this._instance._send_request(de({},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(de({retriesPerformedSoFar:n},r));s.statusCode===0&&xe.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 u=3e3*Math.pow(2,a),c=u/2,d=Math.min(18e5,u),h=Math.random()-.5;return Math.ceil(d+h*(d-c))})(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)"),xe.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,ye(ne)||(this.si&&(ne.removeEventListener("online",this.si),this.si=void 0),this.ai&&(ne.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var n=e.requestOptions;try{this._instance._send_request(de({},n,{transport:"sendBeacon"}))}catch(r){xe.error(r)}}this.Gr=[]}}class PN{constructor(e){this.hi=()=>{var n,r,s,i;this.di||(this.di={});var a=this.scrollElement(),u=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=u+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this.di.lastScrollY=Math.ceil(u),this.di.maxScrollY=Math.max(u,(n=this.di.maxScrollY)!==null&&n!==void 0?n:0),this.di.maxScrollHeight=Math.max(c,(r=this.di.maxScrollHeight)!==null&&r!==void 0?r:0),this.di.lastContentY=d,this.di.maxContentY=Math.max(d,(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(ne,"scroll",this.hi,{capture:!0}),Ht(ne,"scrollend",this.hi,{capture:!0}),Ht(ne,"resize",this.hi)}scrollElement(){if(!this.ci)return ne==null?void 0:ne.document.documentElement;var e=et(this.ci)?this.ci:[this.ci];for(var n of e){var r=ne==null?void 0:ne.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 ne?e==="y"?ne.scrollY||ne.pageYOffset||ne.document.documentElement.scrollTop||0:ne.scrollX||ne.pageXOffset||ne.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var TN=t=>B6(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 TE{constructor(e,n,r,s){this.fi=i=>{var a=this.pi();if(!a||a.sessionId!==i){var u={sessionId:i,props:this.gi(this._instance)};this.mi.register({[py]:u})}},this._instance=e,this.yi=n,this.mi=r,this.gi=s||TN,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[py]}getSetOnceProps(){var e,n=(e=this.pi())==null?void 0:e.props;return n?"r"in n?W6(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 bt(d2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Z1(r)]=n})),e}}class y2{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 Jc=Dt("[SessionId]");class RE{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 y2,this.Ii=(d,h)=>!(!Fi(d)||!Fi(h))&&Math.abs(d-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Zi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ti=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=n||Bi,this.Ri=r||Bi;var i=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*li(this.Te.session_idle_timeout_seconds||1800,60,36e3,Jc.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+i+"_window_id",this.Fi="ph_"+i+"_primary_window_exists",this.Li()){var a=Dn.F(this.Oi),u=Dn.F(this.Fi);a&&!u?this.Ti=a:Dn.P(this.Oi),Dn.q(this.Fi,!0)}if((s=this.Te.bootstrap)!=null&&s.sessionID)try{var c=(d=>{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(),c)}catch(d){Jc.error("Invalid sessionID in bootstrap",d)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ye(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ti),()=>{this.ki=this.ki.filter((n=>n!==e))}}Li(){return this.Te.persistence!=="memory"&&!this.mi.yr&&Dn.N()}Ni(e){e!==this.Ti&&(this.Ti=e,this.Li()&&Dn.q(this.Oi,e))}Di(){return this.Ti?this.Ti:this.Li()?Dn.F(this.Oi):null}qi(e){var n=this.xi;return!cr(n)&&!cr(e)&&5e3>Math.abs(e-n)}$i(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Mi=e,i&&!s||i&&this.qi(n)||(this.xi=n,this.mi.register({[cu]:[n,e,r]}))}ji(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Fi(n)&&n>0}Hi(){this.ji()?this.mi.refreshKey(cu):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!cr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var n=this.Ui();n[1]===this.Mi&&n[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[cu]:[this._sessionActivityTimestamp,(e=this.Mi)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],n=Fi(e)?e:0,r=Fi(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}Vi(e){return this.Hi(),this.Ii(e,this.zi())}Ui(){var e=this.mi.props[cu];return et(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&&ne&&(ne.removeEventListener(am,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&Dn.P(this.Fi)},Ht(ne,am,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Te.cookieless_mode===Zi)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],u=this.zi(),c=this.Di(),d=Fi(a)&&Math.abs(r-a)>864e5,h=!1,p=!1,m=!i,y=i,w=!m&&!e&&this.Ii(r,u);if(w){(w=this.Vi(r))||Jc.info("cross-tab refresh kept the session alive",{sessionId:i});var _=this.Ui();i=_[1],a=_[2]}m||w||d?(i=this.Ei(),c=this.Ri(),Jc.info("new session ID generated",{sessionId:i,windowId:c,changeReason:{noSessionId:m,activityTimeout:w,sessionPastMaximumLength:d}}),a=r,h=!0):(c||(c=this.Ri(),h=!0),(p=i!==y)&&(Jc.info("adopted cross-tab session id",{sessionId:i,windowId:c}),h=!0));var x=Fi(u)&&e&&!d?u:r,E=Fi(a)?a:new Date().getTime();this.Ni(c),this.$i(i,x,E),e||this.Pi();var k={noSessionId:m,activityTimeout:w,sessionPastMaximumLength:d,crossTabAdoption:p};return h&&this.ki.forEach((P=>P(i,c,k))),{sessionId:i,windowId:c,sessionStartTimestamp:E,changeReason:h?k:void 0,lastActivityTimestamp:u}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout((()=>{if(!this.Ci)if(this.Vi(new Date().getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var rP=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&QS(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>QS(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function sP(){return(sP=Jt((function*(){var t=or==null?void 0:or.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return xt(n)&&n.length>0?n:void 0}catch(r){return void xe.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var hm=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 AE(t,e,n){return du({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var iP={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=>hm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!hm(n,r))))),icontains:(t,e)=>e.map(Gh).some((n=>t.map(Gh).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Gh).every((n=>t.map(Gh).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)))}))},Gh=t=>t.toLowerCase();function oP(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(ye(s)||cr(s))return!1;var i=[String(s)],a=iP[r.operator];return!!a&&a(r.values,i)}))}var Ty="custom",IE="i.posthog.com",RN=/^\/static\//;class AN{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("."+IE,".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":Ty),this.Zi[this.apiHost]}Gi(e){if(RN.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===Ty)return this.apiHost+n;var s=IE+n;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}function aP(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var yt=Dt("[Surveys]"),lP="seenSurvey_",uP=t=>{try{var e=(n=>((r,s)=>""+lP+(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)}},IN=[vv.Popover,vv.Widget,vv.API],MN={ignoreConditions:!1,ignoreDelay:!1,displayType:xy.Popover},ON=Dt("[PostHog ExternalIntegrations]"),LN={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class NN{constructor(e){this._instance=e}er(e,n){var r;(r=He.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return ON.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var i,a,u,c=r[0],d=r[1];!d||(i=He.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[c]||e.er(LN[c],(()=>{var h;(h=He.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[c])==null||h.start(e._instance)})),!d&&(a=He.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[c]&&((u=He.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[c])==null||u.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}var bd={},bv=0,pm=()=>{},ME='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ed="Surveys module not available",OE="sanitize_properties is deprecated. Use before_send instead",cP="Invalid value for property_denylist config: ",DN=["token","distinct_id",g6],au="posthog",dP=!wN&&(br==null?void 0:br.indexOf("MSIE"))===-1&&(br==null?void 0:br.indexOf("Mozilla"))===-1,Sv=t=>{var e;return de({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:FL(Se==null?void 0:Se.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:pm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:on&&xt(on==null?void 0:on.search)&&on.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(ne==null||(e=ne.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){xe.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:yy,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Py},error_tracking:{},_onCapture:pm},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:YL,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))},jN=[["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"]],LE=t=>{var e={};for(var n of jN){var r=n[0],s=n[1];ye(t[r])||(e[s]=t[r])}var i=Rt({},e,t),a=t.__preview_external_dependency_versioned_paths;return ye(a)||(ye(t.strict_script_versioning)&&(i.strict_script_versioning=!!a),xt(a)&&ye(t.asset_host)&&(i.asset_host=a)),et(t.property_blacklist)&&(ye(t.property_denylist)?i.property_denylist=t.property_blacklist:et(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:xe.error(cP+t.property_denylist)),i};class FN{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){xe.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ds{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===Zi||this.config.cookieless_mode===Ba&&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 FN,this.Xi=!1,this.version=wt.LIB_VERSION,this.en=new y2,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Sv(),this.SentryIntegration=iN,this.sentryIntegration=r=>(function(s,i){var a=j6(s,i);return{name:D6,processEvent:u=>a(u)}})(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 PN(this),this.pageViewManager=new _E(this),this.rateLimiter=new pN(this),this.requestRouter=new AN(this),this.consent=new WL(this),this.externalIntegrations=new NN(this);var n=(e=ds.__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=>xe.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==au){var s,i=(s=bd[r])!==null&&s!==void 0?s:new ds;return i._init(e,n,r),bd[r]=i,bd[au][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 xe.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=Sv(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 u=Sv(n.defaults),c=LE(n),d=Rt({},u,c,{name:r,token:a});Ot(u.rageclick)&&Ot(c.rageclick)&&(d.rageclick=Rt({},u.rageclick,c.rageclick)),Ot(u.session_recording)&&Ot(c.session_recording)&&(d.session_recording=Rt({},u.session_recording,c.session_recording)),this.set_config(d),this.config.on_xhr_error&&xe.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 gv(this.config,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new gv(de({},this.config,{persistence:"sessionStorage"}),h,!1);var p=de({},this.persistence.props),m=de({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.dn=new EN((T=>this.cn(T)),this.config.request_queue_config),this.vn=new kN(this),this.__request_queue=[];var y=this.Yi();if(y||(this.sessionManager=new RE(this),this.sessionPropsManager=new TE(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(xe.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.fn(y)}),0)):(xe.info("Initializing extensions synchronously"),this.fn(y)),wt.DEBUG=wt.DEBUG||this.config.debug,wt.DEBUG&&xe.info("Starting in debug mode",{this:this,config:n,thisC:de({},this.config),p,s:m}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=de({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var w=n.bootstrap.distinctID,_=this.get_distinct_id(),x=this.persistence.get_property(Is);if(n.bootstrap.isIdentifiedID&&_!=null&&_!==w&&x===Zl)this.identify(w);else if(n.bootstrap.isIdentifiedID&&_!=null&&_!==w&&x===ql)xe.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 E=this.config.get_device_id(Bi()),k=n.bootstrap.isIdentifiedID?E:w;this.persistence.set_property(Is,n.bootstrap.isIdentifiedID?ql:Zl),this.register({distinct_id:w,$device_id:k})}}if(y)this.register_once({distinct_id:Hh,$device_id:null},"");else if(!this.get_distinct_id()){var P=this.config.get_device_id(Bi());this.register_once({distinct_id:P,$device_id:P},""),this.persistence.set_property(Is,Zl)}return Ht(ne,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(T,A){var L=T.config.segment;if(!L)return A();(function(O,R){var M=O.config.segment;if(!M)return R();var N=F=>{var q=()=>F.anonymousId()||Bi();O.config.get_device_id=q,F.id()&&(O.register({distinct_id:F.id(),$device_id:q()}),O.persistence.set_property(Is,ql)),R()},j=M.user();"then"in j&&Ns(j.then)?j.then(N):N(j)})(T,(()=>{L.register((O=>{typeof Promise<"u"&&Promise.resolve||pv.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===O.get_distinct_id()||(pv.info("No userId set, resetting PostHog"),O.reset()),M.event.userId&&M.event.userId!==O.get_distinct_id()&&(pv.info("UserId set, identifying with PostHog"),O.identify(M.event.userId));var j=O.calculateEventProperties(N,M.event.properties);return M.event.properties=Object.assign({},j,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,ou),identify:M=>R(M,dv),screen:M=>R(M,"$screen")}})(T)).then((()=>{A()}))}))})(this,(()=>this.pn())):this.pn(),Ns(this.config._onCapture)&&this.config._onCapture!==pm&&(xe.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(T=>this.config._onCapture(T.event,T)))),this.config.ip&&xe.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 sP.apply(this,arguments)})().then((T=>{T&&this.register({[uv]:T})})).catch(pm),this}fn(e){var n,r,s,i,a,u,c,d,h=performance.now(),p=de({},ds.__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=(u=this.conversations)!==null&&u!==void 0?u: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,sN)),p.toolbar&&this.Ki.push(this.toolbar=(c=this.toolbar)!==null&&c!==void 0?c:new p.toolbar(this)),p.experiments&&this.Ki.push(this.experiments=(d=this.experiments)!==null&&d!==void 0?d:new p.experiments(this)),this.Ki.forEach((y=>{y.initialize&&m.push((()=>{y.initialize==null||y.initialize()}))})),m.push((()=>{if(this.gn){var y=this.gn;this.gn=void 0,this.Hr(y)}})),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){xe.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[v6]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[y6]:s}),this.config.__preview_deferred_init_extensions&&xe.info("PostHog extensions initialized ("+s+"ms)")}Hr(e){if(!Se||!Se.body)return xe.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:yy}),this.Ki.forEach((s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e)))}pn(){try{this.config.loaded(this)}catch(r){xe.critical("`loaded` function failed",r)}if(this.bn(),this.config.internal_or_test_user_hostname&&on!=null&&on.hostname){var e=on.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()}),1),this.wn=new K6(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()&&zh(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(cv),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.dn)==null||s.unload(),(i=this.vn)==null||i.unload()):this.xn()&&this.capture(cv,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?dP?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=de({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(ye(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=de({},n);a.timeout=a.timeout||6e4;var u=(r=a.transport)!==null&&r!==void 0?r:"fetch";u==="sendBeacon"&&ye(a.compression)&&a.data&&(a.compression=ir.Base64),a.url=PE(a.url,a.compression);var c=bp.filter((h=>!a.disableTransport||!h.transport||!a.disableTransport.includes(h.transport))),d=(s=(i=(function(h,p){for(var m=0;h.length>m;m++)if(h[m].transport===u)return h[m]})(c))==null?void 0:i.method)!==null&&s!==void 0?s:c[0].method;if(!d)throw new Error("No available transport method");u!=="sendBeacon"&&a.data&&a.compression===ir.GZipJS&&$O&&typeof Promise<"u"&&!xp?xN(a).then((h=>{d(h)})).catch((h=>{if(XS(h))return xp=!0,void d(de({},a,{compression:void 0,url:PE(n.url,void 0)}));(p=>{if(!p||typeof p!="object")return!1;var m="name"in p?String(p.name):"";return XS(p)||m===M8})(h)&&(xp=!0),d(a)})):d(a)})(de({},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){bv++;try{var n,r=[],s=[],i=[];zh(e,(u=>{if(u)if(et(n=u[0]))i.push(u);else if(Ns(u))try{u.call(this)}catch(c){xe.error("Error executing queued PostHog call",u,c)}else et(u)&&n==="alias"?r.push(u):et(u)&&n.indexOf("capture")!==-1&&Ns(this[n])?i.push(u):s.push(u)}));var a=function(u,c){zh(u,(function(d){try{if(et(d[0])){var h=c;bt(d,(function(p){h=h[p[0]].apply(h,p.slice(1))}))}else c[d[0]].apply(c,d.slice(1))}catch(p){xe.error("Error executing queued PostHog call",d,p)}}))};a(r,this),a(s,this),a(i,this)}finally{bv--}}push(e){if(bv>0&&et(e)&&xt(e[0])){var n=ds.prototype[e[0]];Ns(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s,i,a,u,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!ye(e)&&xt(e)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||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)&&(xe.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||xe.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,y=nE(r==null?void 0:r.uuid,Bi),w={uuid:y,event:e,properties:this.calculateEventProperties(e,n||{},m,y)};e===ou&&this.config.__preview_capture_bot_pageviews&&d&&(w.event="$bot_pageview",w.properties.$browser_type="bot"),h&&(w.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens);var _=e==="$feature_flag_called"&&w.properties.$feature_flag_has_experiment===!1&&this.get_property(nm)===!0;r!=null&&r.$set&&!_&&(w.$set=r==null?void 0:r.$set);var x=r==null?void 0:r.$unset;x&&(w.$unset=x);var E,k,P,T=_?void 0:this.Sn(r==null?void 0:r.$set_once,e!==lE,e===dv);if(T&&(w.$set_once=T),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=w,u=j=>xt(j)?j.slice(0,i):j,c=new Set,w=(function j(F,q){if(F!==Object(F))return u?u(F):F;if(!c.has(F)){var G;if(c.add(F),et(F))G=[],zh(F,(K=>{G.push(j(K))}));else{var W={};bt(F,((K,X)=>{c.has(K)||(W[X]=j(K))})),G=W}return G}})(a)),w.timestamp=m,ye(r==null?void 0:r.timestamp)||(w.properties.$event_time_override_provided=!0,w.properties.$event_time_override_system_time=p),_&&(w.properties=(function(j,F){F===void 0&&(F=[]);var q={},G=W=>{j[W]!==void 0&&(q[W]=j[W])};return HO.forEach(G),F.forEach(G),q})(w.properties,DN)),e===Yi.DISMISSED||e===Yi.SENT){var A=n==null?void 0:n[yv.SURVEY_ID],L=n==null?void 0:n[yv.SURVEY_ITERATION];uP({id:A,current_iteration:L}),w.$set=de({},w.$set,{[(E={id:A,current_iteration:L},k=e===Yi.SENT?"responded":"dismissed",P="$survey_"+k+"/"+E.id,E.current_iteration&&E.current_iteration>0&&(P="$survey_"+k+"/"+E.id+"/"+E.current_iteration),P)]:!0})}else e===Yi.SHOWN&&(w.$set=de({},w.$set,{[yv.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===hN.SHOWN){var O=n==null?void 0:n[xE.TOUR_TYPE];O&&(w.$set=de({},w.$set,{[xE.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var R=de({},w.properties.$set,w.$set);if(zo(R)||this.setPersonPropertiesForFlags(R),!Xe(this.config.before_send)){var M=this.wt(w);if(!M)return;(w=M).uuid=nE(w.uuid,Bi)}this.en.emit("eventCaptured",w);var N={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:w,compression:"best-available",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(N):this.dn.enqueue(N),w}xe.critical("This capture call is ignored due to client rate limiting.")}}else xe.error("No event name provided to posthog.capture")}else xe.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),u=de({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Yi()&&(u[g6]=!0),e==="$snapshot"){var c=de({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=c.distinct_id,(!xt(u.distinct_id)&&!Vn(u.distinct_id)||q1(u.distinct_id))&&xe.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d,h=(function(P,T,A,L){var O,R,M,N;if(L===void 0&&(L=!1),!br)return{};var j,F=P?[...Bu,...T||[]]:[],q=(function($e){for(var ot=0;eE.length>ot;ot++){var Zt=eE[ot],ge=Zt[1],gt=Zt[0].exec($e),dt=gt&&(Ns(ge)?ge(gt,$e):ge);if(dt)return dt}return["",""]})(br),G=q[0],W=q[1],K=(j=typeof navigator<"u"?navigator:void 0)!=null&&j.brave?{brave:!0}:{},X={};ye(A)||(X.detectGoogleSearchApp=A);var $={},ee=(O=navigator)==null||(O=O.userAgentData)==null?void 0:O.platform,z=(R=navigator)==null?void 0:R.maxTouchPoints,D=ne==null||(M=ne.screen)==null?void 0:M.width,Y=ne==null||(N=ne.screen)==null?void 0:N.height,te=ne==null?void 0:ne.devicePixelRatio;ye(ee)||($.userAgentDataPlatform=ee),ye(z)||($.maxTouchPoints=z),ye(D)||($.screenWidth=D),ye(Y)||($.screenHeight=Y),ye(te)||($.devicePixelRatio=te);var ie,ae,ue,Ce,oe,se,he,Pe,be=Rt(d2({$os:G,$os_version:W,$browser:n6(br,navigator.vendor,K,X),$device:tE(br),$device_type:(ae=br,ue=$,Pe=tE(ae),Pe===F8||Pe===j8||Pe==="Kobo"||Pe==="Kindle Fire"||Pe===X8?$u:Pe===Nd||Pe===yu||Pe===Dd||Pe===X1?"Console":Pe===$8?"Wearable":Pe?Zr:(ue==null?void 0:ue.userAgentDataPlatform)==="Android"&&((Ce=ue==null?void 0:ue.maxTouchPoints)!==null&&Ce!==void 0?Ce:0)>0?600>Math.min((oe=ue==null?void 0:ue.screenWidth)!==null&&oe!==void 0?oe:0,(se=ue==null?void 0:ue.screenHeight)!==null&&se!==void 0?se:0)/((he=ue==null?void 0:ue.devicePixelRatio)!==null&&he!==void 0?he:1)?Zr:$u:"Desktop"),$timezone:G6(),$timezone_offset:cN()}),{$current_url:$d(L?Qo(on==null?void 0:on.href):on==null?void 0:on.href,F,Hd),$host:on==null?void 0:on.host,$pathname:on==null?void 0:on.pathname,$raw_user_agent:br.length>1e3?br.substring(0,997)+"...":br,$browser_version:oL(br,navigator.vendor,K,X),$browser_language:wE(),$browser_language_prefix:(ie=wE(),typeof ie=="string"?ie.split("-")[0]:void 0),$screen_height:ne==null?void 0:ne.screen.height,$screen_width:ne==null?void 0:ne.screen.width,$viewport_height:ne==null?void 0:ne.innerHeight,$viewport_width:ne==null?void 0:ne.innerWidth,$lib:wt.LIB_NAME,$lib_version:wt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return wt.SDK_DIST_CHANNEL&&(be.$sdk_dist_channel=wt.SDK_DIST_CHANNEL),be})(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;u.$session_id=p.sessionId,u.$window_id=m}this.sessionPropsManager&&Rt(u,this.sessionPropsManager.getSessionProps());try{var y;this.sessionRecording&&Rt(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=(y=this.vn)==null?void 0:y.length}catch(P){u.$sdk_debug_error_capturing_properties=String(P)}if(this.requestRouter.region===Ty&&(u.$lib_custom_api_host=this.config.api_host),d=e!==ou||i?e!==cv||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=Rt(u,d),e===ou&&Se&&(u.title=Se.title),!ye(a)){var w=r.getTime()-a;u.$duration=parseFloat((w/1e3).toFixed(3))}br&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var _=this.persistence.properties(),x=this.sessionPersistence.properties();bt(["$referrer","$referring_domain"],(P=>{P in _&&delete x[P]})),(u=Rt({},h,_,x,u)).$is_identified=this._isIdentified(),et(this.config.property_denylist)?bt(this.config.property_denylist,(function(P){delete u[P]})):xe.error(cP+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(xe.error(OE),u=E(u,e));var k=this.Cn();return u.$process_person_profile=k,k&&!i&&this.In("_calculate_event_properties"),u}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(),u=Rt({},i,a||{},e||{}),c=this.config.sanitize_properties;return c&&(xe.error(OE),u=c(u,"$set_once")),n&&(this.Xi=!0),zo(u)?void 0:u}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)}Tn(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;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(e,n)}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:ed}),()=>{})}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:ed})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:ed})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=MN),(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:ed}}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:ed})}Mn(e){return!e||q1(e)?(xe.critical("Unique user id has not been set in posthog.identify"),!1):e===Hh?(xe.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())||(xe.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 xe.uninitializedWarning("posthog.identify");if(Vn(e)&&(e=e.toString(),xe.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.In("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tm)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(cd)&&(this.unregister(cd),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Is)||Zl)===Zl;e!==s&&a?(this.persistence.set_property(Is,ql),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(dv,{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.sn=AE(e,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(_d))}}setPersonProperties(e,n){if((e||n)&&this.In("posthog.setPersonProperties")){var r=AE(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):xe.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(et(e)?e:[e]).filter((s=>xt(s)&&s.length>0));r.length!==0&&this.In("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:de({},s,{[e]:n})}),i||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(lE,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),i&&!r&&this.reloadFeatureFlags()}else xe.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.In("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,u,c,d,h,p;if(xe.info("reset"),!this.__loaded)return xe.uninitializedWarning("posthog.reset");var m,y=this.get_property(tm),w=this.get_property(uv),_=this.get_property(Ya);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),ye(_)||(m=this.persistence)==null||m.register({[Ya]:_}),(s=this.surveys)==null||s.reset(),(i=this.wn)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(u=this.conversations)==null||u.reset(),(c=this.logs)==null||c.reset(),(d=this.metrics)==null||d.reset(),(h=this.persistence)==null||h.set_property(Is,Zl),(p=this.sessionManager)==null||p.resetSessionId(),this.sn=null,this.config.cookieless_mode===Zi)this.register_once({distinct_id:Hh,$device_id:null},"");else{var x=this.config.get_device_id(Bi());this.register_once({distinct_id:x,$device_id:e?x:y},""),e||ye(w)||this.register({[uv]:w})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var n=this;return Jt((function*(){var r,s,i,a,u;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(),(u=n.featureFlags)==null||u.destroy()):xe.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(c6)?(xe.critical("Attempting to create alias for existing People user - aborting."),-2):this.In("posthog.alias")?(ye(n)&&(n=this.get_distinct_id()),e!==n?(this.Tn(cd,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(xe.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=de({},this.config);if(Ot(e)){var r,s,i,a,u,c,d,h,p,m,y;Rt(this.config,LE(e));var w=this.hn();(r=this.persistence)==null||r.update_config(this.config,n,w),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new gv(de({},this.config,{persistence:"sessionStorage"}),w,!1);var _=this.an(this.config.debug);Ds(_)&&(this.config.debug=_),Ds(this.config.debug)&&(this.config.debug?(wt.DEBUG=!0,Et.N()&&Et.q("ph_debug",!0),xe.info("set_config",{config:e,oldConfig:n,newConfig:de({},this.config)})):(wt.DEBUG=!1,Et.N()&&Et.P("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(u=this.tracingHeaders)==null||u.startIfEnabledOrStop(),(c=this.autocapture)==null||c.startIfEnabled(),(d=this.heatmaps)==null||d.startIfEnabled(),(h=this.exceptionObserver)==null||h.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(m=this.surveys)==null||m.loadIfEnabled(),this.Pn(),(y=this.externalIntegrations)==null||y.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){wt.LIB_NAME=e,wt.LIB_VERSION=n}startSessionRecording(e){var n,r,s,i,a,u=e===!0,c={sampling:u||!(e==null||!e.sampling),linked_flag:u||!(e==null||!e.linked_flag),url_trigger:u||!(e==null||!e.url_trigger),event_trigger:u||!(e==null||!e.event_trigger)};Object.values(c).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),c.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),c.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),c.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),c.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(de({},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:ds.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:au;return n!==au&&(n=au+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Is))===ql||((n=this.sessionPersistence)==null?void 0:n.get_property(Is))===ql}Cn(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===yy&&!this._isIdentified()&&zo(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[cd])&&((n=this.persistence)==null||(n=n.props)==null||!n[im]))}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.In("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.In("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}In(e){return this.config.person_profiles==="never"?(xe.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Tn(im,!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!==Ba)}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!==Zi){if(this.Yi()){var r,s,i,a,u;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new RE(this),this.pageViewManager=new _E(this),this.persistence&&(this.sessionPropsManager=new TE(this,this.sessionManager,this.persistence));var c,d=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(u=ds.__defaultExtensionClasses)==null?void 0:u.sessionRecording;d&&(this.sessionRecording=this.Ji(this.sessionRecording,new d(this)),this.yn&&((c=this.sessionRecording)==null||c.onRemoteConfig==null||c.onRemoteConfig(this.yn)))}var h,p;this.consent.optInOut(!0),this.Pn(),this.bn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Ba&&((h=this.surveys)==null||h.loadIfEnabled()),(ye(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 xe.warn(ME)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==Zi?(this.config.cookieless_mode===Ba&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===Ba&&(this.register({distinct_id:Hh,$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())):xe.warn(ME)}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===Zi||(this.config.cookieless_mode===Ba?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?rP(or,this.config.custom_blocked_useragents):void 0}_n(){Se&&(Se.visibilityState==="visible"?this.tn||(this.tn=!0,this.capture(ou,{title:Se.title},{send_instantly:!0}),this.rn&&(Se.removeEventListener(om,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),Ht(Se,om,this.rn)))}debug(e){e===!1?(ne==null||ne.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ne==null||ne.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?(xe.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 u=r in n&&!Xe(n[r]),c=s in n&&!Xe(n[s]);return u?n[r]:!!c&&(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,xe)}wt(e){var n;if(Xe(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(ZO),s=et(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s){if(i=a(i),Xe(i)){var u="Event '"+e.event+"' was rejected in beforeSend function";return KO(e.event)?xe.warn(u+". This can cause unexpected behavior."):xe.info(u),null}i.properties&&!zo(i.properties)||xe.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var c of r)if(i.properties&&Xe(i.properties[c]))return xe.warn("Event '"+e.event+"' had its '"+c+"' 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=Ds(e)&&!e,r=Et.N()&&Et.A("ph_debug")==="true";return!n&&(!!r||e)}}ds.__defaultExtensionClasses={},ds.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]]=DL(t.prototype[e[n]])})(ds,["identify"]);class NE{constructor(e){this.disabled=e===!1;var n=Ot(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 Ev="$copy_autocapture",Cv=Dt("[AutoCapture]");function kv(t,e){return e.length>t?e.slice(0,t)+"...":e}function VN(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Jo(e));return e}function $N(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,c=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!Jo(t))return{props:{}};for(var h=[t],p=new Set([t]),m=t;m.parentNode&&!Wr(m,"body")&&P6>h.length;)if(k6(m.parentNode)){var y=m.parentNode.host;if(p.has(y))break;p.add(y),h.push(y),m=y}else{if(!Jo(m.parentNode)||p.has(m.parentNode))break;p.add(m.parentNode),h.push(m.parentNode),m=m.parentNode}var w,_,x=[],E={},k=!1,P=!1;if(bt(h,(R=>{var M=wy(R);if(Wr(R,"a")){var N=R.getAttribute("href");k=!!(M&&N&&wd(N))&&(d?Qo(N):N)}Ge(um(R),"ph-no-capture")&&(P=!0),x.push((function(F,q,G,W,K){K===void 0&&(K=!1);var X=F.tagName.toLowerCase(),$={tag_name:X};h2.indexOf(X)>-1&&!G&&($.$el_text=X.toLowerCase()==="a"||X.toLowerCase()==="button"?kv(1024,gE(F)):kv(1024,Fd(F)));var ee=um(F);ee.length>0&&($.classes=ee.filter((function(te){return te!==""}))),bt(F.attributes,(function(te){var ie;if((!M6(F)||["name","id","class","aria-label"].indexOf(te.name)!==-1)&&(W==null||!W.includes(te.name))&&!q&&wd(te.value)&&(!xt(ie=te.name)||ie.substring(0,10)!=="_ngcontent"&&ie.substring(0,7)!=="_nghost")){var ae=te.value;te.name==="class"&&(ae=f2(ae).join(" ")),$["attr__"+te.name]=kv(1024,te.name==="href"&&K?Qo(ae):ae)}}));for(var z=1,D=1,Y=F;Y=VN(Y);)z++,Y.tagName===F.tagName&&D++;return $.nth_child=z,$.nth_of_type=D,$})(R,i,a,u,d));var j=(function(F){if(!wy(F))return{};var q={};return bt(F.attributes,(function(G){if(G.name&&G.name.indexOf("data-ph-capture-attribute")===0){var W=G.name.replace("data-ph-capture-attribute-",""),K=G.value;W&&K&&wd(K)&&(q[W]=K)}})),q})(R);Rt(E,j)})),P)return{props:{},explicitNoCapture:P};if(a||(x[0].$el_text=Wr(t,"a")||Wr(t,"button")?gE(t):Fd(t)),k){var T,A;x[0].attr__href=k;var L=(T=Vd(k))==null?void 0:T.host,O=ne==null||(A=ne.location)==null?void 0:A.host;L&&O&&L!==O&&(w=k)}return{props:Rt({$event_type:s.type,$ce_version:1},c?{}:{$elements:x},{$elements_chain:(_=x,(function(R){return R.map((M=>{var N,j,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 G=de({},M.text?{text:M.text}:{},{"nth-child":(N=M.nth_child)!==null&&N!==void 0?N:0,"nth-of-type":(j=M.nth_of_type)!==null&&j!==void 0?j:0},M.href?{href:M.href}:{},M.attr_id?{attr_id:M.attr_id}:{},M.attributes),W={};return wp(G).sort(((K,X)=>K[0].localeCompare(X[0]))).forEach((K=>{var X=K[1];return W[vE(K[0].toString())]=vE(X.toString())})),(F+=":")+wp(W).map((K=>K[0]+'="'+K[1]+'"')).join("")})).join(";")})((function(R){return R.map((M=>{var N,j,F={text:(N=M.$el_text)==null?void 0:N.slice(0,400),tag_name:M.tag_name,href:(j=M.attr__href)==null?void 0:j.slice(0,2048),attr_class:nN(M),attr_id:M.attr__id,nth_child:M.nth_child,nth_of_type:M.nth_of_type,attributes:{}};return wp(M).filter((q=>q[0].indexOf("attr__")===0)).forEach((q=>F.attributes[q[0]]=q[1])),F}))})(_)))},(n=x[0])!=null&&n.$el_text?{$el_text:(r=x[0])==null?void 0:r.$el_text}:{},w&&s.type==="click"?{$external_click_url:w}:{},E)}}var td=Dt("[ExceptionAutocapture]"),DE=()=>{},HN=Dt("[TracingHeaders]"),Ma=Dt("[Web Vitals]"),jE=9e5,FE="disabled",VE="lazy_loading",nd="awaiting_config",Kh="missing_config";Dt("[SessionRecording]"),Dt("[SessionRecording]");var Ry="[SessionRecording]",Ii=Dt(Ry),zN=Dt("[Heatmaps]");function Pv(t){return Ot(t)&&"clientX"in t&&"clientY"in t&&Vn(t.clientX)&&Vn(t.clientY)}var Tv=Dt("[Product Tours]"),Rv=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(l2))},UN=["$set_once","$set"],Ys=Dt("[SiteApps]"),$E="Error while initializing PostHog app with config id ";function Ql(t,e,n){if(Xe(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 BN{constructor(e){this.Fn=new y2,this.Ln=(n,r)=>this.$n(n,r)&&this.An(n,r)&&this.Nn(n,r)&&this.Dn(n,r),this.$n=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,n;ye((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(!ye((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var u,c;(u=this.jn)==null||u.add(a),(c=a.steps)==null||c.forEach((d=>{var h;(h=this.qn)==null||h.add((d==null?void 0:d.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;e.forEach((a=>{var u;(u=a.steps)==null||u.forEach((c=>{c!=null&&c.selector&&i.add(c==null?void 0:c.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(e,n){var r;n!=null&&e.length!=0&&(this.qn.has(e)||this.qn.has(n.event))&&this.jn&&((r=this.jn)==null?void 0:r.size)>0&&this.jn.forEach((s=>{this.Hn(n,s)&&this.Fn.emit("actionCaptured",s.name)}))}Bn(e){this.onAction("actionCaptured",(n=>e(n)))}Hn(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Ln(e,r))return!0;return!1}onAction(e,n){return this.Fn.on(e,n)}An(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!Ql(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((u=>Ql(u.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&Ql((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((d=>Ql(d.text,n.text,n.text_matching||"exact")||Ql(d.$el_text,n.text,n.text_matching||"exact")));var i,a,u,c=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(i=(function(d){for(var h,p=[],m=/(?::|")text="(.*?)"/g;!Xe(h=m.exec(d));)p.includes(h[1])||p.push(h[1]);return p})(c),a=n.text,u=n.text_matching||"exact",i.some((d=>Ql(d,a,u))))}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||oP(n.properties.reduce(((r,s)=>{var i=et(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 WN{constructor(e){this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map}Kn(e,n){return!!e&&oP(e.propertyFilters,n==null?void 0:n.properties)}Yn(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 u=r.get(a.name)||[];u.push(s.id),r.set(a.name,u)}}))})),r}Xn(e,n,r){var s=(r===qc.Activation?this.Gn:this.Qn).get(e),i=[];return this.es((a=>{i=a.filter((u=>s==null?void 0:s.includes(u.id)))})),i.filter((a=>{var u,c=(u=a.conditions)==null||(u=u[r])==null||(u=u.values)==null?void 0:u.find((d=>d.name===e));return this.Kn(c,n)}))}register(e){var n;ye((n=this._instance)==null?void 0:n._addCaptureHook)||(this.ts(e),this.rs(e))}rs(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.ns==null&&(this.ns=new BN(this._instance),this.ns.init(),this.ns.Bn((r=>{this.onAction(r)}))),n.forEach((r=>{var s,i,a,u,c;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&&((u=this.ns)==null||u.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((d=>{if(d&&d.name){var h=this.Jn.get(d.name);h&&h.push(r.id),this.Jn.set(d.name,h||[r.id])}})))})))}ts(e){var n,r=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.events)&&((u=i.conditions)==null||(u=u.events)==null||(u=u.values)==null?void 0:u.length)>0})),s=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.cancelEvents)&&((u=i.conditions)==null||(u=u.cancelEvents)==null||(u=u.values)==null?void 0:u.length)>0}));r.length===0&&s.length===0||((n=this._instance)==null||n._addCaptureHook(((i,a)=>{this.onEvent(i,a)})),this.Gn=this.Yn(e,qc.Activation),this.Qn=this.Yn(e,qc.Cancellation))}onEvent(e,n){var r,s,i=this.ss(),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 u=this.os(e,a);if(u==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.ls([a]);if(u==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.us(a)}if(this.Qn.has(e)){var c=this.Xn(e,n,qc.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((h=>h.id))}),this.ls(c.map((h=>h.id))),c.forEach((h=>this.hs(h.id))))}if(this.Gn.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.Gn.get(e)});var d=this.Xn(e,n,qc.Activation);this.ds(d.map((h=>h.id)))}}onAction(e){this.Jn.has(e)&&this.ds(this.Jn.get(e)||[])}ds(e){e.length!==0&&(this.Zn=[...new Set([...this.Zn,...e])],this.ss().info("updating activated items",{activatedItems:this.getActivatedIds()}))}us(e){this.Zn=this.Zn.filter((r=>r!==e));var n=this.cs();n.includes(e)||this.vs([...n,e])}ls(e){var n=new Set(e);this.Zn=this.Zn.filter((i=>!n.has(i)));var r=this.cs(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&this.vs(s)}cs(){var e,n=this.fs();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}getActivatedIds(){return[...new Set([...this.cs(),...this.Zn])].filter((e=>!this.ps(e)))}reset(){this.Zn=[],this.cs().length>0&&this.vs([])}getEventToItemsMap(){return this.Gn}gs(){return this.ns}}class GN extends WN{constructor(e){super(e)}fs(){return dy}ys(){return Yi.SHOWN}es(e){var n;(n=this._instance)==null||n.getSurveys(e)}hs(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}ss(){return yt}vs(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[dy]:e})}ps(){return!1}os(e,n){var r;this.es((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a;return aP(i)&&!((a=i.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||i.schedule==="always"})(r);return s?e===Yi.SHOWN?"consume":"ignore":e===Yi.SHOWN?"persist":e===Yi.DISMISSED||e===Yi.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Av="SDK is not enabled or survey functionality is not yet loaded",HE="Disabled. Not loading surveys.",KN=ne!=null&&ne.location?cm(ne.location.hash,"__posthog")||cm(location.hash,"state"):null,zE="_postHogToolbarParams",UE=Dt("[Toolbar]"),hn=Dt("[FeatureFlags]"),Oa=Dt("[FeatureFlags]",{debugEnabled:!0}),Iv=`" failed. Feature flags didn't load in time.`,BE=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},WE=t=>{var e={};for(var n of wp(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},Mi=Dt("[Error tracking]"),GE="Refusing to render web experiment since the viewer is a likely bot",ZN={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>hm(e,t),not_regex:(t,e)=>!hm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Zn{get Te(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{Zn.bs("retrieved web experiments from the server"),n._s=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n._s&&(Zn.bs("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n._s)==null||a.set(i.feature_flag_key,i));var u=n._instance.getFeatureFlag(i.feature_flag_key);xt(u)&&i.variants[u]&&n.ws(i.name,u,i.variants[u].transforms)}else if(i.variants)for(var c in i.variants){var d=i.variants[c];Zn.xs(d,n._instance)&&n.ws(i.name,c,d.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Zn.bs(GE);else if(!this.Te.disable_web_experiments){if(Xe(this._s))return this._s=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Zn.bs("applying feature flags",e),e.forEach((n=>{var r;if(this._s&&(r=this._s)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this._s)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.ws(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=Zn.getWindowLocation();if(e!=null&&e.search){var n=Uu(e==null?void 0:e.search,"__experiment_id"),r=Uu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Zn.bs("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.ks(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",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}ks(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(Zn.bs("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.ws(s[0].name,n,s[0].variants[n].transforms))}static xs(e,n){return!Xe(e.conditions)&&Zn.Ss(e,n)&&Zn.Cs(e)}static Ss(e,n){var r;if(Xe(e.conditions)||Xe((r=e.conditions)==null?void 0:r.url))return!0;var s=Zn.getWindowLocation();if(s){var i,a,u,c=S6(n,s.href);return(i=e.conditions)==null||!i.url||ZN[(a=(u=e.conditions)==null?void 0:u.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,c)}return!1}static getWindowLocation(){return ne==null?void 0:ne.location}static Cs(e){var n;if(Xe(e.conditions)||Xe((n=e.conditions)==null?void 0:n.utm))return!0;var r=$6();if(r.utm_source){var s,i,a,u,c,d,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,y=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_source)==r.utm_source,w=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_medium||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==r.utm_medium,_=(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&&w&&_&&y}return!1}static bs(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];xe.info("[WebExperiments] "+e,r)}ws(e,n,r){this._is_bot()?Zn.bs(GE):n!=="control"?r.forEach((s=>{if(s.selector){var i;Zn.bs("applying transform of variant "+n+" for experiment "+e+" ",s);var a=(i=document)==null?void 0:i.querySelectorAll(s.selector);a==null||a.forEach((u=>{var c=u;s.html&&(c.innerHTML=s.html),s.css&&c.setAttribute("style",s.css)}))}})):Zn.bs("Control variants leave the page unmodified.")}_is_bot(){return or&&this._instance?rP(or,this.Te.custom_blocked_useragents):void 0}}var ls=Dt("[Conversations]"),La="Conversations not available yet.",KE="console",qm={featureFlags:class{constructor(t){this.Is=!1,this.Ts=!1,this.Ms=!1,this.Es=!1,this.Rs=!1,this.Ps=!1,this.Os=!1,this.Fs=!1,this.Ls=0,this.$s=()=>{var e=this.As();this.Ls=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],ne&&Ht(ne,"online",this.$s)}destroy(){ne==null||ne.removeEventListener("online",this.$s)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}Ns(t){return this._instance.get_property(t)}Ds(){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}qs(){return!!this.Ds()&&(this.Fs||this.Ms||(this.Fs=!0,hn.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}js(){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.Os||(hn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Os=!0),e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||hn.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}Hs(){return this.js().length>0}Bs(){var t=this.Te.flag_keys;if(!ye(t)){if(et(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||hn.error("Invalid flag key found:",e,"Expected non-empty string"),n}));hn.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:{},u=Object.keys(r).filter((d=>!!r[d])).reduce(((d,h)=>(d[h]=r[h]||!1,d)),{}),c=Object.keys(a).filter((d=>u[d])).reduce(((d,h)=>(a[h]&&(d[h]=a[h]),d)),{});this.receivedFeatureFlags({featureFlags:u,featureFlagPayloads:c})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.Ns(Ka))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.Ns(_p))!==null&&s!==void 0?s:{},u=de({},i,t),c=de({},a,e),d={};for(var h of Object.entries(u)){var p=h[0],m=h[1];d[p]={key:p,enabled:KS(m),variant:ZS(m),reason:void 0,metadata:ye(c==null?void 0:c[p])?void 0:{id:0,version:void 0,description:void 0,payload:c[p]}}}this.receivedFeatureFlags({flags:d})}get hasLoadedFlags(){return this.Ts}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Ns(ly),e=this.Ns(Vi),n=this.Ns(iu);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,u,c=r[i],d=e==null?void 0:e[i],h=ye(d)?(a=c==null?void 0:c.enabled)!==null&&a!==void 0&&a:!!d,p=ye(d)?c.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[i],y=de({},c,{enabled:h,variant:h?p??(c==null?void 0:c.variant):void 0});h!==(c==null?void 0:c.enabled)&&(y.original_enabled=c==null?void 0:c.enabled),p!==(c==null?void 0:c.variant)&&(y.original_variant=c==null?void 0:c.variant),m&&(y.metadata=de({},c==null?void 0:c.metadata,{payload:m,original_payload:c==null||(u=c.metadata)==null?void 0:u.payload})),r[i]=y}return this.Is||(hn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Is=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:KS(r),variant:ZS(r),payload:GS(e[n])}}))}getFlagVariants(){var t=this.Ns(Ka),e=this.Ns(Vi);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.Is||(hn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Is=!0),n}getFlagPayloads(){var t=this.Ns(_p),e=this.Ns(iu);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.Is||(hn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Is=!0),n}reloadFeatureFlags(){this.Es||this.Te.advanced_disable_feature_flags||this.As()||this.Us||(this._instance.en.emit("featureFlagsReloading",!0),this.Us=setTimeout((()=>{this.zs()}),5))}Vs(){clearTimeout(this.Us),this.Us=void 0}ensureFlagsLoaded(){this.Ts||this.Ms||this.Us||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Es=t}zs(t){var e;if(this.Vs(),!this._instance.Ur()&&!this.As())if(this.Ms)this.Rs=!0;else{var n=this.Te.token,r=this.Ns(tm),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:de({},((e=this.mi)==null?void 0:e.get_initial_props())||{},this.Ns(za)||{}),group_properties:this.Ns(Ua),timezone:G6()};cr(r)||ye(r)||(s.$device_id=r),(t!=null&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Hs()&&(s.evaluation_contexts=this.js());var i=this.Bs();ye(i)||(s.flag_keys=i);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,u=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Ms=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this.Te.disable_compression?void 0:ir.Base64,timeout:this.Te.feature_flag_request_timeout_ms,callback:c=>{var d,h,p,m=!0;if(this.Ws(c.statusCode),c.statusCode===200&&(this.Rs||(this.$anon_distinct_id=void 0),m=!1),this.Ms=!1,!s.disable_flags||this.Rs){this.Ps=!m;var y=[];c.error?c.error instanceof Error?y.push(c.error.name==="AbortError"?"timeout":"connection_error"):y.push("unknown_error"):c.statusCode!==200&&y.push("api_error_"+c.statusCode),(d=c.json)!=null&&d.errorsWhileComputingFlags&&y.push("errors_while_computing_flags");var w,_=!((h=c.json)==null||(h=h.quotaLimited)==null||!h.includes("feature_flags"));_&&y.push("quota_limited"),(p=this.mi)==null||p.register({[hy]:y}),_?hn.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((w=c.json)!==null&&w!==void 0?w:{},m,{partialResponse:a}),this.Rs&&(this.Rs=!1,this.zs()))}}})}}As(){return F6(this.Ls,3)}Ws(t){this.Ls=V6(t,this.Ls,3,(()=>hn.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.Ps)if(this.Ts||this.getFlags()&&this.getFlags().length>0){if(!this.qs()){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 hn.warn('getFeatureFlag for key "'+t+Iv)}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.Ps)if(this.Ts||this.getFlags()&&this.getFlags().length>0){if(!this.qs()){var n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],a=String(s),u=this.Ns(uy)||void 0,c=this.Ns(jd)||void 0,d=this.Ns(_d)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,p=this._instance.get_session_id(),m=this.Ns(fy);p&&p!==m&&(d={},(h=this.mi)==null||h.register({[_d]:d,[fy]:p}))}if((e.send_event||!("send_event"in e))&&(!(t in d)||!d[t].includes(a))){var y,w,_,x,E,k,P,T,A,L,O;et(d[t])?d[t].push(a):d[t]=[a],(y=this.mi)==null||y.register({[_d]:d});var R=this.getFeatureFlagDetails(t),M=[...(w=this.Ns(hy))!==null&&w!==void 0?w:[]];ye(s)&&M.push("flag_missing");var N={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i||null,$feature_flag_request_id:u,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((_=this.Te.bootstrap)==null||(_=_.featureFlags)==null?void 0:_[t])||null,$feature_flag_bootstrapped_payload:((x=this.Te.bootstrap)==null||(x=x.featureFlagPayloads)==null?void 0:x[t])||null,$used_bootstrap_value:!this.Ps};ye(R==null||(E=R.metadata)==null?void 0:E.has_experiment)||(N.$feature_flag_has_experiment=R.metadata.has_experiment),ye(R==null||(k=R.metadata)==null?void 0:k.version)||(N.$feature_flag_version=R.metadata.version);var j,F=(P=R==null||(T=R.reason)==null?void 0:T.description)!==null&&P!==void 0?P:R==null||(A=R.reason)==null?void 0:A.code;F&&(N.$feature_flag_reason=F),R!=null&&(L=R.metadata)!=null&&L.id&&(N.$feature_flag_id=R.metadata.id),ye(R==null?void 0:R.original_variant)&&ye(R==null?void 0:R.original_enabled)||(N.$feature_flag_original_response=ye(R.original_variant)?R.original_enabled:R.original_variant),R!=null&&(O=R.metadata)!=null&&O.original_payload&&(N.$feature_flag_original_payload=R==null||(j=R.metadata)==null?void 0:j.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:GS(i)}}}else hn.warn('getFeatureFlagResult for key "'+t+Iv)}getRemoteConfigPayload(t,e){var n=this.Te.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.Hs()&&(r.evaluation_contexts=this.js());var s=this.Bs();ye(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,timeout:this.Te.feature_flag_request_timeout_ms,callback(i){var a,u=(a=i.json)==null?void 0:a.featureFlagPayloads;e((u==null?void 0:u[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),!e.fresh||this.Ps){if(this.Ts||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(t,e);return ye(n)?void 0:!!n}hn.warn('isFeatureEnabled for key "'+t+Iv)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.mi){this.Ts=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(a,u,c,d,h,p){c===void 0&&(c={}),d===void 0&&(d={}),h===void 0&&(h={});var m=(R=>{var M=R.flags;return M?(R.featureFlags=Object.fromEntries(Object.keys(M).map((N=>{var j;return[N,(j=M[N].variant)!==null&&j!==void 0?j:M[N].enabled]}))),R.featureFlagPayloads=Object.fromEntries(Object.keys(M).filter((N=>M[N].enabled)).filter((N=>{var j;return(j=M[N].metadata)==null?void 0:j.payload})).map((N=>{var j;return[N,(j=M[N].metadata)==null?void 0:j.payload]})))):R.featureFlags&&hn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),R})(a),y=m.flags,w=m.featureFlags,_=m.featureFlagPayloads;if(w){var x=a.requestId,E=a.evaluatedAt;if(et(w)){hn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var k={};if(w)for(var P=0;w.length>P;P++)k[w[P]]=!0;u&&u.register({[yp]:w,[Ka]:k,[nm]:!1})}else{var T=w,A=_,L=y;if(p!=null&&p.partialResponse)T=de({},c,T),A=de({},d,A),L=de({},h,L);else if(a.errorsWhileComputingFlags)if(y){var O=new Set(Object.keys(y).filter((R=>{var M;return!((M=y[R])!=null&&M.failed)})));T=de({},c,Object.fromEntries(Object.entries(T).filter((R=>O.has(R[0]))))),A=de({},d,Object.fromEntries(Object.entries(A||{}).filter((R=>O.has(R[0]))))),L=de({},h,Object.fromEntries(Object.entries(L||{}).filter((R=>O.has(R[0])))))}else T=de({},c,T),A=de({},d,A),L=de({},h,L);u&&u.register(de({[yp]:Object.keys(WE(T)),[Ka]:T||{},[_p]:A||{},[ly]:L||{},[nm]:a.minimalFlagCalledEvents===!0},x?{[uy]:x}:{},E?{[jd]:E}:{}))}}})(t,this.mi,r,s,i,n),e||(this.Fs=!1),this.Zs(e)}}override(t,e){e===void 0&&(e=!1),hn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return hn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.mi.unregister(Vi),this.mi.unregister(iu),this.Zs(),Oa.info("All overrides cleared");if(et(t)){var e=BE(t);return this.mi.register({[Vi]:e}),this.Zs(),Oa.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.Is=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.mi.unregister(Vi),Oa.info("Flag overrides cleared");else if(r.flags){if(et(r.flags)){var s=BE(r.flags);this.mi.register({[Vi]:s})}else this.mi.register({[Vi]:r.flags});Oa.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.mi.unregister(iu),Oa.info("Payload overrides cleared")):r.payloads&&(this.mi.register({[iu]:r.payloads}),Oa.info("Payload overrides set",{payloads:r.payloads}))),void this.Zs()}if(t&&typeof t=="object")return this.mi.register({[Vi]:t}),this.Zs(),Oa.info("Flag overrides set",{flags:t});hn.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Ts){var e=this.Gs(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){hn.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r,s=(this.Ns(fd)||[]).find((c=>c.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 u=de({},this.getFlagVariants(),{[t]:e});(r=this.mi)==null||r.register({[yp]:Object.keys(WE(u)),[Ka]:u}),this.Zs()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.Ns(fd),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",callback:i=>{var a,u;if(i.json){var c=i.json.earlyAccessFeatures;return(a=this.mi)==null||a.unregister(fd),(u=this.mi)==null||u.register({[fd]:c}),t(c)}}})}Gs(){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)),{})}}Zs(t){var e=this.Gs(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){hn.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.Ns(za)||{},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({[za]:de({},n,i,r)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=de({},this.Ns(za)||{});t.forEach((r=>{delete n[r]})),this._instance.register({[za]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(za),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.Ns(Ua)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=de({},n[r],t[r]),delete t[r]})),this._instance.register({[Ua]:de({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Ns(Ua)||{};this._instance.register({[Ua]:de({},e,{[t]:{}})})}else this._instance.unregister(Ua)}reset(){this.Ts=!1,this.Ms=!1,this.Es=!1,this.Rs=!1,this.Ps=!1,this.$anon_distinct_id=void 0,this.Vs(),this.Is=!1,this.Ls=0}}},qN={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!((t=this.Qs)==null||!t.isStarted)}get status(){var t,e;return this.Js===nd||this.Js===Kh?this.Js:(t=(e=this.Qs)==null?void 0:e.status)!==null&&t!==void 0?t:this.Js}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Js=FE,this.Ks=void 0,this._instance=t,!this._instance.sessionManager)throw Ii.error("started without valid sessionManager"),new Error(Ry+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===Zi)throw new Error(Ry+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ys(){var t,e=!((t=this._instance.get_property(Ya))==null||!t.enabled),n=!this.Te.disable_session_recording,r=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return ne&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this.Ys||(e=this.Qs)==null||!e.isStarted){var n=!ye(Object.assign)&&!ye(Array.from);this.Ys&&n?(this.Xs(t),Ii.info("starting")):(this.Js=FE,this.stopRecording())}}Xs(t){var e,n,r;this.Ys&&(this.Js!==nd&&this.Js!==Kh&&(this.Js=VE),He!=null&&(e=He.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=He.__PosthogExtensions__)!=null&&n.initSessionRecording?this.eo(t):(r=He.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.ro,(s=>{if(s)return Ii.error("could not load recorder",s);this.eo(t)})))}stopRecording(){var t,e;(t=this.Ks)==null||t.call(this),this.Ks=void 0,(e=this.Qs)==null||e.stop()}io(){var t,e;(t=this.Ks)==null||t.call(this),this.Ks=void 0,(e=this.Qs)==null||e.discard()}no(){var t,e;(t=this.mi)==null||t.unregister(u2),(e=this.mi)==null||e.unregister(d6)}so(t,e){if(Xe(t))return null;var n,r=Vn(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Ii.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}oo(t){if(this.mi){var e,n,r=this.mi,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,u=this.so((i=this.Te.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.so(a==null?void 0:a.sampleRate,"remote config sampleRate"),d=u??c;Xe(d)&&this.no();var h=a==null?void 0:a.minimumDurationMilliseconds;r.register({[Ya]:de({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:de({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:d,minimumDurationMilliseconds:ye(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.Ks)==null||e.call(this),this.Ks=(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.oo(e),void this.io()):(this.oo(e),void this.startIfEnabledOrStop()):(this.Js===nd&&(this.Js=Kh,Ii.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.Qs)!=null&&n.log?this.Qs.log(t,e):Ii.warn("log called before recorder was ready")}get ro(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(Ya);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}ao(){var t,e,n=this._instance.get_property(Ya);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(s){return Ii.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}eo(t){var e,n;if((e=He.__PosthogExtensions__)==null||!e.initSessionRecording)return Ii.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[_6]:!0});if(this.Qs||(this.Qs=(n=He.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.Qs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ao())return this.Js===Kh||this.Js===nd?void 0:(this.Js=nd,Ii.info("persisted remote config is stale, requesting fresh config before starting"),void new K6(this._instance).load());this.Js=VE,this.Qs.start(t)}onRRwebEmit(t){var e;(e=this.Qs)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Qs||(e=this.mi)==null||e.register({[h6]:!0}),(t=this.Qs)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Qs||(e=this.mi)==null||e.register({[f6]:!0}),(t=this.Qs)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.Qs||(n=this.mi)==null||n.register({[t==="url"?p6:m6]:!0}),(e=this.Qs)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Qs)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.Qs)==null||!n.tryAddCustomEvent(t,e))}}},YN={autocapture:class{constructor(t){this.lo=!1,this.uo=null,this.ho=!1,this.do=!1,this.instance=t,this.rageclicks=new NE(t.config.rageclick),this.co=null}initialize(){this.startIfEnabled()}get Te(){var t,e,n=Ot(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}vo(){if(this.isBrowserSupported()){if(ne&&Se){var t=n=>{n=n||(ne==null?void 0:ne.event);try{this.fo(n)}catch(r){Cv.error("Failed to capture event",r)}};if(Ht(Se,"submit",t,{capture:!0}),Ht(Se,"change",t,{capture:!0}),Ht(Se,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=n=>{n=n||(ne==null?void 0:ne.event);try{this.fo(n,Ev)}catch(r){Cv.error("Failed to capture copy/cut event",r)}};Ht(Se,"copy",e,{capture:!0}),Ht(Se,"cut",e,{capture:!0})}}}else Cv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.lo&&(this.vo(),this.lo=!0)}onRemoteConfig(t){if(this.ho=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.do=e.elementsChainAsString);var n=e.autocapture_opt_out;Ds(n)&&(this.instance.persistence&&this.instance.persistence.register({[ty]:n}),this.uo=n),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.co=t}getElementSelectors(t){var e,n=[];return(e=this.co)==null||e.forEach((r=>{var s=Se==null?void 0:Se.querySelectorAll(r);s==null||s.forEach((i=>{t===i&&n.push(r)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[ty],r=this.uo,s=this.instance.Ur()&&!this.ho;if(cr(r)&&!Ds(n)&&!s)return!1;var i=(e=this.uo)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!i}fo(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=hv(t);C6(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())&&mE(r,this.instance.config.rageclick)&&this.fo(t,"$rageclick");var s=e===Ev;if(r&&(function(p,m,y,w,_,x){var E;if(!ne||p2(p)||y!=null&&y.url_allowlist&&!fE(y.url_allowlist,x)||y!=null&&y.url_ignorelist&&fE(y.url_ignorelist,x))return!1;if(y!=null&&y.dom_event_allowlist){var k=y.dom_event_allowlist;if(k&&!k.some((R=>m.type===R)))return!1}var P=I6(p,w),T=P.parentIsUsefulElement,A=P.targetElementList;if(!(function(R,M){var N=M==null?void 0:M.element_allowlist;if(ye(N))return!0;var j,F=function(G){if(N.some((W=>G.tagName.toLowerCase()===W)))return{v:!0}};for(var q of R)if(j=F(q))return j.v;return!1})(A,y)||!_y(A,y==null?void 0:y.css_selector_allowlist)||_y(A,(E=y==null?void 0:y.css_selector_ignorelist)!==null&&E!==void 0?E:qL))return!1;try{var L=ne.getComputedStyle(p);if(L&&L.getPropertyValue("cursor")==="pointer"&&m.type==="click")return!0}catch{}var O=p.tagName.toLowerCase();switch(O){case"html":return!1;case"form":return(_||["submit"]).indexOf(m.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(m.type)>=0;default:return T?(_||["click"]).indexOf(m.type)>=0:(_||["click"]).indexOf(m.type)>=0&&(h2.indexOf(O)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,this.Te,s,s?["copy","cut"]:void 0,this.instance)){var i=$N(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.do,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=i.props;if(i.explicitNoCapture)return!1;var u=this.getElementSelectors(r);if(u&&u.length>0&&(a.$element_selectors=u),e===Ev){var c,d=T6(ne==null||(c=ne.getSelection())==null?void 0:c.toString()),h=t.type||"clipboard";if(!d)return!1;a.$selected_content=d,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Ns(Se==null?void 0:Se.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.po=(ne==null||(e=ne.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(xe.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.mo&&this.mo(),this.mo=void 0,xe.info("History API monitoring stopped")}monitorHistoryChanges(){ne&&ne.history&&(this.yo("pushState"),this.yo("replaceState"),this.bo())}yo(t){var e;if(ne&&((e=ne.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,i){try{if(!(s in r))return DE;var a={next:r[s]},u=i((function(){for(var c=arguments.length,d=new Array(c),h=0;c>h;h++)d[h]=arguments[h];return a.next.apply(this,d)}));return Ns(u)&&(u.prototype=u.prototype||{},Object.defineProperties(u,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:a}})),r[s]=u,()=>{if(r[s]!==u)for(var c=r[s];Ns(c)&&c.__posthog_layer__;){var d=c.__posthog_layer__;if(d.next===u)return void(d.next=a.next);c=d.next}else r[s]=a.next}}catch{return DE}})(ne.history,t,(r=>function(s,i,a){r.call(this,s,i,a),n._o(t)}))}}_o(t){try{var e,n=ne==null||(e=ne.location)==null?void 0:e.pathname;if(!n)return;n!==this.po&&this.isEnabled&&this._instance.capture(ou,{navigation_type:t}),this.po=n}catch(r){xe.error("Error capturing "+t+" pageview",r)}}bo(){if(!this.mo){var t=()=>{this._o("popstate")};Ht(ne,"popstate",t),this.mo=()=>{ne&&ne.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.wo=!1,this.lo=!1,this.xo=null,this.instance=t,this.wo=!((e=this.instance.persistence)==null||!e.props[ny]),this.rageclicks=new NE(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Ot(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Xe(this.Te.capture_heatmaps)?Xe(this.Te.enable_heatmaps)?this.wo:this.Te.enable_heatmaps:this.Te.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.lo)return;zN.info("starting..."),this.ko(),this.ke()}else{var t;clearInterval((t=this.xo)!==null&&t!==void 0?t:void 0),this.So(),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({[ny]:n}),this.wo=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Co(t){Pv(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}ke(){this.xo&&clearInterval(this.xo),this.xo=(Se==null?void 0:Se.visibilityState)==="visible"?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}ko(){ne&&Se&&(this.Io=this.oi.bind(this),Ht(ne,am,this.Io),this.To=t=>this.pe(t||(ne==null?void 0:ne.event)),Ht(Se,"click",this.To,{capture:!0}),this.Mo=t=>this.Eo(t||(ne==null?void 0:ne.event)),Ht(Se,"mousemove",this.Mo,{capture:!0}),this.Ro=new yE(this.instance,rN,this.Co.bind(this)),this.Ro.startIfEnabledOrStop(),this.Po=this.ke.bind(this),Ht(Se,om,this.Po),this.lo=!0)}So(){var t;ne&&Se&&(this.Io&&ne.removeEventListener(am,this.Io),this.To&&Se.removeEventListener("click",this.To,{capture:!0}),this.Mo&&Se.removeEventListener("mousemove",this.Mo,{capture:!0}),this.Po&&Se.removeEventListener(om,this.Po),clearTimeout(this.Oo),(t=this.Ro)==null||t.stop(),this.lo=!1)}Fo(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(a,u,c){for(var d=a;d&&Jo(d)&&!Wr(d,"body");){if(d===c)return!1;var h=void 0;try{var p,m,y;h=(p=(m=(y=d.ownerDocument)==null?void 0:y.defaultView)!==null&&m!==void 0?m:ne)==null?void 0:p.getComputedStyle(d).position}catch{return!1}if(Ge(u,h))return!0;d=R6(d)}return!1})(hv(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"),!dE(t.target)&&Pv(t)){var r=this.Fo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&mE(hv(t),this.instance.config.rageclick)&&this.Nt(de({},r,{type:"rageclick"})),this.Nt(r)}}Eo(t){!dE(t.target)&&Pv(t)&&(clearTimeout(this.Oo),this.Oo=setTimeout((()=>{this.Nt(this.Fo(t,"mousemove"))}),500))}Nt(t){if(ne){var e=this.Te.disable_capture_url_hashes?Qo(ne.location.href):ne.location.href,n=this.Te.custom_personal_data_properties,r=this.Te.mask_personal_data_properties?[...Bu,...n||[]]:[],s=$d(e,r,Hd);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:yE,webVitalsAutocapture:class{constructor(t){var e;this.wo=!1,this.lo=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Lo=()=>{clearTimeout(this.$o),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>de({},n,{["$web_vitals_"+r.name+"_event"]:de({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Ao=n=>{var r;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.No();if(!ye(s))if(Xe(n==null?void 0:n.name)||Xe(n==null?void 0:n.value))Ma.error("Invalid metric received",n);else if(!this.Do||this.Do>n.value){this.R.url!==s&&(this.Lo(),this.$o=setTimeout(this.Lo,this.flushToCaptureTimeoutMs)),ye(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=ye(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=de({},n,{$current_url:s,timestamp:Date.now()});ye(i)||(a.$session_id=i.sessionId,a.$window_id=i.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.Lo()}else Ma.error("Ignoring metric with value >= "+this.Do,n)},this.qo=()=>{if(!this.lo){var n,r,s,i,a=He.__PosthogExtensions__;if(!ye(a)&&!ye(a.postHogWebVitalsCallbacks)){var u=a.postHogWebVitalsCallbacks;n=u.onLCP,r=u.onCLS,s=u.onFCP,i=u.onINP}n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Ao.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Ao.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Ao.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Ao.bind(this)),this.lo=!0):Ma.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.wo=!((e=this._instance.persistence)==null||!e.props[oy]),this.startIfEnabled()}get jo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=Ot(this.jo)?(t=this.jo)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Xe(n)?((e=this._instance.persistence)==null?void 0:e.props[ay])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Ot(this.jo)?this.jo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Ot(this.jo)?this.jo.web_vitals_attribution:void 0;return t!=null&&t}get Do(){var t=Ot(this.jo)&&Vn(this.jo.__web_vitals_max_value)?this.jo.__web_vitals_max_value:jE;return t>0&&6e4>=t?jE:t}get isEnabled(){var t=on==null?void 0:on.protocol;if(t!=="http:"&&t!=="https:")return Ma.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ot(this.jo)?this.jo.web_vitals:Ds(this.jo)?this.jo:void 0;return Ds(e)?e:this.wo}startIfEnabled(){this.isEnabled&&!this.lo&&(Ma.info("enabled, starting..."),this.er(this.qo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=Ot(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Ot(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[oy]:n}),this._instance.persistence.register({[ay]:r})),this.wo=n,this.startIfEnabled()}}}er(t){var e,n;(e=He.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(n=He.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?Ma.error("failed to load script",r):t()}))}No(){var t=ne?this._instance.config.disable_capture_url_hashes?Qo(ne.location.href):ne.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Bu,...e||[]]:[];return $d(t,n,Hd)}Ma.error("Could not determine current URL")}}},XN={exceptionObserver:class{constructor(t){var e;this.qo=()=>{var n;if(ne&&this.isEnabled&&(n=He.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=He.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=He.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=He.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ho&&this.Te.capture_unhandled_errors&&(this.Ho=r(this.captureException.bind(this))),!this.Bo&&this.Te.capture_unhandled_rejections&&(this.Bo=s(this.captureException.bind(this))),!this.Uo&&this.Te.capture_console_errors&&(this.Uo=i(this.captureException.bind(this)))}catch(a){td.error("failed to start",a),this.zo()}}},this._instance=t,this.Vo=!((e=this._instance.persistence)==null||!e.props[ry]),this.Wo=new XO(de({},(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:td})),this.Te=this.Zo(),this.startIfEnabledOrStop()}Zo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ot(t)?e=de({},e,t):(ye(t)?this.Vo:t)&&(e=de({},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?(td.info("enabled"),this.zo(),this.er(this.qo)):this.zo()}er(t){var e,n;(e=He.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=He.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return td.error("failed to load script",r);t()}))}zo(){var t,e,n;(t=this.Ho)==null||t.call(this),this.Ho=void 0,(e=this.Bo)==null||e.call(this),this.Bo=void 0,(n=this.Uo)==null||n.call(this),this.Uo=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Vo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[ry]:this.Vo}),this.Te=this.Zo(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.Zo()}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.Wo.consumeRateLimit(s)?td.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.Go=[],this.Qo=new pL([new bL,new IL,new EL,new SL,new RL,new TL,new kL,new AL],(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(u,c){c===void 0&&(c=0);for(var d=[],h=u.split(`
18
- `),p=c;h.length>p;p++){var m=h[p];if(1024>=m.length){var y=oE.test(m)?m.replace(oE,"$1"):m;if(!y.match(/\S*Error: /)){for(var w of i){var _=w(y,r);if(_){d.push(_);break}}if(d.length>=50)break}}}return(function(x){if(!x.length)return[];var E=Array.from(x);return E.reverse(),E.slice(0,50).map((k=>{return de({},k,{filename:k.filename||(P=E,P[P.length-1]||{}).filename,function:k.function||zu});var P}))})(d)}})("web:javascript",yL,xL)),this._instance=t,this.Go=(e=(n=this._instance.persistence)==null?void 0:n.get_property(sy))!==null&&e!==void 0?e:[],this.Jo=em(this.Ko()),this.Yo=new OL(this.Jo)}onConfigChange(){this.Jo=em(this.Ko()),this.Yo.setConfig(this.Jo)}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.Go=i,this._instance.persistence&&this._instance.persistence.register({[sy]:this.Go,[iy]:a})}}}get Xo(){var t,e=!!this._instance.get_property(iy),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Qo.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Jo.enabled)try{if(!xt(t)||t.trim().length===0)return void Mi.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(((u,c)=>ML.has(c)?(a.push(c),u):(u[c]=i[c],u)),{}),droppedKeys:a}})(this.ea(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&Mi.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Yo.add(de({[Qp]:t,[Jp]:new Date().toISOString()},r))}catch(i){Mi.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.ta(e)){if(this.ra(e))return this.ia("Exception dropped: matched a suppression rule"),void Mi.info("Skipping exception capture because a suppression rule matched");if(!this.Xo&&this.na(e))return this.ia("Exception dropped: thrown by a browser extension"),void Mi.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.sa(e))return this.ia("Exception dropped: thrown by the PostHog SDK"),void Mi.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.Jo.enabled&&Xe(t.$exception_steps)?this.oa(t):t;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return r&&this.Yo.clear(),r}catch(s){return Mi.error("Failed to capture exception event. Dropping this exception.",s),void this.Yo.clear()}}catch(s){return void Mi.error("Failed to process exception event. Ignoring this exception.",s)}}oa(t){try{var e=this.Yo.getAttachable();return e.length===0?t:de({},t,{$exception_steps:e})}catch(n){return Mi.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}ia(t){this.Jo.enabled&&this.Yo.add({[Qp]:t,[Jp]:new Date().toISOString()})}ea(t){return Ot(t)?de({},t):{}}Ko(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}ra(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.Go.some((n=>{var r=n.values.map((s=>{var i,a=iP[s.operator],u=et(s.value)?s.value:[s.value],c=(i=e[s.key])!==null&&i!==void 0?i:[];return u.length>0&&a(u,c)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}na(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://")))}sa(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}ta(t){return!Xe(t)&&et(t)}}},QN=de({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.aa=null,this.la=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({[l2]:!!e.productTours}),!Rv(this._instance))return!this.aa&&Xe((n=this.mi)==null?void 0:n.props[hd])||Tv.info("product tours disabled; stopping and clearing cached tours"),(r=this.aa)==null||r.stop(),this.aa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.aa&&Rv(this._instance)&&this.er((()=>this.ua()))}er(t){var e,n;(e=He.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=He.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?Tv.error("Could not load product tours script",r):t()}))}ua(){var t;!this.aa&&(t=He.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.aa=He.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!et(this.la)||e){var n=this.mi;if(n){var r=n.props[hd];if(et(r)&&!e)return this.la=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",callback:s=>{if(Rv(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return Tv.error(a),void t([],{isLoaded:!1,error:a})}var u=et(s.json.product_tours)?s.json.product_tours:[];this.la=u,n&&n.register({[hd]:u}),t(u,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.la,{isLoaded:!0})}getActiveProductTours(t){Xe(this.aa)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.aa.getActiveProductTours(t)}showProductTour(t){var e;(e=this.aa)==null||e.showTourById(t)}previewTour(t){this.aa?this.aa.previewTour(t):this.er((()=>{var e;this.ua(),(e=this.aa)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.aa)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.aa)==null||t.nextStep()}previousStep(){var t;(t=this.aa)==null||t.previousStep()}clearCache(){var t;this.la=null,(t=this.mi)==null||t.unregister(hd)}resetTour(t){var e;(e=this.aa)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.aa)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.aa)==null||e.cancelPendingTour(t)}}},qm),JN={siteApps:class{constructor(t){this.ha=0,this._instance=t,this.da=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ca(t,e){if(e){var n=this.globalsForEvent(e);this.da.push(n),this.da.length>1e3&&(this.da=this.da.slice(10))}}get siteAppLoaders(){var t;return(t=He._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.ca.bind(this));this.va=()=>{t(),this.da=[],this.va=void 0}}}globalsForEvent(t){var e,n,r,s,i,a,u;if(!t)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(h)){var m=p[0];c[m]={id:d[m],type:m,properties:p[1]}}var y=t.$set_once,w=t.$set;return{event:de({},I8(t,UN),{properties:de({},t.properties,w?{$set:de({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},w)}:{},y?{$set_once:de({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},y)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(u=t.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}fa(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)||(Ys.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)||(Ys.error("prepare_external_dependency_script returned null"),null):t}pa(){var t,e,n,r,s,i,a,u;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var c=Se==null?void 0:Se.defaultView,d=c==null||(t=c.Node)==null?void 0:t.prototype;if(!c||!d)return()=>{};if(this.ha++,this.ga)return this.ma();var h=[],p=this,m=new WeakSet,y=(x,E,k)=>{if(x!=null&&x[E]){var P=x[E];x[E]=k(P),h.push((()=>{x[E]=P}))}},w=x=>{if(m.has(x))return x;var E=p.fa(x);return E&&m.add(E),E},_=x=>x.map((E=>typeof E=="string"?E:w(E))).filter((E=>!cr(E)));return y(d,"appendChild",(x=>function(E){var k=w(E);return k?x.call(this,k):E})),y(d,"insertBefore",(x=>function(E,k){var P=w(E);return P?x.call(this,P,k):E})),y(d,"replaceChild",(x=>function(E,k){var P=w(E);return P?x.call(this,P,k):k})),[(e=c.Element)==null?void 0:e.prototype,(n=c.Document)==null?void 0:n.prototype,(r=c.DocumentFragment)==null?void 0:r.prototype].forEach((x=>{y(x,"append",(E=>function(){for(var k=arguments.length,P=new Array(k),T=0;k>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(x,"prepend",(E=>function(){for(var k=arguments.length,P=new Array(k),T=0;k>T;T++)P[T]=arguments[T];return E.apply(this,_(P))}))})),[(s=c.Element)==null?void 0:s.prototype,(i=c.CharacterData)==null?void 0:i.prototype,(a=c.DocumentType)==null?void 0:a.prototype].forEach((x=>{y(x,"before",(E=>function(){for(var k=arguments.length,P=new Array(k),T=0;k>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(x,"after",(E=>function(){for(var k=arguments.length,P=new Array(k),T=0;k>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(x,"replaceWith",(E=>function(){for(var k=arguments.length,P=new Array(k),T=0;k>T;T++)P[T]=arguments[T];var A=_(P);return P.length&&!A.length?void 0:E.apply(this,A)}))})),y((u=c.Element)==null?void 0:u.prototype,"insertAdjacentElement",(x=>function(E,k){var P=w(k);return P?x.call(this,E,P):null})),this.ga=()=>{h.forEach((x=>x())),this.ga=void 0},this.ma()}ma(){var t=!1;return()=>{var e;t||(t=!0,this.ha--,this.ha===0&&((e=this.ga)==null||e.call(this)))}}ya(t,e){e===void 0&&(e=!0);var n=this.pa();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.da.length&&(Ys.info("Processing "+this.da.length+" events for site app with id "+t.id),this.da.forEach((u=>this.ya((()=>e.processEvent==null?void 0:e.processEvent(u))))),e.processedBuffer=!0),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((a=this.va)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,Ys.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var i=this.ya((a=>t.init({posthog:this._instance,callback(u){a(),s(u)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(a){Ys.error($E+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){Ys.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}ba(){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)}_a(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.ya((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){Ys.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.ba(),void this._instance.on("eventCaptured",(c=>this._a(c)))):void Ys.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.va)==null||n.call(this),t.ok){var i=t.config;if((r=i.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(){var c,d=u.id,h=u.url;He["__$$ph_site_app_"+d]=s._instance,(c=He.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(s._instance,h,(p=>{if(p)return Ys.error($E+d,p)}))};for(var u of i.siteApps)a()}else Ys.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},eD={tracingHeaders:class{constructor(t){this.wa=void 0,this.xa=void 0,this.ka=void 0,this.qo=()=>{var e,n,r=this.Sa();r?(ye(this.wa)&&(this.wa=(e=He.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),ye(this.xa)&&(this.xa=(n=He.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.zo()},this._instance=t}initialize(){this.startIfEnabledOrStop()}er(t){var e,n;(e=He.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=He.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return HN.error("failed to load script",r);t()}))}Ca(){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}Sa(){var t=this.Ca();return et(t)?(et(this.ka)?this.ka.splice(0,this.ka.length,...t):this.ka=[...t],t.length>0?this.ka:void 0):(et(this.ka)&&this.ka.splice(0),this.ka=t||void 0,this.ka)}zo(){var t,e;(t=this.wa)==null||t.call(this),(e=this.xa)==null||e.call(this),this.wa=void 0,this.xa=void 0}startIfEnabledOrStop(){this.Sa()?this.er(this.qo):this.zo()}}},tD=de({surveys:class{get Te(){return this._instance.config}constructor(t){this.Ia=void 0,this._surveyManager=null,this.Ta=!1,this.Ma=[],this.Ea=null,this.Ra=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(Xe(e))return yt.warn("Flags not loaded yet. Not loading surveys.");var n=et(e);this.Ia=n?e.length>0:e,yt.info("flags response received, isSurveysEnabled: "+this.Ia),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(lP)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.Ta)yt.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)yt.info(HE);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())yt.info("Not loading surveys in cookieless mode without consent.");else{var t=He==null?void 0:He.__PosthogExtensions__;if(t){if(!ye(this.Ia)||this.Te.advanced_enable_surveys){var e=this.Ia||this.Te.advanced_enable_surveys;this.Ta=!0;try{var n=t.generateSurveys;if(n)return void this.Pa(n,e);var r=t.loadExternalDependency;if(!r)return void this.Oa(c2);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.Oa("Could not load surveys script",s):this.Pa(t.generateSurveys,e)}))}catch(s){throw this.Oa("Error initializing surveys",s),s}finally{this.Ta=!1}}}else yt.error("PostHog Extensions not found.")}}Pa(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new GN(this._instance),yt.info("Surveys loaded successfully"),this.Fa({isLoaded:!0})}Oa(t,e){yt.error(t,e),this.Fa({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ma.push(t),this._surveyManager&&this.Fa({isLoaded:!0}),()=>{this.Ma=this.Ma.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Te.disable_surveys)return yt.info(HE),t([]);var n,r=this._instance.get_property(cy);if(r&&!e)return t(r,{isLoaded:!0}),void(this.La()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.Ea?this.Ea.then((s=>t(s.surveys,s.context))):(typeof Promise<"u"&&(this.Ea=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timeout:this.Te.surveys_request_timeout_ms,callback:s=>{var i;this.Ea=null;var a=s.statusCode;if(a!==200||!s.json){var u="Surveys API could not be loaded, status: "+a;yt.error(u),this.Ra=Date.now();var c={isLoaded:!1,error:u};return t([],c),void(n==null||n({surveys:[],context:c}))}this.Ra=null;var d,h=s.json.surveys||[],p=h.filter((y=>(function(w){return!(!w.start_date||w.end_date)})(y)&&(aP(y)||(function(w){var _;return!((_=w.conditions)==null||(_=_.actions)==null||(_=_.values)==null||!_.length)})(y))));p.length>0&&((d=this._surveyEventReceiver)==null||d.register(p)),(i=this._instance.persistence)==null||i.register({[cy]:h,[rm]:Date.now()});var m={isLoaded:!0};t(h,m),n==null||n({surveys:h,context:m})}}))}La(){return this.$a()&&!this.Ea&&!this.Aa()}$a(){var t=this._instance.get_property(rm);return Vn(t)&&Date.now()-t>3e5}Aa(){return Vn(this.Ra)&&3e5>Date.now()-this.Ra}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};uP(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}Fa(t){for(var e of this.Ma)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),!Xe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);yt.warn("init was not called")}Na(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}Da(t){if(Xe(this._surveyManager))return{eligible:!1,reason:Av};var e=typeof t=="string"?this.Na(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Xe(this._surveyManager))return yt.warn("init was not called"),{visible:!1,disabledReason:Av};var e=this.Da(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Xe(this._surveyManager)?(yt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Av})):new Promise((n=>{this.getSurveys((r=>{var s,i=(s=r.find((u=>u.id===t)))!==null&&s!==void 0?s:null;if(i){var a=this.Da(i);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(Xe(this._surveyManager))yt.warn("init was not called");else{var s=typeof t=="string"?this.Na(t):t;if(s!=null&&s.id)if(IN.includes(s.type)){var i=Se==null?void 0:Se.querySelector(e);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(yt.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,u;yt.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.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(Xe(this._surveyManager))yt.warn("init was not called");else{var r=this.Na(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=de({},r,{appearance:de({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==xy.Popover&&e.initialResponses&&yt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.canRenderSurvey(r);if(!i.visible)return void yt.warn("Survey is not eligible to be displayed: ",i.disabledReason)}e.displayType!==xy.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else yt.warn("Survey not found")}}cancelPendingSurvey(t){Xe(this._surveyManager)?yt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},qm),nD={toolbar:class{constructor(t){this.instance=t}qa(t){He.ph_toolbar_state=t}ja(){var t;return(t=He.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),w6(this.instance.config)||!ne||!Se)return!1;t=t??ne.location,n=n??ne.history;try{if(!e){try{ne.localStorage.setItem("test","test"),ne.localStorage.removeItem("test")}catch{return!1}e=ne==null?void 0:ne.localStorage}var r,s=KN||cm(t.hash,"__posthog")||cm(t.hash,"state"),i=s?uE((()=>JSON.parse(atob(decodeURIComponent(s)))))||uE((()=>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(zE)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Ha(t){var e=He.ph_load_toolbar||He.ph_load_editor;!Xe(e)&&Ns(e)?e(t,this.instance):UE.warn("No toolbar load function found")}loadToolbar(t){var e=!(Se==null||!Se.getElementById(E6));if(!ne||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=de({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ne.localStorage.setItem(zE,JSON.stringify(de({},r,{source:void 0}))),this.ja()===2)this.Ha(r);else if(this.ja()===0){var s;this.qa(1),(s=He.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return UE.error("[Toolbar] Failed to load",i),void this.qa(0);this.qa(2),this.Ha(r)})),Ht(ne,"turbolinks:load",(()=>{this.qa(0),this.loadToolbar(r)}))}return!0}Ba(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=de({experiments:Zn},qm),sD={conversations:class{constructor(t){this.Ua=void 0,this._conversationsManager=null,this.za=!1,this.Va=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;Xe(e)||(Ds(e)?this.Ua=e:(this.Ua=e.enabled,this.Va=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ua=void 0,this.Va=null}loadIfEnabled(){if(!(this._conversationsManager||this.za||this._instance.config.disable_conversations||w6(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=He==null?void 0:He.__PosthogExtensions__;if(t&&!ye(this.Ua)&&this.Ua)if(this.Va&&this.Va.token){this.za=!0;try{var e=t.initConversations;if(e)return this.Wa(e),void(this.za=!1);var n=t.loadExternalDependency;if(!n)return void this.Za(c2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.Za("Could not load conversations script",r):this.Wa(t.initConversations),this.za=!1}))}catch(r){this.Za("Error initializing conversations",r),this.za=!1}}else ls.error("Conversations enabled but missing token in remote config.")}}Wa(t){if(this.Va)try{this._conversationsManager=t(this.Va,this._instance),ls.info("Conversations loaded successfully")}catch(e){this.Za("Error completing conversations initialization",e)}else ls.error("Cannot complete initialization: remote config is null")}Za(t,e){ls.error(t,e),this._conversationsManager=null,this.za=!1}show(){this._conversationsManager?this._conversationsManager.show():ls.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ua===!0&&!cr(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return Jt((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(ls.warn(La),null)}))()}getMessages(t,e){var n=this;return Jt((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(ls.warn(La),null)}))()}markAsRead(t){var e=this;return Jt((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(ls.warn(La),null)}))()}getTickets(t){var e=this;return Jt((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(ls.warn(La),null)}))()}requestRestoreLink(t){var e=this;return Jt((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(ls.warn(La),null)}))()}restoreFromToken(t){var e=this;return Jt((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(ls.warn(La),null)}))()}restoreFromUrlToken(){var t=this;return Jt((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ls.warn(La),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.Ga=!1,this.Qa=!1,this.Ge=Dt("[logs]"),this.Gr=[],this.Ja=[],this.Ls=0,this.Ka=()=>{var n,r;this.Ls=0,(n=this.Ya)==null||n.onReconnect(),(r=this.Xa)==null||r.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Ga=!0),ne&&Ht(ne,"online",this.Ka)}el(t,e,n,r){var s,i=(function(a,u){var c,d,h,p,m,y,w,_=(c=a==null?void 0:a.flushIntervalMs)!==null&&c!==void 0?c:3e3,x=(d=a==null?void 0:a.maxBufferSize)!==null&&d!==void 0?d:100,E=u!=null&&u.consoleCapture?void 0:(h=a==null?void 0:a.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,k=ye(E)?Math.max(x,2048):Math.max(x,E),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:u==null?void 0:u.serviceNameDefault,serviceVersion:(y=P==null?void 0:P["service.version"])!==null&&y!==void 0?y:a==null?void 0:a.serviceVersion,environment:(w=P==null?void 0:P["deployment.environment"])!==null&&w!==void 0?w:a==null?void 0:a.environment,resourceAttributes:P,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:_,maxBufferSize:x,maxQueueSize:k,maxBatchRecordsPerPost:100,rateCapWindowMs:_,maxLogsPerInterval:E,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new dL(this.tl(t,e),i,this.Ge,(()=>this.rl()),(a=>a()),void 0,r),i]}il(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Ya||this.nl!==e){var n;(n=this.Ya)==null||n.reset(),this.nl=e;var r=this.el((()=>this.Gr),(s=>{this.Gr=s}));this.Ya=r[0],this.sl=r[1]}return this.Ya}ol(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Xa||this.al!==e){var n;(n=this.Xa)==null||n.reset(),this.al=e;var r=this.el((()=>this.Ja),(s=>{this.Ja=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},KE);this.Xa=r[0],this.ll=r[1]}return this.Xa}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!Xe(n)&&n&&(this.Ga=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],(t=this.Ya)==null||t.reset(),this.Ja=[],(e=this.Xa)==null||e.reset(),this.Ls=0}captureLog(t){this.il().captureLog(t)}le(t){this.ol().captureLog(t)}get logger(){return this.ul||(this.ul={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.ul}flushLogs(t){t?this.hl(t):(this.Ya&&this.Ya.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))),this.Xa&&this.Xa.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.Ga&&!this.Qa){var t=He==null?void 0:He.__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.Qa=!0)})):this.Ge.error(c2)}else this.Ge.error("PostHog Extensions not found.")}}tl(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Hi.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Hi.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},It:r=>this.It(r),getLibraryId:()=>wt.LIB_NAME,getLibraryVersion:()=>wt.LIB_VERSION}}It(t){return new Promise((e=>{if(F6(this.Ls,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.dl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this.cl(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 u;r({kind:"retry-later",error:(u=i.error)!==null&&u!==void 0?u:new Error("logs request failed with status "+a)})}}})}}))}cl(t){(t!==0||this._instance.__loaded)&&(this.Ls=V6(t,this.Ls,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."))))}hl(t){this.Gr.length>0&&this.vl(t,this.Gr,this.sl,wt.LIB_NAME,(e=>{this.Gr=e})),this.Ja.length>0&&this.vl(t,this.Ja,this.ll,KE,(e=>{this.Ja=e}))}vl(t,e,n,r,s){if(e.length!==0){var i=e.map((u=>u.record));s([]);var a=o6(i,i6(n,wt.LIB_NAME,wt.LIB_VERSION),r,wt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.dl(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}dl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}rl(){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,Xe(s)||(e.sessionStartTimestamp=s),Xe(i)||(e.lastActivityTimestamp=i)}if(He!=null&&(t=He.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Qo(He.location.href):He.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},oD={metrics:class{constructor(t){this.Ge=Dt("[metrics]"),this._instance=t}initialize(){}il(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.Ya&&this.nl===n||((e=this.Ya)==null||e.reset(),this.nl=n,this.Ya=new fL(this.tl(),(function(r){var s,i,a,u,c,d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(a=d==null?void 0:d["deployment.environment"])!==null&&a!==void 0?a:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(u=r==null?void 0:r.flushIntervalMs)!==null&&u!==void 0?u:1e4,maxSeriesPerFlush:(c=r==null?void 0:r.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3}})(n),this.Ge)),this.Ya}count(t,e,n){e===void 0&&(e=1),this.il().count(t,e,n)}gauge(t,e,n){this.il().gauge(t,e,n)}histogram(t,e,n){this.il().histogram(t,e,n)}flush(t){if(!this.Ya)return Promise.resolve();if(t){var e=this.Ya.drainWindow();return e&&this.Bt(e,t),Promise.resolve()}return this.Ya.flush().catch((n=>this.Ge.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.Ya)==null||t.reset()}tl(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Bt:n=>e.Bt(n),getLibraryId:()=>wt.LIB_NAME,getLibraryVersion:()=>wt.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(de({method:"POST",url:this.fl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(a){var u=a.statusCode;if(u>=200&&300>u)s({kind:"ok"});else if(u===413)s({kind:"too-large"});else if(u!==0&&u!==429&&500>u)s({kind:"fatal",error:new Error("metrics request failed with status "+u)});else{var c;s({kind:"retry-later",error:(c=a.error)!==null&&c!==void 0?c:new Error("metrics request failed with status "+u)})}}}))}))}fl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},aD=de({},qm,qN,YN,XN,QN,JN,tD,eD,nD,rD,sD,iD,oD);ds.__defaultExtensionClasses=de({},aD);var Te=(function(){wt.SDK_DIST_CHANNEL="npm";var t=bd[au]=new ds;return(function(){function e(){e.done||(e.done=!0,dP=!1,bt(bd,(function(n){n._dom_loaded()})))}Se!=null&&Se.addEventListener?Se.readyState==="complete"?e():Ht(Se,"DOMContentLoaded",e,{capture:!1}):ne&&xe.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),fP;function lD(t){fP=t}function Ay(){return fP}var _2=v.createContext({get client(){return Ay()},bootstrap:void 0});function hP(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 u=a[i];if(!s.includes(u)||!hP(t[u],e[u],n))return!1}return!0}function uD(t){var e,n,r=t.children,s=t.client,i=t.apiKey,a=t.options,u=v.useRef(null),c=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 d=Ay();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),d},[s,i,JSON.stringify(a)]);return v.useEffect(function(){if(!(s||!i)){var d=Ay(),h=u.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&&!hP(a,h.options)&&d.set_config(a),u.current={apiKey:i,options:a??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,a),u.current={apiKey:i,options:a??{}})}},[s,i,JSON.stringify(a)]),_e.createElement(_2.Provider,{value:{client:c,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 Mv=function(t){return typeof t=="function"},cD=function(){var t=v.useContext(_2).client;return t},Iy=function(t,e){return Iy=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])},Iy(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");Iy(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var fD={componentStack:null,exceptionEvent:null,error:null},hD={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},pD=(function(t){dD(e,t);function e(n){var r=t.call(this,n)||this;return r.state=fD,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Mv(s)?i=s(n):typeof s=="object"&&(i=s);var a=this.context.client,u=a.captureException(n,i),c=r.componentStack;this.setState({error:n,componentStack:c??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return Mv(r)?r():r;var a=Mv(s)?_e.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return _e.isValidElement(a)?a:(console.warn(hD.INVALID_FALLBACK),_e.createElement(_e.Fragment,null))},e.contextType=_2,e})(_e.Component);lD(Te);var Zh={},Ov={exports:{}},wr={},Lv={exports:{}},Nv={};/**
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 ZE;function mD(){return ZE||(ZE=1,(function(t){function e($,ee){var z=$.length;$.push(ee);e:for(;0<z;){var D=z-1>>>1,Y=$[D];if(0<s(Y,ee))$[D]=ee,$[z]=Y,z=D;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var ee=$[0],z=$.pop();if(z!==ee){$[0]=z;e:for(var D=0,Y=$.length,te=Y>>>1;D<te;){var ie=2*(D+1)-1,ae=$[ie],ue=ie+1,Ce=$[ue];if(0>s(ae,z))ue<Y&&0>s(Ce,ae)?($[D]=Ce,$[ue]=z,D=ue):($[D]=ae,$[ie]=z,D=ie);else if(ue<Y&&0>s(Ce,z))$[D]=Ce,$[ue]=z,D=ue;else break e}}return ee}function s($,ee){var z=$.sortIndex-ee.sortIndex;return z!==0?z:$.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var c=[],d=[],h=1,p=null,m=3,y=!1,w=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P($){for(var ee=n(d);ee!==null;){if(ee.callback===null)r(d);else if(ee.startTime<=$)r(d),ee.sortIndex=ee.expirationTime,e(c,ee);else break;ee=n(d)}}function T($){if(_=!1,P($),!w)if(n(c)!==null)w=!0,K(A);else{var ee=n(d);ee!==null&&X(T,ee.startTime-$)}}function A($,ee){w=!1,_&&(_=!1,E(R),R=-1),y=!0;var z=m;try{for(P(ee),p=n(c);p!==null&&(!(p.expirationTime>ee)||$&&!j());){var D=p.callback;if(typeof D=="function"){p.callback=null,m=p.priorityLevel;var Y=D(p.expirationTime<=ee);ee=t.unstable_now(),typeof Y=="function"?p.callback=Y:p===n(c)&&r(c),P(ee)}else r(c);p=n(c)}if(p!==null)var te=!0;else{var ie=n(d);ie!==null&&X(T,ie.startTime-ee),te=!1}return te}finally{p=null,m=z,y=!1}}var L=!1,O=null,R=-1,M=5,N=-1;function j(){return!(t.unstable_now()-N<M)}function F(){if(O!==null){var $=t.unstable_now();N=$;var ee=!0;try{ee=O(!0,$)}finally{ee?q():(L=!1,O=null)}}else L=!1}var q;if(typeof k=="function")q=function(){k(F)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,W=G.port2;G.port1.onmessage=F,q=function(){W.postMessage(null)}}else q=function(){x(F,0)};function K($){O=$,L||(L=!0,q())}function X($,ee){R=x(function(){$(t.unstable_now())},ee)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){w||y||(w=!0,K(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(c)},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var ee=3;break;default:ee=m}var z=m;m=ee;try{return $()}finally{m=z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,ee){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var z=m;m=$;try{return ee()}finally{m=z}},t.unstable_scheduleCallback=function($,ee,z){var D=t.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?D+z:D):z=D,$){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=z+Y,$={id:h++,callback:ee,priorityLevel:$,startTime:z,expirationTime:Y,sortIndex:-1},z>D?($.sortIndex=z,e(d,$),n(c)===null&&$===n(d)&&(_?(E(R),R=-1):_=!0,X(T,z-D))):($.sortIndex=Y,e(c,$),w||y||(w=!0,K(A))),$},t.unstable_shouldYield=j,t.unstable_wrapCallback=function($){var ee=m;return function(){var z=m;m=ee;try{return $.apply(this,arguments)}finally{m=z}}}})(Nv)),Nv}var qE;function gD(){return qE||(qE=1,Lv.exports=mD()),Lv.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 YE;function vD(){if(YE)return wr;YE=1;var t=Y_(),e=gD();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);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 u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function m(o){return c.call(p,o)?!0:c.call(h,o)?!1:d.test(o)?p[o]=!0:(h[o]=!0,!1)}function y(o,l,f,g){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:f!==null?!f.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function w(o,l,f,g){if(l===null||typeof l>"u"||y(o,l,f,g))return!0;if(g)return!1;if(f!==null)switch(f.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 _(o,l,f,g,b,C,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=b,this.mustUseProperty=f,this.propertyName=o,this.type=l,this.sanitizeURL=C,this.removeEmptyString=I}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){x[o]=new _(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];x[l]=new _(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){x[o]=new _(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){x[o]=new _(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){x[o]=new _(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){x[o]=new _(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){x[o]=new _(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){x[o]=new _(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){x[o]=new _(o,5,!1,o.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function k(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(E,k);x[l]=new _(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(E,k);x[l]=new _(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(E,k);x[l]=new _(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){x[o]=new _(o,1,!1,o.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){x[o]=new _(o,1,!1,o.toLowerCase(),null,!0,!0)});function P(o,l,f,g){var b=x.hasOwnProperty(l)?x[l]:null;(b!==null?b.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(w(l,f,b,g)&&(f=null),g||b===null?m(l)&&(f===null?o.removeAttribute(l):o.setAttribute(l,""+f)):b.mustUseProperty?o[b.propertyName]=f===null?b.type===3?!1:"":f:(l=b.attributeName,g=b.attributeNamespace,f===null?o.removeAttribute(l):(b=b.type,f=b===3||b===4&&f===!0?"":""+f,g?o.setAttributeNS(g,l,f):o.setAttribute(l,f))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),L=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),j=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),$=Symbol.iterator;function ee(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var z=Object.assign,D;function Y(o){if(D===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);D=l&&l[1]||""}return`
35
- `+D+o}var te=!1;function ie(o,l){if(!o||te)return"";te=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(re){var g=re}Reflect.construct(o,[],l)}else{try{l.call()}catch(re){g=re}o.call(l.prototype)}else{try{throw Error()}catch(re){g=re}o()}}catch(re){if(re&&g&&typeof re.stack=="string"){for(var b=re.stack.split(`
36
- `),C=g.stack.split(`
37
- `),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 U=`
38
- `+b[I].replace(" at new "," at ");return o.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",o.displayName)),U}while(1<=I&&0<=V);break}}}finally{te=!1,Error.prepareStackTrace=f}return(o=o?o.displayName||o.name:"")?Y(o):""}function ae(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 ue(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case O:return"Fragment";case L:return"Portal";case M:return"Profiler";case R:return"StrictMode";case q:return"Suspense";case G:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case j:return(o.displayName||"Context")+".Consumer";case N:return(o._context.displayName||"Context")+".Provider";case F:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case W:return l=o.displayName||null,l!==null?l:ue(o.type)||"Memo";case K:l=o._payload,o=o._init;try{return ue(o(l))}catch{}}return null}function Ce(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 ue(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 se(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function he(o){var l=se(o)?"checked":"value",f=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),g=""+o[l];if(!o.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var b=f.get,C=f.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:f.enumerable}),{getValue:function(){return g},setValue:function(I){g=""+I},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Pe(o){o._valueTracker||(o._valueTracker=he(o))}function be(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var f=l.getValue(),g="";return o&&(g=se(o)?o.checked?"true":"false":o.value),o=g,o!==f?(l.setValue(o),!0):!1}function $e(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 ot(o,l){var f=l.checked;return z({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??o._wrapperState.initialChecked})}function Zt(o,l){var f=l.defaultValue==null?"":l.defaultValue,g=l.checked!=null?l.checked:l.defaultChecked;f=oe(l.value!=null?l.value:f),o._wrapperState={initialChecked:g,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ge(o,l){l=l.checked,l!=null&&P(o,"checked",l,!1)}function gt(o,l){ge(o,l);var f=oe(l.value),g=l.type;if(f!=null)g==="number"?(f===0&&o.value===""||o.value!=f)&&(o.value=""+f):o.value!==""+f&&(o.value=""+f);else if(g==="submit"||g==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?je(o,l.type,f):l.hasOwnProperty("defaultValue")&&je(o,l.type,oe(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function dt(o,l,f){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,f||l===o.value||(o.value=l),o.defaultValue=l}f=o.name,f!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,f!==""&&(o.name=f)}function je(o,l,f){(l!=="number"||$e(o.ownerDocument)!==o)&&(f==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+f&&(o.defaultValue=""+f))}var Je=Array.isArray;function it(o,l,f,g){if(o=o.options,l){l={};for(var b=0;b<f.length;b++)l["$"+f[b]]=!0;for(f=0;f<o.length;f++)b=l.hasOwnProperty("$"+o[f].value),o[f].selected!==b&&(o[f].selected=b),b&&g&&(o[f].defaultSelected=!0)}else{for(f=""+oe(f),l=null,b=0;b<o.length;b++){if(o[b].value===f){o[b].selected=!0,g&&(o[b].defaultSelected=!0);return}l!==null||o[b].disabled||(l=o[b])}l!==null&&(l.selected=!0)}}function Ze(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return z({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function _t(o,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(n(92));if(Je(f)){if(1<f.length)throw Error(n(93));f=f[0]}l=f}l==null&&(l=""),f=l}o._wrapperState={initialValue:oe(f)}}function xn(o,l){var f=oe(l.value),g=oe(l.defaultValue);f!=null&&(f=""+f,f!==o.value&&(o.value=f),l.defaultValue==null&&o.defaultValue!==f&&(o.defaultValue=f)),g!=null&&(o.defaultValue=""+g)}function jt(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function An(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 zn(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?An(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Lr,Jn=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,g,b){MSApp.execUnsafeLocalFunction(function(){return o(l,f,g,b)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(Lr=Lr||document.createElement("div"),Lr.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Lr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function bn(o,l){if(l){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=l;return}}o.textContent=l}var Vs={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},$s=["Webkit","ms","Moz","O"];Object.keys(Vs).forEach(function(o){$s.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Vs[l]=Vs[o]})});function In(o,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||Vs.hasOwnProperty(o)&&Vs[o]?(""+l).trim():l+"px"}function vi(o,l){o=o.style;for(var f in l)if(l.hasOwnProperty(f)){var g=f.indexOf("--")===0,b=In(f,l[f],g);f==="float"&&(f="cssFloat"),g?o.setProperty(f,b):o[f]=b}}var yi=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ys(o,l){if(l){if(yi[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 Hs(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fr=null;function er(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var zs=null,_s=null,Nr=null;function _i(o){if(o=Ac(o)){if(typeof zs!="function")throw Error(n(280));var l=o.stateNode;l&&(l=Qf(l),zs(o.stateNode,o.type,l))}}function Ke(o){_s?Nr?Nr.push(o):Nr=[o]:_s=o}function At(){if(_s){var o=_s,l=Nr;if(Nr=_s=null,_i(o),l)for(o=0;o<l.length;o++)_i(l[o])}}function tn(o,l){return o(l)}function nn(){}var Us=!1;function qt(o,l,f){if(Us)return o(l,f);Us=!0;try{return tn(o,l,f)}finally{Us=!1,(_s!==null||Nr!==null)&&(nn(),At())}}function cn(o,l){var f=o.stateNode;if(f===null)return null;var g=Qf(f);if(g===null)return null;f=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(f&&typeof f!="function")throw Error(n(231,l,typeof f));return f}var ws=!1;if(u)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){ws=!0}}),window.addEventListener("test",dn,dn),window.removeEventListener("test",dn,dn)}catch{ws=!1}function Un(o,l,f,g,b,C,I,V,U){var re=Array.prototype.slice.call(arguments,3);try{l.apply(f,re)}catch(fe){this.onError(fe)}}var Bs=!1,hr=null,ga=!1,Sl=null,x0={onError:function(o){Bs=!0,hr=o}};function b0(o,l,f,g,b,C,I,V,U){Bs=!1,hr=null,Un.apply(x0,arguments)}function ac(o,l,f,g,b,C,I,V,U){if(b0.apply(this,arguments),Bs){if(Bs){var re=hr;Bs=!1,hr=null}else throw Error(n(198));ga||(ga=!0,Sl=re)}}function wi(o){var l=o,f=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(f=l.return),o=l.return;while(o)}return l.tag===3?f:null}function Of(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 Lf(o){if(wi(o)!==o)throw Error(n(188))}function S0(o){var l=o.alternate;if(!l){if(l=wi(o),l===null)throw Error(n(188));return l!==o?null:o}for(var f=o,g=l;;){var b=f.return;if(b===null)break;var C=b.alternate;if(C===null){if(g=b.return,g!==null){f=g;continue}break}if(b.child===C.child){for(C=b.child;C;){if(C===f)return Lf(b),o;if(C===g)return Lf(b),l;C=C.sibling}throw Error(n(188))}if(f.return!==g.return)f=b,g=C;else{for(var I=!1,V=b.child;V;){if(V===f){I=!0,f=b,g=C;break}if(V===g){I=!0,g=b,f=C;break}V=V.sibling}if(!I){for(V=C.child;V;){if(V===f){I=!0,f=C,g=b;break}if(V===g){I=!0,g=C,f=b;break}V=V.sibling}if(!I)throw Error(n(189))}}if(f.alternate!==g)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?o:l}function El(o){return o=S0(o),o!==null?Cl(o):null}function Cl(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=Cl(o);if(l!==null)return l;o=o.sibling}return null}var lc=e.unstable_scheduleCallback,Nf=e.unstable_cancelCallback,ix=e.unstable_shouldYield,uo=e.unstable_requestPaint,Ft=e.unstable_now,uc=e.unstable_getCurrentPriorityLevel,cc=e.unstable_ImmediatePriority,dc=e.unstable_UserBlockingPriority,xi=e.unstable_NormalPriority,fc=e.unstable_LowPriority,hc=e.unstable_IdlePriority,va=null,Dr=null;function Df(o){if(Dr&&typeof Dr.onCommitFiberRoot=="function")try{Dr.onCommitFiberRoot(va,o,void 0,(o.current.flags&128)===128)}catch{}}var H=Math.clz32?Math.clz32:ve,le=Math.log,Re=Math.LN2;function ve(o){return o>>>=0,o===0?32:31-(le(o)/Re|0)|0}var pe=64,ke=4194304;function We(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Ee(o,l){var f=o.pendingLanes;if(f===0)return 0;var g=0,b=o.suspendedLanes,C=o.pingedLanes,I=f&268435455;if(I!==0){var V=I&~b;V!==0?g=We(V):(C&=I,C!==0&&(g=We(C)))}else I=f&~b,I!==0?g=We(I):C!==0&&(g=We(C));if(g===0)return 0;if(l!==0&&l!==g&&(l&b)===0&&(b=g&-g,C=l&-l,b>=C||b===16&&(C&4194240)!==0))return l;if((g&4)!==0&&(g|=f&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=g;0<l;)f=31-H(l),b=1<<f,g|=o[f],l&=~b;return g}function tr(o,l){switch(o){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pr(o,l){for(var f=o.suspendedLanes,g=o.pingedLanes,b=o.expirationTimes,C=o.pendingLanes;0<C;){var I=31-H(C),V=1<<I,U=b[I];U===-1?((V&f)===0||(V&g)!==0)&&(b[I]=tr(V,l)):U<=l&&(o.expiredLanes|=V),C&=~V}}function es(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function xs(){var o=pe;return pe<<=1,(pe&4194240)===0&&(pe=64),o}function ts(o){for(var l=[],f=0;31>f;f++)l.push(o);return l}function rn(o,l,f){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-H(l),o[l]=f}function Ws(o,l){var f=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<f;){var b=31-H(f),C=1<<b;l[b]=0,g[b]=-1,o[b]=-1,f&=~C}}function bs(o,l){var f=o.entangledLanes|=l;for(o=o.entanglements;f;){var g=31-H(f),b=1<<g;b&l|o[g]&l&&(o[g]|=l),f&=~b}}var vt=0;function ox(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var ax,E0,lx,ux,cx,C0=!1,jf=[],co=null,fo=null,ho=null,pc=new Map,mc=new Map,po=[],yI="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 dx(o,l){switch(o){case"focusin":case"focusout":co=null;break;case"dragenter":case"dragleave":fo=null;break;case"mouseover":case"mouseout":ho=null;break;case"pointerover":case"pointerout":pc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":mc.delete(l.pointerId)}}function gc(o,l,f,g,b,C){return o===null||o.nativeEvent!==C?(o={blockedOn:l,domEventName:f,eventSystemFlags:g,nativeEvent:C,targetContainers:[b]},l!==null&&(l=Ac(l),l!==null&&E0(l)),o):(o.eventSystemFlags|=g,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function _I(o,l,f,g,b){switch(l){case"focusin":return co=gc(co,o,l,f,g,b),!0;case"dragenter":return fo=gc(fo,o,l,f,g,b),!0;case"mouseover":return ho=gc(ho,o,l,f,g,b),!0;case"pointerover":var C=b.pointerId;return pc.set(C,gc(pc.get(C)||null,o,l,f,g,b)),!0;case"gotpointercapture":return C=b.pointerId,mc.set(C,gc(mc.get(C)||null,o,l,f,g,b)),!0}return!1}function fx(o){var l=ya(o.target);if(l!==null){var f=wi(l);if(f!==null){if(l=f.tag,l===13){if(l=Of(f),l!==null){o.blockedOn=l,cx(o.priority,function(){lx(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Ff(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var f=P0(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(f===null){f=o.nativeEvent;var g=new f.constructor(f.type,f);fr=g,f.target.dispatchEvent(g),fr=null}else return l=Ac(f),l!==null&&E0(l),o.blockedOn=f,!1;l.shift()}return!0}function hx(o,l,f){Ff(o)&&f.delete(l)}function wI(){C0=!1,co!==null&&Ff(co)&&(co=null),fo!==null&&Ff(fo)&&(fo=null),ho!==null&&Ff(ho)&&(ho=null),pc.forEach(hx),mc.forEach(hx)}function vc(o,l){o.blockedOn===l&&(o.blockedOn=null,C0||(C0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,wI)))}function yc(o){function l(b){return vc(b,o)}if(0<jf.length){vc(jf[0],o);for(var f=1;f<jf.length;f++){var g=jf[f];g.blockedOn===o&&(g.blockedOn=null)}}for(co!==null&&vc(co,o),fo!==null&&vc(fo,o),ho!==null&&vc(ho,o),pc.forEach(l),mc.forEach(l),f=0;f<po.length;f++)g=po[f],g.blockedOn===o&&(g.blockedOn=null);for(;0<po.length&&(f=po[0],f.blockedOn===null);)fx(f),f.blockedOn===null&&po.shift()}var kl=T.ReactCurrentBatchConfig,Vf=!0;function xI(o,l,f,g){var b=vt,C=kl.transition;kl.transition=null;try{vt=1,k0(o,l,f,g)}finally{vt=b,kl.transition=C}}function bI(o,l,f,g){var b=vt,C=kl.transition;kl.transition=null;try{vt=4,k0(o,l,f,g)}finally{vt=b,kl.transition=C}}function k0(o,l,f,g){if(Vf){var b=P0(o,l,f,g);if(b===null)B0(o,l,g,$f,f),dx(o,g);else if(_I(b,o,l,f,g))g.stopPropagation();else if(dx(o,g),l&4&&-1<yI.indexOf(o)){for(;b!==null;){var C=Ac(b);if(C!==null&&ax(C),C=P0(o,l,f,g),C===null&&B0(o,l,g,$f,f),C===b)break;b=C}b!==null&&g.stopPropagation()}else B0(o,l,g,null,f)}}var $f=null;function P0(o,l,f,g){if($f=null,o=er(g),o=ya(o),o!==null)if(l=wi(o),l===null)o=null;else if(f=l.tag,f===13){if(o=Of(l),o!==null)return o;o=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return $f=o,null}function px(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(uc()){case cc:return 1;case dc:return 4;case xi:case fc:return 16;case hc:return 536870912;default:return 16}default:return 16}}var mo=null,T0=null,Hf=null;function mx(){if(Hf)return Hf;var o,l=T0,f=l.length,g,b="value"in mo?mo.value:mo.textContent,C=b.length;for(o=0;o<f&&l[o]===b[o];o++);var I=f-o;for(g=1;g<=I&&l[f-g]===b[C-g];g++);return Hf=b.slice(o,1<g?1-g:void 0)}function zf(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 Uf(){return!0}function gx(){return!1}function jr(o){function l(f,g,b,C,I){this._reactName=f,this._targetInst=b,this.type=g,this.nativeEvent=C,this.target=I,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(f=o[V],this[V]=f?f(C):C[V]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Uf:gx,this.isPropagationStopped=gx,this}return z(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Uf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Uf)},persist:function(){},isPersistent:Uf}),l}var Pl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},R0=jr(Pl),_c=z({},Pl,{view:0,detail:0}),SI=jr(_c),A0,I0,wc,Bf=z({},_c,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:O0,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!==wc&&(wc&&o.type==="mousemove"?(A0=o.screenX-wc.screenX,I0=o.screenY-wc.screenY):I0=A0=0,wc=o),A0)},movementY:function(o){return"movementY"in o?o.movementY:I0}}),vx=jr(Bf),EI=z({},Bf,{dataTransfer:0}),CI=jr(EI),kI=z({},_c,{relatedTarget:0}),M0=jr(kI),PI=z({},Pl,{animationName:0,elapsedTime:0,pseudoElement:0}),TI=jr(PI),RI=z({},Pl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),AI=jr(RI),II=z({},Pl,{data:0}),yx=jr(II),MI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OI={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"},LI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function NI(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=LI[o])?!!l[o]:!1}function O0(){return NI}var DI=z({},_c,{key:function(o){if(o.key){var l=MI[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=zf(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?OI[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:O0,charCode:function(o){return o.type==="keypress"?zf(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?zf(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),jI=jr(DI),FI=z({},Bf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_x=jr(FI),VI=z({},_c,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:O0}),$I=jr(VI),HI=z({},Pl,{propertyName:0,elapsedTime:0,pseudoElement:0}),zI=jr(HI),UI=z({},Bf,{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}),BI=jr(UI),WI=[9,13,27,32],L0=u&&"CompositionEvent"in window,xc=null;u&&"documentMode"in document&&(xc=document.documentMode);var GI=u&&"TextEvent"in window&&!xc,wx=u&&(!L0||xc&&8<xc&&11>=xc),xx=" ",bx=!1;function Sx(o,l){switch(o){case"keyup":return WI.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ex(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Tl=!1;function KI(o,l){switch(o){case"compositionend":return Ex(l);case"keypress":return l.which!==32?null:(bx=!0,xx);case"textInput":return o=l.data,o===xx&&bx?null:o;default:return null}}function ZI(o,l){if(Tl)return o==="compositionend"||!L0&&Sx(o,l)?(o=mx(),Hf=T0=mo=null,Tl=!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 wx&&l.locale!=="ko"?null:l.data;default:return null}}var qI={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 Cx(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!qI[o.type]:l==="textarea"}function kx(o,l,f,g){Ke(g),l=qf(l,"onChange"),0<l.length&&(f=new R0("onChange","change",null,f,g),o.push({event:f,listeners:l}))}var bc=null,Sc=null;function YI(o){Bx(o,0)}function Wf(o){var l=Ol(o);if(be(l))return o}function XI(o,l){if(o==="change")return l}var Px=!1;if(u){var N0;if(u){var D0="oninput"in document;if(!D0){var Tx=document.createElement("div");Tx.setAttribute("oninput","return;"),D0=typeof Tx.oninput=="function"}N0=D0}else N0=!1;Px=N0&&(!document.documentMode||9<document.documentMode)}function Rx(){bc&&(bc.detachEvent("onpropertychange",Ax),Sc=bc=null)}function Ax(o){if(o.propertyName==="value"&&Wf(Sc)){var l=[];kx(l,Sc,o,er(o)),qt(YI,l)}}function QI(o,l,f){o==="focusin"?(Rx(),bc=l,Sc=f,bc.attachEvent("onpropertychange",Ax)):o==="focusout"&&Rx()}function JI(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Wf(Sc)}function eM(o,l){if(o==="click")return Wf(l)}function tM(o,l){if(o==="input"||o==="change")return Wf(l)}function nM(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ss=typeof Object.is=="function"?Object.is:nM;function Ec(o,l){if(Ss(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var f=Object.keys(o),g=Object.keys(l);if(f.length!==g.length)return!1;for(g=0;g<f.length;g++){var b=f[g];if(!c.call(l,b)||!Ss(o[b],l[b]))return!1}return!0}function Ix(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Mx(o,l){var f=Ix(o);o=0;for(var g;f;){if(f.nodeType===3){if(g=o+f.textContent.length,o<=l&&g>=l)return{node:f,offset:l-o};o=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Ix(f)}}function Ox(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?Ox(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function Lx(){for(var o=window,l=$e();l instanceof o.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)o=l.contentWindow;else break;l=$e(o.document)}return l}function j0(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 rM(o){var l=Lx(),f=o.focusedElem,g=o.selectionRange;if(l!==f&&f&&f.ownerDocument&&Ox(f.ownerDocument.documentElement,f)){if(g!==null&&j0(f)){if(l=g.start,o=g.end,o===void 0&&(o=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(o,f.value.length);else if(o=(l=f.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var b=f.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=Mx(f,C);var I=Mx(f,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=f;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)o=l[f],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var sM=u&&"documentMode"in document&&11>=document.documentMode,Rl=null,F0=null,Cc=null,V0=!1;function Nx(o,l,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;V0||Rl==null||Rl!==$e(g)||(g=Rl,"selectionStart"in g&&j0(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}),Cc&&Ec(Cc,g)||(Cc=g,g=qf(F0,"onSelect"),0<g.length&&(l=new R0("onSelect","select",null,l,f),o.push({event:l,listeners:g}),l.target=Rl)))}function Gf(o,l){var f={};return f[o.toLowerCase()]=l.toLowerCase(),f["Webkit"+o]="webkit"+l,f["Moz"+o]="moz"+l,f}var Al={animationend:Gf("Animation","AnimationEnd"),animationiteration:Gf("Animation","AnimationIteration"),animationstart:Gf("Animation","AnimationStart"),transitionend:Gf("Transition","TransitionEnd")},$0={},Dx={};u&&(Dx=document.createElement("div").style,"AnimationEvent"in window||(delete Al.animationend.animation,delete Al.animationiteration.animation,delete Al.animationstart.animation),"TransitionEvent"in window||delete Al.transitionend.transition);function Kf(o){if($0[o])return $0[o];if(!Al[o])return o;var l=Al[o],f;for(f in l)if(l.hasOwnProperty(f)&&f in Dx)return $0[o]=l[f];return o}var jx=Kf("animationend"),Fx=Kf("animationiteration"),Vx=Kf("animationstart"),$x=Kf("transitionend"),Hx=new Map,zx="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 go(o,l){Hx.set(o,l),i(l,[o])}for(var H0=0;H0<zx.length;H0++){var z0=zx[H0],iM=z0.toLowerCase(),oM=z0[0].toUpperCase()+z0.slice(1);go(iM,"on"+oM)}go(jx,"onAnimationEnd"),go(Fx,"onAnimationIteration"),go(Vx,"onAnimationStart"),go("dblclick","onDoubleClick"),go("focusin","onFocus"),go("focusout","onBlur"),go($x,"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 kc="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(" "),aM=new Set("cancel close invalid load scroll toggle".split(" ").concat(kc));function Ux(o,l,f){var g=o.type||"unknown-event";o.currentTarget=f,ac(g,l,void 0,o),o.currentTarget=null}function Bx(o,l){l=(l&4)!==0;for(var f=0;f<o.length;f++){var g=o[f],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],U=V.instance,re=V.currentTarget;if(V=V.listener,U!==C&&b.isPropagationStopped())break e;Ux(b,V,re),C=U}else for(I=0;I<g.length;I++){if(V=g[I],U=V.instance,re=V.currentTarget,V=V.listener,U!==C&&b.isPropagationStopped())break e;Ux(b,V,re),C=U}}}if(ga)throw o=Sl,ga=!1,Sl=null,o}function It(o,l){var f=l[Y0];f===void 0&&(f=l[Y0]=new Set);var g=o+"__bubble";f.has(g)||(Wx(l,o,2,!1),f.add(g))}function U0(o,l,f){var g=0;l&&(g|=4),Wx(f,o,g,l)}var Zf="_reactListening"+Math.random().toString(36).slice(2);function Pc(o){if(!o[Zf]){o[Zf]=!0,r.forEach(function(f){f!=="selectionchange"&&(aM.has(f)||U0(f,!1,o),U0(f,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Zf]||(l[Zf]=!0,U0("selectionchange",!1,l))}}function Wx(o,l,f,g){switch(px(l)){case 1:var b=xI;break;case 4:b=bI;break;default:b=k0}f=b.bind(null,l,f,o),b=void 0,!ws||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),g?b!==void 0?o.addEventListener(l,f,{capture:!0,passive:b}):o.addEventListener(l,f,!0):b!==void 0?o.addEventListener(l,f,{passive:b}):o.addEventListener(l,f,!1)}function B0(o,l,f,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 U=I.tag;if((U===3||U===4)&&(U=I.stateNode.containerInfo,U===b||U.nodeType===8&&U.parentNode===b))return;I=I.return}for(;V!==null;){if(I=ya(V),I===null)return;if(U=I.tag,U===5||U===6){g=C=I;continue e}V=V.parentNode}}g=g.return}qt(function(){var re=C,fe=er(f),me=[];e:{var ce=Hx.get(o);if(ce!==void 0){var Ae=R0,Ne=o;switch(o){case"keypress":if(zf(f)===0)break e;case"keydown":case"keyup":Ae=jI;break;case"focusin":Ne="focus",Ae=M0;break;case"focusout":Ne="blur",Ae=M0;break;case"beforeblur":case"afterblur":Ae=M0;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ae=vx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ae=CI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ae=$I;break;case jx:case Fx:case Vx:Ae=TI;break;case $x:Ae=zI;break;case"scroll":Ae=SI;break;case"wheel":Ae=BI;break;case"copy":case"cut":case"paste":Ae=AI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ae=_x}var Fe=(l&4)!==0,sn=!Fe&&o==="scroll",Q=Fe?ce!==null?ce+"Capture":null:ce;Fe=[];for(var Z=re,J;Z!==null;){J=Z;var we=J.stateNode;if(J.tag===5&&we!==null&&(J=we,Q!==null&&(we=cn(Z,Q),we!=null&&Fe.push(Tc(Z,we,J)))),sn)break;Z=Z.return}0<Fe.length&&(ce=new Ae(ce,Ne,null,f,fe),me.push({event:ce,listeners:Fe}))}}if((l&7)===0){e:{if(ce=o==="mouseover"||o==="pointerover",Ae=o==="mouseout"||o==="pointerout",ce&&f!==fr&&(Ne=f.relatedTarget||f.fromElement)&&(ya(Ne)||Ne[bi]))break e;if((Ae||ce)&&(ce=fe.window===fe?fe:(ce=fe.ownerDocument)?ce.defaultView||ce.parentWindow:window,Ae?(Ne=f.relatedTarget||f.toElement,Ae=re,Ne=Ne?ya(Ne):null,Ne!==null&&(sn=wi(Ne),Ne!==sn||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(Ae=null,Ne=re),Ae!==Ne)){if(Fe=vx,we="onMouseLeave",Q="onMouseEnter",Z="mouse",(o==="pointerout"||o==="pointerover")&&(Fe=_x,we="onPointerLeave",Q="onPointerEnter",Z="pointer"),sn=Ae==null?ce:Ol(Ae),J=Ne==null?ce:Ol(Ne),ce=new Fe(we,Z+"leave",Ae,f,fe),ce.target=sn,ce.relatedTarget=J,we=null,ya(fe)===re&&(Fe=new Fe(Q,Z+"enter",Ne,f,fe),Fe.target=J,Fe.relatedTarget=sn,we=Fe),sn=we,Ae&&Ne)t:{for(Fe=Ae,Q=Ne,Z=0,J=Fe;J;J=Il(J))Z++;for(J=0,we=Q;we;we=Il(we))J++;for(;0<Z-J;)Fe=Il(Fe),Z--;for(;0<J-Z;)Q=Il(Q),J--;for(;Z--;){if(Fe===Q||Q!==null&&Fe===Q.alternate)break t;Fe=Il(Fe),Q=Il(Q)}Fe=null}else Fe=null;Ae!==null&&Gx(me,ce,Ae,Fe,!1),Ne!==null&&sn!==null&&Gx(me,sn,Ne,Fe,!0)}}e:{if(ce=re?Ol(re):window,Ae=ce.nodeName&&ce.nodeName.toLowerCase(),Ae==="select"||Ae==="input"&&ce.type==="file")var Ve=XI;else if(Cx(ce))if(Px)Ve=tM;else{Ve=JI;var ze=QI}else(Ae=ce.nodeName)&&Ae.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&(Ve=eM);if(Ve&&(Ve=Ve(o,re))){kx(me,Ve,f,fe);break e}ze&&ze(o,ce,re),o==="focusout"&&(ze=ce._wrapperState)&&ze.controlled&&ce.type==="number"&&je(ce,"number",ce.value)}switch(ze=re?Ol(re):window,o){case"focusin":(Cx(ze)||ze.contentEditable==="true")&&(Rl=ze,F0=re,Cc=null);break;case"focusout":Cc=F0=Rl=null;break;case"mousedown":V0=!0;break;case"contextmenu":case"mouseup":case"dragend":V0=!1,Nx(me,f,fe);break;case"selectionchange":if(sM)break;case"keydown":case"keyup":Nx(me,f,fe)}var Ue;if(L0)e:{switch(o){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Tl?Sx(o,f)&&(qe="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(qe="onCompositionStart");qe&&(wx&&f.locale!=="ko"&&(Tl||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Tl&&(Ue=mx()):(mo=fe,T0="value"in mo?mo.value:mo.textContent,Tl=!0)),ze=qf(re,qe),0<ze.length&&(qe=new yx(qe,o,null,f,fe),me.push({event:qe,listeners:ze}),Ue?qe.data=Ue:(Ue=Ex(f),Ue!==null&&(qe.data=Ue)))),(Ue=GI?KI(o,f):ZI(o,f))&&(re=qf(re,"onBeforeInput"),0<re.length&&(fe=new yx("onBeforeInput","beforeinput",null,f,fe),me.push({event:fe,listeners:re}),fe.data=Ue))}Bx(me,l)})}function Tc(o,l,f){return{instance:o,listener:l,currentTarget:f}}function qf(o,l){for(var f=l+"Capture",g=[];o!==null;){var b=o,C=b.stateNode;b.tag===5&&C!==null&&(b=C,C=cn(o,f),C!=null&&g.unshift(Tc(o,C,b)),C=cn(o,l),C!=null&&g.push(Tc(o,C,b))),o=o.return}return g}function Il(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function Gx(o,l,f,g,b){for(var C=l._reactName,I=[];f!==null&&f!==g;){var V=f,U=V.alternate,re=V.stateNode;if(U!==null&&U===g)break;V.tag===5&&re!==null&&(V=re,b?(U=cn(f,C),U!=null&&I.unshift(Tc(f,U,V))):b||(U=cn(f,C),U!=null&&I.push(Tc(f,U,V)))),f=f.return}I.length!==0&&o.push({event:l,listeners:I})}var lM=/\r\n?/g,uM=/\u0000|\uFFFD/g;function Kx(o){return(typeof o=="string"?o:""+o).replace(lM,`
39
- `).replace(uM,"")}function Yf(o,l,f){if(l=Kx(l),Kx(o)!==l&&f)throw Error(n(425))}function Xf(){}var W0=null,G0=null;function K0(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 Z0=typeof setTimeout=="function"?setTimeout:void 0,cM=typeof clearTimeout=="function"?clearTimeout:void 0,Zx=typeof Promise=="function"?Promise:void 0,dM=typeof queueMicrotask=="function"?queueMicrotask:typeof Zx<"u"?function(o){return Zx.resolve(null).then(o).catch(fM)}:Z0;function fM(o){setTimeout(function(){throw o})}function q0(o,l){var f=l,g=0;do{var b=f.nextSibling;if(o.removeChild(f),b&&b.nodeType===8)if(f=b.data,f==="/$"){if(g===0){o.removeChild(b),yc(l);return}g--}else f!=="$"&&f!=="$?"&&f!=="$!"||g++;f=b}while(f);yc(l)}function vo(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 qx(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return o;l--}else f==="/$"&&l++}o=o.previousSibling}return null}var Ml=Math.random().toString(36).slice(2),Gs="__reactFiber$"+Ml,Rc="__reactProps$"+Ml,bi="__reactContainer$"+Ml,Y0="__reactEvents$"+Ml,hM="__reactListeners$"+Ml,pM="__reactHandles$"+Ml;function ya(o){var l=o[Gs];if(l)return l;for(var f=o.parentNode;f;){if(l=f[bi]||f[Gs]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(o=qx(o);o!==null;){if(f=o[Gs])return f;o=qx(o)}return l}o=f,f=o.parentNode}return null}function Ac(o){return o=o[Gs]||o[bi],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Ol(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function Qf(o){return o[Rc]||null}var X0=[],Ll=-1;function yo(o){return{current:o}}function Mt(o){0>Ll||(o.current=X0[Ll],X0[Ll]=null,Ll--)}function Tt(o,l){Ll++,X0[Ll]=o.current,o.current=l}var _o={},Bn=yo(_o),mr=yo(!1),_a=_o;function Nl(o,l){var f=o.type.contextTypes;if(!f)return _o;var g=o.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===l)return g.__reactInternalMemoizedMaskedChildContext;var b={},C;for(C in f)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 Jf(){Mt(mr),Mt(Bn)}function Yx(o,l,f){if(Bn.current!==_o)throw Error(n(168));Tt(Bn,l),Tt(mr,f)}function Xx(o,l,f){var g=o.stateNode;if(l=l.childContextTypes,typeof g.getChildContext!="function")return f;g=g.getChildContext();for(var b in g)if(!(b in l))throw Error(n(108,Ce(o)||"Unknown",b));return z({},f,g)}function eh(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||_o,_a=Bn.current,Tt(Bn,o),Tt(mr,mr.current),!0}function Qx(o,l,f){var g=o.stateNode;if(!g)throw Error(n(169));f?(o=Xx(o,l,_a),g.__reactInternalMemoizedMergedChildContext=o,Mt(mr),Mt(Bn),Tt(Bn,o)):Mt(mr),Tt(mr,f)}var Si=null,th=!1,Q0=!1;function Jx(o){Si===null?Si=[o]:Si.push(o)}function mM(o){th=!0,Jx(o)}function wo(){if(!Q0&&Si!==null){Q0=!0;var o=0,l=vt;try{var f=Si;for(vt=1;o<f.length;o++){var g=f[o];do g=g(!0);while(g!==null)}Si=null,th=!1}catch(b){throw Si!==null&&(Si=Si.slice(o+1)),lc(cc,wo),b}finally{vt=l,Q0=!1}}return null}var Dl=[],jl=0,nh=null,rh=0,ns=[],rs=0,wa=null,Ei=1,Ci="";function xa(o,l){Dl[jl++]=rh,Dl[jl++]=nh,nh=o,rh=l}function eb(o,l,f){ns[rs++]=Ei,ns[rs++]=Ci,ns[rs++]=wa,wa=o;var g=Ei;o=Ci;var b=32-H(g)-1;g&=~(1<<b),f+=1;var C=32-H(l)+b;if(30<C){var I=b-b%5;C=(g&(1<<I)-1).toString(32),g>>=I,b-=I,Ei=1<<32-H(l)+b|f<<b|g,Ci=C+o}else Ei=1<<C|f<<b|g,Ci=o}function J0(o){o.return!==null&&(xa(o,1),eb(o,1,0))}function eg(o){for(;o===nh;)nh=Dl[--jl],Dl[jl]=null,rh=Dl[--jl],Dl[jl]=null;for(;o===wa;)wa=ns[--rs],ns[rs]=null,Ci=ns[--rs],ns[rs]=null,Ei=ns[--rs],ns[rs]=null}var Fr=null,Vr=null,Vt=!1,Es=null;function tb(o,l){var f=as(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=o,l=o.deletions,l===null?(o.deletions=[f],o.flags|=16):l.push(f)}function nb(o,l){switch(o.tag){case 5:var f=o.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,Fr=o,Vr=vo(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,Fr=o,Vr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=wa!==null?{id:Ei,overflow:Ci}:null,o.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=as(18,null,null,0),f.stateNode=l,f.return=o,o.child=f,Fr=o,Vr=null,!0):!1;default:return!1}}function tg(o){return(o.mode&1)!==0&&(o.flags&128)===0}function ng(o){if(Vt){var l=Vr;if(l){var f=l;if(!nb(o,l)){if(tg(o))throw Error(n(418));l=vo(f.nextSibling);var g=Fr;l&&nb(o,l)?tb(g,f):(o.flags=o.flags&-4097|2,Vt=!1,Fr=o)}}else{if(tg(o))throw Error(n(418));o.flags=o.flags&-4097|2,Vt=!1,Fr=o}}}function rb(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Fr=o}function sh(o){if(o!==Fr)return!1;if(!Vt)return rb(o),Vt=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!K0(o.type,o.memoizedProps)),l&&(l=Vr)){if(tg(o))throw sb(),Error(n(418));for(;l;)tb(o,l),l=vo(l.nextSibling)}if(rb(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 f=o.data;if(f==="/$"){if(l===0){Vr=vo(o.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}o=o.nextSibling}Vr=null}}else Vr=Fr?vo(o.stateNode.nextSibling):null;return!0}function sb(){for(var o=Vr;o;)o=vo(o.nextSibling)}function Fl(){Vr=Fr=null,Vt=!1}function rg(o){Es===null?Es=[o]:Es.push(o)}var gM=T.ReactCurrentBatchConfig;function Ic(o,l,f){if(o=f.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var g=f.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(!f._owner)throw Error(n(290,o))}return o}function ih(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function ib(o){var l=o._init;return l(o._payload)}function ob(o){function l(Q,Z){if(o){var J=Q.deletions;J===null?(Q.deletions=[Z],Q.flags|=16):J.push(Z)}}function f(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=To(Q,Z),Q.index=0,Q.sibling=null,Q}function C(Q,Z,J){return Q.index=J,o?(J=Q.alternate,J!==null?(J=J.index,J<Z?(Q.flags|=2,Z):J):(Q.flags|=2,Z)):(Q.flags|=1048576,Z)}function I(Q){return o&&Q.alternate===null&&(Q.flags|=2),Q}function V(Q,Z,J,we){return Z===null||Z.tag!==6?(Z=Zg(J,Q.mode,we),Z.return=Q,Z):(Z=b(Z,J),Z.return=Q,Z)}function U(Q,Z,J,we){var Ve=J.type;return Ve===O?fe(Q,Z,J.props.children,we,J.key):Z!==null&&(Z.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===K&&ib(Ve)===Z.type)?(we=b(Z,J.props),we.ref=Ic(Q,Z,J),we.return=Q,we):(we=Rh(J.type,J.key,J.props,null,Q.mode,we),we.ref=Ic(Q,Z,J),we.return=Q,we)}function re(Q,Z,J,we){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==J.containerInfo||Z.stateNode.implementation!==J.implementation?(Z=qg(J,Q.mode,we),Z.return=Q,Z):(Z=b(Z,J.children||[]),Z.return=Q,Z)}function fe(Q,Z,J,we,Ve){return Z===null||Z.tag!==7?(Z=Ra(J,Q.mode,we,Ve),Z.return=Q,Z):(Z=b(Z,J),Z.return=Q,Z)}function me(Q,Z,J){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=Zg(""+Z,Q.mode,J),Z.return=Q,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case A:return J=Rh(Z.type,Z.key,Z.props,null,Q.mode,J),J.ref=Ic(Q,null,Z),J.return=Q,J;case L:return Z=qg(Z,Q.mode,J),Z.return=Q,Z;case K:var we=Z._init;return me(Q,we(Z._payload),J)}if(Je(Z)||ee(Z))return Z=Ra(Z,Q.mode,J,null),Z.return=Q,Z;ih(Q,Z)}return null}function ce(Q,Z,J,we){var Ve=Z!==null?Z.key:null;if(typeof J=="string"&&J!==""||typeof J=="number")return Ve!==null?null:V(Q,Z,""+J,we);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case A:return J.key===Ve?U(Q,Z,J,we):null;case L:return J.key===Ve?re(Q,Z,J,we):null;case K:return Ve=J._init,ce(Q,Z,Ve(J._payload),we)}if(Je(J)||ee(J))return Ve!==null?null:fe(Q,Z,J,we,null);ih(Q,J)}return null}function Ae(Q,Z,J,we,Ve){if(typeof we=="string"&&we!==""||typeof we=="number")return Q=Q.get(J)||null,V(Z,Q,""+we,Ve);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case A:return Q=Q.get(we.key===null?J:we.key)||null,U(Z,Q,we,Ve);case L:return Q=Q.get(we.key===null?J:we.key)||null,re(Z,Q,we,Ve);case K:var ze=we._init;return Ae(Q,Z,J,ze(we._payload),Ve)}if(Je(we)||ee(we))return Q=Q.get(J)||null,fe(Z,Q,we,Ve,null);ih(Z,we)}return null}function Ne(Q,Z,J,we){for(var Ve=null,ze=null,Ue=Z,qe=Z=0,Cn=null;Ue!==null&&qe<J.length;qe++){Ue.index>qe?(Cn=Ue,Ue=null):Cn=Ue.sibling;var ft=ce(Q,Ue,J[qe],we);if(ft===null){Ue===null&&(Ue=Cn);break}o&&Ue&&ft.alternate===null&&l(Q,Ue),Z=C(ft,Z,qe),ze===null?Ve=ft:ze.sibling=ft,ze=ft,Ue=Cn}if(qe===J.length)return f(Q,Ue),Vt&&xa(Q,qe),Ve;if(Ue===null){for(;qe<J.length;qe++)Ue=me(Q,J[qe],we),Ue!==null&&(Z=C(Ue,Z,qe),ze===null?Ve=Ue:ze.sibling=Ue,ze=Ue);return Vt&&xa(Q,qe),Ve}for(Ue=g(Q,Ue);qe<J.length;qe++)Cn=Ae(Ue,Q,qe,J[qe],we),Cn!==null&&(o&&Cn.alternate!==null&&Ue.delete(Cn.key===null?qe:Cn.key),Z=C(Cn,Z,qe),ze===null?Ve=Cn:ze.sibling=Cn,ze=Cn);return o&&Ue.forEach(function(Ro){return l(Q,Ro)}),Vt&&xa(Q,qe),Ve}function Fe(Q,Z,J,we){var Ve=ee(J);if(typeof Ve!="function")throw Error(n(150));if(J=Ve.call(J),J==null)throw Error(n(151));for(var ze=Ve=null,Ue=Z,qe=Z=0,Cn=null,ft=J.next();Ue!==null&&!ft.done;qe++,ft=J.next()){Ue.index>qe?(Cn=Ue,Ue=null):Cn=Ue.sibling;var Ro=ce(Q,Ue,ft.value,we);if(Ro===null){Ue===null&&(Ue=Cn);break}o&&Ue&&Ro.alternate===null&&l(Q,Ue),Z=C(Ro,Z,qe),ze===null?Ve=Ro:ze.sibling=Ro,ze=Ro,Ue=Cn}if(ft.done)return f(Q,Ue),Vt&&xa(Q,qe),Ve;if(Ue===null){for(;!ft.done;qe++,ft=J.next())ft=me(Q,ft.value,we),ft!==null&&(Z=C(ft,Z,qe),ze===null?Ve=ft:ze.sibling=ft,ze=ft);return Vt&&xa(Q,qe),Ve}for(Ue=g(Q,Ue);!ft.done;qe++,ft=J.next())ft=Ae(Ue,Q,qe,ft.value,we),ft!==null&&(o&&ft.alternate!==null&&Ue.delete(ft.key===null?qe:ft.key),Z=C(ft,Z,qe),ze===null?Ve=ft:ze.sibling=ft,ze=ft);return o&&Ue.forEach(function(qM){return l(Q,qM)}),Vt&&xa(Q,qe),Ve}function sn(Q,Z,J,we){if(typeof J=="object"&&J!==null&&J.type===O&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case A:e:{for(var Ve=J.key,ze=Z;ze!==null;){if(ze.key===Ve){if(Ve=J.type,Ve===O){if(ze.tag===7){f(Q,ze.sibling),Z=b(ze,J.props.children),Z.return=Q,Q=Z;break e}}else if(ze.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===K&&ib(Ve)===ze.type){f(Q,ze.sibling),Z=b(ze,J.props),Z.ref=Ic(Q,ze,J),Z.return=Q,Q=Z;break e}f(Q,ze);break}else l(Q,ze);ze=ze.sibling}J.type===O?(Z=Ra(J.props.children,Q.mode,we,J.key),Z.return=Q,Q=Z):(we=Rh(J.type,J.key,J.props,null,Q.mode,we),we.ref=Ic(Q,Z,J),we.return=Q,Q=we)}return I(Q);case L:e:{for(ze=J.key;Z!==null;){if(Z.key===ze)if(Z.tag===4&&Z.stateNode.containerInfo===J.containerInfo&&Z.stateNode.implementation===J.implementation){f(Q,Z.sibling),Z=b(Z,J.children||[]),Z.return=Q,Q=Z;break e}else{f(Q,Z);break}else l(Q,Z);Z=Z.sibling}Z=qg(J,Q.mode,we),Z.return=Q,Q=Z}return I(Q);case K:return ze=J._init,sn(Q,Z,ze(J._payload),we)}if(Je(J))return Ne(Q,Z,J,we);if(ee(J))return Fe(Q,Z,J,we);ih(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,Z!==null&&Z.tag===6?(f(Q,Z.sibling),Z=b(Z,J),Z.return=Q,Q=Z):(f(Q,Z),Z=Zg(J,Q.mode,we),Z.return=Q,Q=Z),I(Q)):f(Q,Z)}return sn}var Vl=ob(!0),ab=ob(!1),oh=yo(null),ah=null,$l=null,sg=null;function ig(){sg=$l=ah=null}function og(o){var l=oh.current;Mt(oh),o._currentValue=l}function ag(o,l,f){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===f)break;o=o.return}}function Hl(o,l){ah=o,sg=$l=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(vr=!0),o.firstContext=null)}function ss(o){var l=o._currentValue;if(sg!==o)if(o={context:o,memoizedValue:l,next:null},$l===null){if(ah===null)throw Error(n(308));$l=o,ah.dependencies={lanes:0,firstContext:o}}else $l=$l.next=o;return l}var ba=null;function lg(o){ba===null?ba=[o]:ba.push(o)}function lb(o,l,f,g){var b=l.interleaved;return b===null?(f.next=f,lg(l)):(f.next=b.next,b.next=f),l.interleaved=f,ki(o,g)}function ki(o,l){o.lanes|=l;var f=o.alternate;for(f!==null&&(f.lanes|=l),f=o,o=o.return;o!==null;)o.childLanes|=l,f=o.alternate,f!==null&&(f.childLanes|=l),f=o,o=o.return;return f.tag===3?f.stateNode:null}var xo=!1;function ug(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ub(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 Pi(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function bo(o,l,f){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(ct&2)!==0){var b=g.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),g.pending=l,ki(o,f)}return b=g.interleaved,b===null?(l.next=l,lg(g)):(l.next=b.next,b.next=l),g.interleaved=l,ki(o,f)}function lh(o,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var g=l.lanes;g&=o.pendingLanes,f|=g,l.lanes=f,bs(o,f)}}function cb(o,l){var f=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var b=null,C=null;if(f=f.firstBaseUpdate,f!==null){do{var I={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};C===null?b=C=I:C=C.next=I,f=f.next}while(f!==null);C===null?b=C=l:C=C.next=l}else b=C=l;f={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:C,shared:g.shared,effects:g.effects},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=l:o.next=l,f.lastBaseUpdate=l}function uh(o,l,f,g){var b=o.updateQueue;xo=!1;var C=b.firstBaseUpdate,I=b.lastBaseUpdate,V=b.shared.pending;if(V!==null){b.shared.pending=null;var U=V,re=U.next;U.next=null,I===null?C=re:I.next=re,I=U;var fe=o.alternate;fe!==null&&(fe=fe.updateQueue,V=fe.lastBaseUpdate,V!==I&&(V===null?fe.firstBaseUpdate=re:V.next=re,fe.lastBaseUpdate=U))}if(C!==null){var me=b.baseState;I=0,fe=re=U=null,V=C;do{var ce=V.lane,Ae=V.eventTime;if((g&ce)===ce){fe!==null&&(fe=fe.next={eventTime:Ae,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var Ne=o,Fe=V;switch(ce=l,Ae=f,Fe.tag){case 1:if(Ne=Fe.payload,typeof Ne=="function"){me=Ne.call(Ae,me,ce);break e}me=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Fe.payload,ce=typeof Ne=="function"?Ne.call(Ae,me,ce):Ne,ce==null)break e;me=z({},me,ce);break e;case 2:xo=!0}}V.callback!==null&&V.lane!==0&&(o.flags|=64,ce=b.effects,ce===null?b.effects=[V]:ce.push(V))}else Ae={eventTime:Ae,lane:ce,tag:V.tag,payload:V.payload,callback:V.callback,next:null},fe===null?(re=fe=Ae,U=me):fe=fe.next=Ae,I|=ce;if(V=V.next,V===null){if(V=b.shared.pending,V===null)break;ce=V,V=ce.next,ce.next=null,b.lastBaseUpdate=ce,b.shared.pending=null}}while(!0);if(fe===null&&(U=me),b.baseState=U,b.firstBaseUpdate=re,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);Ca|=I,o.lanes=I,o.memoizedState=me}}function db(o,l,f){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=f,typeof b!="function")throw Error(n(191,b));b.call(g)}}}var Mc={},Ks=yo(Mc),Oc=yo(Mc),Lc=yo(Mc);function Sa(o){if(o===Mc)throw Error(n(174));return o}function cg(o,l){switch(Tt(Lc,l),Tt(Oc,o),Tt(Ks,Mc),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:zn(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=zn(l,o)}Mt(Ks),Tt(Ks,l)}function zl(){Mt(Ks),Mt(Oc),Mt(Lc)}function fb(o){Sa(Lc.current);var l=Sa(Ks.current),f=zn(l,o.type);l!==f&&(Tt(Oc,o),Tt(Ks,f))}function dg(o){Oc.current===o&&(Mt(Ks),Mt(Oc))}var Ut=yo(0);function ch(o){for(var l=o;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.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 fg=[];function hg(){for(var o=0;o<fg.length;o++)fg[o]._workInProgressVersionPrimary=null;fg.length=0}var dh=T.ReactCurrentDispatcher,pg=T.ReactCurrentBatchConfig,Ea=0,Bt=null,vn=null,Sn=null,fh=!1,Nc=!1,Dc=0,vM=0;function Wn(){throw Error(n(321))}function mg(o,l){if(l===null)return!1;for(var f=0;f<l.length&&f<o.length;f++)if(!Ss(o[f],l[f]))return!1;return!0}function gg(o,l,f,g,b,C){if(Ea=C,Bt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,dh.current=o===null||o.memoizedState===null?xM:bM,o=f(g,b),Nc){C=0;do{if(Nc=!1,Dc=0,25<=C)throw Error(n(301));C+=1,Sn=vn=null,l.updateQueue=null,dh.current=SM,o=f(g,b)}while(Nc)}if(dh.current=mh,l=vn!==null&&vn.next!==null,Ea=0,Sn=vn=Bt=null,fh=!1,l)throw Error(n(300));return o}function vg(){var o=Dc!==0;return Dc=0,o}function Zs(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?Bt.memoizedState=Sn=o:Sn=Sn.next=o,Sn}function is(){if(vn===null){var o=Bt.alternate;o=o!==null?o.memoizedState:null}else o=vn.next;var l=Sn===null?Bt.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?Bt.memoizedState=Sn=o:Sn=Sn.next=o}return Sn}function jc(o,l){return typeof l=="function"?l(o):l}function yg(o){var l=is(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=o;var g=vn,b=g.baseQueue,C=f.pending;if(C!==null){if(b!==null){var I=b.next;b.next=C.next,C.next=I}g.baseQueue=b=C,f.pending=null}if(b!==null){C=b.next,g=g.baseState;var V=I=null,U=null,re=C;do{var fe=re.lane;if((Ea&fe)===fe)U!==null&&(U=U.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),g=re.hasEagerState?re.eagerState:o(g,re.action);else{var me={lane:fe,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};U===null?(V=U=me,I=g):U=U.next=me,Bt.lanes|=fe,Ca|=fe}re=re.next}while(re!==null&&re!==C);U===null?I=g:U.next=V,Ss(g,l.memoizedState)||(vr=!0),l.memoizedState=g,l.baseState=I,l.baseQueue=U,f.lastRenderedState=g}if(o=f.interleaved,o!==null){b=o;do C=b.lane,Bt.lanes|=C,Ca|=C,b=b.next;while(b!==o)}else b===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function _g(o){var l=is(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=o;var g=f.dispatch,b=f.pending,C=l.memoizedState;if(b!==null){f.pending=null;var I=b=b.next;do C=o(C,I.action),I=I.next;while(I!==b);Ss(C,l.memoizedState)||(vr=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),f.lastRenderedState=C}return[C,g]}function hb(){}function pb(o,l){var f=Bt,g=is(),b=l(),C=!Ss(g.memoizedState,b);if(C&&(g.memoizedState=b,vr=!0),g=g.queue,wg(vb.bind(null,f,g,o),[o]),g.getSnapshot!==l||C||Sn!==null&&Sn.memoizedState.tag&1){if(f.flags|=2048,Fc(9,gb.bind(null,f,g,b,l),void 0,null),En===null)throw Error(n(349));(Ea&30)!==0||mb(f,l,b)}return b}function mb(o,l,f){o.flags|=16384,o={getSnapshot:l,value:f},l=Bt.updateQueue,l===null?(l={lastEffect:null,stores:null},Bt.updateQueue=l,l.stores=[o]):(f=l.stores,f===null?l.stores=[o]:f.push(o))}function gb(o,l,f,g){l.value=f,l.getSnapshot=g,yb(l)&&_b(o)}function vb(o,l,f){return f(function(){yb(l)&&_b(o)})}function yb(o){var l=o.getSnapshot;o=o.value;try{var f=l();return!Ss(o,f)}catch{return!0}}function _b(o){var l=ki(o,1);l!==null&&Ts(l,o,1,-1)}function wb(o){var l=Zs();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:jc,lastRenderedState:o},l.queue=o,o=o.dispatch=wM.bind(null,Bt,o),[l.memoizedState,o]}function Fc(o,l,f,g){return o={tag:o,create:l,destroy:f,deps:g,next:null},l=Bt.updateQueue,l===null?(l={lastEffect:null,stores:null},Bt.updateQueue=l,l.lastEffect=o.next=o):(f=l.lastEffect,f===null?l.lastEffect=o.next=o:(g=f.next,f.next=o,o.next=g,l.lastEffect=o)),o}function xb(){return is().memoizedState}function hh(o,l,f,g){var b=Zs();Bt.flags|=o,b.memoizedState=Fc(1|l,f,void 0,g===void 0?null:g)}function ph(o,l,f,g){var b=is();g=g===void 0?null:g;var C=void 0;if(vn!==null){var I=vn.memoizedState;if(C=I.destroy,g!==null&&mg(g,I.deps)){b.memoizedState=Fc(l,f,C,g);return}}Bt.flags|=o,b.memoizedState=Fc(1|l,f,C,g)}function bb(o,l){return hh(8390656,8,o,l)}function wg(o,l){return ph(2048,8,o,l)}function Sb(o,l){return ph(4,2,o,l)}function Eb(o,l){return ph(4,4,o,l)}function Cb(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 kb(o,l,f){return f=f!=null?f.concat([o]):null,ph(4,4,Cb.bind(null,l,o),f)}function xg(){}function Pb(o,l){var f=is();l=l===void 0?null:l;var g=f.memoizedState;return g!==null&&l!==null&&mg(l,g[1])?g[0]:(f.memoizedState=[o,l],o)}function Tb(o,l){var f=is();l=l===void 0?null:l;var g=f.memoizedState;return g!==null&&l!==null&&mg(l,g[1])?g[0]:(o=o(),f.memoizedState=[o,l],o)}function Rb(o,l,f){return(Ea&21)===0?(o.baseState&&(o.baseState=!1,vr=!0),o.memoizedState=f):(Ss(f,l)||(f=xs(),Bt.lanes|=f,Ca|=f,o.baseState=!0),l)}function yM(o,l){var f=vt;vt=f!==0&&4>f?f:4,o(!0);var g=pg.transition;pg.transition={};try{o(!1),l()}finally{vt=f,pg.transition=g}}function Ab(){return is().memoizedState}function _M(o,l,f){var g=ko(o);if(f={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null},Ib(o))Mb(l,f);else if(f=lb(o,l,f,g),f!==null){var b=rr();Ts(f,o,g,b),Ob(f,l,g)}}function wM(o,l,f){var g=ko(o),b={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null};if(Ib(o))Mb(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,f);if(b.hasEagerState=!0,b.eagerState=V,Ss(V,I)){var U=l.interleaved;U===null?(b.next=b,lg(l)):(b.next=U.next,U.next=b),l.interleaved=b;return}}catch{}finally{}f=lb(o,l,b,g),f!==null&&(b=rr(),Ts(f,o,g,b),Ob(f,l,g))}}function Ib(o){var l=o.alternate;return o===Bt||l!==null&&l===Bt}function Mb(o,l){Nc=fh=!0;var f=o.pending;f===null?l.next=l:(l.next=f.next,f.next=l),o.pending=l}function Ob(o,l,f){if((f&4194240)!==0){var g=l.lanes;g&=o.pendingLanes,f|=g,l.lanes=f,bs(o,f)}}var mh={readContext:ss,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useInsertionEffect:Wn,useLayoutEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useMutableSource:Wn,useSyncExternalStore:Wn,useId:Wn,unstable_isNewReconciler:!1},xM={readContext:ss,useCallback:function(o,l){return Zs().memoizedState=[o,l===void 0?null:l],o},useContext:ss,useEffect:bb,useImperativeHandle:function(o,l,f){return f=f!=null?f.concat([o]):null,hh(4194308,4,Cb.bind(null,l,o),f)},useLayoutEffect:function(o,l){return hh(4194308,4,o,l)},useInsertionEffect:function(o,l){return hh(4,2,o,l)},useMemo:function(o,l){var f=Zs();return l=l===void 0?null:l,o=o(),f.memoizedState=[o,l],o},useReducer:function(o,l,f){var g=Zs();return l=f!==void 0?f(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=_M.bind(null,Bt,o),[g.memoizedState,o]},useRef:function(o){var l=Zs();return o={current:o},l.memoizedState=o},useState:wb,useDebugValue:xg,useDeferredValue:function(o){return Zs().memoizedState=o},useTransition:function(){var o=wb(!1),l=o[0];return o=yM.bind(null,o[1]),Zs().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,f){var g=Bt,b=Zs();if(Vt){if(f===void 0)throw Error(n(407));f=f()}else{if(f=l(),En===null)throw Error(n(349));(Ea&30)!==0||mb(g,l,f)}b.memoizedState=f;var C={value:f,getSnapshot:l};return b.queue=C,bb(vb.bind(null,g,C,o),[o]),g.flags|=2048,Fc(9,gb.bind(null,g,C,f,l),void 0,null),f},useId:function(){var o=Zs(),l=En.identifierPrefix;if(Vt){var f=Ci,g=Ei;f=(g&~(1<<32-H(g)-1)).toString(32)+f,l=":"+l+"R"+f,f=Dc++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=vM++,l=":"+l+"r"+f.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},bM={readContext:ss,useCallback:Pb,useContext:ss,useEffect:wg,useImperativeHandle:kb,useInsertionEffect:Sb,useLayoutEffect:Eb,useMemo:Tb,useReducer:yg,useRef:xb,useState:function(){return yg(jc)},useDebugValue:xg,useDeferredValue:function(o){var l=is();return Rb(l,vn.memoizedState,o)},useTransition:function(){var o=yg(jc)[0],l=is().memoizedState;return[o,l]},useMutableSource:hb,useSyncExternalStore:pb,useId:Ab,unstable_isNewReconciler:!1},SM={readContext:ss,useCallback:Pb,useContext:ss,useEffect:wg,useImperativeHandle:kb,useInsertionEffect:Sb,useLayoutEffect:Eb,useMemo:Tb,useReducer:_g,useRef:xb,useState:function(){return _g(jc)},useDebugValue:xg,useDeferredValue:function(o){var l=is();return vn===null?l.memoizedState=o:Rb(l,vn.memoizedState,o)},useTransition:function(){var o=_g(jc)[0],l=is().memoizedState;return[o,l]},useMutableSource:hb,useSyncExternalStore:pb,useId:Ab,unstable_isNewReconciler:!1};function Cs(o,l){if(o&&o.defaultProps){l=z({},l),o=o.defaultProps;for(var f in o)l[f]===void 0&&(l[f]=o[f]);return l}return l}function bg(o,l,f,g){l=o.memoizedState,f=f(g,l),f=f==null?l:z({},l,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var gh={isMounted:function(o){return(o=o._reactInternals)?wi(o)===o:!1},enqueueSetState:function(o,l,f){o=o._reactInternals;var g=rr(),b=ko(o),C=Pi(g,b);C.payload=l,f!=null&&(C.callback=f),l=bo(o,C,b),l!==null&&(Ts(l,o,b,g),lh(l,o,b))},enqueueReplaceState:function(o,l,f){o=o._reactInternals;var g=rr(),b=ko(o),C=Pi(g,b);C.tag=1,C.payload=l,f!=null&&(C.callback=f),l=bo(o,C,b),l!==null&&(Ts(l,o,b,g),lh(l,o,b))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var f=rr(),g=ko(o),b=Pi(f,g);b.tag=2,l!=null&&(b.callback=l),l=bo(o,b,g),l!==null&&(Ts(l,o,g,f),lh(l,o,g))}};function Lb(o,l,f,g,b,C,I){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,C,I):l.prototype&&l.prototype.isPureReactComponent?!Ec(f,g)||!Ec(b,C):!0}function Nb(o,l,f){var g=!1,b=_o,C=l.contextType;return typeof C=="object"&&C!==null?C=ss(C):(b=gr(l)?_a:Bn.current,g=l.contextTypes,C=(g=g!=null)?Nl(o,b):_o),l=new l(f,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=gh,o.stateNode=l,l._reactInternals=o,g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=C),l}function Db(o,l,f,g){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,g),l.state!==o&&gh.enqueueReplaceState(l,l.state,null)}function Sg(o,l,f,g){var b=o.stateNode;b.props=f,b.state=o.memoizedState,b.refs={},ug(o);var C=l.contextType;typeof C=="object"&&C!==null?b.context=ss(C):(C=gr(l)?_a:Bn.current,b.context=Nl(o,C)),b.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(bg(o,l,C,f),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&&gh.enqueueReplaceState(b,b.state,null),uh(o,f,b,g),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function Ul(o,l){try{var f="",g=l;do f+=ae(g),g=g.return;while(g);var b=f}catch(C){b=`
40
- Error generating stack: `+C.message+`
41
- `+C.stack}return{value:o,source:l,stack:b,digest:null}}function Eg(o,l,f){return{value:o,source:null,stack:f??null,digest:l??null}}function Cg(o,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var EM=typeof WeakMap=="function"?WeakMap:Map;function jb(o,l,f){f=Pi(-1,f),f.tag=3,f.payload={element:null};var g=l.value;return f.callback=function(){Sh||(Sh=!0,$g=g),Cg(o,l)},f}function Fb(o,l,f){f=Pi(-1,f),f.tag=3;var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var b=l.value;f.payload=function(){return g(b)},f.callback=function(){Cg(o,l)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(f.callback=function(){Cg(o,l),typeof g!="function"&&(Eo===null?Eo=new Set([this]):Eo.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),f}function Vb(o,l,f){var g=o.pingCache;if(g===null){g=o.pingCache=new EM;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(f)||(b.add(f),o=FM.bind(null,o,l,f),l.then(o,o))}function $b(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 Hb(o,l,f,g,b){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Pi(-1,1),l.tag=2,bo(f,l,1))),f.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var CM=T.ReactCurrentOwner,vr=!1;function nr(o,l,f,g){l.child=o===null?ab(l,null,f,g):Vl(l,o.child,f,g)}function zb(o,l,f,g,b){f=f.render;var C=l.ref;return Hl(l,b),g=gg(o,l,f,g,C,b),f=vg(),o!==null&&!vr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Ti(o,l,b)):(Vt&&f&&J0(l),l.flags|=1,nr(o,l,g,b),l.child)}function Ub(o,l,f,g,b){if(o===null){var C=f.type;return typeof C=="function"&&!Kg(C)&&C.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=C,Bb(o,l,C,g,b)):(o=Rh(f.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(f=f.compare,f=f!==null?f:Ec,f(I,g)&&o.ref===l.ref)return Ti(o,l,b)}return l.flags|=1,o=To(C,g),o.ref=l.ref,o.return=l,l.child=o}function Bb(o,l,f,g,b){if(o!==null){var C=o.memoizedProps;if(Ec(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,Ti(o,l,b)}return kg(o,l,f,g,b)}function Wb(o,l,f){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(Wl,$r),$r|=f;else{if((f&1073741824)===0)return o=C!==null?C.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Tt(Wl,$r),$r|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=C!==null?C.baseLanes:f,Tt(Wl,$r),$r|=g}else C!==null?(g=C.baseLanes|f,l.memoizedState=null):g=f,Tt(Wl,$r),$r|=g;return nr(o,l,b,f),l.child}function Gb(o,l){var f=l.ref;(o===null&&f!==null||o!==null&&o.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function kg(o,l,f,g,b){var C=gr(f)?_a:Bn.current;return C=Nl(l,C),Hl(l,b),f=gg(o,l,f,g,C,b),g=vg(),o!==null&&!vr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Ti(o,l,b)):(Vt&&g&&J0(l),l.flags|=1,nr(o,l,f,b),l.child)}function Kb(o,l,f,g,b){if(gr(f)){var C=!0;eh(l)}else C=!1;if(Hl(l,b),l.stateNode===null)yh(o,l),Nb(l,f,g),Sg(l,f,g,b),g=!0;else if(o===null){var I=l.stateNode,V=l.memoizedProps;I.props=V;var U=I.context,re=f.contextType;typeof re=="object"&&re!==null?re=ss(re):(re=gr(f)?_a:Bn.current,re=Nl(l,re));var fe=f.getDerivedStateFromProps,me=typeof fe=="function"||typeof I.getSnapshotBeforeUpdate=="function";me||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(V!==g||U!==re)&&Db(l,I,g,re),xo=!1;var ce=l.memoizedState;I.state=ce,uh(l,g,I,b),U=l.memoizedState,V!==g||ce!==U||mr.current||xo?(typeof fe=="function"&&(bg(l,f,fe,g),U=l.memoizedState),(V=xo||Lb(l,f,V,g,ce,U,re))?(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=U),I.props=g,I.state=U,I.context=re,g=V):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{I=l.stateNode,ub(o,l),V=l.memoizedProps,re=l.type===l.elementType?V:Cs(l.type,V),I.props=re,me=l.pendingProps,ce=I.context,U=f.contextType,typeof U=="object"&&U!==null?U=ss(U):(U=gr(f)?_a:Bn.current,U=Nl(l,U));var Ae=f.getDerivedStateFromProps;(fe=typeof Ae=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(V!==me||ce!==U)&&Db(l,I,g,U),xo=!1,ce=l.memoizedState,I.state=ce,uh(l,g,I,b);var Ne=l.memoizedState;V!==me||ce!==Ne||mr.current||xo?(typeof Ae=="function"&&(bg(l,f,Ae,g),Ne=l.memoizedState),(re=xo||Lb(l,f,re,g,ce,Ne,U)||!1)?(fe||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(g,Ne,U),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(g,Ne,U)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||V===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=Ne),I.props=g,I.state=Ne,I.context=U,g=re):(typeof I.componentDidUpdate!="function"||V===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),g=!1)}return Pg(o,l,f,g,C,b)}function Pg(o,l,f,g,b,C){Gb(o,l);var I=(l.flags&128)!==0;if(!g&&!I)return b&&Qx(l,f,!1),Ti(o,l,C);g=l.stateNode,CM.current=l;var V=I&&typeof f.getDerivedStateFromError!="function"?null:g.render();return l.flags|=1,o!==null&&I?(l.child=Vl(l,o.child,null,C),l.child=Vl(l,null,V,C)):nr(o,l,V,C),l.memoizedState=g.state,b&&Qx(l,f,!0),l.child}function Zb(o){var l=o.stateNode;l.pendingContext?Yx(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Yx(o,l.context,!1),cg(o,l.containerInfo)}function qb(o,l,f,g,b){return Fl(),rg(b),l.flags|=256,nr(o,l,f,g),l.child}var Tg={dehydrated:null,treeContext:null,retryLane:0};function Rg(o){return{baseLanes:o,cachePool:null,transitions:null}}function Yb(o,l,f){var g=l.pendingProps,b=Ut.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(Ut,b&1),o===null)return ng(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=Ah(I,g,0,null),o=Ra(o,g,f,null),C.return=l,o.return=l,C.sibling=o,l.child=C,l.child.memoizedState=Rg(f),l.memoizedState=Tg,o):Ag(l,I));if(b=o.memoizedState,b!==null&&(V=b.dehydrated,V!==null))return kM(o,l,I,g,V,b,f);if(C){C=g.fallback,I=l.mode,b=o.child,V=b.sibling;var U={mode:"hidden",children:g.children};return(I&1)===0&&l.child!==b?(g=l.child,g.childLanes=0,g.pendingProps=U,l.deletions=null):(g=To(b,U),g.subtreeFlags=b.subtreeFlags&14680064),V!==null?C=To(V,C):(C=Ra(C,I,f,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?Rg(f):{baseLanes:I.baseLanes|f,cachePool:null,transitions:I.transitions},C.memoizedState=I,C.childLanes=o.childLanes&~f,l.memoizedState=Tg,g}return C=o.child,o=C.sibling,g=To(C,{mode:"visible",children:g.children}),(l.mode&1)===0&&(g.lanes=f),g.return=l,g.sibling=null,o!==null&&(f=l.deletions,f===null?(l.deletions=[o],l.flags|=16):f.push(o)),l.child=g,l.memoizedState=null,g}function Ag(o,l){return l=Ah({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function vh(o,l,f,g){return g!==null&&rg(g),Vl(l,o.child,null,f),o=Ag(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function kM(o,l,f,g,b,C,I){if(f)return l.flags&256?(l.flags&=-257,g=Eg(Error(n(422))),vh(o,l,I,g)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(C=g.fallback,b=l.mode,g=Ah({mode:"visible",children:g.children},b,0,null),C=Ra(C,b,I,null),C.flags|=2,g.return=l,C.return=l,g.sibling=C,l.child=g,(l.mode&1)!==0&&Vl(l,o.child,null,I),l.child.memoizedState=Rg(I),l.memoizedState=Tg,C);if((l.mode&1)===0)return vh(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=Eg(C,g,void 0),vh(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,ki(o,b),Ts(g,o,b,-1))}return Gg(),g=Eg(Error(n(421))),vh(o,l,I,g)}return b.data==="$?"?(l.flags|=128,l.child=o.child,l=VM.bind(null,o),b._reactRetry=l,null):(o=C.treeContext,Vr=vo(b.nextSibling),Fr=l,Vt=!0,Es=null,o!==null&&(ns[rs++]=Ei,ns[rs++]=Ci,ns[rs++]=wa,Ei=o.id,Ci=o.overflow,wa=l),l=Ag(l,g.children),l.flags|=4096,l)}function Xb(o,l,f){o.lanes|=l;var g=o.alternate;g!==null&&(g.lanes|=l),ag(o.return,l,f)}function Ig(o,l,f,g,b){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:f,tailMode:b}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=g,C.tail=f,C.tailMode=b)}function Qb(o,l,f){var g=l.pendingProps,b=g.revealOrder,C=g.tail;if(nr(o,l,g.children,f),g=Ut.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&&Xb(o,f,l);else if(o.tag===19)Xb(o,f,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(Ut,g),(l.mode&1)===0)l.memoizedState=null;else switch(b){case"forwards":for(f=l.child,b=null;f!==null;)o=f.alternate,o!==null&&ch(o)===null&&(b=f),f=f.sibling;f=b,f===null?(b=l.child,l.child=null):(b=f.sibling,f.sibling=null),Ig(l,!1,b,f,C);break;case"backwards":for(f=null,b=l.child,l.child=null;b!==null;){if(o=b.alternate,o!==null&&ch(o)===null){l.child=b;break}o=b.sibling,b.sibling=f,f=b,b=o}Ig(l,!0,f,null,C);break;case"together":Ig(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function yh(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function Ti(o,l,f){if(o!==null&&(l.dependencies=o.dependencies),Ca|=l.lanes,(f&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,f=To(o,o.pendingProps),l.child=f,f.return=l;o.sibling!==null;)o=o.sibling,f=f.sibling=To(o,o.pendingProps),f.return=l;f.sibling=null}return l.child}function PM(o,l,f){switch(l.tag){case 3:Zb(l),Fl();break;case 5:fb(l);break;case 1:gr(l.type)&&eh(l);break;case 4:cg(l,l.stateNode.containerInfo);break;case 10:var g=l.type._context,b=l.memoizedProps.value;Tt(oh,g._currentValue),g._currentValue=b;break;case 13:if(g=l.memoizedState,g!==null)return g.dehydrated!==null?(Tt(Ut,Ut.current&1),l.flags|=128,null):(f&l.child.childLanes)!==0?Yb(o,l,f):(Tt(Ut,Ut.current&1),o=Ti(o,l,f),o!==null?o.sibling:null);Tt(Ut,Ut.current&1);break;case 19:if(g=(f&l.childLanes)!==0,(o.flags&128)!==0){if(g)return Qb(o,l,f);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Tt(Ut,Ut.current),g)break;return null;case 22:case 23:return l.lanes=0,Wb(o,l,f)}return Ti(o,l,f)}var Jb,Mg,eS,tS;Jb=function(o,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)o.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},Mg=function(){},eS=function(o,l,f,g){var b=o.memoizedProps;if(b!==g){o=l.stateNode,Sa(Ks.current);var C=null;switch(f){case"input":b=ot(o,b),g=ot(o,g),C=[];break;case"select":b=z({},b,{value:void 0}),g=z({},g,{value:void 0}),C=[];break;case"textarea":b=Ze(o,b),g=Ze(o,g),C=[];break;default:typeof b.onClick!="function"&&typeof g.onClick=="function"&&(o.onclick=Xf)}ys(f,g);var I;f=null;for(re in b)if(!g.hasOwnProperty(re)&&b.hasOwnProperty(re)&&b[re]!=null)if(re==="style"){var V=b[re];for(I in V)V.hasOwnProperty(I)&&(f||(f={}),f[I]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(s.hasOwnProperty(re)?C||(C=[]):(C=C||[]).push(re,null));for(re in g){var U=g[re];if(V=b!=null?b[re]:void 0,g.hasOwnProperty(re)&&U!==V&&(U!=null||V!=null))if(re==="style")if(V){for(I in V)!V.hasOwnProperty(I)||U&&U.hasOwnProperty(I)||(f||(f={}),f[I]="");for(I in U)U.hasOwnProperty(I)&&V[I]!==U[I]&&(f||(f={}),f[I]=U[I])}else f||(C||(C=[]),C.push(re,f)),f=U;else re==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,V=V?V.__html:void 0,U!=null&&V!==U&&(C=C||[]).push(re,U)):re==="children"?typeof U!="string"&&typeof U!="number"||(C=C||[]).push(re,""+U):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(s.hasOwnProperty(re)?(U!=null&&re==="onScroll"&&It("scroll",o),C||V===U||(C=[])):(C=C||[]).push(re,U))}f&&(C=C||[]).push("style",f);var re=C;(l.updateQueue=re)&&(l.flags|=4)}},tS=function(o,l,f,g){f!==g&&(l.flags|=4)};function Vc(o,l){if(!Vt)switch(o.tailMode){case"hidden":l=o.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Gn(o){var l=o.alternate!==null&&o.alternate.child===o.child,f=0,g=0;if(l)for(var b=o.child;b!==null;)f|=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;)f|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=g,o.childLanes=f,l}function TM(o,l,f){var g=l.pendingProps;switch(eg(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gn(l),null;case 1:return gr(l.type)&&Jf(),Gn(l),null;case 3:return g=l.stateNode,zl(),Mt(mr),Mt(Bn),hg(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(o===null||o.child===null)&&(sh(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Es!==null&&(Ug(Es),Es=null))),Mg(o,l),Gn(l),null;case 5:dg(l);var b=Sa(Lc.current);if(f=l.type,o!==null&&l.stateNode!=null)eS(o,l,f,g,b),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!g){if(l.stateNode===null)throw Error(n(166));return Gn(l),null}if(o=Sa(Ks.current),sh(l)){g=l.stateNode,f=l.type;var C=l.memoizedProps;switch(g[Gs]=l,g[Rc]=C,o=(l.mode&1)!==0,f){case"dialog":It("cancel",g),It("close",g);break;case"iframe":case"object":case"embed":It("load",g);break;case"video":case"audio":for(b=0;b<kc.length;b++)It(kc[b],g);break;case"source":It("error",g);break;case"img":case"image":case"link":It("error",g),It("load",g);break;case"details":It("toggle",g);break;case"input":Zt(g,C),It("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!C.multiple},It("invalid",g);break;case"textarea":_t(g,C),It("invalid",g)}ys(f,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&&Yf(g.textContent,V,o),b=["children",V]):typeof V=="number"&&g.textContent!==""+V&&(C.suppressHydrationWarning!==!0&&Yf(g.textContent,V,o),b=["children",""+V]):s.hasOwnProperty(I)&&V!=null&&I==="onScroll"&&It("scroll",g)}switch(f){case"input":Pe(g),dt(g,C,!0);break;case"textarea":Pe(g),jt(g);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(g.onclick=Xf)}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=An(f)),o==="http://www.w3.org/1999/xhtml"?f==="script"?(o=I.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof g.is=="string"?o=I.createElement(f,{is:g.is}):(o=I.createElement(f),f==="select"&&(I=o,g.multiple?I.multiple=!0:g.size&&(I.size=g.size))):o=I.createElementNS(o,f),o[Gs]=l,o[Rc]=g,Jb(o,l,!1,!1),l.stateNode=o;e:{switch(I=Hs(f,g),f){case"dialog":It("cancel",o),It("close",o),b=g;break;case"iframe":case"object":case"embed":It("load",o),b=g;break;case"video":case"audio":for(b=0;b<kc.length;b++)It(kc[b],o);b=g;break;case"source":It("error",o),b=g;break;case"img":case"image":case"link":It("error",o),It("load",o),b=g;break;case"details":It("toggle",o),b=g;break;case"input":Zt(o,g),b=ot(o,g),It("invalid",o);break;case"option":b=g;break;case"select":o._wrapperState={wasMultiple:!!g.multiple},b=z({},g,{value:void 0}),It("invalid",o);break;case"textarea":_t(o,g),b=Ze(o,g),It("invalid",o);break;default:b=g}ys(f,b),V=b;for(C in V)if(V.hasOwnProperty(C)){var U=V[C];C==="style"?vi(o,U):C==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&Jn(o,U)):C==="children"?typeof U=="string"?(f!=="textarea"||U!=="")&&bn(o,U):typeof U=="number"&&bn(o,""+U):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(s.hasOwnProperty(C)?U!=null&&C==="onScroll"&&It("scroll",o):U!=null&&P(o,C,U,I))}switch(f){case"input":Pe(o),dt(o,g,!1);break;case"textarea":Pe(o),jt(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?it(o,!!g.multiple,C,!1):g.defaultValue!=null&&it(o,!!g.multiple,g.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=Xf)}switch(f){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 Gn(l),null;case 6:if(o&&l.stateNode!=null)tS(o,l,o.memoizedProps,g);else{if(typeof g!="string"&&l.stateNode===null)throw Error(n(166));if(f=Sa(Lc.current),Sa(Ks.current),sh(l)){if(g=l.stateNode,f=l.memoizedProps,g[Gs]=l,(C=g.nodeValue!==f)&&(o=Fr,o!==null))switch(o.tag){case 3:Yf(g.nodeValue,f,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Yf(g.nodeValue,f,(o.mode&1)!==0)}C&&(l.flags|=4)}else g=(f.nodeType===9?f:f.ownerDocument).createTextNode(g),g[Gs]=l,l.stateNode=g}return Gn(l),null;case 13:if(Mt(Ut),g=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Vt&&Vr!==null&&(l.mode&1)!==0&&(l.flags&128)===0)sb(),Fl(),l.flags|=98560,C=!1;else if(C=sh(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[Gs]=l}else Fl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Gn(l),C=!1}else Es!==null&&(Ug(Es),Es=null),C=!0;if(!C)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=f,l):(g=g!==null,g!==(o!==null&&o.memoizedState!==null)&&g&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Ut.current&1)!==0?yn===0&&(yn=3):Gg())),l.updateQueue!==null&&(l.flags|=4),Gn(l),null);case 4:return zl(),Mg(o,l),o===null&&Pc(l.stateNode.containerInfo),Gn(l),null;case 10:return og(l.type._context),Gn(l),null;case 17:return gr(l.type)&&Jf(),Gn(l),null;case 19:if(Mt(Ut),C=l.memoizedState,C===null)return Gn(l),null;if(g=(l.flags&128)!==0,I=C.rendering,I===null)if(g)Vc(C,!1);else{if(yn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(I=ch(o),I!==null){for(l.flags|=128,Vc(C,!1),g=I.updateQueue,g!==null&&(l.updateQueue=g,l.flags|=4),l.subtreeFlags=0,g=f,f=l.child;f!==null;)C=f,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}),f=f.sibling;return Tt(Ut,Ut.current&1|2),l.child}o=o.sibling}C.tail!==null&&Ft()>Gl&&(l.flags|=128,g=!0,Vc(C,!1),l.lanes=4194304)}else{if(!g)if(o=ch(I),o!==null){if(l.flags|=128,g=!0,f=o.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),Vc(C,!0),C.tail===null&&C.tailMode==="hidden"&&!I.alternate&&!Vt)return Gn(l),null}else 2*Ft()-C.renderingStartTime>Gl&&f!==1073741824&&(l.flags|=128,g=!0,Vc(C,!1),l.lanes=4194304);C.isBackwards?(I.sibling=l.child,l.child=I):(f=C.last,f!==null?f.sibling=I:l.child=I,C.last=I)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=Ft(),l.sibling=null,f=Ut.current,Tt(Ut,g?f&1|2:f&1),l):(Gn(l),null);case 22:case 23:return Wg(),g=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==g&&(l.flags|=8192),g&&(l.mode&1)!==0?($r&1073741824)!==0&&(Gn(l),l.subtreeFlags&6&&(l.flags|=8192)):Gn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function RM(o,l){switch(eg(l),l.tag){case 1:return gr(l.type)&&Jf(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return zl(),Mt(mr),Mt(Bn),hg(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return dg(l),null;case 13:if(Mt(Ut),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Fl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Mt(Ut),null;case 4:return zl(),null;case 10:return og(l.type._context),null;case 22:case 23:return Wg(),null;case 24:return null;default:return null}}var _h=!1,Kn=!1,AM=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function Bl(o,l){var f=o.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(g){Yt(o,l,g)}else f.current=null}function Og(o,l,f){try{f()}catch(g){Yt(o,l,g)}}var nS=!1;function IM(o,l){if(W0=Vf,o=Lx(),j0(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var b=g.anchorOffset,C=g.focusNode;g=g.focusOffset;try{f.nodeType,C.nodeType}catch{f=null;break e}var I=0,V=-1,U=-1,re=0,fe=0,me=o,ce=null;t:for(;;){for(var Ae;me!==f||b!==0&&me.nodeType!==3||(V=I+b),me!==C||g!==0&&me.nodeType!==3||(U=I+g),me.nodeType===3&&(I+=me.nodeValue.length),(Ae=me.firstChild)!==null;)ce=me,me=Ae;for(;;){if(me===o)break t;if(ce===f&&++re===b&&(V=I),ce===C&&++fe===g&&(U=I),(Ae=me.nextSibling)!==null)break;me=ce,ce=me.parentNode}me=Ae}f=V===-1||U===-1?null:{start:V,end:U}}else f=null}f=f||{start:0,end:0}}else f=null;for(G0={focusedElem:o,selectionRange:f},Vf=!1,Oe=l;Oe!==null;)if(l=Oe,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Oe=o;else for(;Oe!==null;){l=Oe;try{var Ne=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Fe=Ne.memoizedProps,sn=Ne.memoizedState,Q=l.stateNode,Z=Q.getSnapshotBeforeUpdate(l.elementType===l.type?Fe:Cs(l.type,Fe),sn);Q.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var J=l.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(we){Yt(l,l.return,we)}if(o=l.sibling,o!==null){o.return=l.return,Oe=o;break}Oe=l.return}return Ne=nS,nS=!1,Ne}function $c(o,l,f){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&&Og(l,f,C)}b=b.next}while(b!==g)}}function wh(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&o)===o){var g=f.create;f.destroy=g()}f=f.next}while(f!==l)}}function Lg(o){var l=o.ref;if(l!==null){var f=o.stateNode;switch(o.tag){case 5:o=f;break;default:o=f}typeof l=="function"?l(o):l.current=o}}function rS(o){var l=o.alternate;l!==null&&(o.alternate=null,rS(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Gs],delete l[Rc],delete l[Y0],delete l[hM],delete l[pM])),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 sS(o){return o.tag===5||o.tag===3||o.tag===4}function iS(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||sS(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 Ng(o,l,f){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(o,l):f.insertBefore(o,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(o,f)):(l=f,l.appendChild(o)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=Xf));else if(g!==4&&(o=o.child,o!==null))for(Ng(o,l,f),o=o.sibling;o!==null;)Ng(o,l,f),o=o.sibling}function Dg(o,l,f){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?f.insertBefore(o,l):f.appendChild(o);else if(g!==4&&(o=o.child,o!==null))for(Dg(o,l,f),o=o.sibling;o!==null;)Dg(o,l,f),o=o.sibling}var Mn=null,ks=!1;function So(o,l,f){for(f=f.child;f!==null;)oS(o,l,f),f=f.sibling}function oS(o,l,f){if(Dr&&typeof Dr.onCommitFiberUnmount=="function")try{Dr.onCommitFiberUnmount(va,f)}catch{}switch(f.tag){case 5:Kn||Bl(f,l);case 6:var g=Mn,b=ks;Mn=null,So(o,l,f),Mn=g,ks=b,Mn!==null&&(ks?(o=Mn,f=f.stateNode,o.nodeType===8?o.parentNode.removeChild(f):o.removeChild(f)):Mn.removeChild(f.stateNode));break;case 18:Mn!==null&&(ks?(o=Mn,f=f.stateNode,o.nodeType===8?q0(o.parentNode,f):o.nodeType===1&&q0(o,f),yc(o)):q0(Mn,f.stateNode));break;case 4:g=Mn,b=ks,Mn=f.stateNode.containerInfo,ks=!0,So(o,l,f),Mn=g,ks=b;break;case 0:case 11:case 14:case 15:if(!Kn&&(g=f.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)&&Og(f,l,I),b=b.next}while(b!==g)}So(o,l,f);break;case 1:if(!Kn&&(Bl(f,l),g=f.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=f.memoizedProps,g.state=f.memoizedState,g.componentWillUnmount()}catch(V){Yt(f,l,V)}So(o,l,f);break;case 21:So(o,l,f);break;case 22:f.mode&1?(Kn=(g=Kn)||f.memoizedState!==null,So(o,l,f),Kn=g):So(o,l,f);break;default:So(o,l,f)}}function aS(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var f=o.stateNode;f===null&&(f=o.stateNode=new AM),l.forEach(function(g){var b=$M.bind(null,o,g);f.has(g)||(f.add(g),g.then(b,b))})}}function Ps(o,l){var f=l.deletions;if(f!==null)for(var g=0;g<f.length;g++){var b=f[g];try{var C=o,I=l,V=I;e:for(;V!==null;){switch(V.tag){case 5:Mn=V.stateNode,ks=!1;break e;case 3:Mn=V.stateNode.containerInfo,ks=!0;break e;case 4:Mn=V.stateNode.containerInfo,ks=!0;break e}V=V.return}if(Mn===null)throw Error(n(160));oS(C,I,b),Mn=null,ks=!1;var U=b.alternate;U!==null&&(U.return=null),b.return=null}catch(re){Yt(b,l,re)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)lS(l,o),l=l.sibling}function lS(o,l){var f=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Ps(l,o),qs(o),g&4){try{$c(3,o,o.return),wh(3,o)}catch(Fe){Yt(o,o.return,Fe)}try{$c(5,o,o.return)}catch(Fe){Yt(o,o.return,Fe)}}break;case 1:Ps(l,o),qs(o),g&512&&f!==null&&Bl(f,f.return);break;case 5:if(Ps(l,o),qs(o),g&512&&f!==null&&Bl(f,f.return),o.flags&32){var b=o.stateNode;try{bn(b,"")}catch(Fe){Yt(o,o.return,Fe)}}if(g&4&&(b=o.stateNode,b!=null)){var C=o.memoizedProps,I=f!==null?f.memoizedProps:C,V=o.type,U=o.updateQueue;if(o.updateQueue=null,U!==null)try{V==="input"&&C.type==="radio"&&C.name!=null&&ge(b,C),Hs(V,I);var re=Hs(V,C);for(I=0;I<U.length;I+=2){var fe=U[I],me=U[I+1];fe==="style"?vi(b,me):fe==="dangerouslySetInnerHTML"?Jn(b,me):fe==="children"?bn(b,me):P(b,fe,me,re)}switch(V){case"input":gt(b,C);break;case"textarea":xn(b,C);break;case"select":var ce=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!C.multiple;var Ae=C.value;Ae!=null?it(b,!!C.multiple,Ae,!1):ce!==!!C.multiple&&(C.defaultValue!=null?it(b,!!C.multiple,C.defaultValue,!0):it(b,!!C.multiple,C.multiple?[]:"",!1))}b[Rc]=C}catch(Fe){Yt(o,o.return,Fe)}}break;case 6:if(Ps(l,o),qs(o),g&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,C=o.memoizedProps;try{b.nodeValue=C}catch(Fe){Yt(o,o.return,Fe)}}break;case 3:if(Ps(l,o),qs(o),g&4&&f!==null&&f.memoizedState.isDehydrated)try{yc(l.containerInfo)}catch(Fe){Yt(o,o.return,Fe)}break;case 4:Ps(l,o),qs(o);break;case 13:Ps(l,o),qs(o),b=o.child,b.flags&8192&&(C=b.memoizedState!==null,b.stateNode.isHidden=C,!C||b.alternate!==null&&b.alternate.memoizedState!==null||(Vg=Ft())),g&4&&aS(o);break;case 22:if(fe=f!==null&&f.memoizedState!==null,o.mode&1?(Kn=(re=Kn)||fe,Ps(l,o),Kn=re):Ps(l,o),qs(o),g&8192){if(re=o.memoizedState!==null,(o.stateNode.isHidden=re)&&!fe&&(o.mode&1)!==0)for(Oe=o,fe=o.child;fe!==null;){for(me=Oe=fe;Oe!==null;){switch(ce=Oe,Ae=ce.child,ce.tag){case 0:case 11:case 14:case 15:$c(4,ce,ce.return);break;case 1:Bl(ce,ce.return);var Ne=ce.stateNode;if(typeof Ne.componentWillUnmount=="function"){g=ce,f=ce.return;try{l=g,Ne.props=l.memoizedProps,Ne.state=l.memoizedState,Ne.componentWillUnmount()}catch(Fe){Yt(g,f,Fe)}}break;case 5:Bl(ce,ce.return);break;case 22:if(ce.memoizedState!==null){dS(me);continue}}Ae!==null?(Ae.return=ce,Oe=Ae):dS(me)}fe=fe.sibling}e:for(fe=null,me=o;;){if(me.tag===5){if(fe===null){fe=me;try{b=me.stateNode,re?(C=b.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(V=me.stateNode,U=me.memoizedProps.style,I=U!=null&&U.hasOwnProperty("display")?U.display:null,V.style.display=In("display",I))}catch(Fe){Yt(o,o.return,Fe)}}}else if(me.tag===6){if(fe===null)try{me.stateNode.nodeValue=re?"":me.memoizedProps}catch(Fe){Yt(o,o.return,Fe)}}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:Ps(l,o),qs(o),g&4&&aS(o);break;case 21:break;default:Ps(l,o),qs(o)}}function qs(o){var l=o.flags;if(l&2){try{e:{for(var f=o.return;f!==null;){if(sS(f)){var g=f;break e}f=f.return}throw Error(n(160))}switch(g.tag){case 5:var b=g.stateNode;g.flags&32&&(bn(b,""),g.flags&=-33);var C=iS(o);Dg(o,C,b);break;case 3:case 4:var I=g.stateNode.containerInfo,V=iS(o);Ng(o,V,I);break;default:throw Error(n(161))}}catch(U){Yt(o,o.return,U)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function MM(o,l,f){Oe=o,uS(o)}function uS(o,l,f){for(var g=(o.mode&1)!==0;Oe!==null;){var b=Oe,C=b.child;if(b.tag===22&&g){var I=b.memoizedState!==null||_h;if(!I){var V=b.alternate,U=V!==null&&V.memoizedState!==null||Kn;V=_h;var re=Kn;if(_h=I,(Kn=U)&&!re)for(Oe=b;Oe!==null;)I=Oe,U=I.child,I.tag===22&&I.memoizedState!==null?fS(b):U!==null?(U.return=I,Oe=U):fS(b);for(;C!==null;)Oe=C,uS(C),C=C.sibling;Oe=b,_h=V,Kn=re}cS(o)}else(b.subtreeFlags&8772)!==0&&C!==null?(C.return=b,Oe=C):cS(o)}}function cS(o){for(;Oe!==null;){var l=Oe;if((l.flags&8772)!==0){var f=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Kn||wh(5,l);break;case 1:var g=l.stateNode;if(l.flags&4&&!Kn)if(f===null)g.componentDidMount();else{var b=l.elementType===l.type?f.memoizedProps:Cs(l.type,f.memoizedProps);g.componentDidUpdate(b,f.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var C=l.updateQueue;C!==null&&db(l,C,g);break;case 3:var I=l.updateQueue;if(I!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}db(l,I,f)}break;case 5:var V=l.stateNode;if(f===null&&l.flags&4){f=V;var U=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&f.focus();break;case"img":U.src&&(f.src=U.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var re=l.alternate;if(re!==null){var fe=re.memoizedState;if(fe!==null){var me=fe.dehydrated;me!==null&&yc(me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Kn||l.flags&512&&Lg(l)}catch(ce){Yt(l,l.return,ce)}}if(l===o){Oe=null;break}if(f=l.sibling,f!==null){f.return=l.return,Oe=f;break}Oe=l.return}}function dS(o){for(;Oe!==null;){var l=Oe;if(l===o){Oe=null;break}var f=l.sibling;if(f!==null){f.return=l.return,Oe=f;break}Oe=l.return}}function fS(o){for(;Oe!==null;){var l=Oe;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{wh(4,l)}catch(U){Yt(l,f,U)}break;case 1:var g=l.stateNode;if(typeof g.componentDidMount=="function"){var b=l.return;try{g.componentDidMount()}catch(U){Yt(l,b,U)}}var C=l.return;try{Lg(l)}catch(U){Yt(l,C,U)}break;case 5:var I=l.return;try{Lg(l)}catch(U){Yt(l,I,U)}}}catch(U){Yt(l,l.return,U)}if(l===o){Oe=null;break}var V=l.sibling;if(V!==null){V.return=l.return,Oe=V;break}Oe=l.return}}var OM=Math.ceil,xh=T.ReactCurrentDispatcher,jg=T.ReactCurrentOwner,os=T.ReactCurrentBatchConfig,ct=0,En=null,fn=null,On=0,$r=0,Wl=yo(0),yn=0,Hc=null,Ca=0,bh=0,Fg=0,zc=null,yr=null,Vg=0,Gl=1/0,Ri=null,Sh=!1,$g=null,Eo=null,Eh=!1,Co=null,Ch=0,Uc=0,Hg=null,kh=-1,Ph=0;function rr(){return(ct&6)!==0?Ft():kh!==-1?kh:kh=Ft()}function ko(o){return(o.mode&1)===0?1:(ct&2)!==0&&On!==0?On&-On:gM.transition!==null?(Ph===0&&(Ph=xs()),Ph):(o=vt,o!==0||(o=window.event,o=o===void 0?16:px(o.type)),o)}function Ts(o,l,f,g){if(50<Uc)throw Uc=0,Hg=null,Error(n(185));rn(o,f,g),((ct&2)===0||o!==En)&&(o===En&&((ct&2)===0&&(bh|=f),yn===4&&Po(o,On)),_r(o,g),f===1&&ct===0&&(l.mode&1)===0&&(Gl=Ft()+500,th&&wo()))}function _r(o,l){var f=o.callbackNode;pr(o,l);var g=Ee(o,o===En?On:0);if(g===0)f!==null&&Nf(f),o.callbackNode=null,o.callbackPriority=0;else if(l=g&-g,o.callbackPriority!==l){if(f!=null&&Nf(f),l===1)o.tag===0?mM(pS.bind(null,o)):Jx(pS.bind(null,o)),dM(function(){(ct&6)===0&&wo()}),f=null;else{switch(ox(g)){case 1:f=cc;break;case 4:f=dc;break;case 16:f=xi;break;case 536870912:f=hc;break;default:f=xi}f=bS(f,hS.bind(null,o))}o.callbackPriority=l,o.callbackNode=f}}function hS(o,l){if(kh=-1,Ph=0,(ct&6)!==0)throw Error(n(327));var f=o.callbackNode;if(Kl()&&o.callbackNode!==f)return null;var g=Ee(o,o===En?On:0);if(g===0)return null;if((g&30)!==0||(g&o.expiredLanes)!==0||l)l=Th(o,g);else{l=g;var b=ct;ct|=2;var C=gS();(En!==o||On!==l)&&(Ri=null,Gl=Ft()+500,Pa(o,l));do try{DM();break}catch(V){mS(o,V)}while(!0);ig(),xh.current=C,ct=b,fn!==null?l=0:(En=null,On=0,l=yn)}if(l!==0){if(l===2&&(b=es(o),b!==0&&(g=b,l=zg(o,b))),l===1)throw f=Hc,Pa(o,0),Po(o,g),_r(o,Ft()),f;if(l===6)Po(o,g);else{if(b=o.current.alternate,(g&30)===0&&!LM(b)&&(l=Th(o,g),l===2&&(C=es(o),C!==0&&(g=C,l=zg(o,C))),l===1))throw f=Hc,Pa(o,0),Po(o,g),_r(o,Ft()),f;switch(o.finishedWork=b,o.finishedLanes=g,l){case 0:case 1:throw Error(n(345));case 2:Ta(o,yr,Ri);break;case 3:if(Po(o,g),(g&130023424)===g&&(l=Vg+500-Ft(),10<l)){if(Ee(o,0)!==0)break;if(b=o.suspendedLanes,(b&g)!==g){rr(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=Z0(Ta.bind(null,o,yr,Ri),l);break}Ta(o,yr,Ri);break;case 4:if(Po(o,g),(g&4194240)===g)break;for(l=o.eventTimes,b=-1;0<g;){var I=31-H(g);C=1<<I,I=l[I],I>b&&(b=I),g&=~C}if(g=b,g=Ft()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*OM(g/1960))-g,10<g){o.timeoutHandle=Z0(Ta.bind(null,o,yr,Ri),g);break}Ta(o,yr,Ri);break;case 5:Ta(o,yr,Ri);break;default:throw Error(n(329))}}}return _r(o,Ft()),o.callbackNode===f?hS.bind(null,o):null}function zg(o,l){var f=zc;return o.current.memoizedState.isDehydrated&&(Pa(o,l).flags|=256),o=Th(o,l),o!==2&&(l=yr,yr=f,l!==null&&Ug(l)),o}function Ug(o){yr===null?yr=o:yr.push.apply(yr,o)}function LM(o){for(var l=o;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var g=0;g<f.length;g++){var b=f[g],C=b.getSnapshot;b=b.value;try{if(!Ss(C(),b))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;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 Po(o,l){for(l&=~Fg,l&=~bh,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var f=31-H(l),g=1<<f;o[f]=-1,l&=~g}}function pS(o){if((ct&6)!==0)throw Error(n(327));Kl();var l=Ee(o,0);if((l&1)===0)return _r(o,Ft()),null;var f=Th(o,l);if(o.tag!==0&&f===2){var g=es(o);g!==0&&(l=g,f=zg(o,g))}if(f===1)throw f=Hc,Pa(o,0),Po(o,l),_r(o,Ft()),f;if(f===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,Ta(o,yr,Ri),_r(o,Ft()),null}function Bg(o,l){var f=ct;ct|=1;try{return o(l)}finally{ct=f,ct===0&&(Gl=Ft()+500,th&&wo())}}function ka(o){Co!==null&&Co.tag===0&&(ct&6)===0&&Kl();var l=ct;ct|=1;var f=os.transition,g=vt;try{if(os.transition=null,vt=1,o)return o()}finally{vt=g,os.transition=f,ct=l,(ct&6)===0&&wo()}}function Wg(){$r=Wl.current,Mt(Wl)}function Pa(o,l){o.finishedWork=null,o.finishedLanes=0;var f=o.timeoutHandle;if(f!==-1&&(o.timeoutHandle=-1,cM(f)),fn!==null)for(f=fn.return;f!==null;){var g=f;switch(eg(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&Jf();break;case 3:zl(),Mt(mr),Mt(Bn),hg();break;case 5:dg(g);break;case 4:zl();break;case 13:Mt(Ut);break;case 19:Mt(Ut);break;case 10:og(g.type._context);break;case 22:case 23:Wg()}f=f.return}if(En=o,fn=o=To(o.current,null),On=$r=l,yn=0,Hc=null,Fg=bh=Ca=0,yr=zc=null,ba!==null){for(l=0;l<ba.length;l++)if(f=ba[l],g=f.interleaved,g!==null){f.interleaved=null;var b=g.next,C=f.pending;if(C!==null){var I=C.next;C.next=b,g.next=I}f.pending=g}ba=null}return o}function mS(o,l){do{var f=fn;try{if(ig(),dh.current=mh,fh){for(var g=Bt.memoizedState;g!==null;){var b=g.queue;b!==null&&(b.pending=null),g=g.next}fh=!1}if(Ea=0,Sn=vn=Bt=null,Nc=!1,Dc=0,jg.current=null,f===null||f.return===null){yn=1,Hc=l,fn=null;break}e:{var C=o,I=f.return,V=f,U=l;if(l=On,V.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var re=U,fe=V,me=fe.tag;if((fe.mode&1)===0&&(me===0||me===11||me===15)){var ce=fe.alternate;ce?(fe.updateQueue=ce.updateQueue,fe.memoizedState=ce.memoizedState,fe.lanes=ce.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Ae=$b(I);if(Ae!==null){Ae.flags&=-257,Hb(Ae,I,V,C,l),Ae.mode&1&&Vb(C,re,l),l=Ae,U=re;var Ne=l.updateQueue;if(Ne===null){var Fe=new Set;Fe.add(U),l.updateQueue=Fe}else Ne.add(U);break e}else{if((l&1)===0){Vb(C,re,l),Gg();break e}U=Error(n(426))}}else if(Vt&&V.mode&1){var sn=$b(I);if(sn!==null){(sn.flags&65536)===0&&(sn.flags|=256),Hb(sn,I,V,C,l),rg(Ul(U,V));break e}}C=U=Ul(U,V),yn!==4&&(yn=2),zc===null?zc=[C]:zc.push(C),C=I;do{switch(C.tag){case 3:C.flags|=65536,l&=-l,C.lanes|=l;var Q=jb(C,U,l);cb(C,Q);break e;case 1:V=U;var Z=C.type,J=C.stateNode;if((C.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||J!==null&&typeof J.componentDidCatch=="function"&&(Eo===null||!Eo.has(J)))){C.flags|=65536,l&=-l,C.lanes|=l;var we=Fb(C,V,l);cb(C,we);break e}}C=C.return}while(C!==null)}yS(f)}catch(Ve){l=Ve,fn===f&&f!==null&&(fn=f=f.return);continue}break}while(!0)}function gS(){var o=xh.current;return xh.current=mh,o===null?mh:o}function Gg(){(yn===0||yn===3||yn===2)&&(yn=4),En===null||(Ca&268435455)===0&&(bh&268435455)===0||Po(En,On)}function Th(o,l){var f=ct;ct|=2;var g=gS();(En!==o||On!==l)&&(Ri=null,Pa(o,l));do try{NM();break}catch(b){mS(o,b)}while(!0);if(ig(),ct=f,xh.current=g,fn!==null)throw Error(n(261));return En=null,On=0,yn}function NM(){for(;fn!==null;)vS(fn)}function DM(){for(;fn!==null&&!ix();)vS(fn)}function vS(o){var l=xS(o.alternate,o,$r);o.memoizedProps=o.pendingProps,l===null?yS(o):fn=l,jg.current=null}function yS(o){var l=o;do{var f=l.alternate;if(o=l.return,(l.flags&32768)===0){if(f=TM(f,l,$r),f!==null){fn=f;return}}else{if(f=RM(f,l),f!==null){f.flags&=32767,fn=f;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{yn=6,fn=null;return}}if(l=l.sibling,l!==null){fn=l;return}fn=l=o}while(l!==null);yn===0&&(yn=5)}function Ta(o,l,f){var g=vt,b=os.transition;try{os.transition=null,vt=1,jM(o,l,f,g)}finally{os.transition=b,vt=g}return null}function jM(o,l,f,g){do Kl();while(Co!==null);if((ct&6)!==0)throw Error(n(327));f=o.finishedWork;var b=o.finishedLanes;if(f===null)return null;if(o.finishedWork=null,o.finishedLanes=0,f===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var C=f.lanes|f.childLanes;if(Ws(o,C),o===En&&(fn=En=null,On=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||Eh||(Eh=!0,bS(xi,function(){return Kl(),null})),C=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||C){C=os.transition,os.transition=null;var I=vt;vt=1;var V=ct;ct|=4,jg.current=null,IM(o,f),lS(f,o),rM(G0),Vf=!!W0,G0=W0=null,o.current=f,MM(f),uo(),ct=V,vt=I,os.transition=C}else o.current=f;if(Eh&&(Eh=!1,Co=o,Ch=b),C=o.pendingLanes,C===0&&(Eo=null),Df(f.stateNode),_r(o,Ft()),l!==null)for(g=o.onRecoverableError,f=0;f<l.length;f++)b=l[f],g(b.value,{componentStack:b.stack,digest:b.digest});if(Sh)throw Sh=!1,o=$g,$g=null,o;return(Ch&1)!==0&&o.tag!==0&&Kl(),C=o.pendingLanes,(C&1)!==0?o===Hg?Uc++:(Uc=0,Hg=o):Uc=0,wo(),null}function Kl(){if(Co!==null){var o=ox(Ch),l=os.transition,f=vt;try{if(os.transition=null,vt=16>o?16:o,Co===null)var g=!1;else{if(o=Co,Co=null,Ch=0,(ct&6)!==0)throw Error(n(331));var b=ct;for(ct|=4,Oe=o.current;Oe!==null;){var C=Oe,I=C.child;if((Oe.flags&16)!==0){var V=C.deletions;if(V!==null){for(var U=0;U<V.length;U++){var re=V[U];for(Oe=re;Oe!==null;){var fe=Oe;switch(fe.tag){case 0:case 11:case 15:$c(8,fe,C)}var me=fe.child;if(me!==null)me.return=fe,Oe=me;else for(;Oe!==null;){fe=Oe;var ce=fe.sibling,Ae=fe.return;if(rS(fe),fe===re){Oe=null;break}if(ce!==null){ce.return=Ae,Oe=ce;break}Oe=Ae}}}var Ne=C.alternate;if(Ne!==null){var Fe=Ne.child;if(Fe!==null){Ne.child=null;do{var sn=Fe.sibling;Fe.sibling=null,Fe=sn}while(Fe!==null)}}Oe=C}}if((C.subtreeFlags&2064)!==0&&I!==null)I.return=C,Oe=I;else e:for(;Oe!==null;){if(C=Oe,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:$c(9,C,C.return)}var Q=C.sibling;if(Q!==null){Q.return=C.return,Oe=Q;break e}Oe=C.return}}var Z=o.current;for(Oe=Z;Oe!==null;){I=Oe;var J=I.child;if((I.subtreeFlags&2064)!==0&&J!==null)J.return=I,Oe=J;else e:for(I=Z;Oe!==null;){if(V=Oe,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:wh(9,V)}}catch(Ve){Yt(V,V.return,Ve)}if(V===I){Oe=null;break e}var we=V.sibling;if(we!==null){we.return=V.return,Oe=we;break e}Oe=V.return}}if(ct=b,wo(),Dr&&typeof Dr.onPostCommitFiberRoot=="function")try{Dr.onPostCommitFiberRoot(va,o)}catch{}g=!0}return g}finally{vt=f,os.transition=l}}return!1}function _S(o,l,f){l=Ul(f,l),l=jb(o,l,1),o=bo(o,l,1),l=rr(),o!==null&&(rn(o,1,l),_r(o,l))}function Yt(o,l,f){if(o.tag===3)_S(o,o,f);else for(;l!==null;){if(l.tag===3){_S(l,o,f);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Eo===null||!Eo.has(g))){o=Ul(f,o),o=Fb(l,o,1),l=bo(l,o,1),o=rr(),l!==null&&(rn(l,1,o),_r(l,o));break}}l=l.return}}function FM(o,l,f){var g=o.pingCache;g!==null&&g.delete(l),l=rr(),o.pingedLanes|=o.suspendedLanes&f,En===o&&(On&f)===f&&(yn===4||yn===3&&(On&130023424)===On&&500>Ft()-Vg?Pa(o,0):Fg|=f),_r(o,l)}function wS(o,l){l===0&&((o.mode&1)===0?l=1:(l=ke,ke<<=1,(ke&130023424)===0&&(ke=4194304)));var f=rr();o=ki(o,l),o!==null&&(rn(o,l,f),_r(o,f))}function VM(o){var l=o.memoizedState,f=0;l!==null&&(f=l.retryLane),wS(o,f)}function $M(o,l){var f=0;switch(o.tag){case 13:var g=o.stateNode,b=o.memoizedState;b!==null&&(f=b.retryLane);break;case 19:g=o.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(l),wS(o,f)}var xS;xS=function(o,l,f){if(o!==null)if(o.memoizedProps!==l.pendingProps||mr.current)vr=!0;else{if((o.lanes&f)===0&&(l.flags&128)===0)return vr=!1,PM(o,l,f);vr=(o.flags&131072)!==0}else vr=!1,Vt&&(l.flags&1048576)!==0&&eb(l,rh,l.index);switch(l.lanes=0,l.tag){case 2:var g=l.type;yh(o,l),o=l.pendingProps;var b=Nl(l,Bn.current);Hl(l,f),b=gg(null,l,g,o,b,f);var C=vg();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,eh(l)):C=!1,l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,ug(l),b.updater=gh,l.stateNode=b,b._reactInternals=l,Sg(l,g,o,f),l=Pg(null,l,g,!0,C,f)):(l.tag=0,Vt&&C&&J0(l),nr(null,l,b,f),l=l.child),l;case 16:g=l.elementType;e:{switch(yh(o,l),o=l.pendingProps,b=g._init,g=b(g._payload),l.type=g,b=l.tag=zM(g),o=Cs(g,o),b){case 0:l=kg(null,l,g,o,f);break e;case 1:l=Kb(null,l,g,o,f);break e;case 11:l=zb(null,l,g,o,f);break e;case 14:l=Ub(null,l,g,Cs(g.type,o),f);break e}throw Error(n(306,g,""))}return l;case 0:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Cs(g,b),kg(o,l,g,b,f);case 1:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Cs(g,b),Kb(o,l,g,b,f);case 3:e:{if(Zb(l),o===null)throw Error(n(387));g=l.pendingProps,C=l.memoizedState,b=C.element,ub(o,l),uh(l,g,null,f);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=Ul(Error(n(423)),l),l=qb(o,l,g,f,b);break e}else if(g!==b){b=Ul(Error(n(424)),l),l=qb(o,l,g,f,b);break e}else for(Vr=vo(l.stateNode.containerInfo.firstChild),Fr=l,Vt=!0,Es=null,f=ab(l,null,g,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Fl(),g===b){l=Ti(o,l,f);break e}nr(o,l,g,f)}l=l.child}return l;case 5:return fb(l),o===null&&ng(l),g=l.type,b=l.pendingProps,C=o!==null?o.memoizedProps:null,I=b.children,K0(g,b)?I=null:C!==null&&K0(g,C)&&(l.flags|=32),Gb(o,l),nr(o,l,I,f),l.child;case 6:return o===null&&ng(l),null;case 13:return Yb(o,l,f);case 4:return cg(l,l.stateNode.containerInfo),g=l.pendingProps,o===null?l.child=Vl(l,null,g,f):nr(o,l,g,f),l.child;case 11:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Cs(g,b),zb(o,l,g,b,f);case 7:return nr(o,l,l.pendingProps,f),l.child;case 8:return nr(o,l,l.pendingProps.children,f),l.child;case 12:return nr(o,l,l.pendingProps.children,f),l.child;case 10:e:{if(g=l.type._context,b=l.pendingProps,C=l.memoizedProps,I=b.value,Tt(oh,g._currentValue),g._currentValue=I,C!==null)if(Ss(C.value,I)){if(C.children===b.children&&!mr.current){l=Ti(o,l,f);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 U=V.firstContext;U!==null;){if(U.context===g){if(C.tag===1){U=Pi(-1,f&-f),U.tag=2;var re=C.updateQueue;if(re!==null){re=re.shared;var fe=re.pending;fe===null?U.next=U:(U.next=fe.next,fe.next=U),re.pending=U}}C.lanes|=f,U=C.alternate,U!==null&&(U.lanes|=f),ag(C.return,f,l),V.lanes|=f;break}U=U.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|=f,V=I.alternate,V!==null&&(V.lanes|=f),ag(I,f,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,f),l=l.child}return l;case 9:return b=l.type,g=l.pendingProps.children,Hl(l,f),b=ss(b),g=g(b),l.flags|=1,nr(o,l,g,f),l.child;case 14:return g=l.type,b=Cs(g,l.pendingProps),b=Cs(g.type,b),Ub(o,l,g,b,f);case 15:return Bb(o,l,l.type,l.pendingProps,f);case 17:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Cs(g,b),yh(o,l),l.tag=1,gr(g)?(o=!0,eh(l)):o=!1,Hl(l,f),Nb(l,g,b),Sg(l,g,b,f),Pg(null,l,g,!0,o,f);case 19:return Qb(o,l,f);case 22:return Wb(o,l,f)}throw Error(n(156,l.tag))};function bS(o,l){return lc(o,l)}function HM(o,l,f,g){this.tag=o,this.key=f,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 as(o,l,f,g){return new HM(o,l,f,g)}function Kg(o){return o=o.prototype,!(!o||!o.isReactComponent)}function zM(o){if(typeof o=="function")return Kg(o)?1:0;if(o!=null){if(o=o.$$typeof,o===F)return 11;if(o===W)return 14}return 2}function To(o,l){var f=o.alternate;return f===null?(f=as(o.tag,l,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=l,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&14680064,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,l=o.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f}function Rh(o,l,f,g,b,C){var I=2;if(g=o,typeof o=="function")Kg(o)&&(I=1);else if(typeof o=="string")I=5;else e:switch(o){case O:return Ra(f.children,b,C,l);case R:I=8,b|=8;break;case M:return o=as(12,f,l,b|2),o.elementType=M,o.lanes=C,o;case q:return o=as(13,f,l,b),o.elementType=q,o.lanes=C,o;case G:return o=as(19,f,l,b),o.elementType=G,o.lanes=C,o;case X:return Ah(f,b,C,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case N:I=10;break e;case j:I=9;break e;case F:I=11;break e;case W:I=14;break e;case K:I=16,g=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=as(I,f,l,b),l.elementType=o,l.type=g,l.lanes=C,l}function Ra(o,l,f,g){return o=as(7,o,g,l),o.lanes=f,o}function Ah(o,l,f,g){return o=as(22,o,g,l),o.elementType=X,o.lanes=f,o.stateNode={isHidden:!1},o}function Zg(o,l,f){return o=as(6,o,null,l),o.lanes=f,o}function qg(o,l,f){return l=as(4,o.children!==null?o.children:[],o.key,l),l.lanes=f,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function UM(o,l,f,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=ts(0),this.expirationTimes=ts(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ts(0),this.identifierPrefix=g,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function Yg(o,l,f,g,b,C,I,V,U){return o=new UM(o,l,f,V,U),l===1?(l=1,C===!0&&(l|=8)):l=0,C=as(3,null,null,l),o.current=C,C.stateNode=o,C.memoizedState={element:g,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},ug(C),o}function BM(o,l,f){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:g==null?null:""+g,children:o,containerInfo:l,implementation:f}}function SS(o){if(!o)return _o;o=o._reactInternals;e:{if(wi(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 f=o.type;if(gr(f))return Xx(o,f,l)}return l}function ES(o,l,f,g,b,C,I,V,U){return o=Yg(f,g,!0,o,b,C,I,V,U),o.context=SS(null),f=o.current,g=rr(),b=ko(f),C=Pi(g,b),C.callback=l??null,bo(f,C,b),o.current.lanes=b,rn(o,b,g),_r(o,g),o}function Ih(o,l,f,g){var b=l.current,C=rr(),I=ko(b);return f=SS(f),l.context===null?l.context=f:l.pendingContext=f,l=Pi(C,I),l.payload={element:o},g=g===void 0?null:g,g!==null&&(l.callback=g),o=bo(b,l,I),o!==null&&(Ts(o,b,I,C),lh(o,b,I)),I}function Mh(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 CS(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<l?f:l}}function Xg(o,l){CS(o,l),(o=o.alternate)&&CS(o,l)}function WM(){return null}var kS=typeof reportError=="function"?reportError:function(o){console.error(o)};function Qg(o){this._internalRoot=o}Oh.prototype.render=Qg.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));Ih(o,l,null,null)},Oh.prototype.unmount=Qg.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;ka(function(){Ih(null,o,null,null)}),l[bi]=null}};function Oh(o){this._internalRoot=o}Oh.prototype.unstable_scheduleHydration=function(o){if(o){var l=ux();o={blockedOn:null,target:o,priority:l};for(var f=0;f<po.length&&l!==0&&l<po[f].priority;f++);po.splice(f,0,o),f===0&&fx(o)}};function Jg(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Lh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function PS(){}function GM(o,l,f,g,b){if(b){if(typeof g=="function"){var C=g;g=function(){var re=Mh(I);C.call(re)}}var I=ES(l,g,o,0,null,!1,!1,"",PS);return o._reactRootContainer=I,o[bi]=I.current,Pc(o.nodeType===8?o.parentNode:o),ka(),I}for(;b=o.lastChild;)o.removeChild(b);if(typeof g=="function"){var V=g;g=function(){var re=Mh(U);V.call(re)}}var U=Yg(o,0,!1,null,null,!1,!1,"",PS);return o._reactRootContainer=U,o[bi]=U.current,Pc(o.nodeType===8?o.parentNode:o),ka(function(){Ih(l,U,f,g)}),U}function Nh(o,l,f,g,b){var C=f._reactRootContainer;if(C){var I=C;if(typeof b=="function"){var V=b;b=function(){var U=Mh(I);V.call(U)}}Ih(l,I,o,b)}else I=GM(f,l,o,b,g);return Mh(I)}ax=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var f=We(l.pendingLanes);f!==0&&(bs(l,f|1),_r(l,Ft()),(ct&6)===0&&(Gl=Ft()+500,wo()))}break;case 13:ka(function(){var g=ki(o,1);if(g!==null){var b=rr();Ts(g,o,1,b)}}),Xg(o,1)}},E0=function(o){if(o.tag===13){var l=ki(o,134217728);if(l!==null){var f=rr();Ts(l,o,134217728,f)}Xg(o,134217728)}},lx=function(o){if(o.tag===13){var l=ko(o),f=ki(o,l);if(f!==null){var g=rr();Ts(f,o,l,g)}Xg(o,l)}},ux=function(){return vt},cx=function(o,l){var f=vt;try{return vt=o,l()}finally{vt=f}},zs=function(o,l,f){switch(l){case"input":if(gt(o,f),l=f.name,f.type==="radio"&&l!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var g=f[l];if(g!==o&&g.form===o.form){var b=Qf(g);if(!b)throw Error(n(90));be(g),gt(g,b)}}}break;case"textarea":xn(o,f);break;case"select":l=f.value,l!=null&&it(o,!!f.multiple,l,!1)}},tn=Bg,nn=ka;var KM={usingClientEntryPoint:!1,Events:[Ac,Ol,Qf,Ke,At,Bg]},Bc={findFiberByHostInstance:ya,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ZM={bundleType:Bc.bundleType,version:Bc.version,rendererPackageName:Bc.rendererPackageName,rendererConfig:Bc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=El(o),o===null?null:o.stateNode},findFiberByHostInstance:Bc.findFiberByHostInstance||WM,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 Dh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dh.isDisabled&&Dh.supportsFiber)try{va=Dh.inject(ZM),Dr=Dh}catch{}}return wr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KM,wr.createPortal=function(o,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jg(l))throw Error(n(200));return BM(o,l,null,f)},wr.createRoot=function(o,l){if(!Jg(o))throw Error(n(299));var f=!1,g="",b=kS;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),l=Yg(o,1,!1,null,null,f,!1,g,b),o[bi]=l.current,Pc(o.nodeType===8?o.parentNode:o),new Qg(l)},wr.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=El(l),o=o===null?null:o.stateNode,o},wr.flushSync=function(o){return ka(o)},wr.hydrate=function(o,l,f){if(!Lh(l))throw Error(n(200));return Nh(null,o,l,!0,f)},wr.hydrateRoot=function(o,l,f){if(!Jg(o))throw Error(n(405));var g=f!=null&&f.hydratedSources||null,b=!1,C="",I=kS;if(f!=null&&(f.unstable_strictMode===!0&&(b=!0),f.identifierPrefix!==void 0&&(C=f.identifierPrefix),f.onRecoverableError!==void 0&&(I=f.onRecoverableError)),l=ES(l,null,o,1,f??null,b,!1,C,I),o[bi]=l.current,Pc(o),g)for(o=0;o<g.length;o++)f=g[o],b=f._getVersion,b=b(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,b]:l.mutableSourceEagerHydrationData.push(f,b);return new Oh(l)},wr.render=function(o,l,f){if(!Lh(l))throw Error(n(200));return Nh(null,o,l,!1,f)},wr.unmountComponentAtNode=function(o){if(!Lh(o))throw Error(n(40));return o._reactRootContainer?(ka(function(){Nh(null,null,o,!1,function(){o._reactRootContainer=null,o[bi]=null})}),!0):!1},wr.unstable_batchedUpdates=Bg,wr.unstable_renderSubtreeIntoContainer=function(o,l,f,g){if(!Lh(f))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return Nh(o,l,f,!1,g)},wr.version="18.3.1-next-f1338f8080-20240426",wr}var XE;function pP(){if(XE)return Ov.exports;XE=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(),Ov.exports=vD(),Ov.exports}var QE;function yD(){if(QE)return Zh;QE=1;var t=pP();return Zh.createRoot=t.createRoot,Zh.hydrateRoot=t.hydrateRoot,Zh}var _D=yD();const wD=Gm(_D),Xi={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function mP(t){return"init"in t}function My(t){return typeof t.write=="function"}function xD(t){return!!t.onMount}function JE(t){return"v"in t||"e"in t}function mm(t){if("e"in t)throw t.e;if((Xi?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function gm(t){return typeof(t==null?void 0:t.then)=="function"}function bD(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 gP(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function vP(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 u of i)a.add(u);return a}function SD(t){return!!t.INTERNAL_onInit}const ED=(t,e,n,...r)=>n.read(...r),CD=(t,e,n,...r)=>n.write(...r),kD=(t,e,n)=>n.INTERNAL_onInit(e),PD=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},TD=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const a=t[6],u=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=a.i)==null||r.call(a,n),SD(n)&&u(t,e,n)}return i},RD=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],a=t[5],u=t[6],c=t[13];if(!u.f&&!s.size&&!i.size&&!a.size)return;const d=[],h=p=>{try{p()}catch(m){d.push(m)}};do{u.f&&h(u.f);const p=new Set;for(const m of s){const y=(n=r.get(m))==null?void 0:n.l;if(y)for(const w of y)p.add(w)}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&&c(t,e)}while(s.size||a.size||i.size);if(d.length)throw new AggregateError(d)},AD=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],a=t[14],u=t[17];if(!s.size)return;const c=[],d=[],h=new WeakSet,p=new WeakSet,m=[],y=[];for(const w of s)m.push(w),y.push(i(t,e,w));for(;m.length;){const w=m.length-1,_=m[w],x=y[w];if(p.has(_)){m.pop(),y.pop();continue}if(h.has(_)){if(r.get(_)===x.n)c.push(_),d.push(x);else if((Xi?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),m.pop(),y.pop();continue}h.add(_);for(const E of vP(_,x,n))h.has(E)||(m.push(E),y.push(i(t,e,E)))}for(let w=c.length-1;w>=0;--w){const _=c[w],x=d[w];let E=!1;for(const k of x.d.keys())if(k!==_&&s.has(k)){E=!0;break}E&&(r.set(_,x.n),a(t,e,_),u(t,e,_)),r.delete(_)}},Oy=new WeakSet,ID=(t,e,n)=>{var r,s;const i=t[1],a=t[2],u=t[3],c=t[6],d=t[7],h=t[11],p=t[12],m=t[13],y=t[14],w=t[16],_=t[17],x=t[20],E=t[26],k=t[28],P=h(t,e,n),T=k[0];if(JE(P)){if(i.has(n)&&a.get(n)!==P.n||P.m===T)return P.m=T,P;let W=!1;for(const[K,X]of P.d)if(y(t,e,K).n!==X){W=!0;break}if(!W)return P.m=T,P}let A=!0;const L=new Set(P.d.keys()),O=()=>{for(const W of L)P.d.delete(W)},R=()=>{if(i.has(n)){const W=!u.size;_(t,e,n),W&&(m(t,e),p(t,e))}},M=W=>{var K;if(W===n){const $=h(t,e,W);if(!JE($))if(mP(W))x(t,e,W,W.init);else throw new Error("no atom init");return mm($)}const X=y(t,e,W);try{return mm(X)}finally{L.delete(W),P.d.set(W,X.n),gm(P.v)&&gP(n,P.v,X),i.has(n)&&((K=i.get(W))==null||K.t.add(n)),A||R()}};let N,j;const F={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(Xi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Xi?"production":void 0)!=="production"&&!My(n)&&console.warn("setSelf function cannot be used with read-only atom"),!j&&My(n)&&(j=(...W)=>{if((Xi?"production":void 0)!=="production"&&A&&console.warn("setSelf function cannot be called in sync"),!A)try{return w(t,e,n,W)}finally{m(t,e),p(t,e)}}),j}},q=P.n,G=a.get(n)===q;try{(Xi?"production":void 0)!=="production"&&Oy.delete(e);const W=d(t,e,n,M,F);if((Xi?"production":void 0)!=="production"&&Oy.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),x(t,e,n,W),gm(W)){E(t,e,W,()=>N==null?void 0:N.abort());const K=()=>{O(),R()};W.then(K,K)}else O();return(r=c.r)==null||r.call(c,n),P.m=T,P}catch(W){if(bD(W))throw W;return delete P.v,P.e=W,++P.n,P.m=T,P}finally{A=!1,P.n!==q&&G&&(a.set(n,P.n),u.add(n),(s=c.c)==null||s.call(c,n))}},MD=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],a=[n];for(;a.length;){const u=a.pop(),c=i(t,e,u);for(const d of vP(u,c,r)){const h=i(t,e,d);s.get(d)!==h.n&&(s.set(d,h.n),a.push(d))}}},OD=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],u=t[11],c=t[12],d=t[13],h=t[14],p=t[15],m=t[16],y=t[17],w=t[20],_=t[28];let x=!0;const E=P=>mm(h(t,e,P)),k=(P,...T)=>{var A;const L=u(t,e,P);try{if(P===n){if(!mP(P))throw new Error("atom not writable");(Xi?"production":void 0)!=="production"&&Oy.add(e);const O=L.n,R=T[0];w(t,e,P,R),y(t,e,P),O!==L.n&&(++_[0],s.add(P),p(t,e,P),(A=i.c)==null||A.call(i,P));return}else return m(t,e,P,T)}finally{x||(d(t,e),c(t,e))}};try{return a(t,e,n,E,k,...r)}finally{x=!1}},LD=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],u=t[11],c=t[15],d=t[18],h=t[19],p=u(t,e,n),m=s.get(n);if(m&&p.d.size>0){for(const[y,w]of p.d)if(!m.d.has(y)){const _=u(t,e,y);d(t,e,y).t.add(n),m.d.add(y),w!==_.n&&(i.add(y),c(t,e,y),(r=a.c)==null||r.call(a,y))}for(const y of m.d)if(!p.d.has(y)){m.d.delete(y);const w=h(t,e,y);w==null||w.t.delete(n)}}},ND=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],u=t[10],c=t[11],d=t[12],h=t[13],p=t[14],m=t[16],y=t[18],w=c(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const x of w.d.keys())y(t,e,x).t.add(n);if(_={l:new Set,d:new Set(w.d.keys()),t:new Set},s.set(n,_),My(n)&&xD(n)){const x=()=>{let E=!0;const k=(...P)=>{try{return m(t,e,n,P)}finally{E||(h(t,e),d(t,e))}};try{const P=u(t,e,n,k);P&&(_.u=()=>{E=!0;try{P()}finally{E=!1}})}finally{E=!1}};i.add(x)}(r=a.m)==null||r.call(a,n)}return _},DD=(t,e,n)=>{var r,s;const i=t[1],a=t[5],u=t[6],c=t[11],d=t[19],h=c(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const y of p.t)if((r=i.get(y))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const y of h.d.keys()){const w=d(t,e,y);w==null||w.t.delete(n)}(s=u.u)==null||s.call(u,n);return}return p},jD=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),u="v"in a,c=a.v;if(gm(r))for(const d of a.d.keys())gP(n,r,s(t,e,d));a.v=r,delete a.e,(!u||!Object.is(c,a.v))&&(++a.n,gm(c)&&i(t,e,c))},FD=(t,e,n)=>{const r=t[14];return mm(r(t,e,n))},VD=(t,e,n,...r)=>{const s=t[3],i=t[12],a=t[13],u=t[16],c=s.size;try{return u(t,e,n,r)}finally{s.size!==c&&(a(t,e),i(t,e))}},$D=(t,e,n,r)=>{const s=t[12],i=t[13],a=t[18],u=t[19],d=a(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),u(t,e,n),i(t,e),s(t,e)}},HD=(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)},zD=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},yP=new WeakMap;function UD(t){const e=yP.get(t);if((Xi?"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 BD(...t){const e={get(a){return r(n,e,a)},set(a,...u){return s(n,e,a,...u)},sub(a,u){return i(n,e,a,u)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},ED,CD,kD,PD,TD,RD,AD,ID,MD,OD,LD,ND,DD,jD,FD,VD,$D,void 0,new WeakMap,HD,zD,[0]].map((a,u)=>t[u]||a);yP.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const _P={};let WD=0;function tt(t,e){const n=`atom${++WD}`,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=GD,r.write=KD),e&&(r.write=e),r}function GD(t){return t(this)}function KD(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function ZD(){return BD()}let rd;function qD(){return rd||(rd=ZD(),(_P?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=rd),globalThis.__JOTAI_DEFAULT_STORE__!==rd&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),rd}const YD={},XD=v.createContext(void 0);function w2(t){return v.useContext(XD)||qD()}const Ly=t=>typeof(t==null?void 0:t.then)=="function",Ny=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},QD=_e.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Ny(t),t)}),Dv=new WeakMap,e4=(t,e,n)=>{const r=UD(t),s=r[26];let i=Dv.get(e);return i||(i=new Promise((a,u)=>{let c=e;const d=m=>y=>{c===m&&a(y)},h=m=>y=>{c===m&&u(y)},p=()=>{try{const m=n();Ly(m)?(Dv.set(m,i),c=m,m.then(d(m),h(m)),s(r,t,m,p)):a(m)}catch(m){u(m)}};e.then(d(e),h(e)),s(r,t,e,p)}),Dv.set(e,i)),i};function Qe(t,e){const{delay:n,unstable_promiseStatus:r=!_e.use}={},s=w2(),[[i,a,u],c]=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 d=i;if((a!==s||u!==t)&&(c(),d=s.get(t)),v.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);Ly(p)&&Ny(e4(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(c,n);return}c()});return c(),h},[s,t,n,r]),v.useDebugValue(d),Ly(d)){const h=e4(s,d,()=>s.get(t));return r&&Ny(h),QD(h)}return d}function st(t,e){const n=w2();return v.useCallback((...s)=>{if((YD?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function wP(t,e){return[Qe(t),st(t)]}const x2=v.createContext({});function b2(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const JD=typeof window<"u",S2=JD?v.useLayoutEffect:v.useEffect,Ym=v.createContext(null);function E2(t,e){t.indexOf(e)===-1&&t.push(e)}function vm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const fi=(t,e,n)=>n>e?e:n<t?t:n;let C2=()=>{};const ea={},xP=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),bP=t=>typeof t=="object"&&t!==null,SP=t=>/^0[^.\s]+$/u.test(t);function EP(t){let e;return()=>(e===void 0&&(e=t()),e)}const gs=t=>t,xf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),zd=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class k2{constructor(){this.subscriptions=[]}add(e){return E2(this.subscriptions,e),()=>vm(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,fs=t=>t/1e3,CP=(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,e9=1e-7,t9=12;function n9(t,e,n,r,s){let i,a,u=0;do a=e+(n-e)/2,i=kP(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>e9&&++u<t9);return a}function bf(t,e,n,r){if(t===e&&n===r)return gs;const s=i=>n9(i,0,1,t,n);return i=>i===0||i===1?i:kP(s(i),e,r)}const PP=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,TP=t=>e=>1-t(1-e),RP=bf(.33,1.53,.69,.99),P2=TP(RP),AP=PP(P2),IP=t=>t>=1?1:(t*=2)<1?.5*P2(t):.5*(2-Math.pow(2,-10*(t-1))),T2=t=>1-Math.sin(Math.acos(t)),MP=TP(T2),OP=PP(T2),r9=bf(.42,0,1,1),s9=bf(0,0,.58,1),LP=bf(.42,0,.58,1),i9=t=>Array.isArray(t)&&typeof t[0]!="number",NP=t=>Array.isArray(t)&&typeof t[0]=="number",o9={linear:gs,easeIn:r9,easeInOut:LP,easeOut:s9,circIn:T2,circInOut:OP,circOut:MP,backIn:P2,backInOut:AP,backOut:RP,anticipate:IP},a9=t=>typeof t=="string",t4=t=>{if(NP(t)){C2(t.length===4);const[e,n,r,s]=t;return bf(e,n,r,s)}else if(a9(t))return o9[t];return t},qh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function l9(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(d){i.has(d)&&(c.schedule(d),t()),d(a)}const c={schedule:(d,h=!1,p=!1)=>{const y=p&&r?e:n;return h&&i.add(d),y.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(a=d,r){s=!0;return}r=!0;const h=e;e=n,n=h,e.forEach(u),e.clear(),r=!1,s&&(s=!1,c.process(d))}};return c}const u9=40;function DP(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=qh.reduce((P,T)=>(P[T]=l9(i),P),{}),{setup:u,read:c,resolveKeyframes:d,preUpdate:h,update:p,preRender:m,render:y,postRender:w}=a,_=()=>{const P=ea.useManualTiming,T=P?s.timestamp:performance.now();n=!1,P||(s.delta=r?1e3/60:Math.max(Math.min(T-s.timestamp,u9),1)),s.timestamp=T,s.isProcessing=!0,u.process(s),c.process(s),d.process(s),h.process(s),p.process(s),m.process(s),y.process(s),w.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},x=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:qh.reduce((P,T)=>{const A=a[T];return P[T]=(L,O=!1,R=!1)=>(n||x(),A.schedule(L,O,R)),P},{}),cancel:P=>{for(let T=0;T<qh.length;T++)a[qh[T]].cancel(P)},state:s,steps:a}}const{schedule:Pt,cancel:ta,state:Nn,steps:jv}=DP(typeof requestAnimationFrame<"u"?requestAnimationFrame:gs,!0);let Sp;function c9(){Sp=void 0}const ar={now:()=>(Sp===void 0&&ar.set(Nn.isProcessing||ea.useManualTiming?Nn.timestamp:performance.now()),Sp),set:t=>{Sp=t,queueMicrotask(c9)}},jP=t=>e=>typeof e=="string"&&e.startsWith(t),FP=jP("--"),d9=jP("var(--"),R2=t=>d9(t)?f9.test(t.split("/*")[0].trim()):!1,f9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function n4(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const ec={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ud={...ec,transform:t=>fi(0,1,t)},Yh={...ec,default:1},Sd=t=>Math.round(t*1e5)/1e5,A2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function h9(t){return t==null}const p9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,I2=(t,e)=>n=>!!(typeof n=="string"&&p9.test(n)&&n.startsWith(t)||e&&!h9(n)&&Object.prototype.hasOwnProperty.call(n,e)),VP=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,u]=r.match(A2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}},m9=t=>fi(0,255,t),Fv={...ec,transform:t=>Math.round(m9(t))},Xa={test:I2("rgb","red"),parse:VP("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Fv.transform(t)+", "+Fv.transform(e)+", "+Fv.transform(n)+", "+Sd(Ud.transform(r))+")"};function g9(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 Dy={test:I2("#"),parse:g9,transform:Xa.transform},Sf=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),$i=Sf("deg"),di=Sf("%"),De=Sf("px"),v9=Sf("vh"),y9=Sf("vw"),r4={...di,parse:t=>di.parse(t)/100,transform:t=>di.transform(t*100)},fu={test:I2("hsl","hue"),parse:VP("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+di.transform(Sd(e))+", "+di.transform(Sd(n))+", "+Sd(Ud.transform(r))+")"},mn={test:t=>Xa.test(t)||Dy.test(t)||fu.test(t),parse:t=>Xa.test(t)?Xa.parse(t):fu.test(t)?fu.parse(t):Dy.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Xa.transform(t):fu.transform(t),getAnimatableNone:t=>{const e=mn.parse(t);return e.alpha=0,mn.transform(e)}},_9=/(?:#[\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(A2))==null?void 0:e.length)||0)+(((n=t.match(_9))==null?void 0:n.length)||0)>0}const $P="number",HP="color",x9="var",b9="var(",s4="${}",S9=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Gu(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const u=e.replace(S9,c=>(mn.test(c)?(r.color.push(i),s.push(HP),n.push(mn.parse(c))):c.startsWith(b9)?(r.var.push(i),s.push(x9),n.push(c)):(r.number.push(i),s.push($P),n.push(parseFloat(c))),++i,s4)).split(s4);return{values:n,split:u,indexes:r,types:s}}function E9(t){return Gu(t).values}function zP({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===$P?s+=Sd(r[i]):a===HP?s+=mn.transform(r[i]):s+=r[i]}return s}}function C9(t){return zP(Gu(t))}const k9=t=>typeof t=="number"?0:mn.test(t)?mn.getAnimatableNone(t):t,P9=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:k9(t);function T9(t){const e=Gu(t);return zP(e)(e.values.map((r,s)=>P9(r,e.split[s])))}const js={test:w9,parse:E9,createTransformer:C9,getAnimatableNone:T9};function Vv(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 R9({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 u=n<.5?n*(1+e):n+e-n*e,c=2*n-u;s=Vv(c,u,t+1/3),i=Vv(c,u,t),a=Vv(c,u,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function ym(t,e){return n=>n>0?e:t}const kt=(t,e,n)=>t+(e-t)*n,$v=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},A9=[Dy,Xa,fu],I9=t=>A9.find(e=>e.test(t));function i4(t){const e=I9(t);if(!e)return!1;let n=e.parse(t);return e===fu&&(n=R9(n)),n}const o4=(t,e)=>{const n=i4(t),r=i4(e);if(!n||!r)return ym(t,e);const s={...n};return i=>(s.red=$v(n.red,r.red,i),s.green=$v(n.green,r.green,i),s.blue=$v(n.blue,r.blue,i),s.alpha=kt(n.alpha,r.alpha,i),Xa.transform(s))},jy=new Set(["none","hidden"]);function M9(t,e){return jy.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function O9(t,e){return n=>kt(t,e,n)}function M2(t){return typeof t=="number"?O9:typeof t=="string"?R2(t)?ym:mn.test(t)?o4:D9:Array.isArray(t)?UP:typeof t=="object"?mn.test(t)?o4:L9:ym}function UP(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>M2(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function L9(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=M2(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function N9(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]],u=t.values[a]??0;n[s]=u,r[i]++}return n}const D9=(t,e)=>{const n=js.createTransformer(e),r=Gu(t),s=Gu(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?jy.has(t)&&!s.values.length||jy.has(e)&&!r.values.length?M9(t,e):xf(UP(N9(r,s),s.values),n):ym(t,e)};function BP(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?kt(t,e,n):M2(t)(t,e)}const j9=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Pt.update(e,n),stop:()=>ta(e),now:()=>Nn.isProcessing?Nn.timestamp:ar.now()}},WP=(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)})`},_m=2e4;function O2(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<_m;)e+=n,r=t.next(e);return e>=_m?1/0:e}function F9(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(O2(r),_m);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:fs(s)}}const Qt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Fy(t,e){return t*Math.sqrt(1-e*e)}const V9=12;function $9(t,e,n){let r=n;for(let s=1;s<V9;s++)r=r-t(r)/e(r);return r}const Hv=.001;function H9({duration:t=Qt.duration,bounce:e=Qt.bounce,velocity:n=Qt.velocity,mass:r=Qt.mass}){let s,i,a=1-e;a=fi(Qt.minDamping,Qt.maxDamping,a),t=fi(Qt.minDuration,Qt.maxDuration,fs(t)),a<1?(s=d=>{const h=d*a,p=h*t,m=h-n,y=Fy(d,a),w=Math.exp(-p);return Hv-m/y*w},i=d=>{const p=d*a*t,m=p*n+n,y=Math.pow(a,2)*Math.pow(d,2)*t,w=Math.exp(-p),_=Fy(Math.pow(d,2),a);return(-s(d)+Hv>0?-1:1)*((m-y)*w)/_}):(s=d=>{const h=Math.exp(-d*t),p=(d-n)*t+1;return-Hv+h*p},i=d=>{const h=Math.exp(-d*t),p=(n-d)*(t*t);return h*p});const u=5/t,c=$9(s,i,u);if(t=qr(t),isNaN(c))return{stiffness:Qt.stiffness,damping:Qt.damping,duration:t};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:a*2*Math.sqrt(r*d),duration:t}}}const z9=["duration","bounce"],U9=["stiffness","damping","mass"];function a4(t,e){return e.some(n=>t[n]!==void 0)}function B9(t){let e={velocity:Qt.velocity,stiffness:Qt.stiffness,damping:Qt.damping,mass:Qt.mass,isResolvedFromDuration:!1,...t};if(!a4(t,U9)&&a4(t,z9))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*fi(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Qt.mass,stiffness:s,damping:i}}else{const n=H9({...t,velocity:0});e={...e,...n,mass:Qt.mass},e.isResolvedFromDuration=!0}return e}function wm(t=Qt.visualDuration,e=Qt.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:i},{stiffness:c,damping:d,mass:h,duration:p,velocity:m,isResolvedFromDuration:y}=B9({...n,velocity:-fs(n.velocity||0)}),w=m||0,_=d/(2*Math.sqrt(c*h)),x=a-i,E=fs(Math.sqrt(c/h)),k=Math.abs(x)<5;r||(r=k?Qt.restSpeed.granular:Qt.restSpeed.default),s||(s=k?Qt.restDelta.granular:Qt.restDelta.default);let P,T,A,L,O,R;if(_<1)A=Fy(E,_),L=(w+_*E*x)/A,P=N=>{const j=Math.exp(-_*E*N);return a-j*(L*Math.sin(A*N)+x*Math.cos(A*N))},O=_*E*L+x*A,R=_*E*x-L*A,T=N=>Math.exp(-_*E*N)*(O*Math.sin(A*N)+R*Math.cos(A*N));else if(_===1){P=j=>a-Math.exp(-E*j)*(x+(w+E*x)*j);const N=w+E*x;T=j=>Math.exp(-E*j)*(E*N*j-w)}else{const N=E*Math.sqrt(_*_-1);P=G=>{const W=Math.exp(-_*E*G),K=Math.min(N*G,300);return a-W*((w+_*E*x)*Math.sinh(K)+N*x*Math.cosh(K))/N};const j=(w+_*E*x)/N,F=_*E*j-x*N,q=_*E*x-j*N;T=G=>{const W=Math.exp(-_*E*G),K=Math.min(N*G,300);return W*(F*Math.sinh(K)+q*Math.cosh(K))}}const M={calculatedDuration:y&&p||null,velocity:N=>qr(T(N)),next:N=>{if(!y&&_<1){const F=Math.exp(-_*E*N),q=Math.sin(A*N),G=Math.cos(A*N),W=a-F*(L*q+x*G),K=qr(F*(O*q+R*G));return u.done=Math.abs(K)<=r&&Math.abs(a-W)<=s,u.value=u.done?a:W,u}const j=P(N);if(y)u.done=N>=p;else{const F=qr(T(N));u.done=Math.abs(F)<=r&&Math.abs(a-j)<=s}return u.value=u.done?a:j,u},toString:()=>{const N=Math.min(O2(M),_m),j=WP(F=>M.next(N*F).value,N,30);return N+"ms "+j},toTransition:()=>{}};return M}wm.applyToOptions=t=>{const e=F9(t,100,wm);return t.ease=e.ease,t.duration=qr(e.duration),t.type="keyframes",t};const W9=5;function GP(t,e,n){const r=Math.max(e-W9,0);return CP(n-t(r),e-r)}function Vy({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:u,max:c,restDelta:d=.5,restSpeed:h}){const p=t[0],m={done:!1,value:p},y=R=>u!==void 0&&R<u||c!==void 0&&R>c,w=R=>u===void 0?c:c===void 0||Math.abs(u-R)<Math.abs(c-R)?u:c;let _=n*e;const x=p+_,E=a===void 0?x:a(x);E!==x&&(_=E-p);const k=R=>-_*Math.exp(-R/r),P=R=>E+k(R),T=R=>{const M=k(R),N=P(R);m.done=Math.abs(M)<=d,m.value=m.done?E:N};let A,L;const O=R=>{y(m.value)&&(A=R,L=wm({keyframes:[m.value,w(m.value)],velocity:GP(P,R,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:h}))};return O(0),{calculatedDuration:null,next:R=>{let M=!1;return!L&&A===void 0&&(M=!0,T(R),O(R)),A!==void 0&&R>=A?L.next(R-A):(!M&&T(R),m)}}}function G9(t,e,n){const r=[],s=n||ea.mix||BP,i=t.length-1;for(let a=0;a<i;a++){let u=s(t[a],t[a+1]);if(e){const c=Array.isArray(e)?e[a]||gs:e;u=xf(c,u)}r.push(u)}return r}function K9(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(C2(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 u=G9(e,r,s),c=u.length,d=h=>{if(a&&h<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(h<t[p+1]);p++);const m=zd(t[p],t[p+1],h);return u[p](m)};return n?h=>d(fi(t[0],t[i-1],h)):d}function Z9(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=zd(0,e,r);t.push(kt(n,1,s))}}function q9(t){const e=[0];return Z9(e,t.length-1),e}function Y9(t,e){return t.map(n=>n*e)}function X9(t,e){return t.map(()=>e||LP).splice(0,t.length-1)}function Ed({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=i9(r)?r.map(t4):t4(r),i={done:!1,value:e[0]},a=Y9(n&&n.length===e.length?n:q9(e),t),u=K9(a,e,{ease:Array.isArray(s)?s:X9(e,s)});return{calculatedDuration:t,next:c=>(i.value=u(c),i.done=c>=t,i)}}const Q9=t=>t!==null;function Xm(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(Q9),u=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!u||r===void 0?i[u]:r}const J9={decay:Vy,inertia:Vy,tween:Ed,keyframes:Ed,spring:wm};function KP(t){typeof t.type=="string"&&(t.type=J9[t.type])}class L2{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 e7=t=>t/100;class xm extends L2{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;KP(e);const{type:n=Ed,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:u}=e;const c=n||Ed;c!==Ed&&typeof u[0]!="number"&&(this.mixKeyframes=xf(e7,BP(u[0],u[1])),u=[0,100]);const d=c({...e,keyframes:u});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...u].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=O2(d));const{calculatedDuration:h}=d;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:u,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:h,repeat:p,repeatType:m,repeatDelay:y,type:w,onUpdate:_,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const E=this.currentTime-d*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,T=r;if(p){const R=Math.min(this.currentTime,s)/u;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,y&&(N-=y/u)):m==="mirror"&&(T=a)),P=fi(0,1,N)*u}let A;k?(this.delayState.value=h[0],A=this.delayState):A=T.next(P),i&&!k&&(A.value=i(A.value));let{done:L}=A;!k&&c!==null&&(L=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&L);return O&&w!==Vy&&(A.value=Xm(h,this.options,x,this.speed)),_&&_(A.value),O&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return fs(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+fs(e)}get time(){return fs(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 GP(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=fs(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=j9,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 t7(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Qa=t=>t*180/Math.PI,$y=t=>{const e=Qa(Math.atan2(t[1],t[0]));return Hy(e)},n7={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:$y,rotateZ:$y,skewX:t=>Qa(Math.atan(t[1])),skewY:t=>Qa(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Hy=t=>(t=t%360,t<0&&(t+=360),t),l4=$y,u4=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),c4=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),r7={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:u4,scaleY:c4,scale:t=>(u4(t)+c4(t))/2,rotateX:t=>Hy(Qa(Math.atan2(t[6],t[5]))),rotateY:t=>Hy(Qa(Math.atan2(-t[2],t[0]))),rotateZ:l4,rotate:l4,skewX:t=>Qa(Math.atan(t[4])),skewY:t=>Qa(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function zy(t){return t.includes("scale")?1:0}function Uy(t,e){if(!t||t==="none")return zy(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=r7,s=n;else{const u=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=n7,s=u}if(!s)return zy(e);const i=r[e],a=s[1].split(",").map(i7);return typeof i=="function"?i(a):a[i]}const s7=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Uy(n,e)};function i7(t){return parseFloat(t.trim())}const tc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],nc=new Set([...tc,"pathRotation"]),d4=t=>t===ec||t===De,o7=new Set(["x","y","z"]),a7=tc.filter(t=>!o7.has(t));function l7(t){const e=[];return a7.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Uo={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})=>Uy(e,"x"),y:(t,{transform:e})=>Uy(e,"y")};Uo.translateX=Uo.x;Uo.translateY=Uo.y;const cl=new Set;let By=!1,Wy=!1,Gy=!1;function ZP(){if(Wy){const t=Array.from(cl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=l7(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var u;(u=r.getValue(i))==null||u.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Wy=!1,By=!1,cl.forEach(t=>t.complete(Gy)),cl.clear()}function qP(){cl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Wy=!0)})}function u7(){Gy=!0,qP(),ZP(),Gy=!1}class N2{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?(cl.add(this),By||(By=!0,Pt.read(qP),Pt.resolveKeyframes(ZP))):(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 u=r.readValue(n,a);u!=null&&(e[0]=u)}e[0]===void 0&&(e[0]=a),s&&i===void 0&&s.set(e[0])}t7(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),cl.delete(this)}cancel(){this.state==="scheduled"&&(cl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const c7=t=>t.startsWith("--");function YP(t,e,n){c7(e)?t.style.setProperty(e,n):t.style[e]=n}const d7={};function XP(t,e){const n=EP(t);return()=>d7[e]??n()}const f7=XP(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),QP=XP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),pd=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,f4={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pd([0,.65,.55,1]),circOut:pd([.55,0,1,.45]),backIn:pd([.31,.01,.66,-.59]),backOut:pd([.33,1.53,.69,.99])};function JP(t,e){if(t)return typeof t=="function"?QP()?WP(t,e):"ease-out":NP(t)?pd(t):Array.isArray(t)?t.map(n=>JP(n,e)||f4.easeOut):f4[t]}function h7(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:u="easeOut",times:c}={},d=void 0){const h={[e]:n};c&&(h.offset=c);const p=JP(u,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 d&&(m.pseudoElement=d),t.animate(h,m)}function e3(t){return typeof t=="function"&&"applyToOptions"in t}function p7({type:t,...e}){return e3(t)&&QP()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class t3 extends L2{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:u,onComplete:c}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,C2(typeof e.type!="string");const d=p7(e);this.animation=h7(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=Xm(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(h),YP(n,r,h),this.animation.cancel()}c==null||c(),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 fs(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+fs(e)}get time(){return fs(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&&f7()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),gs):s(this)}}const n3={anticipate:IP,backInOut:AP,circInOut:OP};function m7(t){return t in n3}function g7(t){typeof t.ease=="string"&&m7(t.ease)&&(t.ease=n3[t.ease])}const zv=10;class v7 extends t3{constructor(e){g7(e),KP(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 u=new xm({...a,autoplay:!1}),c=Math.max(zv,ar.now()-this.startTime),d=fi(0,zv,c-zv),h=u.sample(c).value,{name:p}=this.options;i&&p&&YP(i,p,h),n.setWithVelocity(u.sample(Math.max(0,c-d)).value,h,d),u.stop()}}const h4=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(js.test(t)||t==="0")&&!t.startsWith("url("));function y7(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 _7(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=h4(s,e),u=h4(i,e);return!a||!u?!1:y7(t)||(n==="spring"||e3(n))&&r}function Ky(t){t.duration=0,t.type="keyframes"}const r3=new Set(["opacity","clipPath","filter","transform"]),w7=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function x7(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&w7.test(t[e]))return!0;return!1}const b7=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),S7=EP(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function E7(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:u}=t;if(!(((p=e==null?void 0:e.owner)==null?void 0:p.current)instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:h}=e.owner.getProps();return S7()&&n&&(r3.has(n)||b7.has(n)&&x7(u))&&(n!=="transform"||!h)&&!d&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const C7=40;class k7 extends L2{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:u,name:c,motionValue:d,element:h,...p}){var w;super(),this.stop=()=>{var _,x;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=ar.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:c,motionValue:d,element:h,...p},y=(h==null?void 0:h.KeyframeResolver)||N2;this.keyframeResolver=new y(u,(_,x,E)=>this.onKeyframesResolved(_,x,m,!E),c,d,h),(w=this.keyframeResolver)==null||w.scheduleResolve()}onKeyframesResolved(e,n,r,s){var E,k;this.keyframeResolver=void 0;const{name:i,type:a,velocity:u,delay:c,isHandoff:d,onUpdate:h}=r;this.resolvedAt=ar.now();let p=!0;_7(e,i,a,u)||(p=!1,(ea.instantAnimations||!c)&&(h==null||h(Xm(e,r,n))),e[0]=e[e.length-1],Ky(r),r.repeat=0);const y={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>C7?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},w=p&&!d&&E7(y),_=(k=(E=y.motionValue)==null?void 0:E.owner)==null?void 0:k.current;let x;if(w)try{x=new v7({...y,element:_})}catch{x=new xm(y)}else x=new xm(y);x.finished.then(()=>{this.notifyFinished()}).catch(gs),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),u7()),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 s3(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,h)=>d.sortNodePosition(h)).indexOf(e),a=t.size,u=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:u-i*r}const p4=30,P7=t=>!isNaN(parseFloat(t));class T7{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=P7(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 k2);const r=this.events[e].add(n);return e==="change"?()=>{r(),Pt.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>p4)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,p4);return CP(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ku(t,e){return new T7(t,e)}function i3(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function D2(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?i3(n,t):n}const R7={type:"spring",stiffness:500,damping:25,restSpeed:10},A7=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),I7={type:"keyframes",duration:.8},M7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},O7=(t,{keyframes:e})=>e.length>2?I7:nc.has(t)?t.startsWith("scale")?A7(e[1]):R7:M7,L7=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function N7(t){for(const e in t)if(!L7.has(e))return!0;return!1}const j2=(t,e,n,r={},s,i)=>a=>{const u=D2(r,t)||{},c=u.delay||r.delay||0;let{elapsed:d=0}=r;d=d-qr(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-d,onUpdate:m=>{e.set(m),u.onUpdate&&u.onUpdate(m)},onComplete:()=>{a(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:i?void 0:s};N7(u)||Object.assign(h,O7(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)&&(Ky(h),h.delay===0&&(p=!0)),(ea.instantAnimations||ea.skipAnimations||s!=null&&s.shouldSkipAnimations||u.skipAnimations)&&(p=!0,Ky(h),h.delay=0),h.allowFlatten=!u.type&&!u.ease,p&&!i&&e.get()!==void 0){const m=Xm(h.keyframes,u);if(m!==void 0){Pt.update(()=>{h.onUpdate(m),h.onComplete()});return}}return u.isSync?new xm(h):new k7(h)},D7=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function j7(t){const e=D7.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function o3(t,e,n=1){const[r,s]=j7(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return xP(a)?parseFloat(a):a}return R2(s)?o3(s,e,n+1):s}function m4(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function F2(t,e,n,r){if(typeof e=="function"){const[s,i]=m4(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]=m4(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function dl(t,e,n){const r=t.getProps();return F2(r,e,n!==void 0?n:r.custom,t)}const a3=new Set(["width","height","top","left","right","bottom",...tc]),Zy=t=>Array.isArray(t);function F7(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ku(n))}function V7(t){return Zy(t)?t[t.length-1]||0:t}function $7(t,e){const n=dl(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const u=V7(i[a]);F7(t,a,u)}}const Fn=t=>!!(t&&t.getVelocity);function H7(t){return!!(Fn(t)&&t.add)}function qy(t,e){const n=t.getValue("willChange");if(H7(n))return n.add(e);if(!n&&ea.WillChange){const r=new ea.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function V2(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const z7="framerAppearId",l3="data-"+V2(z7);function u3(t){return t.props[l3]}function U7({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function c3(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...u}=e;const c=t.getDefaultTransition();i=i?i3(i,c):c;const d=i==null?void 0:i.reduceMotion,h=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],m=s&&t.animationState&&t.animationState.getState()[s],y=i==null?void 0:i.path;y&&y.animateVisualElement(t,u,i,n,p);for(const w in u){const _=t.getValue(w,t.latestValues[w]??null),x=u[w];if(x===void 0||m&&U7(m,w))continue;const E={delay:n,...D2(i||{},w)};h&&(E.skipAnimations=!0);const k=_.get();if(k!==void 0&&!_.isAnimating()&&!Array.isArray(x)&&x===k&&!E.velocity){Pt.update(()=>_.set(x));continue}let P=!1;if(window.MotionHandoffAnimation){const L=u3(t);if(L){const O=window.MotionHandoffAnimation(L,w,Pt);O!==null&&(E.startTime=O,P=!0)}}qy(t,w);const T=d??t.shouldReduceMotion;_.start(j2(w,_,x,T&&a3.has(w)?{type:!1}:E,t,P));const A=_.animation;A&&p.push(A)}if(a){const w=()=>Pt.update(()=>{a&&$7(t,a)});p.length?Promise.all(p).then(w):w()}return p}function Yy(t,e,n={}){var c;const r=dl(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(c3(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:m}=s;return B7(t,e,d,h,p,m,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[d,h]=u==="beforeChildren"?[i,a]:[a,i];return d().then(()=>h())}else return Promise.all([i(),a(n.delay)])}function B7(t,e,n=0,r=0,s=0,i=1,a){const u=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),u.push(Yy(c,e,{...a,delay:n+(typeof r=="function"?0:r)+s3(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(u)}function W7(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Yy(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Yy(t,e,n);else{const s=typeof e=="function"?dl(t,e,n.custom):e;r=Promise.all(c3(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const G7={test:t=>t==="auto",parse:t=>t},d3=t=>e=>e.test(t),f3=[ec,De,di,$i,y9,v9,G7],g4=t=>f3.find(d3(t));function K7(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||SP(t):!0}const Z7=new Set(["brightness","contrast","saturate","opacity"]);function q7(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(A2)||[];if(!r)return t;const s=n.replace(r,"");let i=Z7.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const Y7=/\b([a-z-]*)\(.*?\)/gu,Xy={...js,getAnimatableNone:t=>{const e=t.match(Y7);return e?e.map(q7).join(" "):t}},Qy={...js,getAnimatableNone:t=>{const e=js.parse(t);return js.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},v4={...ec,transform:Math.round},X7={rotate:$i,pathRotation:$i,rotateX:$i,rotateY:$i,rotateZ:$i,scale:Yh,scaleX:Yh,scaleY:Yh,scaleZ:Yh,skew:$i,skewX:$i,skewY:$i,distance:De,translateX:De,translateY:De,translateZ:De,x:De,y:De,z:De,perspective:De,transformPerspective:De,opacity:Ud,originX:r4,originY:r4,originZ:De},bm={borderWidth:De,borderTopWidth:De,borderRightWidth:De,borderBottomWidth:De,borderLeftWidth:De,borderRadius:De,borderTopLeftRadius:De,borderTopRightRadius:De,borderBottomRightRadius:De,borderBottomLeftRadius:De,width:De,maxWidth:De,height:De,maxHeight:De,top:De,right:De,bottom:De,left:De,inset:De,insetBlock:De,insetBlockStart:De,insetBlockEnd:De,insetInline:De,insetInlineStart:De,insetInlineEnd:De,padding:De,paddingTop:De,paddingRight:De,paddingBottom:De,paddingLeft:De,paddingBlock:De,paddingBlockStart:De,paddingBlockEnd:De,paddingInline:De,paddingInlineStart:De,paddingInlineEnd:De,margin:De,marginTop:De,marginRight:De,marginBottom:De,marginLeft:De,marginBlock:De,marginBlockStart:De,marginBlockEnd:De,marginInline:De,marginInlineStart:De,marginInlineEnd:De,fontSize:De,backgroundPositionX:De,backgroundPositionY:De,...X7,zIndex:v4,fillOpacity:Ud,strokeOpacity:Ud,numOctaves:v4},Q7={...bm,color:mn,backgroundColor:mn,outlineColor:mn,fill:mn,stroke:mn,borderColor:mn,borderTopColor:mn,borderRightColor:mn,borderBottomColor:mn,borderLeftColor:mn,filter:Xy,WebkitFilter:Xy,mask:Qy,WebkitMask:Qy},h3=t=>Q7[t],J7=new Set([Xy,Qy]);function p3(t,e){let n=h3(t);return J7.has(n)||(n=js),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ej=new Set(["auto","none","0"]);function tj(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!ej.has(i)&&Gu(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=p3(n,s)}class nj extends N2{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(),R2(p))){const m=o3(p,n.current);m!==void 0&&(e[h]=m),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!a3.has(r)||e.length!==2)return;const[s,i]=e,a=g4(s),u=g4(i),c=n4(s),d=n4(i);if(c!==d&&Uo[r]){this.needsMeasurement=!0;return}if(a!==u)if(d4(a)&&d4(u))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else Uo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||K7(e[s]))&&r.push(s);r.length&&tj(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=Uo[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 u;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]=Uo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([c,d])=>{e.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const $2=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function m3(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 Jy=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ep(t){return bP(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:H2}=DP(queueMicrotask,!1),Ms={x:!1,y:!1};function g3(){return Ms.x||Ms.y}function rj(t){return t==="x"||t==="y"?Ms[t]?null:(Ms[t]=!0,()=>{Ms[t]=!1}):Ms.x||Ms.y?null:(Ms.x=Ms.y=!0,()=>{Ms.x=Ms.y=!1})}function v3(t,e){const n=m3(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function sj(t){return!(t.pointerType==="touch"||g3())}function ij(t,e,n={}){const[r,s,i]=v3(t,n);return r.forEach(a=>{let u=!1,c=!1,d;const h=()=>{a.removeEventListener("pointerleave",w)},p=x=>{d&&(d(x),d=void 0),h()},m=x=>{u=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,p(x))},y=()=>{u=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},w=x=>{if(x.pointerType!=="touch"){if(u){c=!0;return}p(x)}},_=x=>{if(!sj(x))return;c=!1;const E=e(a,x);typeof E=="function"&&(d=E,a.addEventListener("pointerleave",w,s))};a.addEventListener("pointerenter",_,s),a.addEventListener("pointerdown",y,s)}),i}const y3=(t,e)=>e?t===e?!0:y3(t,e.parentElement):!1,z2=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,oj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function aj(t){return oj.has(t.tagName)||t.isContentEditable===!0}const lj=new Set(["INPUT","SELECT","TEXTAREA"]);function uj(t){return lj.has(t.tagName)||t.isContentEditable===!0}const Cp=new WeakSet;function y4(t){return e=>{e.key==="Enter"&&t(e)}}function Uv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const cj=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=y4(()=>{if(Cp.has(n))return;Uv(n,"down");const s=y4(()=>{Uv(n,"up")}),i=()=>Uv(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 _4(t){return z2(t)&&!g3()}const w4=new WeakSet;function dj(t,e,n={}){const[r,s,i]=v3(t,n),a=u=>{const c=u.currentTarget;if(!_4(u)||w4.has(u))return;Cp.add(c),n.stopPropagation&&w4.add(u);const d=e(c,u),h={...s,capture:!0},p=(w,_)=>{window.removeEventListener("pointerup",m,h),window.removeEventListener("pointercancel",y,h),Cp.has(c)&&Cp.delete(c),_4(w)&&typeof d=="function"&&d(w,{success:_})},m=w=>{p(w,c===window||c===document||n.useGlobalTarget||y3(c,w.target))},y=w=>{p(w,!1)};window.addEventListener("pointerup",m,h),window.addEventListener("pointercancel",y,h)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",a,s),Ep(u)&&(u.addEventListener("focus",d=>cj(d,s)),!aj(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),i}function U2(t){return bP(t)&&"ownerSVGElement"in t}const kp=new WeakMap;let Oo;const _3=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:U2(r)&&"getBBox"in r?r.getBBox()[e]:r[n],fj=_3("inline","width","offsetWidth"),hj=_3("block","height","offsetHeight");function pj({target:t,borderBoxSize:e}){var n;(n=kp.get(t))==null||n.forEach(r=>{r(t,{get width(){return fj(t,e)},get height(){return hj(t,e)}})})}function mj(t){t.forEach(pj)}function gj(){typeof ResizeObserver>"u"||(Oo=new ResizeObserver(mj))}function vj(t,e){Oo||gj();const n=m3(t);return n.forEach(r=>{let s=kp.get(r);s||(s=new Set,kp.set(r,s)),s.add(e),Oo==null||Oo.observe(r)}),()=>{n.forEach(r=>{const s=kp.get(r);s==null||s.delete(e),s!=null&&s.size||Oo==null||Oo.unobserve(r)})}}const Pp=new Set;let hu;function yj(){hu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Pp.forEach(e=>e(t))},window.addEventListener("resize",hu)}function _j(t){return Pp.add(t),hu||yj(),()=>{Pp.delete(t),!Pp.size&&typeof hu=="function"&&(window.removeEventListener("resize",hu),hu=void 0)}}function x4(t,e){return typeof t=="function"?_j(t):vj(t,e)}function wj(t){return U2(t)&&t.tagName==="svg"}const xj=[...f3,mn,js],bj=t=>xj.find(d3(t)),b4=()=>({translate:0,scale:1,origin:0,originPoint:0}),pu=()=>({x:b4(),y:b4()}),S4=()=>({min:0,max:0}),wn=()=>({x:S4(),y:S4()}),Sj=new WeakMap;function Qm(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Bd(t){return typeof t=="string"||Array.isArray(t)}const B2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],W2=["initial",...B2];function Jm(t){return Qm(t.animate)||W2.some(e=>Bd(t[e]))}function w3(t){return!!(Jm(t)||t.variants)}function Ej(t,e,n){for(const r in e){const s=e[r],i=n[r];if(Fn(s))t.addValue(r,s);else if(Fn(i))t.addValue(r,Ku(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,Ku(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Sm={current:null},G2={current:!1},Cj=typeof window<"u";function x3(){if(G2.current=!0,!!Cj)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Sm.current=t.matches;t.addEventListener("change",e),e()}else Sm.current=!1}const E4=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Em={};function b3(t){Em=t}function kj(){return Em}class Pj{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:a,visualState:u},c={}){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=N2,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 y=ar.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,Pt.render(this.render,!1,!0))};const{latestValues:d,renderState:h}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!a,this.isControllingVariants=Jm(n),this.isVariantNode=w3(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in m){const w=m[y];d[y]!==void 0&&Fn(w)&&w.set(d[y])}}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,Sj.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:(G2.current||x3(),this.shouldReduceMotion=Sm.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(),ta(this.notifyUpdate),ta(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&&r3.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:u,times:c,ease:d,duration:h}=n.accelerate,p=new t3({element:this.current,name:e,keyframes:u,times:c,ease:d,duration:qr(h)}),m=a(p);this.valueSubscriptions.set(e,()=>{m(),p.cancel()});return}const r=nc.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Pt.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 Em){const n=Em[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):wn()}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<E4.length;r++){const s=E4[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=Ej(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Ku(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(xP(r)||SP(r))?r=parseFloat(r):!bj(r)&&js.test(n)&&(r=p3(e,n)),this.setBaseTarget(e,Fn(r)?r.get():r)),Fn(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=F2(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Fn(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new k2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){H2.render(this.render)}}class S3 extends Pj{constructor(){super(...arguments),this.KeyframeResolver=nj}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Fn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class la{constructor(e){this.isMounted=!1,this.node=e}update(){}}function E3({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Tj({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Rj(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 Bv(t){return t===void 0||t===1}function e_({scale:t,scaleX:e,scaleY:n}){return!Bv(t)||!Bv(e)||!Bv(n)}function Wa(t){return e_(t)||C3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function C3(t){return C4(t.x)||C4(t.y)}function C4(t){return t&&t!=="0%"}function Cm(t,e,n){const r=t-n,s=e*r;return n+s}function k4(t,e,n,r,s){return s!==void 0&&(t=Cm(t,s,r)),Cm(t,n,r)+e}function t_(t,e=0,n=1,r,s){t.min=k4(t.min,e,n,r,s),t.max=k4(t.max,e,n,r,s)}function k3(t,{x:e,y:n}){t_(t.x,e.translate,e.scale,e.originPoint),t_(t.y,n.translate,n.scale,n.originPoint)}const P4=.999999999999,T4=1.0000000000001;function Aj(t,e,n,r=!1){var u;const s=n.length;if(!s)return;e.x=e.y=1;let i,a;for(let c=0;c<s;c++){i=n[c],a=i.projectionDelta;const{visualElement:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(ii(t.x,-i.scroll.offset.x),ii(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,k3(t,a)),r&&Wa(i.latestValues)&&Tp(t,i.latestValues,(u=i.layout)==null?void 0:u.layoutBox))}e.x<T4&&e.x>P4&&(e.x=1),e.y<T4&&e.y>P4&&(e.y=1)}function ii(t,e){t.min+=e,t.max+=e}function R4(t,e,n,r,s=.5){const i=kt(t.min,t.max,s);t_(t,e,n,i,r)}function A4(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Tp(t,e,n){const r=n??t;R4(t.x,A4(e.x,r.x),e.scaleX,e.scale,e.originX),R4(t.y,A4(e.y,r.y),e.scaleY,e.scale,e.originY)}function P3(t,e){return E3(Rj(t.getBoundingClientRect(),e))}function Ij(t,e,n){const r=P3(t,n),{scroll:s}=e;return s&&(ii(r.x,s.offset.x),ii(r.y,s.offset.y)),r}const Mj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Oj=tc.length;function Lj(t,e,n){let r="",s=!0;for(let a=0;a<Oj;a++){const u=tc[a],c=t[u];if(c===void 0)continue;let d=!0;if(typeof c=="number")d=c===(u.startsWith("scale")?1:0);else{const h=parseFloat(c);d=u.startsWith("scale")?h===1:h===0}if(!d||n){const h=Jy(c,bm[u]);if(!d){s=!1;const p=Mj[u]||u;r+=`${p}(${h}) `}n&&(e[u]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${Jy(i,bm.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function K2(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,u=!1;for(const c in e){const d=e[c];if(nc.has(c)){a=!0;continue}else if(FP(c)){s[c]=d;continue}else{const h=Jy(d,bm[c]);c.startsWith("origin")?(u=!0,i[c]=h):r[c]=h}}if(e.transform||(a||n?r.transform=Lj(e,t.transform,n):r.transform&&(r.transform="none")),u){const{originX:c="50%",originY:d="50%",originZ:h=0}=i;r.transformOrigin=`${c} ${d} ${h}`}}function T3(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 I4(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const sd={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(De.test(t))t=parseFloat(t);else return t;const n=I4(t,e.target.x),r=I4(t,e.target.y);return`${n}% ${r}%`}},Nj={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=js.parse(t);if(s.length>5)return r;const i=js.createTransformer(t),a=typeof s[0]!="number"?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+a]/=u,s[1+a]/=c;const d=kt(u,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=d),typeof s[3+a]=="number"&&(s[3+a]/=d),i(s)}},n_={borderRadius:{...sd,applyTo:[...$2]},borderTopLeftRadius:sd,borderTopRightRadius:sd,borderBottomLeftRadius:sd,borderBottomRightRadius:sd,boxShadow:Nj};function R3(t,{layout:e,layoutId:n}){return nc.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!n_[t]||t==="opacity")}function Z2(t,e,n){var a;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const u in r)(Fn(r[u])||s&&Fn(s[u])||R3(u,t)||((a=n==null?void 0:n.getValue(u))==null?void 0:a.liveStyle)!==void 0)&&(i[u]=r[u]);return i}function Dj(t){return window.getComputedStyle(t)}class jj extends S3{constructor(){super(...arguments),this.type="html",this.renderInstance=T3}readValueFromInstance(e,n){var r;if(nc.has(n))return(r=this.projection)!=null&&r.isProjecting?zy(n):s7(e,n);{const s=Dj(e),i=(FP(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return P3(e,n)}build(e,n,r){K2(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Z2(e,n,r)}}const Fj={offset:"stroke-dashoffset",array:"stroke-dasharray"},Vj={offset:"strokeDashoffset",array:"strokeDasharray"};function $j(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?Fj:Vj;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const Hj=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function A3(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...u},c,d,h){if(K2(t,u,d),c){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 y of Hj)p[y]!==void 0&&(m[y]=p[y],delete p[y]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&$j(p,s,i,a,!1)}const I3=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"]),M3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function zj(t,e,n,r){T3(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(I3.has(s)?s:V2(s),e.attrs[s])}function O3(t,e,n){const r=Z2(t,e,n);for(const s in t)if(Fn(t[s])||Fn(e[s])){const i=tc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class Uj extends S3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=wn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(nc.has(n)){const r=h3(n);return r&&r.default||0}return n=I3.has(n)?n:V2(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return O3(e,n,r)}build(e,n,r){A3(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){zj(e,n,r,s)}mount(e){this.isSVGTag=M3(e.tagName),super.mount(e)}}const Bj=W2.length;function L3(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?L3(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Bj;n++){const r=W2[n],s=t.props[r];(Bd(s)||s===!1)&&(e[r]=s)}return e}function N3(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 Wj=[...B2].reverse(),Gj=B2.length;function Kj(t){return e=>Promise.all(e.map(({animation:n,options:r})=>W7(t,n,r)))}function Zj(t){let e=Kj(t),n=M4(),r=!0,s=!1;const i=d=>(h,p)=>{var y;const m=dl(t,p,d==="exit"?(y=t.presenceContext)==null?void 0:y.custom:void 0);if(m){const{transition:w,transitionEnd:_,...x}=m;h={...h,...x,..._}}return h};function a(d){e=d(t)}function u(d){const{props:h}=t,p=L3(t.parent)||{},m=[],y=new Set;let w={},_=1/0;for(let E=0;E<Gj;E++){const k=Wj[E],P=n[k],T=h[k]!==void 0?h[k]:p[k],A=Bd(T),L=k===d?P.isActive:null;L===!1&&(_=E);let O=T===p[k]&&T!==h[k]&&A;if(O&&(r||s)&&t.manuallyAnimateOnMount&&(O=!1),P.protectedKeys={...w},!P.isActive&&L===null||!T&&!P.prevProp||Qm(T)||typeof T=="boolean")continue;if(k==="exit"&&P.isActive&&L!==!0){P.prevResolvedValues&&(w={...w,...P.prevResolvedValues});continue}const R=qj(P.prevProp,T);let M=R||k===d&&P.isActive&&!O&&A||E>_&&A,N=!1;const j=Array.isArray(T)?T:[T];let F=j.reduce(i(k),{});L===!1&&(F={});const{prevResolvedValues:q={}}=P,G={...q,...F},W=$=>{M=!0,y.has($)&&(N=!0,y.delete($)),P.needsAnimating[$]=!0;const ee=t.getValue($);ee&&(ee.liveStyle=!1)};for(const $ in G){const ee=F[$],z=q[$];if(w.hasOwnProperty($))continue;let D=!1;Zy(ee)&&Zy(z)?D=!N3(ee,z)||R:D=ee!==z,D?ee!=null?W($):y.add($):ee!==void 0&&y.has($)?W($):P.protectedKeys[$]=!0}P.prevProp=T,P.prevResolvedValues=F,P.isActive&&(w={...w,...F}),(r||s)&&t.blockInitialAnimation&&(M=!1);const K=O&&R;M&&(!K||N)&&m.push(...j.map($=>{const ee={type:k};if(typeof $=="string"&&(r||s)&&!K&&t.manuallyAnimateOnMount&&t.parent){const{parent:z}=t,D=dl(z,$);if(z.enteringChildren&&D){const{delayChildren:Y}=D.transition||{};ee.delay=s3(z.enteringChildren,t,Y)}}return{animation:$,options:ee}}))}if(y.size){const E={};if(typeof h.initial!="boolean"){const k=dl(t,Array.isArray(h.initial)?h.initial[0]:h.initial);k&&k.transition&&(E.transition=k.transition)}y.forEach(k=>{const P=t.getBaseTarget(k),T=t.getValue(k);T&&(T.liveStyle=!0),E[k]=P??null}),m.push({animation:E})}let x=!!m.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?e(m):Promise.resolve()}function c(d,h){var m;if(n[d].isActive===h)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(y=>{var w;return(w=y.animationState)==null?void 0:w.setActive(d,h)}),n[d].isActive=h;const p=u(d);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:u,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=M4(),s=!0}}}function qj(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!N3(e,t):!1}function Na(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function M4(){return{animate:Na(!0),whileInView:Na(),whileHover:Na(),whileTap:Na(),whileDrag:Na(),whileFocus:Na(),exit:Na()}}function r_(t,e){t.min=e.min,t.max=e.max}function Rs(t,e){r_(t.x,e.x),r_(t.y,e.y)}function O4(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const D3=1e-4,Yj=1-D3,Xj=1+D3,j3=.01,Qj=0-j3,Jj=0+j3;function lr(t){return t.max-t.min}function eF(t,e,n){return Math.abs(t-e)<=n}function L4(t,e,n,r=.5){t.origin=r,t.originPoint=kt(e.min,e.max,t.origin),t.scale=lr(n)/lr(e),t.translate=kt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Yj&&t.scale<=Xj||isNaN(t.scale))&&(t.scale=1),(t.translate>=Qj&&t.translate<=Jj||isNaN(t.translate))&&(t.translate=0)}function Cd(t,e,n,r){L4(t.x,e.x,n.x,r?r.originX:void 0),L4(t.y,e.y,n.y,r?r.originY:void 0)}function N4(t,e,n,r=0){const s=r?kt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+lr(e)}function tF(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 D4(t,e,n,r=0){const s=r?kt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+lr(e)}function km(t,e,n,r){D4(t.x,e.x,n.x,r==null?void 0:r.x),D4(t.y,e.y,n.y,r==null?void 0:r.y)}function j4(t,e,n,r,s){return t-=e,t=Cm(t,1/n,r),s!==void 0&&(t=Cm(t,1/s,r)),t}function nF(t,e=0,n=1,r=.5,s,i=t,a=t){if(di.test(e)&&(e=parseFloat(e),e=kt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let u=kt(i.min,i.max,r);t===i&&(u-=e),t.min=j4(t.min,e,n,u,s),t.max=j4(t.max,e,n,u,s)}function F4(t,e,[n,r,s],i,a){nF(t,e[n],e[r],e[s],e.scale,i,a)}const rF=["x","scaleX","originX"],sF=["y","scaleY","originY"];function V4(t,e,n,r){F4(t.x,e,rF,n?n.x:void 0,r?r.x:void 0),F4(t.y,e,sF,n?n.y:void 0,r?r.y:void 0)}function $4(t){return t.translate===0&&t.scale===1}function F3(t){return $4(t.x)&&$4(t.y)}function H4(t,e){return t.min===e.min&&t.max===e.max}function iF(t,e){return H4(t.x,e.x)&&H4(t.y,e.y)}function z4(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function V3(t,e){return z4(t.x,e.x)&&z4(t.y,e.y)}function U4(t){return lr(t.x)/lr(t.y)}function B4(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ei(t){return[t("x"),t("y")]}function oF(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:d,rotate:h,pathRotation:p,rotateX:m,rotateY:y,skewX:w,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),y&&(r+=`rotateY(${y}deg) `),w&&(r+=`skewX(${w}deg) `),_&&(r+=`skewY(${_}deg) `)}const u=t.x.scale*e.x,c=t.y.scale*e.y;return(u!==1||c!==1)&&(r+=`scale(${u}, ${c})`),r||"none"}const aF=$2.length,W4=t=>typeof t=="string"?parseFloat(t):t,G4=t=>typeof t=="number"||De.test(t);function lF(t,e,n,r,s,i){s?(t.opacity=kt(0,n.opacity??1,uF(r)),t.opacityExit=kt(e.opacity??1,0,cF(r))):i&&(t.opacity=kt(e.opacity??1,n.opacity??1,r));for(let a=0;a<aF;a++){const u=$2[a];let c=K4(e,u),d=K4(n,u);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||G4(c)===G4(d)?(t[u]=Math.max(kt(W4(c),W4(d),r),0),(di.test(d)||di.test(c))&&(t[u]+="%")):t[u]=d}(e.rotate||n.rotate)&&(t.rotate=kt(e.rotate||0,n.rotate||0,r))}function K4(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const uF=$3(0,.5,MP),cF=$3(.5,.95,gs);function $3(t,e,n){return r=>r<t?0:r>e?1:n(zd(t,e,r))}function dF(t,e,n){const r=Fn(t)?t:Ku(t);return r.start(j2("",r,e,n)),r.animation}function Wd(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const fF=(t,e)=>t.depth-e.depth;class hF{constructor(){this.children=[],this.isDirty=!1}add(e){E2(this.children,e),this.isDirty=!0}remove(e){vm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(fF),this.isDirty=!1,this.children.forEach(e)}}function pF(t,e){const n=ar.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(ta(r),t(i-e))};return Pt.setup(r,!0),()=>ta(r)}function Rp(t){return Fn(t)?t.get():t}class mF{constructor(){this.members=[]}add(e){E2(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&&(vm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(vm(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 Ap={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Wv=["","X","Y","Z"],gF=1e3;let vF=0;function Gv(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function H3(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=u3(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Pt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&H3(r)}function z3({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},u=e==null?void 0:e()){this.id=vF++,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(kF),this.nodes.forEach(PF),this.nodes.forEach(xF)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new hF)}addEventListener(a,u){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new k2),this.eventHandlers.get(a).add(u)}notifyListeners(a,...u){const c=this.eventHandlers.get(a);c&&c.notify(...u)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=U2(a)&&!wj(a),this.instance=a;const{layoutId:u,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||u)&&(this.isLayoutDirty=!0),t){let h,p=0;const m=()=>this.root.updateBlockedByResize=!1;Pt.read(()=>{p=window.innerWidth}),t(a,()=>{const y=window.innerWidth;y!==p&&(p=y,this.root.updateBlockedByResize=!0,h&&h(),h=pF(m,250),Ap.hasAnimatedSinceResize&&(Ap.hasAnimatedSinceResize=!1,this.nodes.forEach(Y4)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&d&&(u||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||MF,{onLayoutAnimationStart:_,onLayoutAnimationComplete:x}=d.getProps(),E=!this.targetLayout||!V3(this.targetLayout,y),k=!p&&m;if(this.options.layoutRoot||this.resumeFrom||k||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...D2(w,"layout"),onPlay:_,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(h,k,P.path)}else p||Y4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}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(),ta(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(TF),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&&H3(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:u,layout:c}=this.options;if(u===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(SF),this.nodes.forEach(Z4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(q4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(EF),this.nodes.forEach(CF),this.nodes.forEach(yF),this.nodes.forEach(_F)):this.nodes.forEach(q4),this.clearAllSnapshots();const u=ar.now();Nn.delta=fi(0,1e3/60,u-Nn.timestamp),Nn.timestamp=u,Nn.isProcessing=!0,jv.update.process(Nn),jv.preRender.process(Nn),jv.render.process(Nn),Nn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,H2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(bF),this.sharedNodes.forEach(RF)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Pt.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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=wn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(u=!1),u&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!F3(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,h=d!==this.prevTransformTemplateValue;a&&this.instance&&(u||Wa(this.latestValues)||h)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const u=this.measurePageBox();let c=this.removeElementScroll(u);return a&&(c=this.removeTransform(c)),OF(c),{animationId:this.root.animationId,measuredBox:u,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:a}=this.options;if(!a)return wn();const u=a.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(LF))){const{scroll:h}=this.root;h&&(ii(u.x,h.offset.x),ii(u.y,h.offset.y))}return u}removeElementScroll(a){var c;const u=wn();if(Rs(u,a),(c=this.scroll)!=null&&c.wasRoot)return u;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:p,options:m}=h;h!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&Rs(u,a),ii(u.x,p.offset.x),ii(u.y,p.offset.y))}return u}applyTransform(a,u=!1,c){var h,p;const d=c||wn();Rs(d,a);for(let m=0;m<this.path.length;m++){const y=this.path[m];!u&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(ii(d.x,-y.scroll.offset.x),ii(d.y,-y.scroll.offset.y)),Wa(y.latestValues)&&Tp(d,y.latestValues,(h=y.layout)==null?void 0:h.layoutBox)}return Wa(this.latestValues)&&Tp(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(a){var c;const u=wn();Rs(u,a);for(let d=0;d<this.path.length;d++){const h=this.path[d];if(!Wa(h.latestValues))continue;let p;h.instance&&(e_(h.latestValues)&&h.updateSnapshot(),p=wn(),Rs(p,h.measurePageBox())),V4(u,h.latestValues,(c=h.snapshot)==null?void 0:c.layoutBox,p)}return Wa(this.latestValues)&&V4(u,this.latestValues),u}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Nn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var y;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==u;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=Nn.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=wn(),this.targetWithTransforms=wn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tF(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Rs(this.target,this.layout.layoutBox),k3(this.target,this.targetDelta)):Rs(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||e_(this.parent.latestValues)||C3(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,u,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=wn(),this.relativeTargetOrigin=wn(),km(this.relativeTargetOrigin,u,c,this.options.layoutAnchor||void 0),Rs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var w;const a=this.getLead(),u=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(w=this.parent)!=null&&w.isProjectionDirty)&&(c=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Nn.timestamp&&(c=!1),c)return;const{layout:d,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||h))return;Rs(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;Aj(this.layoutCorrected,this.treeScale,this.path,u),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=wn());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(O4(this.prevProjectionDelta.x,this.projectionDelta.x),O4(this.prevProjectionDelta.y,this.projectionDelta.y)),Cd(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!B4(this.projectionDelta.x,this.prevProjectionDelta.x)||!B4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var u;if((u=this.options.visualElement)==null||u.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=pu(),this.projectionDelta=pu(),this.projectionDeltaWithTransform=pu()}setAnimationOrigin(a,u=!1,c){const d=this.snapshot,h=d?d.latestValues:{},p={...this.latestValues},m=pu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const y=wn(),w=d?d.source:void 0,_=this.layout?this.layout.source:void 0,x=w!==_,E=this.getStack(),k=!E||E.members.length<=1,P=!!(x&&!k&&this.options.crossfade===!0&&!this.path.some(IF));this.animationProgress=0;let T;const A=c==null?void 0:c.interpolateProjection(a);this.mixTargetDelta=L=>{const O=L/1e3,R=A==null?void 0:A(O);R?(m.x.translate=R.x,m.x.scale=kt(a.x.scale,1,O),m.x.origin=a.x.origin,m.x.originPoint=a.x.originPoint,m.y.translate=R.y,m.y.scale=kt(a.y.scale,1,O),m.y.origin=a.y.origin,m.y.originPoint=a.y.originPoint):(X4(m.x,a.x,O),X4(m.y,a.y,O)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(km(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),AF(this.relativeTarget,this.relativeTargetOrigin,y,O),T&&iF(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=wn()),Rs(T,this.relativeTarget)),x&&(this.animationValues=p,lF(p,h,this.latestValues,O,P,k)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var u,c,d;this.notifyListeners("animationStart"),(u=this.currentAnimation)==null||u.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(ta(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pt.update(()=>{Ap.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ku(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(gF),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:u,target:c,layout:d,latestValues:h}=a;if(!(!u||!c||!d)){if(this!==a&&this.layout&&d&&U3(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||wn();const p=lr(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+p;const m=lr(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+m}Rs(u,c),Tp(u,h),Cd(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(a,u){this.sharedNodes.has(a)||this.sharedNodes.set(a,new mF),this.sharedNodes.get(a).add(u);const d=u.options.initialPromotionConfig;u.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(u):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var u;const{layoutId:a}=this.options;return a?((u=this.getStack())==null?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:a}=this.options;return a?(u=this.getStack())==null?void 0:u.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:u,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let u=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(u=!0),!u)return;const d={};c.z&&Gv("z",a,d,this.animationValues);for(let h=0;h<Wv.length;h++)Gv(`rotate${Wv[h]}`,a,d,this.animationValues),Gv(`skew${Wv[h]}`,a,d,this.animationValues);a.render();for(const h in d)a.setStaticValue(h,d[h]),this.animationValues&&(this.animationValues[h]=d[h]);a.scheduleRender()}applyProjectionStyles(a,u){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Rp(u==null?void 0:u.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Rp(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!Wa(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=oF(this.projectionDeltaWithTransform,this.treeScale,h);c&&(p=c(h,p)),a.transform=p;const{x:m,y}=this.projectionDelta;a.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,d.animationValues?a.opacity=d===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const w in n_){if(h[w]===void 0)continue;const{correct:_,applyTo:x,isCSSVariable:E}=n_[w],k=p==="none"?h[w]:_(h[w],d);if(x){const P=x.length;for(let T=0;T<P;T++)a[x[T]]=k}else E?this.options.visualElement.renderState.vars[w]=k:a[w]=k}this.options.layoutId&&(a.pointerEvents=d===this?Rp(u==null?void 0:u.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var u;return(u=a.currentAnimation)==null?void 0:u.stop()}),this.root.nodes.forEach(Z4),this.root.sharedNodes.clear()}}}function yF(t){t.updateLayout()}function _F(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")ei(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],y=lr(m);m.min=r[p].min,m.max=m.min+y});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";r_(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else U3(i,e.layoutBox,r)&&ei(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],y=lr(r[p]);m.max=m.min+y,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+y)});const u=pu();Cd(u,r,e.layoutBox);const c=pu();a?Cd(c,t.applyTransform(s,!0),e.measuredBox):Cd(c,r,e.layoutBox);const d=!F3(u);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:y}=p;if(m&&y){const w=t.options.layoutAnchor||void 0,_=wn();km(_,e.layoutBox,m.layoutBox,w);const x=wn();km(x,r,y.layoutBox,w),V3(_,x)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:u,hasLayoutChanged:d,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 xF(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function bF(t){t.clearSnapshot()}function Z4(t){t.clearMeasurements()}function SF(t){t.isLayoutDirty=!0,t.updateLayout()}function q4(t){t.isLayoutDirty=!1}function EF(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function CF(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Y4(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function kF(t){t.resolveTargetDelta()}function PF(t){t.calcProjection()}function TF(t){t.resetSkewAndRotation()}function RF(t){t.removeLeadSnapshot()}function X4(t,e,n){t.translate=kt(e.translate,0,n),t.scale=kt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Q4(t,e,n,r){t.min=kt(e.min,n.min,r),t.max=kt(e.max,n.max,r)}function AF(t,e,n,r){Q4(t.x,e.x,n.x,r),Q4(t.y,e.y,n.y,r)}function IF(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const MF={duration:.45,ease:[.4,0,.1,1]},J4=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),eC=J4("applewebkit/")&&!J4("chrome/")?Math.round:gs;function tC(t){t.min=eC(t.min),t.max=eC(t.max)}function OF(t){tC(t.x),tC(t.y)}function U3(t,e,n){return t==="position"||t==="preserve-aspect"&&!eF(U4(e),U4(n),.2)}function LF(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const NF=z3({attachResizeListener:(t,e)=>Wd(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}),Kv={current:void 0},B3=z3({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Kv.current){const t=new NF({});t.mount(window),t.setOptions({layoutScroll:!0}),Kv.current=t}return Kv.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),q2=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function nC(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function DF(...t){return e=>{let n=!1;const r=t.map(s=>{const i=nC(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():nC(t[s],null)}}}}function jF(...t){return v.useCallback(DF(...t),t)}class FF extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Ep(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Ep(r)&&r.offsetWidth||0,i=Ep(r)&&r.offsetHeight||0,a=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(a.height),u.width=parseFloat(a.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=i-u.height-u.top,u.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function VF({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const a=v.useId(),u=v.useRef(null),c=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=v.useContext(q2),h=((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref),p=jF(u,h);return v.useInsertionEffect(()=>{const{width:y,height:w,top:_,left:x,right:E,bottom:k,direction:P}=c.current;if(e||i===!1||!u.current||!y||!w)return;const T=P==="rtl",A=n==="left"?T?`right: ${E}`:`left: ${x}`:T?`left: ${x}`:`right: ${E}`,L=r==="bottom"?`bottom: ${k}`:`top: ${_}`;u.current.dataset.motionPopId=a;const O=document.createElement("style");d&&(O.nonce=d);const R=s??document.head;return R.appendChild(O),O.sheet&&O.sheet.insertRule(`
63
- [data-motion-pop-id="${a}"] {
64
- position: absolute !important;
65
- width: ${y}px !important;
66
- height: ${w}px !important;
67
- ${A}px !important;
68
- ${L}px !important;
69
- }
70
- `),()=>{var M;(M=u.current)==null||M.removeAttribute("data-motion-pop-id"),R.contains(O)&&R.removeChild(O)}},[e]),S.jsx(FF,{isPresent:e,childRef:u,sizeRef:c,pop:i,children:i===!1?t:v.cloneElement(t,{ref:p})})}const $F=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:u,anchorY:c,root:d})=>{const h=b2(HF),p=v.useId(),m=v.useRef(n),y=v.useRef(r);S2(()=>{m.current=n,y.current=r});let w=!0,_=v.useMemo(()=>(w=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:x=>{h.set(x,!0);for(const E of h.values())if(!E)return;r&&r()},register:x=>(h.set(x,!1),()=>{var E;h.delete(x),!m.current&&!h.size&&((E=y.current)==null||E.call(y))})}),[n,h,r]);return i&&w&&(_={..._}),v.useMemo(()=>{h.forEach((x,E)=>h.set(E,!1))},[n]),v.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=S.jsx(VF,{pop:a==="popLayout",isPresent:n,anchorX:u,anchorY:c,root:d,children:t}),S.jsx(Ym.Provider,{value:_,children:t})};function HF(){return new Map}function W3(t=!0){const e=v.useContext(Ym);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 Xh=t=>t.key||"";function rC(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const Ji=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:u="left",anchorY:c="top",root:d})=>{const[h,p]=W3(a),m=v.useMemo(()=>rC(t),[t]),y=a&&!h?[]:m.map(Xh),w=v.useRef(!0),_=v.useRef(m),x=b2(()=>new Map),E=v.useRef(new Set),[k,P]=v.useState(m),[T,A]=v.useState(m);S2(()=>{w.current=!1,_.current=m;for(let R=0;R<T.length;R++){const M=Xh(T[R]);y.includes(M)?(x.delete(M),E.current.delete(M)):x.get(M)!==!0&&x.set(M,!1)}},[T,y.length,y.join("-")]);const L=[];if(m!==k){let R=[...m];for(let M=0;M<T.length;M++){const N=T[M],j=Xh(N);y.includes(j)||(R.splice(M,0,N),L.push(N))}return i==="wait"&&L.length&&(R=L),A(rC(R)),P(m),null}const{forceRender:O}=v.useContext(x2);return S.jsx(S.Fragment,{children:T.map(R=>{const M=Xh(R),N=a&&!h?!1:m===T||y.includes(M),j=()=>{if(E.current.has(M))return;if(x.has(M))E.current.add(M),x.set(M,!0);else return;let F=!0;x.forEach(q=>{q||(F=!1)}),F&&(O==null||O(),A(_.current),a&&(p==null||p()),r&&r())};return S.jsx($F,{isPresent:N,initial:!w.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:N?void 0:j,anchorX:u,anchorY:c,children:R},M)})})},G3=v.createContext({strict:!1}),sC={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 iC=!1;function zF(){if(iC)return;const t={};for(const e in sC)t[e]={isEnabled:n=>sC[e].some(r=>!!n[r])};b3(t),iC=!0}function K3(){return zF(),kj()}function UF(t){const e=K3();for(const n in t)e[n]={...e[n],...t[n]};b3(e)}const BF=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 Pm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||BF.has(t)}let Z3=t=>!Pm(t);function WF(t){typeof t=="function"&&(Z3=e=>e.startsWith("on")?!Pm(e):t(e))}try{WF(require("@emotion/is-prop-valid").default)}catch{}function GF(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||Fn(t[s])||(Z3(s)||n===!0&&Pm(s)||!e&&!Pm(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const e0=v.createContext({});function KF(t,e){if(Jm(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Bd(n)?n:void 0,animate:Bd(r)?r:void 0}}return t.inherit!==!1?e:{}}function ZF(t){const{initial:e,animate:n}=KF(t,v.useContext(e0));return v.useMemo(()=>({initial:e,animate:n}),[oC(e),oC(n)])}function oC(t){return Array.isArray(t)?t.join(" "):t}const Y2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function q3(t,e,n){for(const r in e)!Fn(e[r])&&!R3(r,n)&&(t[r]=e[r])}function qF({transformTemplate:t},e){return v.useMemo(()=>{const n=Y2();return K2(n,e,t),Object.assign({},n.vars,n.style)},[e])}function YF(t,e){const n=t.style||{},r={};return q3(r,n,t),Object.assign(r,qF(t,e)),r}function XF(t,e){const n={},r=YF(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 Y3=()=>({...Y2(),attrs:{}});function QF(t,e,n,r){const s=v.useMemo(()=>{const i=Y3();return A3(i,e,M3(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};q3(i,t.style,t),s.style={...i,...s.style}}return s}const JF=["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 X2(t){return typeof t!="string"||t.includes("-")?!1:!!(JF.indexOf(t)>-1||/[A-Z]/u.test(t))}function eV(t,e,n,{latestValues:r},s,i=!1,a){const c=(a??X2(t)?QF:XF)(e,r,s,t),d=GF(e,typeof t=="string",i),h=t!==v.Fragment?{...d,...c,ref:n}:{},{children:p}=e,m=v.useMemo(()=>Fn(p)?p.get():p,[p]);return v.createElement(t,{...h,children:m})}function tV({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:nV(n,r,s,t),renderState:e()}}function nV(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Rp(i[m]);let{initial:a,animate:u}=t;const c=Jm(t),d=w3(t);e&&d&&!c&&t.inherit!==!1&&(a===void 0&&(a=e.initial),u===void 0&&(u=e.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const p=h?u:a;if(p&&typeof p!="boolean"&&!Qm(p)){const m=Array.isArray(p)?p:[p];for(let y=0;y<m.length;y++){const w=F2(t,m[y]);if(w){const{transitionEnd:_,transition:x,...E}=w;for(const k in E){let P=E[k];if(Array.isArray(P)){const T=h?P.length-1:0;P=P[T]}P!==null&&(s[k]=P)}for(const k in _)s[k]=_[k]}}}return s}const X3=t=>(e,n)=>{const r=v.useContext(e0),s=v.useContext(Ym),i=()=>tV(t,e,r,s);return n?i():b2(i)},rV=X3({scrapeMotionValuesFromProps:Z2,createRenderState:Y2}),sV=X3({scrapeMotionValuesFromProps:O3,createRenderState:Y3}),iV=Symbol.for("motionComponentSymbol");function oV(t,e,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const s=v.useRef(null);return v.useCallback(i=>{var u;i&&((u=t.onMount)==null||u.call(t,i)),e&&(i?e.mount(i):e.unmount());const a=r.current;if(typeof a=="function")if(i){const c=a(i);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[e])}const Q3=v.createContext({});function lu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function aV(t,e,n,r,s,i){var P,T;const{visualElement:a}=v.useContext(e0),u=v.useContext(G3),c=v.useContext(Ym),d=v.useContext(q2),h=d.reducedMotion,p=d.skipAnimations,m=v.useRef(null),y=v.useRef(!1);r=r||u.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:i}),y.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const w=m.current,_=v.useContext(Q3);w&&!w.projection&&s&&(w.type==="html"||w.type==="svg")&&lV(m.current,n,s,_);const x=v.useRef(!1);v.useInsertionEffect(()=>{w&&x.current&&w.update(n,c)});const E=n[l3],k=v.useRef(!!E&&typeof window<"u"&&!((P=window.MotionHandoffIsComplete)!=null&&P.call(window,E))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,E)));return S2(()=>{y.current=!0,w&&(x.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),k.current&&w.animationState&&w.animationState.animateChanges())}),v.useEffect(()=>{w&&(!k.current&&w.animationState&&w.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,E)}),k.current=!1),w.enteringChildren=void 0)}),w}function lV(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:u,layoutScroll:c,layoutRoot:d,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:J3(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||u&&lu(u),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:d,layoutAnchor:h})}function J3(t){if(t)return t.options.allowProjection!==!1?t.projection:J3(t.parent)}function Zv(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&UF(r);const i=n?n==="svg":X2(t),a=i?sV:rV;function u(d,h){let p;const m={...v.useContext(q2),...d,layoutId:uV(d)},{isStatic:y}=m,w=ZF(d),_=a(d,y);if(!y&&typeof window<"u"){cV();const x=dV(m);p=x.MeasureLayout,w.visualElement=aV(t,_,m,s,x.ProjectionNode,i)}return S.jsxs(e0.Provider,{value:w,children:[p&&w.visualElement?S.jsx(p,{visualElement:w.visualElement,...m}):null,eV(t,d,oV(_,w.visualElement,h),_,y,e,i)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=v.forwardRef(u);return c[iV]=t,c}function uV({layoutId:t}){const e=v.useContext(x2).id;return e&&t!==void 0?e+"-"+t:t}function cV(t,e){v.useContext(G3).strict}function dV(t){const e=K3(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function fV(t,e){if(typeof Proxy>"u")return Zv;const n=new Map,r=(i,a)=>Zv(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,Zv(a,void 0,t,e)),n.get(a))})}const hV=(t,e)=>e.isSVG??X2(t)?new Uj(e):new jj(e,{allowProjection:t!==v.Fragment});class pV extends la{constructor(e){super(e),e.animationState||(e.animationState=Zj(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Qm(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 mV=0;class gV extends la{constructor(){super(...arguments),this.id=mV++,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:u}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const c=dl(this.node,a,u);if(c){const{transition:d,transitionEnd:h,...p}=c;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 vV={animation:{Feature:pV},exit:{Feature:gV}};function Ef(t){return{point:{x:t.pageX,y:t.pageY}}}const yV=t=>e=>z2(e)&&t(e,Ef(e));function kd(t,e,n,r){return Wd(t,e,yV(n),r)}const eT=({current:t})=>t?t.ownerDocument.defaultView:null,aC=(t,e)=>Math.abs(t-e);function _V(t,e){const n=aC(t.x,e.x),r=aC(t.y,e.y);return Math.sqrt(n**2+r**2)}const lC=new Set(["auto","scroll"]);class tT{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Qh(this.lastRawMoveEventInfo,this.transformPagePoint));const w=qv(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,x=_V(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!x)return;const{point:E}=w,{timestamp:k}=Nn;this.history.push({...E,timestamp:k});const{onStart:P,onMove:T}=this.handlers;_||(P&&P(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,w)},this.handlePointerMove=(w,_)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=Qh(_,this.transformPagePoint),Pt.update(this.updatePoint,!0)},this.handlePointerUp=(w,_)=>{this.end();const{onEnd:x,onSessionEnd:E,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=qv(w.type==="pointercancel"?this.lastMoveEventInfo:Qh(_,this.transformPagePoint),this.history);this.startEvent&&x&&x(w,P),E&&E(w,P)},!z2(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const c=Ef(e),d=Qh(c,this.transformPagePoint),{point:h}=d,{timestamp:p}=Nn;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,qv(d,this.history));const y={passive:!0,capture:!0};this.removeListeners=xf(kd(this.contextWindow,"pointermove",this.handlePointerMove,y),kd(this.contextWindow,"pointerup",this.handlePointerUp,y),kd(this.contextWindow,"pointercancel",this.handlePointerUp,y)),u&&this.startScrollTracking(u)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(lC.has(r.overflowX)||lC.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),Pt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ta(this.updatePoint)}}function Qh(t,e){return e?{point:e(t.point)}:t}function uC(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qv({point:t},e){return{point:t,delta:uC(t,nT(e)),offset:uC(t,wV(e)),velocity:xV(e,.1)}}function wV(t){return t[0]}function nT(t){return t[t.length-1]}function xV(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=nT(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>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=fs(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 bV(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?kt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?kt(n,t,r.max):Math.min(t,n)),t}function cC(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 SV(t,{top:e,left:n,bottom:r,right:s}){return{x:cC(t.x,n,s),y:cC(t.y,e,r)}}function dC(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 EV(t,e){return{x:dC(t.x,e.x),y:dC(t.y,e.y)}}function CV(t,e){let n=.5;const r=lr(t),s=lr(e);return s>r?n=zd(e.min,e.max-r,t.min):r>s&&(n=zd(t.min,t.max-s,e.min)),fi(0,1,n)}function kV(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 s_=.35;function PV(t=s_){return t===!1?t=0:t===!0&&(t=s_),{x:fC(t,"left","right"),y:fC(t,"top","bottom")}}function fC(t,e,n){return{min:hC(t,e),max:hC(t,n)}}function hC(t,e){return typeof t=="number"?t:t[e]||0}const TV=new WeakMap;class RV{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=wn(),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(Ef(p).point),this.stopAnimation()},a=(p,m)=>{const{drag:y,dragPropagation:w,onDragStart:_}=this.getProps();if(y&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rj(y),!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),ei(E=>{let k=this.getAxisMotionValue(E).get()||0;if(di.test(k)){const{projection:P}=this.visualElement;if(P&&P.layout){const T=P.layout.layoutBox[E];T&&(k=lr(T)*(parseFloat(k)/100))}}this.originPoint[E]=k}),_&&Pt.update(()=>_(p,m),!1,!0),qy(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:y,dragDirectionLock:w,onDirectionLock:_,onDrag:x}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:E}=m;if(w&&this.currentDirection===null){this.currentDirection=IV(E),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",m.point,E),this.updateAxis("y",m.point,E),this.visualElement.render(),x&&Pt.update(()=>x(p,m),!1,!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new tT(e,{onSessionStart:i,onStart:a,onMove:u,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:eT(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:u}=this.getProps();u&&Pt.postRender(()=>u(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||!Jh(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=bV(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&&lu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=SV(r.layoutBox,e):this.constraints=!1,this.elastic=PV(n),s!==this.constraints&&!lu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&ei(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=kV(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!lu(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=Ij(r,s.root,this.visualElement.getTransformPagePoint());let a=EV(s.layout.layoutBox,i);if(n){const u=n(Tj(a));this.hasMutatedConstraints=!!u,u&&(a=E3(u))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:u}=this.getProps(),c=this.constraints||{},d=ei(h=>{if(!Jh(h,n,this.currentDirection))return;let p=c&&c[h]||{};(a===!0||a===h)&&(p={min:0,max:0});const m=s?200:1e6,y=s?40:1e7,w={type:"inertia",velocity:r?e[h]:0,bounceStiffness:m,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,w)});return Promise.all(d).then(u)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return qy(this.visualElement,e),r.start(j2(e,r,0,n,this.visualElement,!1))}stopAnimation(){ei(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){ei(n=>{const{drag:r}=this.getProps();if(!Jh(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:u}=s.layout.layoutBox[n],c=i.get()||0;i.set(e[n]-kt(a,u,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!lu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ei(a=>{const u=this.getAxisMotionValue(a);if(u&&this.constraints!==!1){const c=u.get();s[a]=CV({min:c,max:c},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(),ei(a=>{if(!Jh(a,e,null))return;const u=this.getAxisMotionValue(a),{min:c,max:d}=this.constraints[a];u.set(kt(c,d,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;TV.set(this.visualElement,this);const e=this.visualElement.current,n=kd(e,"pointerdown",d=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=d.target,y=m!==e&&uj(m);h&&p&&!y&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();lu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=AV(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Pt.read(s);const u=Wd(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(ei(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.render())}));return()=>{u(),n(),a(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=s_,dragMomentum:u=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:u}}}function pC(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function AV(t,e,n){const r=x4(t,pC(n)),s=x4(e,pC(n));return()=>{r(),s()}}function Jh(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function IV(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class MV extends la{constructor(e){super(e),this.removeGroupControls=gs,this.removeListeners=gs,this.controls=new RV(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gs}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Yv=t=>(e,n)=>{t&&Pt.update(()=>t(e,n),!1,!0)};class OV extends la{constructor(){super(...arguments),this.removePointerDownListener=gs}onPointerDown(e){this.session=new tT(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:eT(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Yv(e),onStart:Yv(n),onMove:Yv(r),onEnd:(i,a)=>{delete this.session,s&&Pt.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=kd(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 Xv=!1;class LV 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),Xv&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ap.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}),Xv=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Pt.postRender(()=>{const u=a.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),H2.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;Xv=!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 rT(t){const[e,n]=W3(),r=v.useContext(x2);return S.jsx(LV,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(Q3),isPresent:e,safeToRemove:n})}const NV={pan:{Feature:OV},drag:{Feature:MV,ProjectionNode:B3,MeasureLayout:rT}};function mC(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&&Pt.postRender(()=>i(e,Ef(e)))}class DV extends la{mount(){const{current:e}=this.node;e&&(this.unmount=ij(e,(n,r)=>(mC(this.node,r,"Start"),s=>mC(this.node,s,"End"))))}unmount(){}}class jV extends la{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=xf(Wd(this.node.current,"focus",()=>this.onFocus()),Wd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function gC(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&&Pt.postRender(()=>i(e,Ef(e)))}class FV extends la{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=dj(e,(s,i)=>(gC(this.node,i,"Start"),(a,{success:u})=>gC(this.node,a,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const i_=new WeakMap,Qv=new WeakMap,VV=t=>{const e=i_.get(t.target);e&&e(t)},$V=t=>{t.forEach(VV)};function HV({root:t,...e}){const n=t||document;Qv.has(n)||Qv.set(n,{});const r=Qv.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver($V,{root:t,...e})),r[s]}function zV(t,e,n){const r=HV(e);return i_.set(t,n),r.observe(t),()=>{i_.delete(t),r.unobserve(t)}}const UV={some:0,all:1};class BV extends la{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.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:UV[s]},u=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,i&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),y=h?p:m;y&&y(d)};this.stopObserver=zV(this.node.current,a,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(WV(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function WV({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const GV={inView:{Feature:BV},tap:{Feature:FV},focus:{Feature:jV},hover:{Feature:DV}},KV={layout:{ProjectionNode:B3,MeasureLayout:rT}},ZV={...vV,...GV,...NV,...KV},eo=fV(ZV,hV);function qV(){!G2.current&&x3();const[t]=v.useState(Sm.current);return t}const fl=eo;var t0=pP();const YV=Gm(t0);function XV(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 QV=t=>{switch(t){case"success":return t$;case"info":return r$;case"warning":return n$;case"error":return s$;default:return null}},JV=Array(12).fill(0),e$=({visible:t,className:e})=>_e.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},_e.createElement("div",{className:"sonner-spinner"},JV.map((n,r)=>_e.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),t$=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),n$=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},_e.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),r$=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),s$=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),i$=_e.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"},_e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),o$=()=>{const[t,e]=_e.useState(document.hidden);return _e.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let o_=1;class a${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:o_++,a=this.toasts.find(c=>c.id===i),u=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...e,id:i,title:r}),{...c,...e,id:i,dismissible:u,title:r}):c):this.addToast({title:r,...s,dismissible:u,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 u=s.then(async d=>{if(a=["resolve",d],_e.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(u$(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...w})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...w})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,...w})}}).catch(async d=>{if(a=["reject",d],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,y=typeof h=="object"&&!_e.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,h)=>u.then(()=>a[0]==="reject"?h(a[1]):d(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||o_++;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 a$,l$=(t,e)=>{const n=(e==null?void 0:e.id)||o_++;return Sr.addToast({title:t,...e,id:n}),n},u$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",c$=l$,d$=()=>Sr.toasts,f$=()=>Sr.getActiveToasts(),ht=Object.assign(c$,{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:f$});XV("[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 ep(t){return t.label!==void 0}const h$=3,p$="24px",m$="16px",vC=4e3,g$=356,v$=14,y$=45,_$=200;function Xs(...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 x$=t=>{var e,n,r,s,i,a,u,c,d;const{invert:h,toast:p,unstyled:m,interacting:y,setHeights:w,visibleToasts:_,heights:x,index:E,toasts:k,expanded:P,removeToast:T,defaultRichColors:A,closeButton:L,style:O,cancelButtonStyle:R,actionButtonStyle:M,className:N="",descriptionClassName:j="",duration:F,position:q,gap:G,expandByDefault:W,classNames:K,icons:X,closeButtonAriaLabel:$="Close toast"}=t,[ee,z]=_e.useState(null),[D,Y]=_e.useState(null),[te,ie]=_e.useState(!1),[ae,ue]=_e.useState(!1),[Ce,oe]=_e.useState(!1),[se,he]=_e.useState(!1),[Pe,be]=_e.useState(!1),[$e,ot]=_e.useState(0),[Zt,ge]=_e.useState(0),gt=_e.useRef(p.duration||F||vC),dt=_e.useRef(null),je=_e.useRef(null),Je=E===0,it=E+1<=_,Ze=p.type,_t=p.dismissible!==!1,xn=p.className||"",jt=p.descriptionClassName||"",An=_e.useMemo(()=>x.findIndex(Ke=>Ke.toastId===p.id)||0,[x,p.id]),zn=_e.useMemo(()=>{var Ke;return(Ke=p.closeButton)!=null?Ke:L},[p.closeButton,L]),Lr=_e.useMemo(()=>p.duration||F||vC,[p.duration,F]),Jn=_e.useRef(0),bn=_e.useRef(0),Vs=_e.useRef(0),$s=_e.useRef(null),[In,vi]=q.split("-"),yi=_e.useMemo(()=>x.reduce((Ke,At,tn)=>tn>=An?Ke:Ke+At.height,0),[x,An]),ys=o$(),Hs=p.invert||h,fr=Ze==="loading";bn.current=_e.useMemo(()=>An*G+yi,[An,yi]),_e.useEffect(()=>{gt.current=Lr},[Lr]),_e.useEffect(()=>{ie(!0)},[]),_e.useEffect(()=>{const Ke=je.current;if(Ke){const At=Ke.getBoundingClientRect().height;return ge(At),w(tn=>[{toastId:p.id,height:At,position:p.position},...tn]),()=>w(tn=>tn.filter(nn=>nn.toastId!==p.id))}},[w,p.id]),_e.useLayoutEffect(()=>{if(!te)return;const Ke=je.current,At=Ke.style.height;Ke.style.height="auto";const tn=Ke.getBoundingClientRect().height;Ke.style.height=At,ge(tn),w(nn=>nn.find(qt=>qt.toastId===p.id)?nn.map(qt=>qt.toastId===p.id?{...qt,height:tn}:qt):[{toastId:p.id,height:tn,position:p.position},...nn])},[te,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const er=_e.useCallback(()=>{ue(!0),ot(bn.current),w(Ke=>Ke.filter(At=>At.toastId!==p.id)),setTimeout(()=>{T(p)},_$)},[p,T,w,bn]);_e.useEffect(()=>{if(p.promise&&Ze==="loading"||p.duration===1/0||p.type==="loading")return;let Ke;return P||y||ys?(()=>{if(Vs.current<Jn.current){const nn=new Date().getTime()-Jn.current;gt.current=gt.current-nn}Vs.current=new Date().getTime()})():(()=>{gt.current!==1/0&&(Jn.current=new Date().getTime(),Ke=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),er()},gt.current))})(),()=>clearTimeout(Ke)},[P,y,p,Ze,ys,er]),_e.useEffect(()=>{p.delete&&(er(),p.onDismiss==null||p.onDismiss.call(p,p))},[er,p.delete]);function zs(){var Ke;if(X!=null&&X.loading){var At;return _e.createElement("div",{className:Xs(K==null?void 0:K.loader,p==null||(At=p.classNames)==null?void 0:At.loader,"sonner-loader"),"data-visible":Ze==="loading"},X.loading)}return _e.createElement(e$,{className:Xs(K==null?void 0:K.loader,p==null||(Ke=p.classNames)==null?void 0:Ke.loader),visible:Ze==="loading"})}const _s=p.icon||(X==null?void 0:X[Ze])||QV(Ze);var Nr,_i;return _e.createElement("li",{tabIndex:0,ref:je,className:Xs(N,xn,K==null?void 0:K.toast,p==null||(e=p.classNames)==null?void 0:e.toast,K==null?void 0:K.default,K==null?void 0:K[Ze],p==null||(n=p.classNames)==null?void 0:n[Ze]),"data-sonner-toast":"","data-rich-colors":(Nr=p.richColors)!=null?Nr:A,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":te,"data-promise":!!p.promise,"data-swiped":Pe,"data-removed":ae,"data-visible":it,"data-y-position":In,"data-x-position":vi,"data-index":E,"data-front":Je,"data-swiping":Ce,"data-dismissible":_t,"data-type":Ze,"data-invert":Hs,"data-swipe-out":se,"data-swipe-direction":D,"data-expanded":!!(P||W&&te),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":k.length-E,"--offset":`${ae?$e:bn.current}px`,"--initial-height":W?"auto":`${Zt}px`,...O,...p.style},onDragEnd:()=>{oe(!1),z(null),$s.current=null},onPointerDown:Ke=>{Ke.button!==2&&(fr||!_t||(dt.current=new Date,ot(bn.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(oe(!0),$s.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,At,tn;if(se||!_t)return;$s.current=null;const nn=Number(((Ke=je.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Us=Number(((At=je.current)==null?void 0:At.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qt=new Date().getTime()-((tn=dt.current)==null?void 0:tn.getTime()),cn=ee==="x"?nn:Us,ws=Math.abs(cn)/qt;if(Math.abs(cn)>=y$||ws>.11){ot(bn.current),p.onDismiss==null||p.onDismiss.call(p,p),Y(ee==="x"?nn>0?"right":"left":Us>0?"down":"up"),er(),he(!0);return}else{var dn,Un;(dn=je.current)==null||dn.style.setProperty("--swipe-amount-x","0px"),(Un=je.current)==null||Un.style.setProperty("--swipe-amount-y","0px")}be(!1),oe(!1),z(null)},onPointerMove:Ke=>{var At,tn,nn;if(!$s.current||!_t||((At=window.getSelection())==null?void 0:At.toString().length)>0)return;const qt=Ke.clientY-$s.current.y,cn=Ke.clientX-$s.current.x;var ws;const dn=(ws=t.swipeDirections)!=null?ws:w$(q);!ee&&(Math.abs(cn)>1||Math.abs(qt)>1)&&z(Math.abs(cn)>Math.abs(qt)?"x":"y");let Un={x:0,y:0};const Bs=hr=>1/(1.5+Math.abs(hr)/20);if(ee==="y"){if(dn.includes("top")||dn.includes("bottom"))if(dn.includes("top")&&qt<0||dn.includes("bottom")&&qt>0)Un.y=qt;else{const hr=qt*Bs(qt);Un.y=Math.abs(hr)<Math.abs(qt)?hr:qt}}else if(ee==="x"&&(dn.includes("left")||dn.includes("right")))if(dn.includes("left")&&cn<0||dn.includes("right")&&cn>0)Un.x=cn;else{const hr=cn*Bs(cn);Un.x=Math.abs(hr)<Math.abs(cn)?hr:cn}(Math.abs(Un.x)>0||Math.abs(Un.y)>0)&&be(!0),(tn=je.current)==null||tn.style.setProperty("--swipe-amount-x",`${Un.x}px`),(nn=je.current)==null||nn.style.setProperty("--swipe-amount-y",`${Un.y}px`)}},zn&&!p.jsx&&Ze!=="loading"?_e.createElement("button",{"aria-label":$,"data-disabled":fr,"data-close-button":!0,onClick:fr||!_t?()=>{}:()=>{er(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Xs(K==null?void 0:K.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(_i=X==null?void 0:X.close)!=null?_i:i$):null,(Ze||p.icon||p.promise)&&p.icon!==null&&((X==null?void 0:X[Ze])!==null||p.icon)?_e.createElement("div",{"data-icon":"",className:Xs(K==null?void 0:K.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||zs():null,p.type!=="loading"?_s:null):null,_e.createElement("div",{"data-content":"",className:Xs(K==null?void 0:K.content,p==null||(i=p.classNames)==null?void 0:i.content)},_e.createElement("div",{"data-title":"",className:Xs(K==null?void 0:K.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?_e.createElement("div",{"data-description":"",className:Xs(j,jt,K==null?void 0:K.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),_e.isValidElement(p.cancel)?p.cancel:p.cancel&&ep(p.cancel)?_e.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:Ke=>{ep(p.cancel)&&_t&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ke),er())},className:Xs(K==null?void 0:K.cancelButton,p==null||(c=p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,_e.isValidElement(p.action)?p.action:p.action&&ep(p.action)?_e.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||M,onClick:Ke=>{ep(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ke),!Ke.defaultPrevented&&er())},className:Xs(K==null?void 0:K.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function yC(){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 b$(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",u=i?m$:p$;function c(d){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${a}-${d}`]=u:n[`${a}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(u)}),n}const S$=_e.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:c,className:d,offset:h,mobileOffset:p,theme:m="light",richColors:y,duration:w,style:_,visibleToasts:x=h$,toastOptions:E,dir:k=yC(),gap:P=v$,icons:T,containerAriaLabel:A="Notifications"}=e,[L,O]=_e.useState([]),R=_e.useMemo(()=>r?L.filter(te=>te.toasterId===r):L.filter(te=>!te.toasterId),[L,r]),M=_e.useMemo(()=>Array.from(new Set([i].concat(R.filter(te=>te.position).map(te=>te.position)))),[R,i]),[N,j]=_e.useState([]),[F,q]=_e.useState(!1),[G,W]=_e.useState(!1),[K,X]=_e.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=_e.useRef(null),ee=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=_e.useRef(null),D=_e.useRef(!1),Y=_e.useCallback(te=>{O(ie=>{var ae;return(ae=ie.find(ue=>ue.id===te.id))!=null&&ae.delete||Sr.dismiss(te.id),ie.filter(({id:ue})=>ue!==te.id)})},[]);return _e.useEffect(()=>Sr.subscribe(te=>{if(te.dismiss){requestAnimationFrame(()=>{O(ie=>ie.map(ae=>ae.id===te.id?{...ae,delete:!0}:ae))});return}setTimeout(()=>{YV.flushSync(()=>{O(ie=>{const ae=ie.findIndex(ue=>ue.id===te.id);return ae!==-1?[...ie.slice(0,ae),{...ie[ae],...te},...ie.slice(ae+1)]:[te,...ie]})})})}),[L]),_e.useEffect(()=>{if(m!=="system"){X(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:ie})=>{X(ie?"dark":"light")})}catch{te.addListener(({matches:ae})=>{try{X(ae?"dark":"light")}catch(ue){console.error(ue)}})}},[m]),_e.useEffect(()=>{L.length<=1&&q(!1)},[L]),_e.useEffect(()=>{const te=ie=>{var ae;if(a.every(oe=>ie[oe]||ie.code===oe)){var Ce;q(!0),(Ce=$.current)==null||Ce.focus()}ie.code==="Escape"&&(document.activeElement===$.current||(ae=$.current)!=null&&ae.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[a]),_e.useEffect(()=>{if($.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,D.current=!1)}},[$.current]),_e.createElement("section",{ref:n,"aria-label":`${A} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((te,ie)=>{var ae;const[ue,Ce]=te.split("-");return R.length?_e.createElement("ol",{key:te,dir:k==="auto"?yC():k,tabIndex:-1,ref:$,className:d,"data-sonner-toaster":!0,"data-sonner-theme":K,"data-y-position":ue,"data-x-position":Ce,style:{"--front-toast-height":`${((ae=N[0])==null?void 0:ae.height)||0}px`,"--width":`${g$}px`,"--gap":`${P}px`,..._,...b$(h,p)},onBlur:oe=>{D.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(D.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||D.current||(D.current=!0,z.current=oe.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{G||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===te).map((oe,se)=>{var he,Pe;return _e.createElement(x$,{key:oe.id,icons:T,index:se,toast:oe,defaultRichColors:y,duration:(he=E==null?void 0:E.duration)!=null?he:w,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:s,visibleToasts:x,closeButton:(Pe=E==null?void 0:E.closeButton)!=null?Pe:c,interacting:G,position:te,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:Y,toasts:R.filter(be=>be.position==oe.position),heights:N.filter(be=>be.position==oe.position),setHeights:j,expandByDefault:u,gap:P,expanded:F,swipeDirections:e.swipeDirections})})):null}))});var E$=Object.defineProperty,rc=(t,e)=>E$(t,"name",{value:e,configurable:!0}),sT=!!(typeof window<"u"&&window.document&&window.document.createElement);function Lt(t,e,{checkForDefaultPrevented:n=!0}={}){return rc(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}rc(Lt,"composeEventHandlers");function C$(t){var e;if(!sT)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}rc(C$,"getOwnerWindow");function a_(t){if(!sT)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}rc(a_,"getOwnerDocument");function iT(t,e=!1){const{activeElement:n}=a_(t);if(!(n!=null&&n.nodeName))return null;if(oT(n)&&n.contentDocument)return iT(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=a_(n).getElementById(r);if(s)return s}}return n}rc(iT,"getActiveElement");function oT(t){return t.tagName==="IFRAME"}rc(oT,"isFrame");function _C(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function k$(...t){return e=>{let n=!1;const r=t.map(s=>{const i=_C(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():_C(t[s],null)}}}}function ln(...t){return v.useCallback(k$(...t),t)}function ua(t,e=[]){let n=[];function r(i,a){const u=v.createContext(a);u.displayName=i+"Context";const c=n.length;n=[...n,a];const d=p=>{var E;const{scope:m,children:y,...w}=p,_=((E=m==null?void 0:m[t])==null?void 0:E[c])||u,x=v.useMemo(()=>w,Object.values(w));return S.jsx(_.Provider,{value:x,children:y})};d.displayName=i+"Provider";function h(p,m,y={}){var E;const{optional:w=!1}=y,_=((E=m==null?void 0:m[t])==null?void 0:E[c])||u,x=v.useContext(_);if(x)return x;if(a!==void 0)return a;if(!w)throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(a=>v.createContext(a));return function(u){const c=(u==null?void 0:u[t])||i;return v.useMemo(()=>({[`__scope${t}`]:{...u,[t]:c}}),[u,c])}};return s.scopeName=t,[r,P$(s,...e)]}function P$(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((u,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...u,...p}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var Pr=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},T$=_f[" useId ".trim().toString()]||(()=>{}),R$=0;function hl(t){const[e,n]=v.useState(T$());return Pr(()=>{n(r=>r??String(R$++))},[t]),t||(e?`radix-${e}`:"")}var wC=_f[" useEffectEvent ".trim().toString()],xC=_f[" useInsertionEffect ".trim().toString()];function A$(t){if(typeof wC=="function")return wC(t);const e=v.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof xC=="function"?xC(()=>{e.current=t}):Pr(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}var I$=Object.defineProperty,Cf=(t,e)=>I$(t,"name",{value:e,configurable:!0}),M$=_f[" useInsertionEffect ".trim().toString()]||Pr;function ca({prop:t,defaultProp:e,onChange:n=Cf(()=>{},"onChange"),caller:r}){const[s,i,a]=aT({defaultProp:e,onChange:n}),u=t!==void 0,c=u?t:s,d=v.useCallback(h=>{var p;if(u){const m=lT(h)?h(t):h;m!==t&&((p=a.current)==null||p.call(a,m))}else i(h)},[u,t,i,a]);return[c,d]}Cf(ca,"useControllableState");function aT({defaultProp:t,onChange:e}){const[n,r]=v.useState(t),s=v.useRef(n),i=v.useRef(e);return M$(()=>{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]}Cf(aT,"useUncontrolledState");function lT(t){return typeof t=="function"}Cf(lT,"isFunction");var bC=Symbol("RADIX:SYNC_STATE");function O$(t,e,n,r){const{prop:s,defaultProp:i,onChange:a,caller:u}=e,c=s!==void 0,d=A$(a),h=[{...n,state:i}];r&&h.push(r);const[p,m]=v.useReducer((x,E)=>{if(E.type===bC)return{...x,state:E.state};const k=t(x,E);return c&&!Object.is(k.state,x.state)&&d(k.state),k},...h),y=p.state,w=v.useRef(y);v.useEffect(()=>{w.current!==y&&(w.current=y,c||d(y))},[y,w,c]);const _=v.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return v.useEffect(()=>{c&&!Object.is(s,p.state)&&m({type:bC,state:s})},[s,p.state,c]),[_,m]}Cf(O$,"useControllableStateReducer");function Gd(t){const e=v.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,u=!1;const c=[];SC(s)&&typeof tp=="function"&&(s=tp(s._payload)),v.Children.forEach(s,m=>{var y;if(F$(m)){u=!0;const w=m;let _="child"in w.props?w.props.child:w.props.children;SC(_)&&typeof tp=="function"&&(_=tp(_._payload)),a=N$(w,_),c.push((y=a==null?void 0:a.props)==null?void 0:y.children)}else c.push(m)}),a?a=v.cloneElement(a,void 0,c):!u&&v.Children.count(s)===1&&v.isValidElement(s)&&(a=s);const d=a?j$(a):void 0,h=ln(r,d);if(!a){if(s||s===0)throw new Error(u?z$(t):H$(t));return s}const p=D$(i,a.props??{});return a.type!==v.Fragment&&(p.ref=r?h:d),v.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}var uT=Symbol.for("radix.slottable");function L$(t){const e=n=>"child"in n?n.children(n.child):n.children;return e.displayName=`${t}.Slottable`,e.__radixId=uT,e}var N$=(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};function D$(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]=(...u)=>{const c=i(...u);return s(...u),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function j$(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)}function F$(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===uT}var V$=Symbol.for("react.lazy");function SC(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===V$&&"_payload"in t&&$$(t._payload)}function $$(t){return typeof t=="object"&&t!==null&&"then"in t}var H$=t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,z$=t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,tp=_f[" use ".trim().toString()],U$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],un=U$.reduce((t,e)=>{const n=Gd(`Primitive.${e}`),r=v.forwardRef((s,i)=>{const{asChild:a,...u}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...u,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function B$(t,e){t&&t0.flushSync(()=>t.dispatchEvent(e))}function Zu(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)}),[])}var W$=Object.defineProperty,Pn=(t,e)=>W$(t,"name",{value:e,configurable:!0}),l_="dismissableLayer.update",G$="dismissableLayer.pointerDownOutside",K$="dismissableLayer.focusOutside",EC,cT=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Q2=v.forwardRef(Pn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:u,onInteractOutside:c,onDismiss:d,...h}=e,p=v.useContext(cT),[m,y]=v.useState(null),w=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=v.useState({}),x=ln(n,y),E=Array.from(p.layers),[k]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),P=k?E.indexOf(k):-1,T=m?E.indexOf(m):-1,A=p.layersWithOutsidePointerEventsDisabled.size>0,L=T>=P,O=v.useRef(!1),R=fT(F=>{a==null||a(F),c==null||c(F),F.defaultPrevented||d==null||d()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(F=>{if(!(F instanceof Node))return!1;const q=[...p.branches].some(G=>G.contains(F));return L&&!q},[p.branches,L])}),M=hT(F=>{if(s&&O.current)return;const q=F.target;[...p.branches].some(W=>W.contains(q))||(u==null||u(F),c==null||c(F),F.defaultPrevented||d==null||d())},w),N=m?T===E.length-1:!1,j=Zu(F=>{F.key==="Escape"&&(i==null||i(F),!F.defaultPrevented&&d&&(F.preventDefault(),d()))});return v.useEffect(()=>{if(N)return w.addEventListener("keydown",j,{capture:!0}),()=>w.removeEventListener("keydown",j,{capture:!0})},[w,N,j]),v.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(EC=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),u_(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=EC))}},[m,w,r,p]),v.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),u_())},[m,p]),v.useEffect(()=>{const F=Pn(()=>_({}),"handleUpdate");return document.addEventListener(l_,F),()=>document.removeEventListener(l_,F)},[]),S.jsx(un.div,{...h,ref:x,style:{pointerEvents:A?L?"auto":"none":void 0,...e.style},onFocusCapture:Lt(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Lt(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Lt(e.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function dT(){const t=v.useContext(cT),[e,n]=v.useState(null);return v.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Pn(dT,"useDismissableLayerSurface");var Z$=Pn(()=>!0,"IS_TRUE");function fT(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=Z$}=e,u=Zu(t),c=v.useRef(!1),d=v.useRef(!1),h=v.useRef(new Map),p=v.useRef(()=>{});return v.useEffect(()=>{function m(){d.current=!1,s.current=!1,h.current.clear()}Pn(m,"resetOutsideInteraction");function y(){return Array.from(h.current.values()).some(Boolean)}Pn(y,"isOutsideInteractionIntercepted");function w(P){if(!d.current)return;const T=P.target;T instanceof Node&&[...i].some(L=>L.contains(T))||h.current.set(P.type,!0),P.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}Pn(w,"handleInteractionCapture");function _(P){d.current&&h.current.set(P.type,!1)}Pn(_,"handleInteractionBubble");const x=Pn(P=>{if(P.target&&!c.current){let T=function(){n.removeEventListener("click",p.current);const L=y();m(),L||J2(G$,u,A,{discrete:!0})};if(Pn(T,"handleAndDispatchPointerDownOutsideEvent"),!a(P.target)){n.removeEventListener("click",p.current),m(),c.current=!1;return}const A={originalEvent:P};d.current=!0,s.current=r&&P.button===0,h.current.clear(),!r||P.button!==0?T():(n.removeEventListener("click",p.current),p.current=T,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();c.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const P of E)n.addEventListener(P,w,!0),n.addEventListener(P,_);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",x)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",x),n.removeEventListener("click",p.current);for(const P of E)n.removeEventListener(P,w,!0),n.removeEventListener(P,_)}},[n,u,r,s,i,a]),{onPointerDownCapture:Pn(()=>c.current=!0,"onPointerDownCapture")}}Pn(fT,"usePointerDownOutside");function hT(t,e=globalThis==null?void 0:globalThis.document){const n=Zu(t),r=v.useRef(!1);return v.useEffect(()=>{const s=Pn(i=>{i.target&&!r.current&&J2(K$,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(hT,"useFocusOutside");function u_(){const t=new CustomEvent(l_);document.dispatchEvent(t)}Pn(u_,"dispatchUpdate");function J2(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?B$(s,i):s.dispatchEvent(i)}Pn(J2,"handleAndDispatchCustomEvent");var q$=Object.defineProperty,ur=(t,e)=>q$(t,"name",{value:e,configurable:!0}),Jv="focusScope.autoFocusOnMount",e1="focusScope.autoFocusOnUnmount",CC={bubbles:!1,cancelable:!0},pT=v.forwardRef(ur(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...u}=e,[c,d]=v.useState(null),h=Zu(i),p=Zu(a),m=v.useRef(null),y=ln(n,d),w=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(s){let x=function(T){if(w.paused||!c)return;const A=T.target;c.contains(A)?m.current=A:zi(m.current,{select:!0})},E=function(T){if(w.paused||!c)return;const A=T.relatedTarget;A!==null&&(c.contains(A)||zi(m.current,{select:!0}))},k=function(T){if(document.activeElement===document.body)for(const L of T)L.removedNodes.length>0&&zi(c)};ur(x,"handleFocusIn"),ur(E,"handleFocusOut"),ur(k,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",E);const P=new MutationObserver(k);return c&&P.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",E),P.disconnect()}}},[s,c,w.paused]),v.useEffect(()=>{if(c){kC.add(w);const x=document.activeElement;if(!c.contains(x)){const k=new CustomEvent(Jv,CC);c.addEventListener(Jv,h),c.dispatchEvent(k),k.defaultPrevented||(mT(wT(ew(c)),{select:!0}),document.activeElement===x&&zi(c))}return()=>{c.removeEventListener(Jv,h),setTimeout(()=>{const k=new CustomEvent(e1,CC);c.addEventListener(e1,p),c.dispatchEvent(k),k.defaultPrevented||zi(x??document.body,{select:!0}),c.removeEventListener(e1,p),kC.remove(w)},0)}}},[c,h,p,w]);const _=v.useCallback(x=>{if(!r&&!s||w.paused)return;const E=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,k=document.activeElement;if(E&&k){const P=x.currentTarget,[T,A]=gT(P);T&&A?!x.shiftKey&&k===A?(x.preventDefault(),r&&zi(T,{select:!0})):x.shiftKey&&k===T&&(x.preventDefault(),r&&zi(A,{select:!0})):k===P&&x.preventDefault()}},[r,s,w.paused]);return S.jsx(un.div,{tabIndex:-1,...u,ref:y,onKeyDown:_})},"FocusScope"));function mT(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(zi(r,{select:e}),document.activeElement!==n)return}ur(mT,"focusFirst");function gT(t){const e=ew(t),n=c_(e,t),r=c_(e.reverse(),t);return[n,r]}ur(gT,"getTabbableEdges");function ew(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:ur(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}ur(ew,"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}):vT(r,{upTo:e})))return r}ur(c_,"findVisible");function vT(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}ur(vT,"isHidden");function yT(t){return t instanceof HTMLInputElement&&"select"in t}ur(yT,"isSelectableInput");function zi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&yT(t)&&e&&t.select()}}ur(zi,"focus");var kC=_T();function _T(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=d_(t,e),t.unshift(e)},remove(e){var n;t=d_(t,e),(n=t[0])==null||n.resume()}}}ur(_T,"createFocusScopesStack");function d_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}ur(d_,"arrayRemove");function wT(t){return t.filter(e=>e.tagName!=="A")}ur(wT,"removeLinks");var Y$=Object.defineProperty,X$=(t,e)=>Y$(t,"name",{value:e,configurable:!0}),tw=v.forwardRef(X$(function(e,n){var c;const{container:r,...s}=e,[i,a]=v.useState(!1);Pr(()=>a(!0),[]);const u=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?t0.createPortal(S.jsx(un.div,{...s,ref:n}),u):null},"Portal")),Q$=Object.defineProperty,ro=(t,e)=>Q$(t,"name",{value:e,configurable:!0});function xT(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}ro(xT,"useStateMachine");var da=ro(t=>{const{present:e,children:n}=t,r=bT(e),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=ST(r.ref,ET(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:i}):null},"Presence");function bT(t){const[e,n]=v.useState(),r=v.useRef(null),s=v.useRef(t),i=v.useRef("none"),a=v.useRef(void 0),u=t?"mounted":"unmounted",[c,d]=xT(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{c==="mounted"?(i.current=a.current??uu(r.current),a.current=void 0):i.current="none"},[c]),Pr(()=>{const h=r.current,p=s.current;if(p!==t){const y=i.current,w=uu(h);t?(a.current=w,d("MOUNT")):w==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(p&&y!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Pr(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,m=ro(w=>{const x=uu(r.current).includes(CSS.escape(w.animationName));if(w.target===e&&x&&(d("ANIMATION_END"),!s.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},"handleAnimationEnd"),y=ro(w=>{w.target===e&&(i.current=uu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,a.current=uu(p)}else r.current=null;n(h)},[])}}ro(bT,"usePresence");function f_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}ro(f_,"setRef");function ST(...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 u=f_(a,n);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let a=0;a<i.length;a++){const u=i[a];typeof u=="function"?u():f_(r[a],null)}}},[])}ro(ST,"useStableComposedRefs");function uu(t){return(t==null?void 0:t.animationName)||"none"}ro(uu,"getAnimationName");function ET(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)}ro(ET,"getElementRef");var np=0,Qs=null;function CT(){v.useEffect(()=>{Qs||(Qs={start:PC(),end:PC()});const{start:t,end:e}=Qs;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),np++,()=>{np===1&&(Qs==null||Qs.start.remove(),Qs==null||Qs.end.remove(),Qs=null),np=Math.max(0,np-1)}},[])}function PC(){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}var oi=function(){return oi=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},oi.apply(this,arguments)};function kT(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 J$(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 Ip="right-scroll-bar-position",Mp="width-before-scroll-bar",eH="with-scroll-bars-hidden",tH="--removed-body-scroll-bar-size";function t1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function nH(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 rH=typeof window<"u"?v.useLayoutEffect:v.useEffect,TC=new WeakMap;function sH(t,e){var n=nH(null,function(r){return t.forEach(function(s){return t1(s,r)})});return rH(function(){var r=TC.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(u){i.has(u)||t1(u,null)}),i.forEach(function(u){s.has(u)||t1(u,a)})}TC.set(n,t)},[t]),n}function iH(t){return t}function oH(t,e){e===void 0&&(e=iH);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(u){return u!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(i),a=n}var c=function(){var h=a;a=[],h.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return s}function aH(t){t===void 0&&(t={});var e=oH(null);return e.options=oi({async:!0,ssr:!1},t),e}var PT=function(t){var e=t.sideCar,n=kT(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,oi({},n))};PT.isSideCarExport=!0;function lH(t,e){return t.useMedium(e),PT}var TT=aH(),n1=function(){},n0=v.forwardRef(function(t,e){var n=v.useRef(null),r=v.useState({onScrollCapture:n1,onWheelCapture:n1,onTouchMoveCapture:n1}),s=r[0],i=r[1],a=t.forwardProps,u=t.children,c=t.className,d=t.removeScrollBar,h=t.enabled,p=t.shards,m=t.sideCar,y=t.noRelative,w=t.noIsolation,_=t.inert,x=t.allowPinchZoom,E=t.as,k=E===void 0?"div":E,P=t.gapMode,T=kT(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=m,L=sH([n,e]),O=oi(oi({},T),s);return v.createElement(v.Fragment,null,h&&v.createElement(A,{sideCar:TT,removeScrollBar:d,shards:p,noRelative:y,noIsolation:w,inert:_,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:P}),a?v.cloneElement(v.Children.only(u),oi(oi({},O),{ref:L})):v.createElement(k,oi({},O,{className:c,ref:L}),u))});n0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};n0.classNames={fullWidth:Mp,zeroRight:Ip};var uH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cH(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=uH();return e&&t.setAttribute("nonce",e),t}function dH(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function fH(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var hH=function(){var t=0,e=null;return{add:function(n){t==0&&(e=cH())&&(dH(e,n),fH(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},pH=function(){var t=hH();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},RT=function(){var t=pH(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},mH={left:0,top:0,right:0,gap:0},r1=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[r1(n),r1(r),r1(s)]},vH=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return mH;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])}},yH=RT(),_u="data-scroll-locked",_H=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,u=t.gap;return n===void 0&&(n="margin"),`
71
- .`.concat(eH,` {
72
- overflow: hidden `).concat(r,`;
73
- padding-right: `).concat(u,"px ").concat(r,`;
74
- }
75
- body[`).concat(_u,`] {
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(u,"px ").concat(r,`;
85
- `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
86
- }
87
-
88
- .`).concat(Ip,` {
89
- right: `).concat(u,"px ").concat(r,`;
90
- }
91
-
92
- .`).concat(Mp,` {
93
- margin-right: `).concat(u,"px ").concat(r,`;
94
- }
95
-
96
- .`).concat(Ip," .").concat(Ip,` {
97
- right: 0 `).concat(r,`;
98
- }
99
-
100
- .`).concat(Mp," .").concat(Mp,` {
101
- margin-right: 0 `).concat(r,`;
102
- }
103
-
104
- body[`).concat(_u,`] {
105
- `).concat(tH,": ").concat(u,`px;
106
- }
107
- `)},RC=function(){var t=parseInt(document.body.getAttribute(_u)||"0",10);return isFinite(t)?t:0},wH=function(){v.useEffect(function(){return document.body.setAttribute(_u,(RC()+1).toString()),function(){var t=RC()-1;t<=0?document.body.removeAttribute(_u):document.body.setAttribute(_u,t.toString())}},[])},xH=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;wH();var i=v.useMemo(function(){return vH(s)},[s]);return v.createElement(yH,{styles:_H(i,!e,s,n?"":"!important")})},h_=!1;if(typeof window<"u")try{var rp=Object.defineProperty({},"passive",{get:function(){return h_=!0,!0}});window.addEventListener("test",rp,rp),window.removeEventListener("test",rp,rp)}catch{h_=!1}var Jl=h_?{passive:!1}:!1,bH=function(t){return t.tagName==="TEXTAREA"},AT=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!bH(t)&&n[e]==="visible")},SH=function(t){return AT(t,"overflowY")},EH=function(t){return AT(t,"overflowX")},AC=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=IT(t,r);if(s){var i=MT(t,r),a=i[1],u=i[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},CH=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},kH=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},IT=function(t,e){return t==="v"?SH(e):EH(e)},MT=function(t,e){return t==="v"?CH(e):kH(e)},PH=function(t,e){return t==="h"&&e==="rtl"?-1:1},TH=function(t,e,n,r,s){var i=PH(t,window.getComputedStyle(e).direction),a=i*r,u=n.target,c=e.contains(u),d=!1,h=a>0,p=0,m=0;do{if(!u)break;var y=MT(t,u),w=y[0],_=y[1],x=y[2],E=_-x-i*w;(w||E)&&IT(t,u)&&(p+=E,m+=w);var k=u.parentNode;u=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!c&&u!==document.body||c&&(e.contains(u)||e===u));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(d=!0),d},sp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},IC=function(t){return[t.deltaX,t.deltaY]},MC=function(t){return t&&"current"in t?t.current:t},RH=function(t,e){return t[0]===e[0]&&t[1]===e[1]},AH=function(t){return`
108
- .block-interactivity-`.concat(t,` {pointer-events: none;}
109
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
110
- `)},IH=0,eu=[];function MH(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(IH++)[0],i=v.useState(RT)[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 _=J$([t.lockRef.current],(t.shards||[]).map(MC),!0).filter(Boolean);return _.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var u=v.useCallback(function(_,x){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!a.current.allowPinchZoom;var E=sp(_),k=n.current,P="deltaX"in _?_.deltaX:k[0]-E[0],T="deltaY"in _?_.deltaY:k[1]-E[1],A,L=_.target,O=Math.abs(P)>Math.abs(T)?"h":"v";if("touches"in _&&O==="h"&&L.type==="range")return!1;var R=window.getSelection(),M=R&&R.anchorNode,N=M?M===L||M.contains(L):!1;if(N)return!1;var j=AC(O,L);if(!j)return!0;if(j?A=O:(A=O==="v"?"h":"v",j=AC(O,L)),!j)return!1;if(!r.current&&"changedTouches"in _&&(P||T)&&(r.current=A),!A)return!0;var F=r.current||A;return TH(F,x,_,F==="h"?P:T)},[]),c=v.useCallback(function(_){var x=_;if(!(!eu.length||eu[eu.length-1]!==i)){var E="deltaY"in x?IC(x):sp(x),k=e.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&RH(A.delta,E)})[0];if(k&&k.should){x.cancelable&&x.preventDefault();return}if(!k){var P=(a.current.shards||[]).map(MC).filter(Boolean).filter(function(A){return A.contains(x.target)}),T=P.length>0?u(x,P[0]):!a.current.noIsolation;T&&x.cancelable&&x.preventDefault()}}},[]),d=v.useCallback(function(_,x,E,k){var P={name:_,delta:x,target:E,should:k,shadowParent:OH(E)};e.current.push(P),setTimeout(function(){e.current=e.current.filter(function(T){return T!==P})},1)},[]),h=v.useCallback(function(_){n.current=sp(_),r.current=void 0},[]),p=v.useCallback(function(_){d(_.type,IC(_),_.target,u(_,t.lockRef.current))},[]),m=v.useCallback(function(_){d(_.type,sp(_),_.target,u(_,t.lockRef.current))},[]);v.useEffect(function(){return eu.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Jl),document.addEventListener("touchmove",c,Jl),document.addEventListener("touchstart",h,Jl),function(){eu=eu.filter(function(_){return _!==i}),document.removeEventListener("wheel",c,Jl),document.removeEventListener("touchmove",c,Jl),document.removeEventListener("touchstart",h,Jl)}},[]);var y=t.removeScrollBar,w=t.inert;return v.createElement(v.Fragment,null,w?v.createElement(i,{styles:AH(s)}):null,y?v.createElement(xH,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function OH(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const LH=lH(TT,MH);var nw=v.forwardRef(function(t,e){return v.createElement(n0,oi({},t,{ref:e,sideCar:LH}))});nw.classNames=n0.classNames;var NH=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},tu=new WeakMap,ip=new WeakMap,op={},s1=0,OT=function(t){return t&&(t.host||OT(t.parentNode))},DH=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=OT(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})},jH=function(t,e,n,r){var s=DH(e,Array.isArray(t)?t:[t]);op[n]||(op[n]=new WeakMap);var i=op[n],a=[],u=new Set,c=new Set(s),d=function(p){!p||u.has(p)||(u.add(p),d(p.parentNode))};s.forEach(d);var h=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))h(m);else try{var y=m.getAttribute(r),w=y!==null&&y!=="false",_=(tu.get(m)||0)+1,x=(i.get(m)||0)+1;tu.set(m,_),i.set(m,x),a.push(m),_===1&&w&&ip.set(m,!0),x===1&&m.setAttribute(n,"true"),w||m.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",m,E)}})};return h(e),u.clear(),s1++,function(){a.forEach(function(p){var m=tu.get(p)-1,y=i.get(p)-1;tu.set(p,m),i.set(p,y),m||(ip.has(p)||p.removeAttribute(r),ip.delete(p)),y||p.removeAttribute(n)}),s1--,s1||(tu=new WeakMap,tu=new WeakMap,ip=new WeakMap,op={})}},LT=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=NH(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),jH(r,s,n,"aria-hidden")):function(){return null}},FH=Object.defineProperty,Fs=(t,e)=>FH(t,"name",{value:e,configurable:!0}),rw="Dialog",[NT]=ua(rw),[VH,ao]=NT(rw),sw=Fs(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,u=v.useRef(null),c=v.useRef(null),[d,h]=ca({prop:r,defaultProp:s??!1,onChange:i,caller:rw}),[p,m]=v.useState(0),[y,w]=v.useState(0);return S.jsx(VH,{scope:e,triggerRef:u,contentRef:c,contentId:hl(),titleId:hl(),descriptionId:hl(),titlePresent:p>0,descriptionPresent:y>0,setTitleCount:m,setDescriptionCount:w,open:d,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(_=>!_),[h]),modal:a,children:n})},"Dialog"),DT="DialogPortal",[$H,jT]=NT(DT,{forceMount:void 0}),iw=Fs(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=ao(DT,e);return S.jsx($H,{scope:e,forceMount:n,children:v.Children.map(r,a=>S.jsx(da,{present:n||i.open,children:S.jsx(tw,{asChild:!0,container:s,children:a})}))})},"DialogPortal"),p_="DialogOverlay",ow=v.forwardRef(Fs(function(e,n){const r=jT(p_,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=ao(p_,e.__scopeDialog);return a.modal?S.jsx(da,{present:s||a.open,children:S.jsx(zH,{...i,ref:n})}):null},"DialogOverlay")),HH=Gd("DialogOverlay.RemoveScroll"),zH=v.forwardRef(Fs(function(e,n){const{__scopeDialog:r,...s}=e,i=ao(p_,r),a=dT(),u=ln(n,a);return S.jsx(nw,{as:HH,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(un.div,{"data-state":cw(i.open),...s,ref:u,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Kd="DialogContent",aw=v.forwardRef(Fs(function(e,n){const r=jT(Kd,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=ao(Kd,e.__scopeDialog);return S.jsx(da,{present:s||a.open,children:a.modal?S.jsx(UH,{...i,ref:n}):S.jsx(BH,{...i,ref:n})})},"DialogContent")),UH=v.forwardRef(Fs(function(e,n){const r=ao(Kd,e.__scopeDialog),s=v.useRef(null),i=ln(n,r.contentRef,s);return v.useEffect(()=>{const a=s.current;if(a)return LT(a)},[]),S.jsx(FT,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Lt(e.onCloseAutoFocus,a=>{var u;a.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Lt(e.onPointerDownOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0;(u.button===2||c)&&a.preventDefault()}),onFocusOutside:Lt(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),BH=v.forwardRef(Fs(function(e,n){const r=ao(Kd,e.__scopeDialog),s=v.useRef(!1),i=v.useRef(!1);return S.jsx(FT,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,a),a.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"DialogContentNonModal")),FT=v.forwardRef(Fs(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,...u}=e,c=ao(Kd,r);return CT(),S.jsx(S.Fragment,{children:S.jsx(pT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:S.jsx(Q2,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":cw(c.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),WH="DialogTitle",lw=v.forwardRef(Fs(function(e,n){const{__scopeDialog:r,...s}=e,i=ao(WH,r),{setTitleCount:a}=i;return Pr(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),S.jsx(un.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),GH="DialogDescription",uw=v.forwardRef(Fs(function(e,n){const{__scopeDialog:r,...s}=e,i=ao(GH,r),{setDescriptionCount:a}=i;return Pr(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),S.jsx(un.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function cw(t){return t?"open":"closed"}Fs(cw,"getState");const KH=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"}))]]),ZH=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"}))]]),qH=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"}))]]),YH=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"}))]]),XH=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"}))]]),QH=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"}))]]),JH=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"}))]]),ez=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"}))]]),tz=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"}))]]),nz=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"}))]]),rz=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"}))]]),sz=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"}))]]),iz=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"}))]]),oz=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"}))]]),az=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"}))]]),lz=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"}))]]),uz=v.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Hn=v.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:u,weights:c,...d}=t,{color:h="currentColor",size:p,weight:m="regular",mirrored:y=!1,...w}=v.useContext(uz);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||y?"scale(-1, 1)":void 0,...w,...d},!!n&&v.createElement("title",null,n),u,c.get(i??m))});Hn.displayName="IconBase";const VT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:KH}));VT.displayName="ArrowLeftIcon";const cz=VT,$T=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:ZH}));$T.displayName="ArrowSquareOutIcon";const dz=$T,HT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:qH}));HT.displayName="ArrowUpIcon";const fz=HT,zT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:YH}));zT.displayName="CaretDownIcon";const hz=zT,UT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:XH}));UT.displayName="ChatCircleIcon";const pz=UT,BT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:QH}));BT.displayName="CheckIcon";const WT=BT,GT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:JH}));GT.displayName="CircleNotchIcon";const r0=GT,KT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:ez}));KT.displayName="CopyIcon";const Zd=KT,ZT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:tz}));ZT.displayName="MagnifyingGlassIcon";const mz=ZT,qT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:nz}));qT.displayName="PencilSimpleIcon";const gz=qT,YT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:rz}));YT.displayName="SidebarSimpleIcon";const vz=YT,XT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:sz}));XT.displayName="SignOutIcon";const yz=XT,QT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:iz}));QT.displayName="SparkleIcon";const i1=QT,JT=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:oz}));JT.displayName="SwatchesIcon";const e5=JT,t5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:az}));t5.displayName="TrashIcon";const _z=t5,n5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:lz}));n5.displayName="XIcon";const r5=n5;function s5(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=s5(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function wz(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=s5(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},bz=(t,e)=>({classGroupId:t,validator:e}),i5=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Tm="-",OC=[],Sz="arbitrary..",Ez=t=>{const e=kz(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Cz(a);const u=a.split(Tm),c=u[0]===""&&u.length>1?1:0;return o5(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],d=n[a];return c?d?xz(d,c):c:d||OC}return n[a]||OC}}},o5=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=o5(t,e+1,i);if(d)return d}const a=n.validators;if(a===null)return;const u=e===0?t.join(Tm):t.slice(e).join(Tm),c=a.length;for(let d=0;d<c;d++){const h=a[d];if(h.validator(u))return h.classGroupId}},Cz=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?Sz+r:void 0})(),kz=t=>{const{theme:e,classGroups:n}=t;return Pz(n,e)},Pz=(t,e)=>{const n=i5();for(const r in t){const s=t[r];dw(s,n,r,e)}return n},dw=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];Tz(a,e,n,r)}},Tz=(t,e,n,r)=>{if(typeof t=="string"){Rz(t,e,n);return}if(typeof t=="function"){Az(t,e,n,r);return}Iz(t,e,n,r)},Rz=(t,e,n)=>{const r=t===""?e:a5(e,t);r.classGroupId=n},Az=(t,e,n,r)=>{if(Mz(t)){dw(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(bz(n,t))},Iz=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[u,c]=s[a];dw(c,a5(e,u),n,r)}},a5=(t,e)=>{let n=t;const r=e.split(Tm),s=r.length;for(let i=0;i<s;i++){const a=r[i];let u=n.nextPart.get(a);u||(u=i5(),n.nextPart.set(a,u)),n=u}return n},Mz=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Oz=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)}}},m_="!",LC=":",Lz=[],NC=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Nz=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,u=0,c=0,d;const h=s.length;for(let _=0;_<h;_++){const x=s[_];if(a===0&&u===0){if(x===LC){i.push(s.slice(c,_)),c=_+1;continue}if(x==="/"){d=_;continue}}x==="["?a++:x==="]"?a--:x==="("?u++:x===")"&&u--}const p=i.length===0?s:s.slice(c);let m=p,y=!1;p.endsWith(m_)?(m=p.slice(0,-1),y=!0):p.startsWith(m_)&&(m=p.slice(1),y=!0);const w=d&&d>c?d-c:void 0;return NC(i,y,m,w)};if(e){const s=e+LC,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):NC(Lz,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},Dz=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],u=a[0]==="[",c=e.has(a);u||c?(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}},jz=t=>({cache:Oz(t.cacheSize),parseClassName:Nz(t),sortModifiers:Dz(t),postfixLookupClassGroupIds:Fz(t),...Ez(t)}),Fz=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},Vz=/\s+/,$z=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,u=[],c=t.trim().split(Vz);let d="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:m,modifiers:y,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:x}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let E=!!x,k;if(E){const O=_.substring(0,x);k=r(O);const R=k&&a[k]?r(_):void 0;R&&R!==k&&(k=R,E=!1)}else k=r(_);if(!k){if(!E){d=p+(d.length>0?" "+d:d);continue}if(k=r(_),!k){d=p+(d.length>0?" "+d:d);continue}E=!1}const P=y.length===0?"":y.length===1?y[0]:i(y).join(":"),T=w?P+m_:P,A=T+k;if(u.indexOf(A)>-1)continue;u.push(A);const L=s(k,E);for(let O=0;O<L.length;++O){const R=L[O];u.push(T+R)}d=p+(d.length>0?" "+d:d)}return d},Hz=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=l5(n))&&(s&&(s+=" "),s+=r);return s},l5=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=l5(t[r]))&&(n&&(n+=" "),n+=e);return n},zz=(t,...e)=>{let n,r,s,i;const a=c=>{const d=e.reduce((h,p)=>p(h),t());return n=jz(d),r=n.cache.get,s=n.cache.set,i=u,u(c)},u=c=>{const d=r(c);if(d)return d;const h=$z(c,n);return s(c,h),h};return i=a,(...c)=>i(Hz(...c))},Uz=[],_n=t=>{const e=n=>n[t]||Uz;return e.isThemeGetter=!0,e},u5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,c5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Wz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gz=/\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$/,Kz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Zz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Io=t=>Bz.test(t),nt=t=>!!t&&!Number.isNaN(Number(t)),Js=t=>!!t&&Number.isInteger(Number(t)),o1=t=>t.endsWith("%")&&nt(t.slice(0,-1)),Oi=t=>Wz.test(t),d5=()=>!0,Yz=t=>Gz.test(t)&&!Kz.test(t),fw=()=>!1,Xz=t=>Zz.test(t),Qz=t=>qz.test(t),Jz=t=>!Me(t)&&!Le(t),eU=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)),tU=t=>fa(t,p5,fw),Me=t=>u5.test(t),Da=t=>fa(t,m5,Yz),DC=t=>fa(t,uU,nt),nU=t=>fa(t,v5,d5),rU=t=>fa(t,g5,fw),jC=t=>fa(t,f5,fw),sU=t=>fa(t,h5,Qz),ap=t=>fa(t,y5,Xz),Le=t=>c5.test(t),id=t=>xl(t,m5),iU=t=>xl(t,g5),FC=t=>xl(t,f5),oU=t=>xl(t,p5),aU=t=>xl(t,h5),lp=t=>xl(t,y5,!0),lU=t=>xl(t,v5,!0),fa=(t,e,n)=>{const r=u5.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},xl=(t,e,n=!1)=>{const r=c5.exec(t);return r?r[1]?e(r[1]):n:!1},f5=t=>t==="position"||t==="percentage",h5=t=>t==="image"||t==="url",p5=t=>t==="length"||t==="size"||t==="bg-size",m5=t=>t==="length",uU=t=>t==="number",g5=t=>t==="family-name",v5=t=>t==="number"||t==="weight",y5=t=>t==="shadow",cU=()=>{const t=_n("color"),e=_n("font"),n=_n("text"),r=_n("font-weight"),s=_n("tracking"),i=_n("leading"),a=_n("breakpoint"),u=_n("container"),c=_n("spacing"),d=_n("radius"),h=_n("shadow"),p=_n("inset-shadow"),m=_n("text-shadow"),y=_n("drop-shadow"),w=_n("blur"),_=_n("perspective"),x=_n("aspect"),E=_n("ease"),k=_n("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...T(),Le,Me],L=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],R=()=>[Le,Me,c],M=()=>[Io,"full","auto",...R()],N=()=>[Js,"none","subgrid",Le,Me],j=()=>["auto",{span:["full",Js,Le,Me]},Js,Le,Me],F=()=>[Js,"auto",Le,Me],q=()=>["auto","min","max","fr",Le,Me],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...R()],X=()=>[Io,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],$=()=>[Io,"screen","full","dvw","lvw","svw","min","max","fit",...R()],ee=()=>[Io,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],z=()=>[t,Le,Me],D=()=>[...T(),FC,jC,{position:[Le,Me]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",oU,tU,{size:[Le,Me]}],ie=()=>[o1,id,Da],ae=()=>["","none","full",d,Le,Me],ue=()=>["",nt,id,Da],Ce=()=>["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"],se=()=>[nt,o1,FC,jC],he=()=>["","none",w,Le,Me],Pe=()=>["none",nt,Le,Me],be=()=>["none",nt,Le,Me],$e=()=>[nt,Le,Me],ot=()=>[Io,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oi],breakpoint:[Oi],color:[d5],container:[Oi],"drop-shadow":[Oi],ease:["in","out","in-out"],font:[Jz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oi],shadow:[Oi],spacing:["px",nt],text:[Oi],"text-shadow":[Oi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Io,Me,Le,x]}],container:["container"],"container-type":[{"@container":["","normal","size",Le,Me]}],"container-named":[eU],columns:[{columns:[nt,Me,Le,u]}],"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:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset: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:[Js,"auto",Le,Me]}],basis:[{basis:[Io,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,Io,"auto","initial","none",Me]}],grow:[{grow:["",nt,Le,Me]}],shrink:[{shrink:["",nt,Le,Me]}],order:[{order:[Js,"first","last","none",Le,Me]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"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:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mbs:[{mbs:K()}],mbe:[{mbe:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[u,"screen",...X()]}],"min-w":[{"min-w":[u,"screen","none",...X()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,id,Da]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,lU,nU]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",o1,Me]}],"font-family":[{font:[iU,rU,e]}],"font-features":[{"font-features":[Me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Le,Me]}],"line-clamp":[{"line-clamp":[nt,"none",Le,DC]}],leading:[{leading:[i,...R()]}],"list-image":[{"list-image":["none",Le,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",Le,Da]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[nt,"auto",Le,Me]}],"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:[Js,Le,Me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Le,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Js,Le,Me],radial:["",Le,Me],conic:[Js,Le,Me]},aU,sU]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,Le,Me]}],"outline-w":[{outline:["",nt,id,Da]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",h,lp,ap]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",p,lp,ap]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[nt,Da]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",m,lp,ap]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[nt,Le,Me]}],"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":[nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Le,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Me]}],filter:[{filter:["","none",Le,Me]}],blur:[{blur:he()}],brightness:[{brightness:[nt,Le,Me]}],contrast:[{contrast:[nt,Le,Me]}],"drop-shadow":[{"drop-shadow":["","none",y,lp,ap]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",nt,Le,Me]}],"hue-rotate":[{"hue-rotate":[nt,Le,Me]}],invert:[{invert:["",nt,Le,Me]}],saturate:[{saturate:[nt,Le,Me]}],sepia:[{sepia:["",nt,Le,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Me]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[nt,Le,Me]}],"backdrop-contrast":[{"backdrop-contrast":[nt,Le,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,Le,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,Le,Me]}],"backdrop-invert":[{"backdrop-invert":["",nt,Le,Me]}],"backdrop-opacity":[{"backdrop-opacity":[nt,Le,Me]}],"backdrop-saturate":[{"backdrop-saturate":[nt,Le,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,Le,Me]}],"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",Le,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",Le,Me]}],ease:[{ease:["linear","initial",E,Le,Me]}],delay:[{delay:[nt,Le,Me]}],animate:[{animate:["none",k,Le,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Le,Me]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Pe()}],"rotate-x":[{"rotate-x":Pe()}],"rotate-y":[{"rotate-y":Pe()}],"rotate-z":[{"rotate-z":Pe()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:$e()}],"skew-x":[{"skew-x":$e()}],"skew-y":[{"skew-y":$e()}],transform:[{transform:[Le,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ot()}],"translate-x":[{"translate-x":ot()}],"translate-y":[{"translate-y":ot()}],"translate-z":[{"translate-z":ot()}],"translate-none":["translate-none"],zoom:[{zoom:[Js,Le,Me]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Le,Me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"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",Le,Me]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[nt,id,Da,DC]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dU=zz(cU);function dr(...t){return dU(wz(t))}const qd={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},VC=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function _5(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=VC[Math.abs(e)%VC.length];return{color:n,backgroundColor:`${n}22`}}function w5(t,e={}){const{axis:n="y"}=e,r=v.useRef(new Map),[s,i]=v.useState(null),[a,u]=v.useState([]),c=v.useRef([]),d=v.useRef(0),h=v.useRef(null),p=v.useRef(null),m=v.useCallback(()=>{if(!t.current)return;const k=[];r.current.forEach((P,T)=>{k[T]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),c.current=k,u(k)},[t]),y=v.useCallback((E,k)=>{k?r.current.set(E,k):r.current.delete(E),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,m()})},[m]),w=v.useCallback(E=>{const k=E.clientX,P=E.clientY;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const T=t.current;if(!T)return;const A=T.getBoundingClientRect(),L=n==="x"?k:P;let O=null,R=1/0,M=null;const N=c.current,j=n==="x"?T.scrollLeft:T.scrollTop,F=n==="x"?T.clientLeft:T.clientTop,q=n==="x"?A.left:A.top,G=n==="x"?T.offsetWidth:T.offsetHeight,W=n==="x"?A.width:A.height,K=G>0?W/G:1;for(let X=0;X<N.length;X++){const $=N[X];if(!$)continue;const ee=n==="x"?$.left:$.top,z=q+(F+ee-j)*K,D=(n==="x"?$.width:$.height)*K,Y=z+D;L>=z&&L<=Y&&(M=X);const te=z+D/2,ie=Math.abs(L-te);ie<R&&(R=ie,O=X)}i(M??O)})},[n,t]),_=v.useCallback(()=>{d.current+=1,m()},[m]),x=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:d,handlers:{onMouseMove:w,onMouseEnter:_,onMouseLeave:x},registerItem:y,measureItems:m}}function fU(t,e,n){v.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const x5=(t,e)=>`style:${t}:${e}`,b5=t=>`text:${t}`,S5=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"]},E5=t=>S5(t)[0],up=(t,e)=>S5(t).includes(e),hU=t=>{const e=E5(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${x5(e,t.property)}${n}`:`${b5(e)}${n}`},Ln=[];for(let t=0;t<256;++t)Ln.push((t+256).toString(16).slice(1));function pU(t,e=0){return(Ln[t[e+0]]+Ln[t[e+1]]+Ln[t[e+2]]+Ln[t[e+3]]+"-"+Ln[t[e+4]]+Ln[t[e+5]]+"-"+Ln[t[e+6]]+Ln[t[e+7]]+"-"+Ln[t[e+8]]+Ln[t[e+9]]+"-"+Ln[t[e+10]]+Ln[t[e+11]]+Ln[t[e+12]]+Ln[t[e+13]]+Ln[t[e+14]]+Ln[t[e+15]]).toLowerCase()}const mU=new Uint8Array(16);function gU(){return crypto.getRandomValues(mU)}function $C(t,e,n){return crypto.randomUUID?crypto.randomUUID():vU(t)}function vU(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,pU(r)}const yU=300;class _U{constructor(){Ao(this,"history",{current:new Map,past:[],future:[]});Ao(this,"pendingChanges",new Map);Ao(this,"currentBatchId",null);Ao(this,"debounceTimer",null);Ao(this,"onChangeCallbacks",[]);Ao(this,"stateBeforePending",null);Ao(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=$C(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=E5(e.elementId),r=e.type==="style"?x5(n,e.property):b5(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=hU(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},yU),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"&&up(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"&&up(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>up(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>up(n.elementId,e))}onChange(e){return this.onChangeCallbacks.push(e),()=>{const n=this.onChangeCallbacks.indexOf(e);n!==-1&&this.onChangeCallbacks.splice(n,1)}}notifyChange(){this.onChangeCallbacks.forEach(e=>e())}export(){return{current:Array.from(this.history.current.entries()),past:this.history.past.map(e=>Array.from(e.entries())),future:this.history.future.map(e=>Array.from(e.entries()))}}import(e){this.history={current:new Map(e.current),past:e.past.map(n=>new Map(n)),future:e.future.map(n=>new Map(n))},this.notifyChange()}async transaction(e){const n=this.pendingChanges.size===0;n&&(this.currentBatchId=$C(),this.stateBeforePending=new Map(this.history.current)),this.transactionDepth++;try{await e()}catch(r){throw n&&this.stateBeforePending&&(this.history.current=new Map(this.stateBeforePending),this.pendingChanges.clear(),this.currentBatchId=null,this.stateBeforePending=null),r}finally{this.transactionDepth--,n&&this.transactionDepth===0&&this.flushPending()}}}const Rm={kind:"base"};function Yd(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function wU(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}},C5=Object.fromEntries(Object.entries(xU).map(([t,e])=>[t,{isEnabled:e.default}]));tt("view");const k5=tt(!0),P5=tt(null),bU=tt("chat"),T5=tt(0),R5=tt({name:null,email:null}),HC=tt(Rm);tt(null);const Xd=new Map,SU=t=>{const e=Yd(t);let n=Xd.get(e);return n||(n=new _U,Xd.set(e,n)),n};tt(t=>SU(t(HC)),(t,e,n)=>{Xd.set(Yd(t(HC)),n)});const EU=t=>{for(const e of[...Xd.keys()])e==="base"||t.has(e)||Xd.delete(e)},Qd=tt(new Map),zC=tt(null);tt(null);const g_=tt(0),Am=tt(null),v_=tt(!1),y_=tt(null),A5=tt(!1),I5=tt(!1),__=tt(null),w_=tt(null),Jd=tt(null),hw=tt(null),na=tt(null),kf=tt({active:!1}),M5=tt([]),UC=tt(null),CU=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&wU(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},kU=tt(null,(t,e,n)=>{const r=c=>{const d=c??Rm;return d.kind==="variant"&&!n.has(Yd(d))},s=t(Qd);let i=null;for(const[c,d]of s)r(d.target)&&(i??(i=new Set)).add(c);if(i){const c=new Map(s);for(const d of i)c.delete(d);e(Qd,c)}const a=t(zC);a&&r(a.target)&&(e(zC,null),e(AU,!1));const u=t(UC);u&&(i!=null&&i.has(u.commentId))&&e(UC,null),EU(n)}),x_=tt(C5),PU=tt(!1),O5=tt(null),Pf=tt(!0),L5=tt(!1),N5=tt(!1),D5=tt(!1),j5=tt(null),TU=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},s0=tt(TU()),RU=tt(null),AU=tt(!1);tt(0);tt(0);var Op={exports:{}},IU=Op.exports,BC;function MU(){return BC||(BC=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(IU,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 u(_,x){var E=_[x];if(typeof E.bind=="function")return E.bind(_);try{return Function.prototype.bind.call(E,_)}catch{return function(){return Function.prototype.apply.apply(E,[_,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?c:console[_]!==void 0?u(console,_):console.log!==void 0?u(console,"log"):e}function h(){for(var _=this.getLevel(),x=0;x<s.length;x++){var E=s[x];this[E]=x<_?e:this.methodFactory(E,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function p(_){return function(){typeof console!==n&&(h.call(this),this[_].apply(this,arguments))}}function m(_,x,E){return d(_)||p.apply(this,arguments)}function y(_,x){var E=this,k,P,T,A="loglevel";typeof _=="string"?A+=":"+_:typeof _=="symbol"&&(A=void 0);function L(j){var F=(s[j]||"silent").toUpperCase();if(!(typeof window===n||!A)){try{window.localStorage[A]=F;return}catch{}try{window.document.cookie=encodeURIComponent(A)+"="+F+";"}catch{}}}function O(){var j;if(!(typeof window===n||!A)){try{j=window.localStorage[A]}catch{}if(typeof j===n)try{var F=window.document.cookie,q=encodeURIComponent(A),G=F.indexOf(q+"=");G!==-1&&(j=/^([^;]+)/.exec(F.slice(G+q.length+1))[1])}catch{}return E.levels[j]===void 0&&(j=void 0),j}}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(j){var F=j;if(typeof F=="string"&&E.levels[F.toUpperCase()]!==void 0&&(F=E.levels[F.toUpperCase()]),typeof F=="number"&&F>=0&&F<=E.levels.SILENT)return F;throw new TypeError("log.setLevel() called with invalid level: "+j)}E.name=_,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=x||m,E.getLevel=function(){return T??P??k},E.setLevel=function(j,F){return T=M(j),F!==!1&&L(T),h.call(E)},E.setDefaultLevel=function(j){P=M(j),O()||E.setLevel(j,!1)},E.resetLevel=function(){T=null,R(),h.call(E)},E.enableAll=function(j){E.setLevel(E.levels.TRACE,j)},E.disableAll=function(j){E.setLevel(E.levels.SILENT,j)},E.rebuild=function(){if(a!==E&&(k=M(a.getLevel())),h.call(E),a===E)for(var j in i)i[j].rebuild()},k=M(a?a.getLevel():"WARN");var N=O();N!=null&&(T=M(N)),h.call(E)}a=new y,a.getLogger=function(x){if(typeof x!="symbol"&&typeof x!="string"||x==="")throw new TypeError("You must supply a name when creating a logger.");var E=i[x];return E||(E=i[x]=new y(x,a.methodFactory)),E};var w=typeof window!==n?window.log:void 0;return a.noConflict=function(){return typeof window!==n&&window.log===a&&(window.log=w),a},a.getLoggers=function(){return i},a.default=a,a})})(Op)),Op.exports}var OU=MU();const Os=Gm(OU),LU="INFO",NU=LU.toUpperCase();Os.setLevel(Os.levels[NU]||Os.levels.INFO);const vs=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>Os.trace(`${e}${n}`,...r),debug:(n,...r)=>Os.debug(`${e}${n}`,...r),info:(n,...r)=>Os.info(`${e}${n}`,...r),warn:(n,...r)=>Os.warn(`${e}${n}`,...r),error:(n,...r)=>{Os.error(`${e}${n}`,...r);try{const i=r.map(u=>u instanceof Error?u.message:String(u)).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}:{}};Te.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>Os.info(`${e}API: ${n}`,...r),hook:(n,...r)=>Os.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>Os.debug(`${e}Mount: ${n}`,...r)}};let Lp=0;const DU=()=>{Lp+=1;let t=!1;return()=>{t||(t=!0,Lp=Math.max(0,Lp-1))}},jU=()=>Lp>0;function FU(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const VU=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],pw=({className:t,"data-testid":e}={})=>S.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:S.jsx("div",{className:"rivet-sparkle-strip",children:VU.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),$U=["top","right","bottom","left"],ra=Math.min,to=Math.max,Im=Math.round,cp=Math.floor,no=t=>({x:t,y:t}),HU={left:"right",right:"left",bottom:"top",top:"bottom"};function F5(t,e,n){return to(t,ra(e,n))}function so(t,e){return typeof t=="function"?t(e):t}function sa(t){return t.split("-")[0]}function sc(t){return t.split("-")[1]}function mw(t){return t==="x"?"y":"x"}function gw(t){return t==="y"?"height":"width"}function ui(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function vw(t){return mw(ui(t))}function zU(t,e,n){n===void 0&&(n=!1);const r=sc(t),s=vw(t),i=gw(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=Mm(a)),[a,Mm(a)]}function UU(t){const e=Mm(t);return[b_(t),e,b_(e)]}function b_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const WC=["left","right"],GC=["right","left"],BU=["top","bottom"],WU=["bottom","top"];function GU(t,e,n){switch(t){case"top":case"bottom":return n?e?GC:WC:e?WC:GC;case"left":case"right":return e?BU:WU;default:return[]}}function KU(t,e,n,r){const s=sc(t);let i=GU(sa(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(b_)))),i}function Mm(t){const e=sa(t);return HU[e]+t.slice(e.length)}function ZU(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 V5(t){return typeof t!="number"?ZU(t):{top:t,right:t,bottom:t,left:t}}function Om(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function KC(t,e,n){let{reference:r,floating:s}=t;const i=ui(e),a=vw(e),u=gw(a),c=sa(e),d=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[u]/2-s[u]/2;let y;switch(c){case"top":y={x:h,y:r.y-s.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-s.width,y:p};break;default:y={x:r.x,y:r.y}}const w=sc(e);return w&&(y[a]+=m*(w==="end"?1:-1)*(n&&d?-1:1)),y}async function qU(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:u,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:y=0}=so(e,t),w=V5(y),x=u[m?p==="floating"?"reference":"floating":p],E=Om(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:d,rootBoundary:h,strategy:c})),k=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(u.floating)),T=await(i.isElement==null?void 0:i.isElement(P))&&await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1},A=Om(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:k,offsetParent:P,strategy:c}):k);return{top:(E.top-A.top+w.top)/T.y,bottom:(A.bottom-E.bottom+w.bottom)/T.y,left:(E.left-A.left+w.left)/T.x,right:(A.right-E.right+w.right)/T.x}}const YU=50,XU=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:qU},c=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=KC(d,r,c),m=r,y=0;const w={};for(let _=0;_<i.length;_++){const x=i[_];if(!x)continue;const{name:E,fn:k}=x,{x:P,y:T,data:A,reset:L}=await k({x:h,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:w,rects:d,platform:u,elements:{reference:t,floating:e}});h=P??h,p=T??p,w[E]={...w[E],...A},L&&y<YU&&(y++,typeof L=="object"&&(L.placement&&(m=L.placement),L.rects&&(d=L.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):L.rects),{x:h,y:p}=KC(d,m,c)),_=-1)}return{x:h,y:p,placement:m,strategy:s,middlewareData:w}},QU=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:u,middlewareData:c}=e,{element:d,padding:h=0}=so(t,e)||{};if(d==null)return{};const p=V5(h),m={x:n,y:r},y=vw(s),w=gw(y),_=await a.getDimensions(d),x=y==="y",E=x?"top":"left",k=x?"bottom":"right",P=x?"clientHeight":"clientWidth",T=i.reference[w]+i.reference[y]-m[y]-i.floating[w],A=m[y]-i.reference[y],L=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let O=L?L[P]:0;(!O||!await(a.isElement==null?void 0:a.isElement(L)))&&(O=u.floating[P]||i.floating[w]);const R=T/2-A/2,M=O/2-_[w]/2-1,N=ra(p[E],M),j=ra(p[k],M),F=O-_[w]-j,q=O/2-_[w]/2+R,G=F5(N,q,F),W=!c.arrow&&sc(s)!=null&&q!==G&&i.reference[w]/2-(q<N?N:j)-_[w]/2<0,K=W?q<N?q-N:q-F:0;return{[y]:m[y]+K,data:{[y]:G,centerOffset:q-G-K,...W&&{alignmentOffset:K}},reset:W}}}),JU=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:u,platform:c,elements:d}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...x}=so(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const E=sa(s),k=ui(u),P=sa(u)===u,T=await(c.isRTL==null?void 0:c.isRTL(d.floating)),A=m||(P||!_?[Mm(u)]:UU(u)),L=w!=="none";!m&&L&&A.push(...KU(u,_,w,T));const O=[u,...A],R=await c.detectOverflow(e,x),M=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&M.push(R[E]),p){const G=zU(s,a,T);M.push(R[G[0]],R[G[1]])}if(N=[...N,{placement:s,overflows:M}],!M.every(G=>G<=0)){var j,F;const G=(((j=i.flip)==null?void 0:j.index)||0)+1,W=O[G];if(W&&(!(p==="alignment"?k!==ui(W):!1)||N.every($=>ui($.placement)===k?$.overflows[0]>0:!0)))return{data:{index:G,overflows:N},reset:{placement:W}};let K=(F=N.filter(X=>X.overflows[0]<=0).sort((X,$)=>X.overflows[1]-$.overflows[1])[0])==null?void 0:F.placement;if(!K)switch(y){case"bestFit":{var q;const X=(q=N.filter($=>{if(L){const ee=ui($.placement);return ee===k||ee==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ee=>ee>0).reduce((ee,z)=>ee+z,0)]).sort(($,ee)=>$[1]-ee[1])[0])==null?void 0:q[0];X&&(K=X);break}case"initialPlacement":K=u;break}if(s!==K)return{reset:{placement:K}}}return{}}}};function ZC(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function qC(t){return $U.some(e=>t[e]>=0)}const eB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=so(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),u=ZC(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:qC(u)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),u=ZC(a,n.floating);return{data:{escapedOffsets:u,escaped:qC(u)}}}default:return{}}}}},$5=new Set(["left","top"]);async function tB(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=sa(n),u=sc(n),c=ui(n)==="y",d=$5.has(a)?-1:1,h=i&&c?-1:1,p=so(e,t);let{mainAxis:m,crossAxis:y,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof w=="number"&&(y=u==="end"?w*-1:w),c?{x:y*h,y:m*d}:{x:m*d,y:y*h}}const nB=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:u}=e,c=await tB(e,t);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},rB=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:u=!1,limiter:c={fn:k=>{let{x:P,y:T}=k;return{x:P,y:T}}},...d}=so(t,e),h={x:n,y:r},p=await i.detectOverflow(e,d),m=ui(s),y=mw(m);let w=h[y],_=h[m];const x=(k,P)=>F5(P+p[k==="y"?"top":"left"],P,P-p[k==="y"?"bottom":"right"]);a&&(w=x(y,w)),u&&(_=x(m,_));const E=c.fn({...e,[y]:w,[m]:_});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[y]:a,[m]:u}}}}}},sB=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:a,rects:u,middlewareData:c}=e,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=so(t,e),m={x:s,y:i},y=ui(a),w=mw(y);let _=m[w],x=m[y];const E=so(d,e),k=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(n=E.mainAxis)!=null?n:0,crossAxis:(r=E.crossAxis)!=null?r:0};if(h){const A=w==="y"?"height":"width",L=u.reference[w]-u.floating[A]+k.mainAxis,O=u.reference[w]+u.reference[A]-k.mainAxis;_<L?_=L:_>O&&(_=O)}if(p){var P,T;const A=w==="y"?"width":"height",L=$5.has(sa(a)),O=u.reference[y]-u.floating[A]+(L&&((P=c.offset)==null?void 0:P[y])||0)+(L?0:k.crossAxis),R=u.reference[y]+u.reference[A]+(L?0:((T=c.offset)==null?void 0:T[y])||0)-(L?k.crossAxis:0);x<O?x=O:x>R&&(x=R)}return{[w]:_,[y]:x}}}},iB=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=()=>{},...u}=so(t,e),c=await s.detectOverflow(e,u),d=sa(n),h=sc(n),p=ui(n)==="y",{width:m,height:y}=r.floating;let w,_;d==="top"||d==="bottom"?(w=d,_=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,w=h==="end"?"top":"bottom");const x=y-c.top-c.bottom,E=m-c.left-c.right,k=ra(y-c[w],x),P=ra(m-c[_],E),T=e.middlewareData.shift,A=!T;let L=k,O=P;T!=null&&T.enabled.x&&(O=E),T!=null&&T.enabled.y&&(L=x),A&&!h&&(p?O=m-2*to(c.left,c.right):L=y-2*to(c.top,c.bottom)),await a({...e,availableWidth:O,availableHeight:L});const R=await s.getDimensions(i.floating);return m!==R.width||y!==R.height?{reset:{rects:!0}}:{}}}};function i0(){return typeof window<"u"}function ic(t){return H5(t)?(t.nodeName||"").toLowerCase():"#document"}function Tr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function lo(t){var e;return(e=(H5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function H5(t){return i0()?t instanceof Node||t instanceof Tr(t).Node:!1}function hi(t){return i0()?t instanceof Element||t instanceof Tr(t).Element:!1}function ha(t){return i0()?t instanceof HTMLElement||t instanceof Tr(t).HTMLElement:!1}function YC(t){return!i0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Tr(t).ShadowRoot}function o0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=pi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function oB(t){return/^(table|td|th)$/.test(ic(t))}function a0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const aB=/transform|translate|scale|rotate|perspective|filter/,lB=/paint|layout|strict|content/,ja=t=>!!t&&t!=="none";let a1;function yw(t){const e=hi(t)?pi(t):t;return ja(e.transform)||ja(e.translate)||ja(e.scale)||ja(e.rotate)||ja(e.perspective)||!_w()&&(ja(e.backdropFilter)||ja(e.filter))||aB.test(e.willChange||"")||lB.test(e.contain||"")}function uB(t){let e=_l(t);for(;ha(e)&&!ef(e);){if(yw(e))return e;if(a0(e))return null;e=_l(e)}return null}function _w(){return a1==null&&(a1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),a1}function ef(t){return/^(html|body|#document)$/.test(ic(t))}function pi(t){return Tr(t).getComputedStyle(t)}function l0(t){return hi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function _l(t){if(ic(t)==="html")return t;const e=t.assignedSlot||t.parentNode||YC(t)&&t.host||lo(t);return YC(e)?e.host:e}function z5(t){const e=_l(t);return ef(e)?(t.ownerDocument||t).body:ha(e)&&o0(e)?e:z5(e)}function tf(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=z5(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Tr(s);if(i){const u=S_(a);return e.concat(a,a.visualViewport||[],o0(s)?s:[],u&&n?tf(u):[])}else return e.concat(s,tf(s,[],n))}function S_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function U5(t){const e=pi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=ha(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,u=Im(n)!==i||Im(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function ww(t){return hi(t)?t:t.contextElement}function wu(t){const e=ww(t);if(!ha(e))return no(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=U5(e);let a=(i?Im(n.width):n.width)/r,u=(i?Im(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const cB=no(0);function B5(t){const e=Tr(t);return!_w()||!e.visualViewport?cB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function dB(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Tr(t)}function wl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=ww(t);let a=no(1);e&&(r?hi(r)&&(a=wu(r)):a=wu(t));const u=dB(i,n,r)?B5(i):no(0);let c=(s.left+u.x)/a.x,d=(s.top+u.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(i&&r){const m=Tr(i),y=hi(r)?Tr(r):r;let w=m,_=S_(w);for(;_&&y!==w;){const x=wu(_),E=_.getBoundingClientRect(),k=pi(_),P=E.left+(_.clientLeft+parseFloat(k.paddingLeft))*x.x,T=E.top+(_.clientTop+parseFloat(k.paddingTop))*x.y;c*=x.x,d*=x.y,h*=x.x,p*=x.y,c+=P,d+=T,w=Tr(_),_=S_(w)}}return Om({width:h,height:p,x:c,y:d})}function u0(t,e){const n=l0(t).scrollLeft;return e?e.left+n:wl(lo(t)).left+n}function W5(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-u0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function fB(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=lo(r),u=e?a0(e.floating):!1;if(r===a||u&&i)return n;let c={scrollLeft:0,scrollTop:0},d=no(1);const h=no(0),p=ha(r);if((p||!i)&&((ic(r)!=="body"||o0(a))&&(c=l0(r)),p)){const y=wl(r);d=wu(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const m=a&&!p&&!i?W5(a,c):no(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-c.scrollTop*d.y+h.y+m.y}}function hB(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function pB(t){const e=l0(t),n=t.ownerDocument.body,r=to(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=to(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+u0(t);const a=-e.scrollTop;return pi(n).direction==="rtl"&&(i+=to(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:a}}const mB=25;function gB(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Tr(t),i=lo(t),a=s.visualViewport;let u=i.clientWidth,c=i.clientHeight,d=0,h=0;if(a){const m=!_w()||e==="fixed";r?m||(d=-a.offsetLeft,h=-a.offsetTop):(u=a.width,c=a.height,m&&(d=a.offsetLeft,h=a.offsetTop))}if(u0(i)<=0){const m=i.ownerDocument,y=m.body,w=getComputedStyle(y),_=m.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,x=Math.abs(i.clientWidth-y.clientWidth-_),E=getComputedStyle(i).scrollbarGutter==="stable both-edges"?x/2:x;E<=mB&&(u-=E)}return{width:u,height:c,x:d,y:h}}function vB(t,e){const n=wl(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=wu(t),a=t.clientWidth*i.x,u=t.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:a,height:u,x:c,y:d}}function XC(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=gB(t,n,e);else if(e==="document")r=pB(lo(t));else if(hi(e))r=vB(e,n);else{const s=B5(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Om(r)}function yB(t,e){const n=e.get(t);if(n)return n;let r=tf(t,[],!1).filter(u=>hi(u)&&ic(u)!=="body"),s=null;const i=pi(t).position==="fixed";let a=i?_l(t):t;for(;hi(a)&&!ef(a);){const u=pi(a),c=yw(a),d=s?s.position:i?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&u.position==="static")?r=r.filter(p=>p!==a):s=u,a=_l(a)}return e.set(t,r),r}function _B(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?a0(e)?[]:yB(e,this._c):[].concat(n),r],u=XC(e,a[0],s);let c=u.top,d=u.right,h=u.bottom,p=u.left;for(let m=1;m<a.length;m++){const y=XC(e,a[m],s);c=to(y.top,c),d=ra(y.right,d),h=ra(y.bottom,h),p=to(y.left,p)}return{width:d-p,height:h-c,x:p,y:c}}function wB(t){const{width:e,height:n}=U5(t);return{width:e,height:n}}function xB(t,e,n){const r=ha(e),s=lo(e),i=n==="fixed",a=wl(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const c=no(0);if((r||!i)&&((ic(e)!=="body"||o0(s))&&(u=l0(e)),r)){const m=wl(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&s&&(c.x=u0(s));const d=s&&!r&&!i?W5(s,u):no(0),h=a.left+u.scrollLeft-c.x-d.x,p=a.top+u.scrollTop-c.y-d.y;return{x:h,y:p,width:a.width,height:a.height}}function l1(t){return pi(t).position==="static"}function QC(t,e){if(!ha(t)||pi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return lo(t)===n&&(n=n.ownerDocument.body),n}function G5(t,e){const n=Tr(t);if(a0(t))return n;if(!ha(t)){let s=_l(t);for(;s&&!ef(s);){if(hi(s)&&!l1(s))return s;s=_l(s)}return n}let r=QC(t,e);for(;r&&oB(r)&&l1(r);)r=QC(r,e);return r&&ef(r)&&l1(r)&&!yw(r)?n:r||uB(t)||n}const bB=async function(t){const e=this.getOffsetParent||G5,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 SB(t){return pi(t).direction==="rtl"}const EB={convertOffsetParentRelativeRectToViewportRelativeRect:fB,getDocumentElement:lo,getClippingRect:_B,getOffsetParent:G5,getElementRects:bB,getClientRects:hB,getDimensions:wB,getScale:wu,isElement:hi,isRTL:SB};function K5(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function CB(t,e,n){let r=null,s;const i=lo(t);function a(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function u(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),a();const m=t.getBoundingClientRect(),{left:y,top:w,width:_,height:x}=m;if(h||e(),!_||!x)return;const E=cp(w),k=cp(i.clientWidth-(y+_)),P=cp(i.clientHeight-(w+x)),T=cp(y),L={rootMargin:-E+"px "+-k+"px "+-P+"px "+-T+"px",threshold:to(0,ra(1,p))||1};let O=!0;function R(M){const N=M[0].intersectionRatio;if(!K5(m,t.getBoundingClientRect()))return u();if(N!==p){if(!O)return u();N?u(!1,N):s=setTimeout(()=>{u(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(R,{...L,root:i.ownerDocument})}catch{r=new IntersectionObserver(R,L)}r.observe(t)}const c=Tr(t),d=()=>u(n);return c.addEventListener("resize",d),u(!0),()=>{c.removeEventListener("resize",d),a()}}function kB(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=ww(t),h=s||i?[...d?tf(d):[],...e?tf(e):[]]:[];h.forEach(E=>{s&&E.addEventListener("scroll",n),i&&E.addEventListener("resize",n)});const p=d&&u?CB(d,n,i):null;let m=-1,y=null;a&&(y=new ResizeObserver(E=>{let[k]=E;k&&k.target===d&&y&&e&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var P;(P=y)==null||P.observe(e)})),n()}),d&&!c&&y.observe(d),e&&y.observe(e));let w,_=c?wl(t):null;c&&x();function x(){const E=wl(t);_&&!K5(_,E)&&n(),_=E,w=requestAnimationFrame(x)}return n(),()=>{var E;h.forEach(k=>{s&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),p==null||p(),(E=y)==null||E.disconnect(),y=null,c&&cancelAnimationFrame(w)}}const PB=nB,TB=rB,RB=JU,AB=iB,IB=eB,JC=QU,MB=sB,OB=(t,e,n)=>{const r=new Map,s=n??{},i={...EB,...s.platform,_c:r};return XU(t,e,{...s,platform:i})};var LB=typeof document<"u",NB=function(){},Np=LB?v.useLayoutEffect:NB;function Lm(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(!Lm(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)&&!Lm(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function Z5(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ek(t,e){const n=Z5(t);return Math.round(e*n)/n}function u1(t){const e=v.useRef(t);return Np(()=>{e.current=t}),e}function DB(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:u=!0,whileElementsMounted:c,open:d}=t,[h,p]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,y]=v.useState(r);Lm(m,r)||y(r);const[w,_]=v.useState(null),[x,E]=v.useState(null),k=v.useCallback($=>{$!==L.current&&(L.current=$,_($))},[]),P=v.useCallback($=>{$!==O.current&&(O.current=$,E($))},[]),T=i||w,A=a||x,L=v.useRef(null),O=v.useRef(null),R=v.useRef(h),M=c!=null,N=u1(c),j=u1(s),F=u1(d),q=v.useCallback(()=>{if(!L.current||!O.current)return;const $={placement:e,strategy:n,middleware:m};j.current&&($.platform=j.current),OB(L.current,O.current,$).then(ee=>{const z={...ee,isPositioned:F.current!==!1};G.current&&!Lm(R.current,z)&&(R.current=z,t0.flushSync(()=>{p(z)}))})},[m,e,n,j,F]);Np(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[d]);const G=v.useRef(!1);Np(()=>(G.current=!0,()=>{G.current=!1}),[]),Np(()=>{if(T&&(L.current=T),A&&(O.current=A),T&&A){if(N.current)return N.current(T,A,q);q()}},[T,A,q,N,M]);const W=v.useMemo(()=>({reference:L,floating:O,setReference:k,setFloating:P}),[k,P]),K=v.useMemo(()=>({reference:T,floating:A}),[T,A]),X=v.useMemo(()=>{const $={position:n,left:0,top:0};if(!K.floating)return $;const ee=ek(K.floating,h.x),z=ek(K.floating,h.y);return u?{...$,transform:"translate("+ee+"px, "+z+"px)",...Z5(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:z}},[n,u,K.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:q,refs:W,elements:K,floatingStyles:X}),[h,q,W,K,X])}const jB=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?JC({element:r.current,padding:s}).fn(n):{}:r?JC({element:r,padding:s}).fn(n):{}}}},FB=(t,e)=>{const n=PB(t);return{name:n.name,fn:n.fn,options:[t,e]}},VB=(t,e)=>{const n=TB(t);return{name:n.name,fn:n.fn,options:[t,e]}},$B=(t,e)=>({fn:MB(t).fn,options:[t,e]}),HB=(t,e)=>{const n=RB(t);return{name:n.name,fn:n.fn,options:[t,e]}},zB=(t,e)=>{const n=AB(t);return{name:n.name,fn:n.fn,options:[t,e]}},UB=(t,e)=>{const n=IB(t);return{name:n.name,fn:n.fn,options:[t,e]}},BB=(t,e)=>{const n=jB(t);return{name:n.name,fn:n.fn,options:[t,e]}};function q5(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,u;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,u=d.blockSize}else a=t.offsetWidth,u=t.offsetHeight;n({width:a,height:u})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var WB=Object.defineProperty,qo=(t,e)=>WB(t,"name",{value:e,configurable:!0}),Y5="Popper",[X5,c0]=ua(Y5),[GB,Q5]=X5(Y5),KB=qo(t=>{const{__scopePopper:e,children:n}=t,[r,s]=v.useState(null),[i,a]=v.useState(void 0);return S.jsx(GB,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})},"Popper"),ZB="PopperAnchor",qB=v.forwardRef(qo(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,a=Q5(ZB,r),u=v.useRef(null),c=a.onAnchorChange,d=v.useCallback(_=>{u.current=_,_&&c(_)},[c]),h=ln(n,d),p=v.useRef(null);v.useEffect(()=>{if(!s)return;const _=p.current;p.current=s.current,_!==p.current&&c(p.current)});const m=a.placementState&&d0(a.placementState),y=m==null?void 0:m[0],w=m==null?void 0:m[1];return s?null:S.jsx(un.div,{"data-radix-popper-side":y,"data-radix-popper-align":w,...i,ref:h})},"PopperAnchor")),J5="PopperContent",[YB,nJ]=X5(J5),XB=v.forwardRef(qo(function(e,n){var se,he,Pe,be,$e,ot,Zt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:u=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:y=!1,updatePositionStrategy:w="optimized",onPlaced:_,...x}=e,E=Q5(J5,r),[k,P]=v.useState(null),T=ln(n,P),[A,L]=v.useState(null),O=q5(A),R=(O==null?void 0:O.width)??0,M=(O==null?void 0:O.height)??0,N=s+(a!=="center"?"-"+a:""),j=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},F=Array.isArray(h)?h:[h],q=F.length>0,G={padding:j,boundary:F.filter(eR),altBoundary:q},{refs:W,floatingStyles:K,placement:X,isPositioned:$,middlewareData:ee}=DB({strategy:"fixed",placement:N,whileElementsMounted:qo((...ge)=>kB(...ge,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:E.anchor},middleware:[FB({mainAxis:i+M,alignmentAxis:u}),d&&VB({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?$B():void 0,...G}),d&&HB({...G}),zB({...G,apply:qo(({elements:ge,rects:gt,availableWidth:dt,availableHeight:je})=>{const{width:Je,height:it}=gt.reference,Ze=ge.floating.style;Ze.setProperty("--radix-popper-available-width",`${dt}px`),Ze.setProperty("--radix-popper-available-height",`${je}px`),Ze.setProperty("--radix-popper-anchor-width",`${Je}px`),Ze.setProperty("--radix-popper-anchor-height",`${it}px`)},"apply")}),A&&BB({element:A,padding:c}),QB({arrowWidth:R,arrowHeight:M}),y&&UB({strategy:"referenceHidden",...G,boundary:q?G.boundary:void 0})]}),z=E.setPlacementState;Pr(()=>(z(X),()=>{z(void 0)}),[X,z]);const[D,Y]=d0(X),te=Zu(_);Pr(()=>{$&&(te==null||te())},[$,te]);const ie=(se=ee.arrow)==null?void 0:se.x,ae=(he=ee.arrow)==null?void 0:he.y,ue=((Pe=ee.arrow)==null?void 0:Pe.centerOffset)!==0,[Ce,oe]=v.useState();return Pr(()=>{k&&oe(window.getComputedStyle(k).zIndex)},[k]),S.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:$?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ce,"--radix-popper-transform-origin":[(be=ee.transformOrigin)==null?void 0:be.x,($e=ee.transformOrigin)==null?void 0:$e.y].join(" "),...((ot=ee.hide)==null?void 0:ot.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(YB,{scope:r,placedSide:D,placedAlign:Y,onArrowChange:L,arrowX:ie,arrowY:ae,shouldHideArrow:ue,children:S.jsx(un.div,{"data-side":D,"data-align":Y,...x,ref:T,style:{...x.style,animation:$?(Zt=x.style)==null?void 0:Zt.animation:"none"}})})})},"PopperContent"));function eR(t){return t!==null}qo(eR,"isNotNull");var QB=qo(t=>({name:"transformOrigin",options:t,fn(e){var x,E,k;const{placement:n,rects:r,middlewareData:s}=e,a=((x=s.arrow)==null?void 0:x.centerOffset)!==0,u=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[d,h]=d0(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((E=s.arrow)==null?void 0:E.x)??0)+u/2,y=(((k=s.arrow)==null?void 0:k.y)??0)+c/2;let w="",_="";return d==="bottom"?(w=a?p:`${m}px`,_=`${-c}px`):d==="top"?(w=a?p:`${m}px`,_=`${r.floating.height+c}px`):d==="right"?(w=`${-c}px`,_=a?p:`${y}px`):d==="left"&&(w=`${r.floating.width+c}px`,_=a?p:`${y}px`),{data:{x:w,y:_}}}}),"transformOrigin");function d0(t){const[e,n="center"]=t.split("-");return[e,n]}qo(d0,"getSideAndAlignFromPlacement");var tR=KB,nR=qB,rR=XB,JB=Object.defineProperty,pa=(t,e)=>JB(t,"name",{value:e,configurable:!0}),xw="Popover",[sR]=ua(xw,[c0]),bw=c0(),[eW,oc]=sR(xw),tW=pa(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,u=bw(e),c=v.useRef(null),[d,h]=v.useState(!1),[p,m]=ca({prop:r,defaultProp:s??!1,onChange:i,caller:xw});return S.jsx(tR,{...u,children:S.jsx(eW,{scope:e,contentId:hl(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:v.useCallback(()=>m(y=>!y),[m]),hasCustomAnchor:d,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:a,children:n})})},"Popover"),nW="PopoverTrigger",rW=v.forwardRef(pa(function(e,n){const{__scopePopover:r,...s}=e,i=oc(nW,r),a=bw(r),u=ln(n,i.triggerRef),c=S.jsx(un.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Sw(i.open),...s,ref:u,onClick:Lt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:S.jsx(nR,{asChild:!0,...a,children:c})},"PopoverTrigger")),iR="PopoverPortal",[sW,iW]=sR(iR,{forceMount:void 0}),oW=pa(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=oc(iR,e);return S.jsx(sW,{scope:e,forceMount:n,children:S.jsx(da,{present:n||i.open,children:S.jsx(tw,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),nf="PopoverContent",aW=v.forwardRef(pa(function(e,n){const r=iW(nf,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,a=oc(nf,e.__scopePopover);return S.jsx(da,{present:s||a.open,children:a.modal?S.jsx(uW,{...i,ref:n}):S.jsx(cW,{...i,ref:n})})},"PopoverContent")),lW=Gd("PopoverContent.RemoveScroll"),uW=v.forwardRef(pa(function(e,n){const r=oc(nf,e.__scopePopover),s=v.useRef(null),i=ln(n,s),a=v.useRef(!1);return v.useEffect(()=>{const u=s.current;if(u)return LT(u)},[]),S.jsx(nw,{as:lW,allowPinchZoom:!0,children:S.jsx(oR,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lt(e.onCloseAutoFocus,u=>{var c;u.preventDefault(),a.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Lt(e.onPointerDownOutside,u=>{const c=u.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,h=c.button===2||d;a.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Lt(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),cW=v.forwardRef(pa(function(e,n){const r=oc(nf,e.__scopePopover),s=v.useRef(!1),i=v.useRef(!1);return S.jsx(oR,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,a),a.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"PopoverContentNonModal")),oR=v.forwardRef(pa(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,...m}=e,y=oc(nf,r),w=bw(r);return CT(),S.jsx(pT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:S.jsx(Q2,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onDismiss:()=>y.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(rR,{"data-state":Sw(y.open),role:"dialog",id:y.contentId,...w,...m,ref:n,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function Sw(t){return t?"open":"closed"}pa(Sw,"getState");var aR=tW,lR=rW,uR=oW,cR=aW;const dR=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:a,dropdownAriaLabel:u="More actions",dropdownItems:c})=>{const[d,h]=v.useState(!1),p=i?a??t:t,m=c.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?S.jsxs(aR,{open:d,onOpenChange:h,children:[S.jsx(lR,{asChild:!0,children:S.jsx("button",{"aria-label":u,disabled:s||i,title:u,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(hz,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(uR,{children:S.jsx(cR,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(y=>{const w=y.icon;return S.jsxs("button",{onClick:()=>{y.isDisabled||(y.onClick(),h(!1))},disabled:y.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[w?S.jsx(w,{className:"h-3.5 w-3.5",weight:"bold"}):null,y.label]},y.label)})})})]}):null]})};var dW=Object.defineProperty,fW=(t,e)=>dW(t,"name",{value:e,configurable:!0}),hW=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"}),pW=v.forwardRef(fW(function(e,n){return S.jsx(un.span,{...e,ref:n,style:{...hW,...e.style}})},"VisuallyHidden")),mW=pW,gW=Object.defineProperty,Tn=(t,e)=>gW(t,"name",{value:e,configurable:!0}),[Ew]=ua("Tooltip",[c0]),Cw=c0(),vW="TooltipProvider",yW=700,E_="tooltip.open",[_W,kw]=Ew(vW),wW=Tn(t=>{const{__scopeTooltip:e,delayDuration:n=yW,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=v.useRef(!0),u=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),S.jsx(_W,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:v.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),C_="Tooltip",[xW,Tf]=Ew(C_),bW=Tn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=t,c=kw(C_,t.__scopeTooltip),d=Cw(e),[h,p]=v.useState(null),[m,y]=v.useState(void 0),w=hl(),_=v.useRef(0),x=a??c.disableHoverableContent,E=u??c.delayDuration,k=v.useRef(!1),[P,T]=ca({prop:r,defaultProp:s??!1,onChange:Tn(N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(E_))):c.onClose(),i==null||i(N)},"onChange"),caller:C_}),A=v.useMemo(()=>P?k.current?"delayed-open":"instant-open":"closed",[P]),L=v.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k.current=!1,T(!0)},[T]),O=v.useCallback(()=>{window.clearTimeout(_.current),_.current=0,T(!1)},[T]),R=v.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{k.current=!0,T(!0),_.current=0},E)},[E,T]);v.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const M=m??w;return S.jsx(tR,{...d,children:S.jsx(xW,{scope:e,contentId:M,setContentId:y,open:P,stateAttribute:A,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?R():L()},[c.isOpenDelayedRef,R,L]),onTriggerLeave:v.useCallback(()=>{x?O():(window.clearTimeout(_.current),_.current=0)},[O,x]),onOpen:L,onClose:O,disableHoverableContent:x,children:n})})},"Tooltip"),tk="TooltipTrigger",SW=v.forwardRef(Tn(function(e,n){const{__scopeTooltip:r,...s}=e,i=Tf(tk,r),a=kw(tk,r),u=Cw(r),c=v.useRef(null),d=ln(n,c,i.onTriggerChange),h=v.useRef(!1),p=v.useRef(!1),m=v.useCallback(()=>h.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),S.jsx(nR,{asChild:!0,...u,children:S.jsx(un.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:Lt(e.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:Lt(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:Lt(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Lt(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:Lt(e.onBlur,i.onClose),onClick:Lt(e.onClick,i.onClose)})})},"TooltipTrigger")),fR="TooltipPortal",[EW,CW]=Ew(fR,{forceMount:void 0}),kW=Tn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Tf(fR,e);return S.jsx(EW,{scope:e,forceMount:n,children:S.jsx(da,{present:n||i.open,children:S.jsx(tw,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),rf="TooltipContent",PW=v.forwardRef(Tn(function(e,n){const r=CW(rf,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...a}=e,u=Tf(rf,e.__scopeTooltip);return S.jsx(da,{present:s||u.open,children:u.disableHoverableContent?S.jsx(hR,{side:i,...a,ref:n}):S.jsx(TW,{side:i,...a,ref:n})})},"TooltipContent")),TW=v.forwardRef(Tn(function(e,n){const r=Tf(rf,e.__scopeTooltip),s=kw(rf,e.__scopeTooltip),i=v.useRef(null),a=ln(n,i),[u,c]=v.useState(null),{trigger:d,onClose:h}=r,p=i.current,{onPointerInTransitChange:m}=s,y=v.useCallback(()=>{c(null),m(!1)},[m]),w=v.useCallback((_,x)=>{const E=_.currentTarget,k={x:_.clientX,y:_.clientY},P=pR(k,E.getBoundingClientRect()),T=mR(k,P),A=gR(x.getBoundingClientRect()),L=yR([...T,...A]);c(L),m(!0)},[m]);return v.useEffect(()=>()=>y(),[y]),v.useEffect(()=>{if(d&&p){const _=Tn(E=>w(E,p),"handleTriggerLeave"),x=Tn(E=>w(E,d),"handleContentLeave");return d.addEventListener("pointerleave",_),p.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",_),p.removeEventListener("pointerleave",x)}}},[d,p,w,y]),v.useEffect(()=>{if(u){const _=Tn(x=>{const E=x.target,k={x:x.clientX,y:x.clientY},P=(d==null?void 0:d.contains(E))||(p==null?void 0:p.contains(E)),T=!vR(k,u);P?y():T&&(y(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,p,u,h,y]),S.jsx(hR,{...e,ref:a})},"TooltipContentHoverable")),RW=L$("TooltipContent"),hR=v.forwardRef(Tn(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:a,onEscapeKeyDown:u,onPointerDownOutside:c,...d}=e,h=Tf(rf,r),p=Cw(r),{onClose:m}=h;v.useEffect(()=>(document.addEventListener(E_,m),()=>document.removeEventListener(E_,m)),[m]),v.useEffect(()=>{if(h.trigger){const w=Tn(_=>{_.target instanceof Node&&_.target.contains(h.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[h.trigger,m]);const{setContentId:y}=h;return Pr(()=>(y(a),()=>{y(void 0)}),[a,y]),S.jsx(Q2,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:w=>w.preventDefault(),onDismiss:m,children:S.jsxs(rR,{"data-state":h.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:h.contentId,...p,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(RW,{children:s}),i?S.jsx(mW,{id:h.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function pR(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Tn(pR,"getExitSideFromRect");function mR(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Tn(mR,"getPaddedExitPoints");function gR(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}Tn(gR,"getPointsFromRect");function vR(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 u=e[i],c=e[a],d=u.x,h=u.y,p=c.x,m=c.y;h>r!=m>r&&n<(p-d)*(r-h)/(m-h)+d&&(s=!s)}return s}Tn(vR,"isPointInPolygon");function yR(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),_R(e)}Tn(yR,"getHull");function _R(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Tn(_R,"getHullPresorted");var AW=wW,IW=bW,MW=SW,OW=kW,LW=PW;const Pd={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},wR={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"}},xR=v.createContext(null);function f0(){const t=v.useContext(xR);return t?t.classes:wR.pill}function NW(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function DW({children:t,defaultShape:e="pill"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{NW(()=>r(i))},[]);return S.jsx(xR.Provider,{value:{shape:n,setShape:s,classes:wR[n]},children:t})}const bR=v.createContext(null);function SR({value:t,children:e}){return S.jsx(bR.Provider,{value:t,children:e})}function jW(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function Pw({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:a,onOpenChange:u}){const[c,d]=v.useState(!1),h=a!==void 0?a:c,[p,m]=v.useState(!1),y=f0(),w=v.useContext(bR);v.useEffect(()=>{h&&m(!0)},[h]);const _=()=>{h||m(!1)},x=jW(n);return S.jsx(AW,{delayDuration:s,children:S.jsxs(IW,{open:h,onOpenChange:E=>{d(E),u==null||u(E)},children:[S.jsx(MW,{asChild:!0,children:e}),p&&S.jsx(OW,{forceMount:!0,container:w??void 0,children:S.jsx(LW,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(eo.div,{className:dr("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",y.bg,i),style:{fontVariationSettings:Pd.medium},initial:{opacity:0,scale:.8,...x},animate:{opacity:h?1:0,scale:h?1:.9,x:0,y:0},transition:h?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const Bo=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:a})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(Pw,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),h0="/__rivet/preview",nk=`${h0}/variant/`,rk=`${h0}/history/`,ER=t=>t?t.startsWith("/")?t:`/${t}`:"/",FW=t=>`${h0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${ER(t.routePath)}`,VW=t=>`${h0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${ER(t.routePath)}`,$W=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(nk)||e.pathname.startsWith(rk)}catch{return t.startsWith(nk)||t.startsWith(rk)}},sk=t=>{var s,i,a,u;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")?FW({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"&&((u=n.preview)==null?void 0:u.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},ik="/rivet/",CR=t=>{if(!t.startsWith(ik))return null;const e=t.slice(ik.length);return!e||e==="/"?null:`/${e}`},sf=(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(()=>{})},HW=(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),sf(r,e))}},ok=6,k_="original",Tw="Original",Rw="The original state of your app before any variants were generated.",ak=200,pn=vs("AgentVariantsPanel"),c1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},zW=t=>t?t.kind==="active"?t.variant.workItemId:`${t.entry.sessionId}:${t.entry.variantId}`:null,nu=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},UW=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function xu(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}async function Li(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 BW=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},Za=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")},kR=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},PR=t=>t.status==="succeeded"&&!Za(t)&&(!t.previewUnavailable||kR(t)),d1=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"},lk=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},WW=t=>{var e;return BW(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},uk=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),GW=(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}),KW=()=>{var hc,va,Dr,Df;const t=Qe(kf),e=Qe(M5),n=Qe(O5),r=Qe(Pf),s=Qe(x_),i=((hc=s.deployPrototype)==null?void 0:hc.isEnabled)??!1,a=((va=s.canvasShare)==null?void 0:va.isEnabled)??!1,u=((Dr=s.variantSend)==null?void 0:Dr.isEnabled)??!1,c=((Df=s.designContextViewer)==null?void 0:Df.isEnabled)??!1,d=Qe(D5),h=Qe(j5),p=st(g_),m=st(Am),y=st(v_),w=st(y_),_=st(A5),x=st(I5),E=st(Jd),k=st(hw),P=st(P5);v.useEffect(()=>(P("Directions"),()=>P(null)),[P]);const T=Qe(na),A=st(na),L=v.useCallback(()=>{HW(T),A(null)},[A,T]),O=Qe(__),R=st(__),M=Qe(w_),N=st(w_),j=M?`${M.sessionId}:${M.variantId}`:null,[F,q]=v.useState(""),[G,W]=v.useState(null),[K,X]=v.useState(null),[$,ee]=v.useState({}),[z,D]=v.useState(null),[Y,te]=v.useState({}),[ie,ae]=v.useState(null),[ue,Ce]=v.useState([]),oe=v.useRef([]);oe.current=ue;const[se,he]=v.useState(!1),Pe=v.useRef(!1);Pe.current=M!==null||O!==null||se;const be=v.useMemo(()=>t.active?t.variants:[],[t]),$e=v.useMemo(()=>be.filter(WW),[be]),ot=v.useMemo(()=>uk($e,$),[$e,$]),Zt=(z==null?void 0:z.key)===ot?z.shareUrl:null,ge=t.active?t.sessionId:null,gt=v.useMemo(()=>{const H=new Set;if(!ge)return H;for(const le of be)H.add(`${ge}:${le.workItemId}`),le.adoptedSource&&H.add(`${le.adoptedSource.sessionId}:${le.adoptedSource.variantId}`);return H},[ge,be]),dt=v.useMemo(()=>[...ue.filter(le=>!gt.has(`${le.sessionId}:${le.variantId}`))].sort((le,Re)=>{const ve=new Date(le.createdAt).getTime(),pe=new Date(Re.createdAt).getTime();return(Number.isNaN(pe)?0:pe)-(Number.isNaN(ve)?0:ve)}),[ue,gt]),je=v.useMemo(()=>M?be.find(H=>{var le,Re;return((le=H.adoptedSource)==null?void 0:le.sessionId)===M.sessionId&&((Re=H.adoptedSource)==null?void 0:Re.variantId)===M.variantId})??null:null,[M,be]),Je=v.useMemo(()=>M?dt.find(H=>H.sessionId===M.sessionId&&H.variantId===M.variantId)??null:null,[M,dt]),it=t.active?t.projectContext:null,Ze=(it==null?void 0:it.kind)==="fresh"?it.workspacePath:n,_t=!t.active&&dt.length>0&&dt.every(H=>H.projectKind==="fresh"),xn=t.active?UW(it):!!n&&!_t,jt=v.useMemo(()=>Ze?`?projectPath=${encodeURIComponent(Ze)}`:"",[Ze]),An=v.useRef(null),zn=v.useRef(null),Lr=typeof window>"u"?"/":CR(window.location.pathname)??"/",Jn=v.useRef(null),bn=v.useRef(!1),Vs=v.useCallback((H,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),c1(),Jn.current={kind:"live",variantId:H,startX:le.clientX,startY:le.clientY,committed:!1})},[]),$s=v.useCallback((H,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),c1(),Jn.current={kind:"past",entry:H,startX:le.clientX,startY:le.clientY,committed:!1})},[]);v.useEffect(()=>{const H=ve=>{const pe=Jn.current;if(!pe)return;const ke=ve.clientX-pe.startX,We=ve.clientY-pe.startY;if(!pe.committed){if(ke*ke+We*We<ok*ok)return;if(c1(),pe.kind==="live"){const Ee=be.find(pr=>pr.workItemId===pe.variantId);if(!Ee||Ee.status!=="succeeded"){Jn.current=null;return}const tr=sk({sessionId:ge,variant:Ee,projectContext:it,routePath:Lr});E({sessionId:ge??"",variantId:Ee.workItemId,label:Ee.label||"Direction",url:tr,source:"live",runLabel:Ee.runLabel,description:Ee.description})}else{const{entry:Ee}=pe,tr=nu(Ee),pr=tr?VW({sessionId:Ee.sessionId,variantId:Ee.variantId,routePath:Lr}):`/api/variants/history/${encodeURIComponent(Ee.sessionId)}/${encodeURIComponent(Ee.variantId)}/preview${jt}`;if(E({sessionId:Ee.sessionId,variantId:Ee.variantId,label:Ee.label||"Direction",url:pr,source:tr?"history-dev-server":"history-static",runLabel:Ee.runLabel,description:Ee.brief}),tr){const es=lk(`/api/variants/history/${encodeURIComponent(Ee.sessionId)}/${encodeURIComponent(Ee.variantId)}/run${jt}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(es,{method:"POST"})).ok)return;const ts=lk(pr,"replay",String(Date.now()));E(rn=>!rn||rn.sessionId!==Ee.sessionId||rn.variantId!==Ee.variantId||rn.source!=="history-dev-server"?rn:{...rn,url:ts}),A(rn=>{if(!rn)return rn;const Ws=bs=>!bs||bs.sessionId!==Ee.sessionId||bs.variantId!==Ee.variantId?bs:{...bs,url:ts};return{...rn,left:Ws(rn.left),right:Ws(rn.right)}})}catch(xs){pn.warn("history replay drag boot failed",xs)}})()}}pe.committed=!0}k({x:ve.clientX,y:ve.clientY})},le=()=>{const ve=Jn.current;ve!=null&&ve.committed&&(bn.current=!0),Jn.current=null,k(null)},Re=ve=>{if(ve.key!=="Escape")return;const pe=Jn.current;pe!=null&&pe.committed&&(pe.kind==="past"&&nu(pe.entry)&&sf({sessionId:pe.entry.sessionId,variantId:pe.entry.variantId,source:"history-dev-server"}),Jn.current=null,E(null),k(null))};return window.addEventListener("pointermove",H),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",Re),()=>{window.removeEventListener("pointermove",H),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",Re)}},[be,ge,it,Lr,jt,E,k,A]);const In=v.useMemo(()=>{var le;if(se||j)return null;const H=O?be.find(Re=>Re.workItemId===O):null;return O&&!H?null:H?Za(H)?H.workItemId:null:t.active?((le=be.find(Re=>{var ve,pe;return Za(Re)&&(((ve=Re.preview)==null?void 0:ve.kind)==="static_artifact"||((pe=Re.preview)==null?void 0:pe.kind)==="dev_server")}))==null?void 0:le.workItemId)??null:null},[O,j,se,t,be]),vi=v.useCallback(async H=>{var Re,ve,pe,ke;if(!ge)return;const le=(H==null?void 0:H.workItemId)??null;W({kind:"switch",variantId:le??void 0});try{if(((Re=H==null?void 0:H.preview)==null?void 0:Re.kind)==="static_artifact"){if(y(!1),w(null),((ve=H.refinement)==null?void 0:ve.status)==="succeeded"){const Ee=H.preview.url.includes("?")?"&":"?";m(`${H.preview.url}${Ee}refinement=${encodeURIComponent(H.refinement.workItemId)}`)}else m(H.preview.url);p(Ee=>Ee+1);return}if(le&&ge&&t.active&&t.projectContext.kind==="fresh"&&((pe=t.projectContext.executionPlan)==null?void 0:pe.mode)!=="vite_app"&&((ke=H==null?void 0:H.preview)==null?void 0:ke.kind)!=="dev_server"){y(!1),w(null),m(`/api/variants/${ge}/static/${le}`),p(Ee=>Ee+1);return}const We=H&&le?sk({sessionId:ge,variant:H,projectContext:t.active?t.projectContext:null,routePath:Lr}):null;if(We){y(!1),w(null),m(We),p(Ee=>Ee+1);return}Te.capture("variants_panel.preview_display_failed",{sessionId:ge,variantId:le,previewKind:H?d1(H):"none",hasPreview:!!(H!=null&&H.preview),hasPort:typeof(H==null?void 0:H.port)=="number",errorMessage:"No addressable dev-server preview URL"}),y(!1),w(null)}catch(We){pn.warn("preview display failed",We),Te.capture("variants_panel.preview_display_failed",{sessionId:ge,variantId:le,previewKind:H?d1(H):"none",hasPreview:!!(H!=null&&H.preview),hasPort:typeof(H==null?void 0:H.port)=="number",errorMessage:We instanceof Error?We.message:String(We)}),y(!1),w(null)}finally{W(null)}},[ge,t,Lr,p,m,y,w]),yi=v.useRef(!1),ys=v.useRef(null),Hs=v.useRef(0),fr=v.useCallback(()=>{if(Hs.current++,_(!1),x(!1),!yi.current)return;const H=ys.current;yi.current=!1,ys.current=null;const le=H?new URLSearchParams({sessionId:H.sessionId,variantId:H.variantId}):null,Re=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(Re,{method:"POST"}).catch(ve=>pn.warn("history replay stop failed",ve))},[_,x]),er=v.useCallback(async H=>{if(ge){W({kind:"switch",variantId:H.workItemId});try{const le=await fetch(`/api/variants/${ge}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:H.workItemId})});if(!le.ok){const Re=await Li(le);throw new Error(Re.message??`Preview restoration failed (${le.status})`)}}catch(le){pn.warn("preview restoration failed",le),Te.capture("variants_panel.preview_display_failed",{sessionId:ge,variantId:H.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:le instanceof Error?le.message:String(le)})}finally{W(null)}}},[ge]),zs=v.useCallback(H=>{var ke,We,Ee,tr,pr;if(bn.current){bn.current=!1;return}const le=Za(H),Re=H.status==="pending"||H.status==="running"||PR(H);if(!le&&!Re)return;fr();const ve=d1(H),pe=be.find(es=>es.workItemId===O);Te.capture("variants_panel.preview_requested",{sessionId:ge,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:H.workItemId,variantStatus:H.status,isPreviewReady:le,isArmed:Re,previewKind:ve,hasPreview:!!H.preview,hasPort:typeof H.port=="number",viewEnabled:((We=(ke=H.actions)==null?void 0:ke.view)==null?void 0:We.enabled)??null,previewUnavailableReason:((Ee=H.previewUnavailable)==null?void 0:Ee.reason)??null}),R(H.workItemId),N(null),le?(zn.current=H.workItemId,he(!1),L(),vi(H)):(zn.current=null,he(!1),m(null),y(!1),Te.capture("variants_panel.preview_armed",{sessionId:ge,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:H.workItemId,variantStatus:H.status,previewKind:ve,hasPreview:!!H.preview,hasPort:typeof H.port=="number",viewEnabled:((pr=(tr=H.actions)==null?void 0:tr.view)==null?void 0:pr.enabled)??null}),kR(H)&&er(H)),Te.capture("variants_panel.preview_switched",{sessionId:ge,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:H.workItemId,armed:Re})},[O,ge,L,R,N,fr,er,vi,be,m,y]),_s=t.active?`${t.sessionId}:${t.stage}`:"inactive",Nr=v.useRef(!1);v.useEffect(()=>{if(r)return;let H=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${jt}`,{credentials:"same-origin"});if(!le.ok)return;const Re=await le.json();if(H)return;const ve=(Re.variants??[]).filter(pe=>{var ke,We;return((ke=pe.preview)==null?void 0:ke.kind)==="static"||((We=pe.serve)==null?void 0:We.kind)==="static"||nu(pe)});if(!Nr.current&&!Pe.current&&_s==="inactive"&&ve.length>0&&ve.every(pe=>pe.projectKind==="fresh")){const pe=[...ve].sort((ke,We)=>new Date(We.createdAt).getTime()-new Date(ke.createdAt).getTime()).find(ke=>!nu(ke));pe&&(Nr.current=!0,N({sessionId:pe.sessionId,variantId:pe.variantId,previewKind:"static"}),he(!1),m(`/api/variants/history/${encodeURIComponent(pe.sessionId)}/${encodeURIComponent(pe.variantId)}/preview${jt}`))}if(GW(oe.current,ve))return;oe.current=ve,Ce(ve)}catch(le){pn.warn("Failed to load past variants",le)}})(),()=>{H=!0}},[r,_s,jt]);const _i=v.useCallback(()=>{yi.current=!1,ys.current=null,_(!1),x(!1),N(null),R(null),he(!0),y(!1),w(null),m(null),p(H=>H+1)},[R,_,x,p,m,w,N,y]),Ke=v.useCallback(H=>{if(bn.current){bn.current=!1;return}if(L(),N({sessionId:H.sessionId,variantId:H.variantId,previewKind:nu(H)?"dev_server":"static"}),R(null),he(!1),nu(H)){const le=++Hs.current;yi.current=!0,ys.current={sessionId:H.sessionId,variantId:H.variantId},_(!0),x(!0),(async()=>{W({kind:"switch"}),Te.capture("variants_panel.history_replay_started",{sessionId:H.sessionId,variantId:H.variantId});const Re=ve=>Te.capture("variants_panel.history_replay_failed",{sessionId:H.sessionId,variantId:H.variantId,...ve});try{const ve=await fetch(`/api/variants/history/${encodeURIComponent(H.sessionId)}/${encodeURIComponent(H.variantId)}/run${jt}`,{method:"POST"});if(le!==Hs.current)return;if(!ve.ok){const{errorCode:pe}=await Li(ve);pn.warn(`history replay failed: HTTP ${ve.status} ${pe??""}`),Re({httpStatus:ve.status,errorCode:pe}),_i();return}x(!1),y(!0),w(null),m(null),p(pe=>pe+1),Te.capture("variants_panel.history_replay_ready",{sessionId:H.sessionId,variantId:H.variantId})}catch(ve){if(le!==Hs.current)return;pn.warn("history replay failed",ve),Re({errorMessage:ve instanceof Error?ve.message:String(ve)}),_i()}finally{W(null)}})();return}fr(),y(!1),w(null),m(`/api/variants/history/${encodeURIComponent(H.sessionId)}/${encodeURIComponent(H.variantId)}/preview${jt}`)},[_i,W,_,x,p,N,R,m,w,L,y,fr,jt]),At=v.useCallback(async()=>{fr();const H=()=>{L(),R(null),N(null),he(!0),zn.current=null,y(!1),w(null),m(null),p(le=>le+1)};if(!ge){H();return}W({kind:"switch"});try{const le=await fetch(`/api/variants/${ge}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!le.ok){pn.warn(`switch to original failed: HTTP ${le.status}`);return}H(),y(!0),Te.capture("variants_panel.preview_switched",{sessionId:ge,fromVariantId:O,toVariantId:null,target:"original",armed:!1})}catch(le){pn.warn("preview-port original switch failed",le)}finally{W(null)}},[O,ge,R,N,p,m,w,L,y,fr]),tn=v.useCallback(async H=>{var Re,ve;const le=((ve=(Re=H.actions)==null?void 0:Re.commit)==null?void 0:ve.enabled)??H.status==="succeeded";if(!(!ge||!le)){Te.capture("variants_panel.commit_clicked",{sessionId:ge,variantId:H.workItemId,variantLabel:H.label}),W({kind:"commit",variantId:H.workItemId});try{const pe=await fetch(`/api/variants/${ge}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:H.workItemId})});if(!pe.ok){const{message:We,errorCode:Ee}=await Li(pe);pn.warn(`commit failed: HTTP ${pe.status} ${Ee??""} ${We??""}`),Te.capture("variants_panel.commit_failed",{sessionId:ge,variantId:H.workItemId,httpStatus:pe.status,errorCode:Ee??null,errorMessage:We??null}),ht.error("Couldn't send direction",{description:We??`The server rejected the request (HTTP ${pe.status}). Try again, or pick a different direction.`});return}const ke=await pe.json().catch(()=>null);Te.capture("variants_panel.commit_succeeded",{sessionId:ge,variantId:H.workItemId,payloadKind:(ke==null?void 0:ke.payloadKind)??null,duplicate:(ke==null?void 0:ke.duplicate)??!1}),ht.success(`Sent "${H.label}" to your project`,{description:(ke==null?void 0:ke.payloadKind)==="project-created"?`Project created at ${(ke==null?void 0:ke.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(ke==null?void 0:ke.payloadKind)!=="project-created"&&(m(null),y(!1),p(We=>We+1))}catch(pe){pn.warn("commit failed",pe),Te.capture("variants_panel.commit_failed",{sessionId:ge,variantId:H.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),ht.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{W(null)}}},[ge,p,m,y]),nn=v.useCallback(async(H,le,Re)=>{Te.capture("variants_panel.deploy_clicked",{sessionId:H,variantId:le,variantLabel:Re});try{const ve=await fetch(`/api/variants/${H}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:le,...n?{projectPath:n}:{}})});if(!ve.ok){const{message:We,errorCode:Ee}=await Li(ve);return pn.warn(`deploy failed: HTTP ${ve.status} ${Ee??""} ${We??""}`),Te.capture("variants_panel.deploy_failed",{sessionId:H,variantId:le,httpStatus:ve.status,errorCode:Ee??null,errorMessage:We??null}),ht.error("Couldn't deploy this direction",{description:We??`The server rejected the request (HTTP ${ve.status}). Try again.`}),null}const pe=await ve.json().catch(()=>null),ke=pe==null?void 0:pe.shareUrl;return ke?(await navigator.clipboard.writeText(ke).catch(()=>{}),Te.capture("variants_panel.deploy_succeeded",{sessionId:H,variantId:le}),ht.success(`"${Re}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}}),ke):(ht.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(ve){return pn.warn("deploy failed",ve),Te.capture("variants_panel.deploy_failed",{sessionId:H,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:ve instanceof Error?ve.message:String(ve)}),ht.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),Us=v.useCallback(async H=>{if(!ge)return;const le=$[H.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),ht.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}W({kind:"deploy",variantId:H.workItemId});try{const Re=await nn(ge,H.workItemId,H.label);Re&&ee(ve=>({...ve,[H.workItemId]:Re}))}finally{W(null)}},[ge,$,nn]),qt=v.useCallback(async()=>{if(!(!ge||$e.length===0)){if(Zt){await navigator.clipboard.writeText(Zt).catch(()=>{}),ht.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(Zt,"_blank","noopener")}});return}Te.capture("variants_panel.deploy_clicked",{sessionId:ge,variantId:"canvas",variantLabel:"Canvas",variantCount:$e.length}),W({kind:"deploy-canvas"});try{const H=await fetch(`/api/variants/${ge}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:$e.map(ke=>ke.workItemId),...n?{projectPath:n}:{}})});if(!H.ok){const{message:ke,errorCode:We}=await Li(H);pn.warn(`canvas deploy failed: HTTP ${H.status} ${We??""} ${ke??""}`),Te.capture("variants_panel.deploy_failed",{sessionId:ge,variantId:"canvas",httpStatus:H.status,errorCode:We??null,errorMessage:ke??null,variantCount:$e.length}),ht.error("Couldn't share this canvas",{description:ke??`The server rejected the request (HTTP ${H.status}). Try again.`});return}const le=await H.json().catch(()=>null),Re=le==null?void 0:le.shareUrl;if(!Re){ht.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const ve=Object.fromEntries(((le==null?void 0:le.variants)??[]).filter(ke=>typeof ke.variantId=="string"&&typeof ke.shareUrl=="string").map(ke=>[ke.variantId,ke.shareUrl])),pe=Object.keys(ve).length>0?{...$,...ve}:$;pe!==$&&ee(pe),await navigator.clipboard.writeText(Re).catch(()=>{}),D({key:uk($e,pe),shareUrl:Re}),Te.capture("variants_panel.deploy_succeeded",{sessionId:ge,variantId:"canvas",variantCount:$e.length}),ht.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Re,"_blank","noopener")}})}catch(H){pn.warn("canvas deploy failed",H),Te.capture("variants_panel.deploy_failed",{sessionId:ge,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:H instanceof Error?H.message:String(H),variantCount:$e.length}),ht.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{W(null)}}},[Zt,$e,$,n,ge]),cn=v.useCallback(async H=>{const le=`${H.sessionId}:${H.variantId}`,Re=Y[le];if(Re){await navigator.clipboard.writeText(Re).catch(()=>{}),ht.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Re,"_blank","noopener")}});return}ae(le);try{const ve=await nn(H.sessionId,H.variantId,H.label);ve&&te(pe=>({...pe,[le]:ve}))}finally{ae(null)}},[Y,nn]),ws=v.useCallback(async H=>{if(ge){Te.capture("variants_panel.remove_clicked",{sessionId:ge,variantId:H.workItemId,variantLabelLength:H.label.length}),W({kind:"remove",variantId:H.workItemId});try{const le=await fetch(`/api/variants/${ge}/${H.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:Re}=await Li(le);pn.warn(`remove failed: HTTP ${le.status} ${Re??""}`),ht.error("Couldn't remove direction",{description:Re??`The server rejected the request (HTTP ${le.status}). Try again.`});return}(H.workItemId===In||H.workItemId===O)&&(R(null),m(null),y(!1),p(Re=>Re+1))}catch(le){pn.warn("remove failed",le),ht.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{W(null)}}},[ge,O,In,R,m,y,p]),dn=v.useCallback(async H=>{if(!Ze){ht.error("Couldn't remove direction",{description:"No project path available."});return}Te.capture("variants_panel.remove_past_clicked",{sessionId:H.sessionId,variantId:H.variantId});const le=`${H.sessionId}:${H.variantId}`,Re=ve=>ve.sessionId===H.sessionId&&ve.variantId===H.variantId;W({kind:"remove",variantId:le}),Ce(ve=>ve.filter(pe=>!Re(pe))),j===le&&(N(null),m(null),y(!1),p(ve=>ve+1));try{const ve=await fetch(`/api/variants/history/${encodeURIComponent(H.sessionId)}/${encodeURIComponent(H.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:Ze})});if(!ve.ok){const{message:pe}=await Li(ve);Ce(ke=>ke.some(Re)?ke:[...ke,H]),ht.error("Couldn't remove direction",{description:pe??`The server rejected the request (HTTP ${ve.status}). Try again.`})}}catch(ve){pn.warn("remove past failed",ve),Ce(pe=>pe.some(Re)?pe:[...pe,H]),ht.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{W(null)}},[Ze,j,N,m,y,p]),Un=v.useCallback(H=>{X(H)},[]),Bs=v.useCallback(async()=>{if(K)try{K.kind==="active"?await ws(K.variant):await dn(K.entry)}finally{X(null)}},[K,ws,dn]),hr=zW(K),ga=(G==null?void 0:G.kind)==="remove"&&G.variantId===hr,[Sl,x0]=v.useState(null),[b0,ac]=v.useState(null),wi=v.useCallback(H=>{ac(H)},[]),Of=v.useCallback(()=>{ac(null)},[]),Lf=v.useCallback(async H=>{const le=H.trim();if(le)try{await navigator.clipboard.writeText(le),ht.success("Copied")}catch{ht.error("Couldn't copy")}},[]),S0=v.useCallback(async(H,le)=>{ac(null);const Re=le.trim();if(!Re||H.kind==="original")return;if(H.kind==="active"){if(!ge||Re===H.variant.label)return;Te.capture("variants_panel.rename",{sessionId:ge,variantId:H.variant.workItemId,labelLength:Re.length,past:!1});try{const ke=await fetch(`/api/variants/${ge}/${H.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Re})});if(!ke.ok){const{message:We}=await Li(ke);ht.error("Couldn't rename direction",{description:We??`The server rejected the request (HTTP ${ke.status}). Try again.`})}}catch(ke){pn.warn("rename failed",ke),ht.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:ve}=H;if(Re===ve.label.trim())return;if(!Ze){ht.error("Couldn't rename direction",{description:"No project path available."});return}Te.capture("variants_panel.rename",{sessionId:ve.sessionId,variantId:ve.variantId,labelLength:Re.length,past:!0});const pe=ke=>ke.sessionId===ve.sessionId&&ke.variantId===ve.variantId;Ce(ke=>ke.map(We=>pe(We)?{...We,label:Re}:We));try{const ke=await fetch(`/api/variants/history/${encodeURIComponent(ve.sessionId)}/${encodeURIComponent(ve.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Re,projectPath:Ze})});if(!ke.ok){const{message:We}=await Li(ke);Ce(Ee=>Ee.map(tr=>pe(tr)?{...tr,label:ve.label}:tr)),ht.error("Couldn't rename direction",{description:We??`The server rejected the request (HTTP ${ke.status}). Try again.`})}}catch(ke){pn.warn("rename failed",ke),Ce(We=>We.map(Ee=>pe(Ee)?{...Ee,label:ve.label}:Ee)),ht.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[ge,Ze]);v.useEffect(()=>{if(An.current!==ge){const le=An.current===null;if(An.current=ge,zn.current=null,D(null),m(null),y(!1),w(null),L(),R(null),N(null),he(!1),Nr.current=!1,!le)return}if(j||se||!In||t.active!==!0||zn.current===In)return;const H=be.find(le=>le.workItemId===In);H&&(zn.current=In,L(),vi(H))},[ge,j,se,In,t,be,vi,L,R,N,m,w,y]),v.useEffect(()=>{!M||!je||(zn.current=null,N(null),R(je.workItemId),he(!1))},[je,M,ge,R,N]),v.useEffect(()=>{!M||je||Je||N(null)},[je,M,Je,ge,N,dt]),v.useEffect(()=>{const H=F.trim().toLowerCase(),le=be.filter(Ee=>Za(Ee)&&xu(H,Ee.label,Ee.runLabel)),Re=dt.filter(Ee=>xu(H,Ee.label,Ee.runLabel,Ee.brief)),ve=xn&&xu(H,Tw,Rw);if(le.length===0&&Re.length===0&&!ve)return;const pe=[...le.map(Ee=>({source:"live",variant:Ee})),...Re.map(Ee=>({source:"past",entry:Ee})),...ve?[{source:"original"}]:[]],ke=Ee=>Ee.source==="live"?`live:${Ee.variant.workItemId}`:Ee.source==="past"?`past:${Ee.entry.sessionId}:${Ee.entry.variantId}`:k_,We=Ee=>{if(jU())return;if(Ee.key==="Enter"){const Ws=be.find(bs=>bs.workItemId===Sl);Ws&&Za(Ws)&&(Ee.preventDefault(),zs(Ws));return}if(Ee.key!=="ArrowUp"&&Ee.key!=="ArrowDown")return;Ee.preventDefault();let pr=In?`live:${In}`:null;j?pr=`past:${j}`:se&&(pr=k_);const es=pr?pe.findIndex(Ws=>ke(Ws)===pr):-1;let xs;if(es===-1?xs=Ee.key==="ArrowDown"?0:pe.length-1:Ee.key==="ArrowDown"?xs=Math.min(es+1,pe.length-1):xs=Math.max(es-1,0),xs===es)return;const ts=pe[xs];ts.source==="live"?zs(ts.variant):ts.source==="past"?Ke(ts.entry):At();const rn=document.querySelector(`[data-variant-key="${ke(ts)}"]`);rn instanceof HTMLElement&&rn.focus({preventScroll:!0})};return window.addEventListener("keydown",We),()=>window.removeEventListener("keydown",We)},[be,dt,F,xn,j,se,In,Sl,zs,Ke,At]);const El=be.find(H=>H.workItemId===In)??null,Cl=j?dt.find(H=>`${H.sessionId}:${H.variantId}`===j)??null:null,lc=!!Cl,Nf=t.active?t.artifacts??[]:[],uo=[...(t.active?be.filter(H=>H.status!=="cancelled"):[]).map(H=>({kind:"active",variant:H})),...dt.map(H=>({kind:"past",entry:H})),...xn?[{kind:"original"}]:[]],Ft=F.trim().toLowerCase(),uc=Ft?uo.filter(H=>XW(H,Ft)):uo,cc=new Set(be.map(H=>H.requestId).filter(Boolean)),dc=e.filter(H=>!cc.has(H.requestId)),xi=dc.length>0,fc=r&&!xi&&uo.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[uo.length>0?S.jsx("div",{className:"px-3 pt-2 pb-1",children:S.jsxs("div",{className:"relative",children:[S.jsx(mz,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),S.jsx("input",{type:"text",value:F,onChange:H=>q(H.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[xi?S.jsx(dG,{groups:dc}):null,fc?S.jsx(fG,{}):null,t.active&&uo.length===0&&!xi&&!fc?S.jsx(hG,{}):null,!t.active&&!xi&&!fc&&dt.length===0&&!xn?S.jsx(pG,{isMCPSession:d,mcpEditor:h}):null,uo.length>0&&uc.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",F.trim(),"”."]}):null,uc.length>0?S.jsx(tG,{rows:uc,activeVariantId:O??In,activePastKey:j,isOriginalSelected:se,busy:G,editingKey:b0,onSelectActive:zs,onSelectPast:Ke,onSelectOriginal:At,onActivePointerDown:Vs,onPastPointerDown:$s,onHover:x0,onRemove:H=>Un({kind:"active",variant:H}),onRemovePast:H=>Un({kind:"past",entry:H}),onStartRename:wi,onCommitRename:S0,onCancelRename:Of,onCopyVariantContext:Lf,activeSessionId:t.active?t.sessionId:null,projectPath:Ze}):null,t.active&&c?S.jsx(aG,{artifacts:Nf}):null]}),lc&&Cl?S.jsx(sG,{entry:Cl,deploying:ie===j,deployedUrl:j?Y[j]??null:null,onDeploy:cn,isDeployDisabled:!i}):null,!lc&&t.active?S.jsx(cG,{selectedVariant:El,busy:G,onSend:tn,onDeploy:Us,onDeployCanvas:qt,canDeploy:i&&(it==null?void 0:it.kind)==="fresh",canDeployCanvas:i&&a&&(it==null?void 0:it.kind)==="fresh",canSendToAgent:u,canvasVariantCount:$e.length,canvasDeployedUrl:Zt,deployedUrl:El?$[El.workItemId]??null:null}):null,S.jsx(qW,{target:K,isConfirming:ga,onCancel:()=>X(null),onConfirm:Bs})]})},ZW=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.entry.label.trim()||"this direction",qW=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=ZW(t);return S.jsx(sw,{open:!0,onOpenChange:i=>{!i&&!e&&n()},children:S.jsxs(iw,{children:[S.jsx(ow,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(aw,{className:"fixed left-1/2 top-1/2 z-max w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(lw,{className:"text-base font-medium text-content",children:"Remove direction?"}),S.jsxs(uw,{className:"text-sm leading-5 text-content-subtle",children:['This removes "',s,'" from the directions list.']}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"rounded-md px-3 py-1.5 text-sm font-medium text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":"Remove direction"})]})]})})]})})},YW=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:k_,XW=(t,e)=>t.kind==="active"?xu(e,t.variant.label,t.variant.runLabel):t.kind==="past"?xu(e,t.entry.label,t.entry.runLabel,t.entry.brief):xu(e,Tw,Rw),QW=t=>t.length<=ak?t:`${t.slice(0,ak-1)}…`,JW=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,eG=t=>{var i,a;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(u=>!!u).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},tG=({rows:t,activeVariantId:e,activePastKey:n,isOriginalSelected:r,busy:s,editingKey:i,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:d,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:y,onStartRename:w,onCommitRename:_,onCancelRename:x,onCopyVariantContext:E,activeSessionId:k,projectPath:P})=>{const T=v.useRef(null),{activeIndex:A,itemRects:L,sessionRef:O,handlers:R,registerItem:M}=w5(T),N=(s==null?void 0:s.kind)==="switch",j=A!==null?L[A]:null;return S.jsxs("div",{ref:T,className:"relative",onMouseEnter:R.onMouseEnter,onMouseMove:R.onMouseMove,onMouseLeave:R.onMouseLeave,children:[S.jsx(Ji,{children:j&&S.jsx(fl.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:j.top,left:j.left,width:j.width,height:j.height},animate:{opacity:1,top:j.top,left:j.left,width:j.width,height:j.height},exit:{opacity:0,transition:{duration:.06}},transition:{...qd.fast,opacity:{duration:.08}}},O.current)}),S.jsx("ul",{className:"relative",children:t.map((F,q)=>{const G=YW(F);let W=!1;return F.kind==="active"?W=F.variant.workItemId===e:F.kind==="past"?W=`${F.entry.sessionId}:${F.entry.variantId}`===n:W=r,S.jsx(nG,{rowKey:G,row:F,index:q,isSelected:W,isEditing:i===G,isSwitchInFlight:N,busy:s,registerItem:M,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:d,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:y,onStartRename:w,onCommitRename:_,onCancelRename:x,onCopyVariantContext:E,activeSessionId:k,projectPath:P},G)})})]})},nG=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isSwitchInFlight:i,busy:a,registerItem:u,onSelectActive:c,onSelectPast:d,onSelectOriginal:h,onActivePointerDown:p,onPastPointerDown:m,onHover:y,onRemove:w,onRemovePast:_,onStartRename:x,onCommitRename:E,onCancelRename:k,onCopyVariantContext:P,activeSessionId:T,projectPath:A})=>{var Ce,oe;const L=v.useRef(null);fU(u,n,L);const O=e.kind==="active",R=e.kind==="original",M=e.kind==="active"?e.variant:null,N=e.kind==="past"?e.entry:null,j=O?M.status==="succeeded":!0,F=O?Za(M):!0,q=O?PR(M):!1,G=O&&(M.status==="pending"||M.status==="running"),W=O?j&&(F||q)||G:!0,K=O&&M.status==="failed",X=O&&M.status==="cancelled",$=O&&(!W||i),ee=O&&(a==null?void 0:a.kind)==="remove"&&a.variantId===M.workItemId,z=O&&(((Ce=M.refinement)==null?void 0:Ce.status)==="pending"||((oe=M.refinement)==null?void 0:oe.status)==="running");let D=Tw;O?D=M.label||`Direction ${n+1}`:N&&(D=N.label.trim()||"Untitled direction");let Y;O?Y=M.runLabel:N&&(Y=N.runLabel);let te=Rw;O?te=M.description:N&&(te=N.brief);const ie=te?QW(te):null,ae=JW(e,T),ue=ae?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:L,"data-proximity-index":n,className:"group relative z-10",children:S.jsx("div",{className:"bg-main-input flex w-full items-start gap-2 rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(rG,{initial:D,onCommit:se=>E(e,se),onCancel:k}),ie&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:ie})]})})}):S.jsxs("li",{ref:L,"data-proximity-index":n,className:"group relative z-10",children:[S.jsx("div",{role:"button",tabIndex:W?0:-1,"data-variant-id":O?M.workItemId:void 0,"data-variant-key":t,onClick:()=>{if($)return;const se=window.getSelection();se&&!se.isCollapsed||(e.kind==="active"?c(e.variant):e.kind==="past"?d(e.entry):h())},onKeyDown:se=>{$||(se.key==="Enter"||se.key===" ")&&(se.preventDefault(),se.stopPropagation(),e.kind==="active"?c(e.variant):e.kind==="past"?d(e.entry):h())},onPointerDown:se=>{$||(e.kind==="active"?j&&p(e.variant.workItemId,se):e.kind==="past"&&m(e.entry,se))},"aria-pressed":W?r:void 0,"aria-disabled":O?!W:void 0,"aria-busy":G||z,onMouseEnter:O?()=>y(M.workItemId):void 0,onMouseLeave:O?()=>y(null):void 0,className:dr("focus-visible:ring-content-muted/40 flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors focus:outline-none focus-visible:ring-1",r&&"bg-main-input ring-content-muted/40 ring-1 ring-inset",j&&F&&"cursor-grab active:cursor-grabbing",(G||q)&&"cursor-pointer",!j&&!G&&!q&&"cursor-not-allowed opacity-60",$&&"cursor-not-allowed opacity-50"),style:j?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[(G||z)&&S.jsx(pw,{className:"text-content-muted shrink-0 text-sm","data-testid":z&&!G?"variant-refining":void 0}),S.jsx(Bo,{label:"Double-click to rename",disabled:R,children:S.jsx("span",{onDoubleClick:se=>{se.stopPropagation(),R||x(t)},className:dr("min-w-0 flex-1 truncate text-sm font-medium select-text",R?"cursor-default":"cursor-text",j||r?"text-content":"text-content-muted"),children:D})}),K&&S.jsx(ck,{label:"Failed"}),X&&S.jsx(ck,{label:"Cancelled"}),Y&&S.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:_5(Y),children:Y})]}),ie&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:ie})]})}),S.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||ae?S.jsx(Bo,{label:ue,children:S.jsx("button",{type:"button","aria-label":ue,onClick:se=>{se.stopPropagation(),P(eG({label:D,description:te,reference:ae,projectPath:A}))},onPointerDown:se=>se.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(Zd,{size:13,weight:"bold"})})}):null,!R&&S.jsx(Bo,{label:"Rename",children:S.jsx("button",{type:"button","aria-label":"Rename direction",onClick:se=>{se.stopPropagation(),x(t)},onPointerDown:se=>se.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(gz,{size:13,weight:"bold"})})}),!R&&S.jsx(Bo,{label:"Remove",children:S.jsx("button",{type:"button","data-variant-remove-id":e.kind==="active"?e.variant.workItemId:void 0,"aria-label":"Remove direction",disabled:ee,onClick:se=>{se.stopPropagation(),e.kind==="active"?w(e.variant):_(e.entry)},onPointerDown:se=>se.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 ml-1 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(_z,{size:13,weight:"bold"})})})]})]})},rG=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=v.useState(t),i=v.useRef(!1),a=v.useCallback(c=>{c&&(c.focus(),c.select())},[]),u=c=>{i.current||(i.current=!0,c?e(r):n())};return S.jsx("input",{ref:a,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:c=>s(c.target.value),onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"?(c.preventDefault(),u(!0)):c.key==="Escape"&&(c.preventDefault(),u(!1))},onBlur:()=>u(!0),onClick:c=>c.stopPropagation(),onPointerDown:c=>c.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"})},ck=({label:t})=>S.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),sG=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const a=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?S.jsx(Zd,{size:12,weight:"bold"}):null,a]})]})},iG={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},oG={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},aG=({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 S.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[S.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),S.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>S.jsx(lG,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},lG=({artifact:t,isExpanded:e,onToggle:n})=>{const r=oG[t.kind],s=t.source?iG[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),a=t.kind==="design_context"&&!!t.viewUrl,u=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return a?S.jsx("li",{className:"border-main-border rounded-md border",children:S.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer","aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:S.jsx(dz,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):S.jsxs("li",{className:"border-main-border rounded-md border",children:[S.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":u,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?S.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:S.jsx(uG,{artifact:t})}):null]})},uG=({artifact:t})=>S.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?S.jsx("p",{children:t.summary}):null,t.path?S.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?S.jsx("p",{children:"No inline content available for this artifact."}):null]}),cG=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:u,canvasVariantCount:c,canvasDeployedUrl:d,deployedUrl:h})=>{var O,R,M,N;const p=t?((R=(O=t.actions)==null?void 0:O.commit)==null?void 0:R.enabled)??t.status==="succeeded":!1,m=p&&e===null,y=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),w=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",x=!i||!p||e!==null,E=a&&c>0,P=w?"Deploying…":h?"Copy link":"Share",A=_?"Sharing…":d?"Copy canvas link":"Share canvas",L=y?"Applying…":"Apply to project";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),h?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[S.jsx(dR,{primaryLabel:P,primaryIcon:h&&!w?Zd:void 0,primaryAction:()=>{t&&r(t)},isDisabled:x,isDropdownDisabled:e!==null,isLoading:w,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:E?[{label:A,icon:d&&!_?Zd:void 0,onClick:s,isDisabled:e!==null}]:[]}),u?S.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:L}):null]})]})},TR=()=>S.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx(pw,{className:"text-content-muted shrink-0 text-sm"}),S.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),S.jsx("span",{className:"mt-1.5 flex",children:S.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),dG=({groups:t})=>S.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>S.jsx(TR,{},`${e.requestId}-${r}`)))}),fG=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(TR,{},e))}),hG=()=>S.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[S.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),S.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),dk="Try different ways to create a dropdown that feels fluid and dynamic",pG=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=v.useState(!1),s=FU(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(dk).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return S.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),S.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),S.jsxs("div",{className:"w-full",children:[S.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),S.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[S.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",dk,"”"]}),S.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?S.jsx(WT,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(Zd,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},mG=({onClose:t})=>{const e=Qe(P5);return t?S.jsxs("div",{className:"z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b border-main-border bg-main-light px-2.5 py-2.5",children:[e?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):S.jsx("span",{}),S.jsx(Bo,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 text-content-subtle transition-colors hover:bg-main-input hover:text-content",children:S.jsx(vz,{className:"h-4 w-4",weight:"bold"})})})]}):null},gG='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',vG=({itemSelector:t=gG,loop:e=!1}={})=>{const n=v.useRef(null),r=v.useRef(null),s=v.useCallback(a=>{var u;n.current=a,a?r.current=DU():((u=r.current)==null||u.call(r),r.current=null)},[]),i=v.useCallback(a=>{var w;const{key:u}=a;if(u!=="ArrowDown"&&u!=="ArrowUp"&&u!=="Home"&&u!=="End")return;const c=n.current;if(!c)return;const d=Array.from(c.querySelectorAll(t));if(d.length===0)return;a.preventDefault(),a.stopPropagation();const h=d.indexOf(document.activeElement),p=d.length-1,m=_=>{if(h===-1)return _===1?0:p;const x=h+_;return e?(x+d.length)%d.length:Math.min(Math.max(x,0),p)};let y;u==="Home"?y=0:u==="End"?y=p:u==="ArrowDown"?y=m(1):y=m(-1),(w=d[y])==null||w.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},fk="/assets/arena-Db0j1set.png",yG=vs("useIntegrations"),hk=["integrations"],_G="rivet:connect-result",wG=t=>typeof t=="object"&&t!==null&&t.type===_G,xG=tt(null),bG=()=>{const t=T8(),[e,n]=wP(xG),r=B1({queryKey:hk,queryFn:async()=>{const u=await fetch("/api/integrations");if(!u.ok)throw new Error(`Failed to load integrations (${u.status})`);return(await u.json()).integrations??[]},staleTime:1e4}),s=v.useCallback(()=>t.invalidateQueries({queryKey:hk}),[t]),i=v.useCallback(async u=>{const c=window.open("","_blank","width=560,height=720");if(!c)throw new Error("Popup blocked. Allow popups to connect.");n(u);try{const d=await fetch(`/api/integrations/${u}/connect`,{method:"POST"}),h=await d.json().catch(()=>({}));if(!d.ok||!h.authUrl)throw c.close(),new Error(h.error||`Could not connect ${u}`);c.location.href=h.authUrl,await new Promise(p=>{const m=()=>{window.removeEventListener("message",y),clearInterval(w),s(),p()},y=_=>{wG(_.data)&&_.data.provider===u&&(_.data.status==="error"&&yG.warn(`Connect failed for ${u}:`,_.data.message),m())};window.addEventListener("message",y);const w=setInterval(()=>{c.closed&&m()},500)})}finally{n(null)}},[s,n]),a=v.useCallback(async u=>{n(u);try{const c=await fetch(`/api/integrations/${u}`,{method:"DELETE"});if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.error||`Could not disconnect ${u}`)}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}},bu=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:a="button","data-cy":u})=>{const c=S.jsx("button",{onClick:t,disabled:s,className:i,type:a,"data-cy":u,children:r});return e?S.jsx(Pw,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:e}),n?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:c}):c},pk=vs("ConnectorsModal"),SG=()=>S.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})}),EG=()=>S.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${fk})`,maskImage:`url(${fk})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),CG=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:S.jsx(SG,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:S.jsx(EG,{})}],kG=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const a=(e==null?void 0:e.status)==="connected",u=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return S.jsxs("article",{className:`flex flex-col rounded-xl bg-main-light p-[18px] ${r?"ring-2 ring-secondary":""}`,children:[S.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"mt-4 flex-1",children:[S.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,a?S.jsx(WT,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),S.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),a&&u?S.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:u}):null]}),a?S.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg bg-main-input px-3.5 text-[13px] font-semibold text-content-muted transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):S.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg bg-secondary px-3.5 text-[13px] font-semibold text-secondary-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},P_=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:u,connect:c,disconnect:d}=bG(),[h,p]=v.useState(null),m=x=>s.find(E=>E.provider===x),y=v.useCallback(x=>{c(x).catch(E=>{const k=E instanceof Error?E.message:"Could not connect.";pk.warn(`Connect error for ${x}:`,k),ht.error(k)})},[c]),w=v.useCallback(x=>{d(x).catch(E=>{const k=E instanceof Error?E.message:"Could not disconnect.";pk.warn(`Disconnect error for ${x}:`,k),ht.error(k)})},[d]),_=n==="onboarding";return S.jsx(sw,{open:t,onOpenChange:x=>!x&&e(),children:S.jsxs(iw,{children:[S.jsx(ow,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(aw,{ref:p,className:"fixed left-1/2 top-1/2 z-max w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(SR,{value:h,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(lw,{className:"text-base font-medium text-content",children:"Connect design references"}),S.jsx(bu,{onClick:e,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content",children:S.jsx(r5,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(uw,{className:"text-sm text-content-subtle",children:"Connect your design references to use them with Rivet’s MCP."}),a?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:a}):null,S.jsx("div",{className:"grid grid-cols-2 gap-4",children:CG.map(x=>S.jsx(kG,{meta:x,integration:m(x.provider),isPending:i||u===x.provider,isHighlighted:r===x.provider,onConnect:()=>y(x.provider),onDisconnect:()=>w(x.provider)},x.provider))}),_?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-xs text-content-subtle",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push flex-none rounded-lg bg-secondary px-3.5 py-2 text-[13px] font-medium text-secondary-foreground transition-colors hover:bg-accent",children:"Skip for now"})]}):null]})]})})]})})},mk=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),PG=vs("SupportTicketModal"),gk=5e3,f1="feedback",TG=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},RG=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=TG(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}`},AG=({isOpen:t,onClose:e,contactEmail:n})=>{const r=cD(),[s,i]=v.useState(""),[a,u]=v.useState(!1),[c,d]=v.useState(null),h=v.useCallback(()=>{i("")},[]),p=v.useCallback(()=>{a||(h(),e())},[a,e,h]),m=v.useCallback(async()=>{const x=s.trim();if(!(!x||a)){u(!0);try{const E=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,k=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,P=n==null?void 0:n.trim(),T=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:f1,message:x,contactEmail:P||void 0,metadata:{posthogSessionId:E??void 0,posthogDistinctId:k??void 0,appVersion:"0.14.6",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!T.ok){const A=await RG(T);throw new Error(A)}r==null||r.capture("support_ticket_submitted",{ticket_type:f1,has_posthog_session_id:!!E}),ht.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(E){const k=E instanceof Error?E.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:f1,error:k}),PG.error("Failed to submit support ticket:",k),ht.error("Could not send feedback",{description:k})}finally{u(!1)}}},[n,a,s,e,r,h]),y=v.useCallback(x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),m())},[m]),w=gk-s.length,_=a||s.trim().length===0;return S.jsx(sw,{open:t,onOpenChange:x=>!x&&p(),children:S.jsxs(iw,{children:[S.jsx(ow,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(aw,{ref:d,className:"fixed left-1/2 top-1/2 z-max w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(SR,{value:c,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(lw,{className:"text-base font-medium text-content",children:"Send feedback"}),S.jsx(bu,{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:S.jsx(r5,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(uw,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"rounded-lg bg-main-input outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:x=>i(x.target.value),onKeyDown:y,maxLength:gk,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"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[S.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[w<=500&&S.jsx("span",{className:"text-xs text-content-subtle",children:w}),S.jsx(bu,{onClick:m,disabled:_,title:"Send feedback",shortcut:"⌘↵",className:"flex items-center justify-center rounded bg-primary p-1 text-content transition-colors hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-80",children:a?S.jsx(r0,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(fz,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},IG=vs("ProfileAvatar"),RR=(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):""},MG=(t,e)=>RR(t,e).charAt(0).toUpperCase(),OG=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=Qe(R5),i=Qe(N5),a=Qe(L5),[u,c]=v.useState(!1),[d,h]=v.useState(!1),[p,m]=v.useState(!1),[y,w]=v.useState(!1),{containerRef:_,onKeyDown:x}=vG(),E=Qe(Pf),k=MG(r,s);if(!k)return E?S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(mk,{className:"h-7 w-7 rounded-full"}),S.jsx(mk,{className:"h-3 w-16"})]}):null;const P=RR(r,s),T=(r==null?void 0:r.trim())||null,A=(s==null?void 0:s.trim())||null,L=async()=>{w(!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){IG.warn("Logout request failed",O),ht.error("Could not log out. Please try again."),w(!1);return}window.location.reload()};return S.jsxs(S.Fragment,{children:[S.jsxs(aR,{open:u,onOpenChange:c,children:[S.jsx(lR,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account",className:`flex shrink-0 select-none items-center gap-2 text-content-muted transition-colors hover:text-content ${t}`,children:[S.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-main-border bg-main-input text-[11px] font-semibold leading-none",children:k}),P?S.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:P}):null]})}),S.jsx(uR,{children:S.jsxs(cR,{ref:_,onKeyDown:x,role:"menu",className:"z-[60] min-w-[180px] rounded-lg bg-surface-2 p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[T||A?S.jsxs("div",{className:"border-b border-main-border px-3 py-2",children:[T?S.jsx("div",{className:"truncate text-xs font-medium text-content",children:T}):null,A?S.jsx("div",{className:"truncate text-[11px] text-content-muted",children:A}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),h(!0)},disabled:!i||a,className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(e5,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),m(!0)},className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none",children:[S.jsx(pz,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:L,disabled:y,className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(yz,{className:"h-3.5 w-3.5",weight:"bold"}),y?"Logging out…":"Log out"]})]})})]}),S.jsx(P_,{isOpen:d,onClose:()=>h(!1)}),S.jsx(AG,{isOpen:p,onClose:()=>m(!1),contactEmail:s??void 0})]})},LG=({onClose:t})=>S.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[S.jsx(mG,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(KW,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:S.jsx(OG,{side:"top",align:"start"})})]}),NG=vs("useServerConfig"),DG=()=>{const[t,e]=v.useState(null),[n,r]=v.useState(!0),[s,i]=v.useState(null),a=v.useCallback(async()=>{var u;try{r(!0),i(null);const c=await fetch("/api/health");if(!c.ok)throw new Error(`Failed to fetch config: ${c.status}`);const d=await c.json();if(!d.framework)throw new Error("Server did not return framework information");const h={userPort:((u=d.ports)==null?void 0:u.userDevServer)||3e3,framework:d.framework};return e(h),h}catch(c){const d=c instanceof Error?c.message:"Failed to fetch server config";throw i(d),NG.warn("Error fetching server config:",c),c}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},jG="#1C1C20",Ni=[118,118,124],vk=.85,FG=3,VG=.15,dp=36,$G=4.4,HG=.7,zG=3.5,UG=.8,yk=9,BG=11,WG=[1.35,1.12,.95,.85],GG=[0,1.1,2.3,3.1],KG=[0,.35,.16,.13],ZG=[.9,.5,.4,.35],Fa=3,h1=[[{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}]],fp=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},Dp=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Va=(t,e)=>(Math.round(t/e-.5)+.5)*e,qG=Math.sin(Math.PI/3),_k=(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*qG;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()},YG=(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)-yk}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)-yk}return Dp(.5-r/(2*BG))},AR=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=st(T5),r=v.useRef(null),s=v.useCallback(i=>{var N;if((N=r.current)==null||N.call(r),r.current=null,!i)return;const a=i.getContext("2d");if(!a)return;e&&n(j=>j+1);const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let c=[],d=0,h=0,p=dp,m=dp,y=null,w=null,_=0,x=-1;const E=new Array(33),k=j=>{const F=Math.round(j*32);let q=E[F];if(!q){const G=F/32,W=Math.round(Ni[0]+(255-Ni[0])*G),K=Math.round(Ni[1]+(255-Ni[1])*G),X=Math.round(Ni[2]+(255-Ni[2])*G);q=`rgba(${W}, ${K}, ${X}, ${vk})`,E[F]=q}return q},P=j=>{const F=1-.35*j,q=Math.round(Ni[0]*F),G=Math.round(Ni[1]*F),W=Math.round(Ni[2]*F);return`rgba(${q}, ${G}, ${W}, ${vk})`},T=j=>{let F=Math.floor(Math.random()*h1.length);F===x&&(F=(F+1)%h1.length),x=F;const q=[0,0,0,0],G=h1[F].map((D,Y)=>{const te=D.level,ie=q[te]++,ae=GG[te]+ie*KG[te],ue=ZG[te]+fp(F*131+Y*17+5)*.2;if(D.hline){const se=Va((D.y??0)*h,m);return{hline:!0,x1:Va(D.x1*d,p),x2:Va(D.x2*d,p),y1:se,y2:se,level:te,start:ae,dur:ue}}const Ce=Va(D.x1*d,p),oe=Va((D.y1??0)*h,m);return{hline:!1,x1:Ce,y1:oe,x2:Math.max(Va(D.x2*d,p),Ce+p),y2:Math.max(Va((D.y2??0)*h,m),oe+m),level:te,start:ae,dur:ue}}),W=G.reduce((D,Y)=>Math.max(D,Y.start+Y.dur),0),K=c.length,X=new Float32Array(K*Fa),$=new Int16Array(K*Fa).fill(-1),ee=new Uint8Array(K),z=G[0];for(let D=0;D<K;D++){const Y=c[D];Y.x>z.x1&&Y.x<z.x2&&Y.y>z.y1&&Y.y<z.y2&&(ee[D]=1);const te=D*Fa;for(let ie=0;ie<G.length;ie++){const ae=YG(Y.x,Y.y,G[ie]);if(ae<=.02)continue;let ue=te;for(let Ce=te;Ce<te+Fa;Ce++){if($[Ce]===-1){ue=Ce;break}X[Ce]<X[ue]&&(ue=Ce)}($[ue]===-1||ae>X[ue])&&(X[ue]=ae,$[ue]=ie)}}return{startT:j,buildEnd:W,els:G,frame:z,cellQ:X,cellEl:$,inFrame:ee}},A=()=>{const j=i.getBoundingClientRect();d=Math.max(1,j.width),h=Math.max(1,j.height);const F=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*F),i.height=Math.round(h*F),a.setTransform(F,0,0,F,0,0);const q=Math.max(8,Math.round(d/dp)),G=Math.max(6,Math.round(h/dp));p=d/q,m=h/G,c=[];for(let W=0;W<G;W++){const K=G>1?W/(G-1):.5,X=$G*(1+HG*.4*(K*2-1));for(let $=0;$<q;$++){const ee=W*8191+$*131+1,z={x:($+.5)*p,y:(W+.5)*m,size:X,seed:ee,phase:fp(ee),kind:0};z.kind=Math.floor(fp(ee*97)*3),c.push(z)}}w=null,y=null},L=new Float32Array(32),O=j=>{a.fillStyle=jG,a.fillRect(0,0,d,h),y||(y=T(j+.2)),j>=y.startT+y.buildEnd+zG&&(w=y,_=j,y=T(j+.2));let F=0;w&&(F=1-Dp((j-_)/UG),F<=0&&(w=null));const q=y;for(let z=0;z<q.els.length;z++){const D=q.els[z];L[z]=Dp(Math.min(1,Math.max(0,(j-q.startT-D.start)/D.dur)))}const G=L[0],W=P(0),K=P(G),X=F>0?P(F):W,$=F>0?P(Math.max(G,F)):K,ee=c.length;for(let z=0;z<ee;z++){const D=c[z];let Y=0,te=0;const ie=z*Fa;for(let Pe=ie;Pe<ie+Fa;Pe++){const be=q.cellEl[Pe];if(be<0)break;const $e=q.cellQ[Pe]*L[be];$e>Y&&(Y=$e,te=q.els[be].level)}if(w)for(let Pe=ie;Pe<ie+Fa;Pe++){const be=w.cellEl[Pe];if(be<0)break;const $e=w.cellQ[Pe]*F;$e>Y&&(Y=$e,te=w.els[be].level)}const ae=j/FG+D.phase,ue=Math.floor(ae),Ce=ae-ue,oe=Dp(Math.min(Ce,1-Ce)/VG),se=Math.floor(fp(D.seed*97+ue*7919)*3);se!==D.kind&&Y<.02&&oe<.05&&(D.kind=se);const he=Math.max(oe*(1-Y),Y);if(!(he<.01))if(Y<.02){const Pe=q.inFrame[z]===1,be=w?w.inFrame[z]===1:!1;Pe?a.fillStyle=be?$:K:a.fillStyle=be?X:W;const $e=Math.max(Pe?G:0,be?F:0);_k(a,D.kind,D.x,D.y,D.size*he*(1-.2*$e))}else{a.fillStyle=k(Y);const Pe=1+(WG[te]-1)*Y;_k(a,D.kind,D.x,D.y,D.size*he*Pe)}}};A();let R=0;if(u)y=T(-100),O(0);else{const j=performance.now(),F=q=>{O((q-j)/1e3),R=requestAnimationFrame(F)};R=requestAnimationFrame(F)}const M=new ResizeObserver(()=>{A(),u&&(y=T(-100),O(0))});M.observe(i),r.current=()=>{cancelAnimationFrame(R),M.disconnect(),e&&n(j=>j-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},XG=async(t=null)=>{if(t)return QG(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return hp();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable"};let r;try{r=await e.json()}catch{return hp()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable"}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable"}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable"}:hp()},QG=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable"}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}},hp=async()=>{try{const t=await fetch("/");return{isOk:t.status!==502&&t.status!==503,unavailableReason:"upstream_unreachable"}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}},wk=vs("usePreviewUpstreamHealth"),JG=500,eK=4e3,tK=15e3,nK=(t,e={})=>{const n=v.useRef(null),r=v.useRef(null),s=e.probeMsWhileDown??JG,i=e.probeMsWhileUp??eK,a=e.firstUnreachableCaptureAfterMs??tK,u=e.rerunProbeImmediatelyOnVersion,c=e.probePath??null,d=e.skip??!1,[h,p]=v.useState(t==="static"),[m,y]=v.useState(0),[w,_]=v.useState(null),[x,E]=v.useState(0),[k,P]=v.useState(!1),[T,A]=v.useState(!1),[L,O]=v.useState(t==="static"?null:"upstream_unreachable");return v.useEffect(()=>{if(t==="static"){p(!0),_(null),E(0),P(!1),A(!0),O(null);return}if(d){p(!1),_(null),E(0),P(!1),A(!0),O("upstream_unreachable"),n.current=null;return}let R=!0;const M=Date.now();_(M),E(0),P(!1),p(!1),A(!1),O("upstream_unreachable");const N={current:!1},j={current:!1},F={current:!1},q={current:null},G={current:!1};let W=null;const K=()=>{F.current||(F.current=!0,R&&A(!0))},X=()=>{W!==null&&(clearTimeout(W),W=null)},$=(z,D)=>{X(),W=setTimeout(D,z)},ee=async()=>{if(!R)return;E(ie=>ie+1);const{isOk:z,unavailableReason:D}=await XG(c);if(!R)return;if(K(),z){const ie=!G.current;G.current=!0,p(!0),O(null),q.current=null,j.current=!1,P(!1),N.current?ie&&(Te==null||Te.capture("preview_upstream_restored",{framework:t})):(N.current=!0,Te==null||Te.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-M})),$(i,ee);return}const Y=G.current;G.current=!1,p(!1),O(D),q.current===null&&(q.current=Date.now(),j.current=!1,P(!1)),Y&&(Te==null||Te.capture("preview_upstream_lost",{framework:t}),y(ie=>ie+1),wk.warn("Preview upstream became unavailable after it was ready"));const te=Date.now()-q.current;te>=a&&!j.current&&(j.current=!0,P(!0),Te==null||Te.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:te}),wk.warn("Dev server did not become ready within timeout window")),$(s,ee)};return n.current=()=>$(0,ee),$(0,ee),()=>{R=!1,n.current=null,X()}},[t,s,i,a,c,d]),v.useEffect(()=>{var M;if(t==="static"||u===void 0)return;const R=r.current;r.current=u,R!==null&&R!==u&&((M=n.current)==null||M.call(n))},[t,u]),{isUpstreamReady:h,iframeRemountKey:m,probeStartedAt:w,probeAttemptCount:x,isFirstUnreachableWindowExceeded:k,initialProbeComplete:T,unavailableReason:L}};function rK(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const IR=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}`},MR=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${IR(t)}${e}`:e,sK="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",iK=t=>sK,oK=vs("PreviewSurface"),xk=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",OR=({target:t,src:e,framework:n,remountKey:r})=>(Qe(s0),S.jsx("div",{className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:iK(),onLoad:()=>{Te==null||Te.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Te==null||Te.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:xk(e,t),framework:n}))},onError:()=>{Te==null||Te.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Te==null||Te.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:xk(e,t),framework:n})),oK.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),aK="modulepreload",lK=function(t){return"/"+t},bk={},uK=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=a(n.map(d=>{if(d=lK(d),d in bk)return;bk[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":aK,h||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),h)return new Promise((y,w)=>{m.addEventListener("load",y),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return s.then(a=>{for(const u of a||[])u.status==="rejected"&&i(u.reason);return e().catch(i)})},cK=v.lazy(()=>uK(()=>Promise.resolve().then(()=>zZ),void 0)),dK={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"},fK={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},hK={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"},Td=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:u="md",children:c,state:d,role:h="status",busy:p=!1,className:m=""})=>{const y=v.useCallback(_=>{_&&d&&(Te==null||Te.capture("status_surface_shown",{state:d,tone:i,fill:a}))},[d,i,a]),w=!!(e||n||r||c||s!=null&&s.length);return S.jsxs("div",{ref:y,className:`${dK[a]} ${m}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,w?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:fK[u],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>S.jsx("button",{type:"button",onClick:_.onClick,className:hK[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},T_=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(Td,{...r,size:n,busy:!0,backdrop:S.jsx(AR,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(Td,{...r,size:n,busy:!0,backdrop:S.jsx(v.Suspense,{fallback:null,children:S.jsx(cK,{className:"absolute inset-0"})})}):S.jsx(Td,{...r,size:n,busy:!0,media:S.jsx(r0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),LR=({icon:t,...e})=>S.jsx(Td,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Nm=t=>S.jsx(Td,{...t,tone:"error",role:"alert"}),Sk="/static/",pK=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(Sk)}catch{return t.endsWith(Sk)}},mK=({isInteractionDisabled:t=!1,framework:e,userPort:n,activeDemoSessionId:r=null,holdPreviewNavigation:s=!1})=>{const i=Qe(g_),a=st(g_),u=Qe(Am),c=st(Am),d=Qe(kf),h=Qe(s0),p=Qe(v_),m=Qe(y_),y=Qe(A5),w=Qe(I5),_=st(y_),x=Qe(na),E=Qe(w_),k=st(v_),P=d.active&&d.projectContext.kind==="fresh",T=Qe(__),A=d.active?d.variants.find(je=>je.workItemId===T&&(je.status==="pending"||je.status==="running"||je.status==="succeeded"&&!je.preview&&typeof je.port!="number"&&(!je.previewUnavailable||je.previewUnavailable.reason==="idle_timeout")))??null:null,L=d.active&&d.variants.some(je=>je.status==="pending"||je.status==="running"),O=P||L,R=d.active?d.variants.find(je=>{var Je;return je.workItemId===T&&je.status==="succeeded"&&!!je.previewUnavailable&&((Je=je.previewUnavailable)==null?void 0:Je.reason)!=="idle_timeout"})??null:null,M=e==="static"&&u!==null&&pK(u);v.useEffect(()=>{d.active||k(!1)},[d.active,k]);const N=v.useRef(!1);v.useEffect(()=>{const je=!!(x!=null&&x.left||x!=null&&x.right),Je=je&&!N.current;N.current=je;const it=d.active?d.sessionId:null;!it||!rK({enteringSplit:Je,isExistingSession:d.active&&d.projectContext.kind==="existing",hasActiveVariantProxy:p&&m!==null})||(k(!1),_(null),a(Ze=>Ze+1),fetch(`/api/variants/${encodeURIComponent(it)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[x,d,p,m,k,_,a]);const F=v.useMemo(()=>{var xn;if(p||u&&!M||!d.active)return null;const{stage:je,variants:Je}=d,it=je==="ready"||je==="degraded",Ze=Je.some(jt=>{var An,zn;return((An=jt.refinement)==null?void 0:An.status)==="pending"||((zn=jt.refinement)==null?void 0:zn.status)==="running"});if(!it&&!Ze)return null;const _t=Je.find(jt=>{var An;return jt.status==="succeeded"&&((An=jt.preview)==null?void 0:An.kind)==="static_artifact"});return((xn=_t==null?void 0:_t.preview)==null?void 0:xn.kind)==="static_artifact"?_t.preview.url:null},[M,u,p,d])??u,q=v.useMemo(()=>!d.active||!F?null:d.variants.find(je=>{var Je;return((Je=je.preview)==null?void 0:Je.kind)==="static_artifact"&&F.startsWith(je.preview.url)})??null,[F,d]),G=v.useMemo(()=>{if((E==null?void 0:E.previewKind)==="static")return{kind:"variant",sessionId:E.sessionId,variantId:E.variantId};if(!d.active)return Rm;if(q)return{kind:"variant",sessionId:d.sessionId,variantId:q.workItemId};if(F){const Je=F.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),it=Je!=null&&Je[1]?decodeURIComponent(Je[1]):null,Ze=Je!=null&&Je[2]?decodeURIComponent(Je[2]):null;if(it===d.sessionId&&Ze&&d.variants.some(jt=>jt.workItemId===Ze))return{kind:"variant",sessionId:d.sessionId,variantId:Ze};const _t=F.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),xn=_t!=null&&_t[1]?decodeURIComponent(_t[1]):null;if(xn&&d.variants.some(jt=>jt.workItemId===xn))return{kind:"variant",sessionId:d.sessionId,variantId:xn}}const je=!!(x!=null&&x.left||x!=null&&x.right);return(!je||P)&&!F&&p&&m&&d.variants.some(Je=>Je.workItemId===m)?{kind:"variant",sessionId:d.sessionId,variantId:m}:(!je||P)&&!F&&T&&d.variants.some(Je=>Je.workItemId===T)?{kind:"variant",sessionId:d.sessionId,variantId:T}:Rm},[E,q,d,p,m,F,x,P,T]),W=v.useRef(null);v.useEffect(()=>{var Ze,_t;if(!q||((Ze=q.preview)==null?void 0:Ze.kind)!=="static_artifact"||((_t=q.refinement)==null?void 0:_t.status)!=="succeeded")return;const je=`${q.workItemId}:${q.refinement.workItemId}`;if(W.current===je)return;W.current=je;const Je=q.preview.url.includes("?")?"&":"?",it=`${q.preview.url}${Je}refinement=${encodeURIComponent(q.refinement.workItemId)}`;F!==it&&(c(it),a(xn=>xn+1))},[F,q,a,c,d]);const K=F!==null&&$W(F),X=F!==null&&!K||P&&!p&&!K,{isUpstreamReady:$,iframeRemountKey:ee,probeAttemptCount:z,initialProbeComplete:D}=nK(e,{rerunProbeImmediatelyOnVersion:i,probePath:K?F:null,skip:X}),[Y,te]=v.useState(()=>y&&$?i:null),ie=v.useRef(null);v.useEffect(()=>{if(!y){ie.current=null,te(null);return}if(Y===i){ie.current=null;return}const je=ie.current;if(!je||je.remountKey!==i){ie.current={remountKey:i,probeAttemptCount:z};return}$&&z>je.probeAttemptCount&&(ie.current=null,te(i))},[Y,i,y,z,$]);const ue=F!==null&&!K||$,oe=w||y&&Y!==i||y&&!ue,se=`${ee}:${i}`,he=r?`/try/${encodeURIComponent(r)}`:"",Pe=CR(window.location.pathname),be=e==="static"?`${he}/static${Pe??"/"}`:`${he}${Pe??"/"}`,$e=IR(h);let ot=null;F&&(ot=MR({agentApplyMode:h,url:F}));const ge=A||oe?"about:blank":(K&&!ue?"about:blank":ot)??(s||!ue?"about:blank":`${$e}${be}`),gt=!!A||!!R||!ue&&D;let dt=null;return oe?dt=S.jsx(T_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):A?dt=S.jsx(T_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})}):R?dt=S.jsx(Nm,{fill:"overlay",state:"preview_unavailable",title:"Preview couldn’t start",description:"Its preview server didn’t start.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}):gt&&(dt=O?S.jsx(LR,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Nm,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),S.jsxs("div",{className:"relative h-full w-full",children:[dt,S.jsx(OR,{target:G,src:ge,framework:e,remountKey:se})]})};function Ek({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var E;const u=st(na),c=Qe(kf),d=Qe(s0),h=v.useRef(!1),p=v.useCallback(()=>{h.current||(h.current=!0,sf({source:i,sessionId:e,variantId:n}))},[i,e,n]),m=v.useCallback(()=>{if(a){u(null);return}p(),u(k=>{if(!k)return null;const P={...k};return delete P[t],P.left||P.right?P:null})},[u,t,a,p]),y=v.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),w=v.useMemo(()=>!c.active||c.sessionId!==e?null:c.variants.find(k=>k.workItemId===n)??null,[e,n,c]),_=v.useMemo(()=>{var P,T;let k=r;if(((P=w==null?void 0:w.preview)==null?void 0:P.kind)==="static_artifact"&&((T=w.refinement)==null?void 0:T.status)==="succeeded"){const A=w.preview.url.includes("?")?"&":"?";k=`${w.preview.url}${A}refinement=${encodeURIComponent(w.refinement.workItemId)}`}return MR({agentApplyMode:d,url:k})},[d,w,r]),x=((E=w==null?void 0:w.refinement)==null?void 0:E.status)==="succeeded"?`${n}:${w.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(Bo,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:m,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(OR,{target:y,src:_,framework:"static",remountKey:x})})]})}const Ck=240;function gK(){const t=Qe(Jd),e=Qe(hw),n=v.useRef(null);return v.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-Ck/2,s=e.y-22;n.current.style.transform=`translate3d(${r}px, ${s}px, 0)`},[t,e]),!t||!e?null:S.jsx("div",{ref:n,"aria-hidden":"true",className:"variant-drag-ghost",style:{width:Ck},children:S.jsxs("div",{className:"variant-drag-ghost-body",children:[S.jsxs("div",{className:"variant-drag-ghost-row",children:[S.jsx("div",{className:"variant-drag-ghost-title",children:t.label}),t.runLabel?S.jsx("div",{className:"variant-drag-ghost-tag",style:_5(t.runLabel),children:t.runLabel}):null]}),t.description?S.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function vK(){const t=Qe(Jd),e=Qe(hw),n=Qe(na),r=st(Jd),s=st(na),i=v.useRef(null),[a,u]=v.useState(null),[c,d]=v.useState("hidden");v.useEffect(()=>{if(!t){d("hidden"),u(null);return}const m=requestAnimationFrame(()=>d("visible"));return()=>cancelAnimationFrame(m)},[t]);const h=v.useCallback((m,y)=>{const w=i.current;if(!w)return null;const _=w.getBoundingClientRect();return m<_.left||m>_.right||y<_.top||y>_.bottom?null:m<(_.left+_.right)/2?"left":"right"},[]);if(v.useEffect(()=>{if(!t||!e)return;const m=h(e.x,e.y);u(y=>y===m?y:m)},[t,e,h]),v.useEffect(()=>{if(!t)return;const m=y=>{const w=h(y.clientX,y.clientY);if(w&&t.url){const _={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},x=n==null?void 0:n[w];x&&(x.sessionId!==_.sessionId||x.variantId!==_.variantId)&&sf(x),s(E=>({...E??{},[w]:_})),d("exiting"),window.setTimeout(()=>r(null),220)}else sf(t),d("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",m),window.addEventListener("pointercancel",m),()=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m)}},[t,h,r,s,n]),!t)return null;const p=["variant-drop-zones",c==="visible"&&"is-visible",c==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:i,className:p,"aria-hidden":"true",children:[S.jsx(kk,{side:"left",hovered:a==="left",canDrop:!!t.url,label:t.label}),S.jsx(kk,{side:"right",hovered:a==="right",canDrop:!!t.url,label:t.label})]})}function kk({side:t,hovered:e,canDrop:n,label:r}){return S.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[S.jsxs("div",{className:"variant-drop-zone-inner",children:[S.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),S.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),S.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:S.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),S.jsx("div",{className:"variant-drop-zone-border"})]})}const NR=(t,e,n)=>{var i,a;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(u=>u.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)}`},Pk=(t,e)=>{if(!t)return;const n=NR(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},yK=()=>S.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:S.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:S.jsx(AR,{trackGlobalLoaderCount:!1})})}),_K=({isLoading:t=!1,isInteractionDisabled:e=!1,activeDemoSessionId:n=null,holdHostedTryoutPreviewNavigation:r=!1})=>{const{config:s,fetchConfig:i,isLoading:a,error:u}=DG();return v.useEffect(()=>{i().catch(c=>{Te==null||Te.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error"})})},[i]),a?r?S.jsx("div",{className:"bg-main flex h-full min-h-0 w-full flex-1","aria-busy":"true"}):S.jsx(yK,{}):u||!s?S.jsx(Nm,{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:()=>{Te==null||Te.capture("preview_config_retry_clicked"),i().catch(c=>{Te==null||Te.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error"})})}}]}):S.jsx(wK,{isLoading:t,isInteractionDisabled:e,framework:s.framework,userPort:s.userPort,activeDemoSessionId:n,holdHostedTryoutPreviewNavigation:r})};function wK(t){const e=Qe(na),n=Qe(Jd),r=Qe(kf),s=Qe(Am),i=e==null?void 0:e.left,a=e==null?void 0:e.right,u=v.useMemo(()=>{var A,L;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const _=(A=i??a)==null?void 0:A.variantId,x=r.variants.filter(O=>{var R;return O.status==="succeeded"&&((R=O.preview)==null?void 0:R.kind)==="static_artifact"&&O.workItemId!==_}),E=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),P=x.find(O=>{var R;return((R=O.preview)==null?void 0:R.kind)==="static_artifact"&&O.preview.url===E})??x[0];if(((L=P==null?void 0:P.preview)==null?void 0:L.kind)!=="static_artifact")return;const T=NR(r,r.sessionId,P.workItemId);if(T)return{sessionId:r.sessionId,variantId:P.workItemId,label:P.label,url:T,source:"live"}},[r,i,a,s]),c=Pk(i,r)??(a?u:void 0),d=Pk(a,r)??(i?u:void 0),h=!i&&!!c,p=!a&&!!d,m=!!(c||d),y=S.jsx(mK,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort,activeDemoSessionId:t.activeDemoSessionId,holdPreviewNavigation:t.holdHostedTryoutPreviewNavigation});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&S.jsx(Ek,{side:"left",sessionId:c.sessionId,variantId:c.variantId,url:c.url,label:c.label,source:c.source,isFallback:h},`left-${c.sessionId}:${c.variantId}:${c.url}`),!(c&&d)&&S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:y}),d&&S.jsx(Ek,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(vK,{}),S.jsx(gK,{})]})})}const DR=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(r0,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,S.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]});function Ui(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jR(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 Yr={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},of={duration:.5,overwrite:!1,delay:0},Aw,$n,zt,hs=1e8,Ct=1/hs,R_=Math.PI*2,xK=R_/4,bK=0,FR=Math.sqrt,SK=Math.cos,EK=Math.sin,Rn=function(e){return typeof e=="string"},en=function(e){return typeof e=="function"},io=function(e){return typeof e=="number"},Iw=function(e){return typeof e>"u"},mi=function(e){return typeof e=="object"},Rr=function(e){return e!==!1},Mw=function(){return typeof window<"u"},pp=function(e){return en(e)||Rn(e)},VR=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Qn=Array.isArray,CK=/random\([^)]+\)/g,kK=/,\s*/g,Tk=/(?:-?\.?\d|\.)+/gi,$R=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,mu=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,p1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,HR=/[+-]=-?[.\d]+/,PK=/[^,'"\[\]\s]+/gi,TK=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Gt,ti,A_,Ow,Qr={},Dm={},zR,UR=function(e){return(Dm=qu(e,Qr))&&Or},Lw=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},af=function(e,n){return!n&&console.warn(e)},BR=function(e,n){return e&&(Qr[e]=n)&&Dm&&(Dm[e]=n)||Qr},lf=function(){return 0},RK={suppressEvents:!0,isStart:!0,kill:!1},jp={suppressEvents:!0,kill:!1},AK={suppressEvents:!0},Nw={},Yo=[],I_={},WR,Ur={},m1={},Rk=30,Fp=[],Dw="",jw=function(e){var n=e[0],r,s;if(mi(n)||en(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Fp.length;s--&&!Fp[s].targetTest(n););r=Fp[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new hA(e[s],r)))||e.splice(s,1);return e},pl=function(e){return e._gsap||jw(ps(e))[0]._gsap},GR=function(e,n,r){return(r=e[n])&&en(r)?e[n]():Iw(r)&&e.getAttribute&&e.getAttribute(n)||r},Ar=function(e,n){return(e=e.split(",")).forEach(n)||e},an=function(e){return Math.round(e*1e5)/1e5||0},Wt=function(e){return Math.round(e*1e7)/1e7||0},Su=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},IK=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},jm=function(){var e=Yo.length,n=Yo.slice(0),r,s;for(I_={},Yo.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},Fw=function(e){return!!(e._initted||e._startAt||e.add)},KR=function(e,n,r,s){Yo.length&&!$n&&jm(),e.render(n,r,!!($n&&n<0&&Fw(e))),Yo.length&&!$n&&jm()},ZR=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(PK).length<2?n:Rn(e)?e.trim():e},qR=function(e){return e},Jr=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},MK=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},qu=function(e,n){for(var r in n)e[r]=n[r];return e},Ak=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=mi(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Fm=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Rd=function(e){var n=e.parent||Gt,r=e.keyframes?MK(Qn(e.keyframes)):Jr;if(Rr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},OK=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},YR=function(e,n,r,s,i){var a=e[s],u;if(i)for(u=n[i];a&&a[i]>u;)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},p0=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},ia=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},ml=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},LK=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},M_=function(e,n,r,s){return e._startAt&&($n?e._startAt.revert(jp):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},NK=function t(e){return!e||e._ts&&t(e.parent)},Ik=function(e){return e._repeat?Yu(e._tTime,e=e.duration()+e._rDelay)*e:0},Yu=function(e,n){var r=Math.floor(e=Wt(e/n));return e&&r===e?r-1:r},Vm=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},m0=function(e){return e._end=Wt(e._start+(e._tDur/Math.abs(e._ts||e._rts||Ct)||0))},g0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Wt(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),m0(e),r._dirty||ml(r,e)),e},XR=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Vm(e.rawTime(),n),(!n._dur||Rf(0,n.totalDuration(),r)-n._tTime>Ct)&&n.render(r,!0)),ml(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=-Ct}},ai=function(e,n,r,s){return n.parent&&ia(n),n._start=Wt((io(r)?r:r||e!==Gt?us(e,r,n):e._time)+n._delay),n._end=Wt(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),YR(e,n,"_first","_last",e._sort?"_start":0),O_(n)||(e._recent=n),s||XR(e,n),e._ts<0&&g0(e,e._tTime),e},QR=function(e,n){return(Qr.ScrollTrigger||Lw("scrollTrigger",n))&&Qr.ScrollTrigger.create(n,e)},JR=function(e,n,r,s,i){if($w(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!$n&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&WR!==Br.frame)return Yo.push(e),e._lazy=[i,s],1},DK=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},O_=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},jK=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&DK(e)&&!(!e._initted&&O_(e))||(e._ts<0||e._dp._ts<0)&&!O_(e))?0:1,u=e._rDelay,c=0,d,h,p;if(u&&e._repeat&&(c=Rf(0,e._tDur,n),h=Yu(c,u),e._yoyo&&h&1&&(a=1-a),h!==Yu(e._tTime,u)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||$n||s||e._zTime===Ct||!n&&e._zTime){if(!e._initted&&JR(e,n,s,r,c))return;for(p=e._zTime,e._zTime=n||(r?Ct:0),r||(r=n&&!p),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=c,d=e._pt;d;)d.r(a,d.d),d=d._next;n<0&&M_(e,n,r,!0),e._onUpdate&&!r&&Gr(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&Gr(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&ia(e,1),!r&&!$n&&(Gr(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},FK=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}},Xu=function(e,n,r,s){var i=e._repeat,a=Wt(n)||0,u=e._tTime/e._tDur;return u&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:Wt(a*(i+1)+e._rDelay*i):a,u>0&&!s&&g0(e,e._tTime=e._tDur*u),e.parent&&m0(e),r||ml(e.parent,e),e},Mk=function(e){return e instanceof Cr?ml(e):Xu(e,e._dur)},VK={_start:0,endTime:lf,totalDuration:lf},us=function t(e,n,r){var s=e.labels,i=e._recent||VK,a=e.duration()>=hs?i.endTime(!1):e._dur,u,c,d;return Rn(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),d=n.substr(-1)==="%",u=n.indexOf("="),c==="<"||c===">"?(u>=0&&(n=n.replace(/=/,"")),(c==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(u<0?i:r).totalDuration()/100:1)):u<0?(n in s||(s[n]=a),s[n]):(c=parseFloat(n.charAt(u-1)+n.substr(u+1)),d&&r&&(c=c/100*(Qn(r)?r[0]:r).totalDuration()),u>1?t(e,n.substr(0,u-1),r)+c:a+c)):n==null?a:+n},Ad=function(e,n,r){var s=io(n[1]),i=(s?2:1)+(e<2?0:1),a=n[i],u,c;if(s&&(a.duration=n[1]),a.parent=r,e){for(u=a,c=r;c&&!("immediateRender"in u);)u=c.vars.defaults||{},c=Rr(c.vars.inherit)&&c.parent;a.immediateRender=Rr(u.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new gn(n[0],a,n[i+1])},ma=function(e,n){return e||e===0?n(e):n},Rf=function(e,n,r){return r<e?e:r>n?n:r},Yn=function(e,n){return!Rn(e)||!(n=TK.exec(e))?"":n[1]},$K=function(e,n,r){return ma(r,function(s){return Rf(e,n,s)})},L_=[].slice,eA=function(e,n){return e&&mi(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&mi(e[0]))&&!e.nodeType&&e!==ti},HK=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Rn(s)&&!n||eA(s,1)?(i=r).push.apply(i,ps(s)):r.push(s)})||r},ps=function(e,n,r){return zt&&!n&&zt.selector?zt.selector(e):Rn(e)&&!r&&(A_||!Qu())?L_.call((n||Ow).querySelectorAll(e),0):Qn(e)?HK(e,r):eA(e)?L_.call(e,0):e?[e]:[]},N_=function(e){return e=ps(e)[0]||af("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return ps(n,r.querySelectorAll?r:r===e?af("Invalid scope")||Ow.createElement("div"):e)}},tA=function(e){return e.sort(function(){return .5-Math.random()})},nA=function(e){if(en(e))return e;var n=mi(e)?e:{each:e},r=gl(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},u=s>0&&s<1,c=isNaN(s)||u,d=n.axis,h=s,p=s;return Rn(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!u&&c&&(h=s[0],p=s[1]),function(m,y,w){var _=(w||n).length,x=a[_],E,k,P,T,A,L,O,R,M;if(!x){if(M=n.grid==="auto"?0:(n.grid||[1,hs])[1],!M){for(O=-hs;O<(O=w[M++].getBoundingClientRect().left)&&M<_;);M<_&&M--}for(x=a[_]=[],E=c?Math.min(M,_)*h-.5:s%M,k=M===hs?0:c?_*p/M-.5:s/M|0,O=0,R=hs,L=0;L<_;L++)P=L%M-E,T=k-(L/M|0),x[L]=A=d?Math.abs(d==="y"?T:P):FR(P*P+T*T),A>O&&(O=A),A<R&&(R=A);s==="random"&&tA(x),x.max=O-R,x.min=R,x.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(M>_?_-1:d?d==="y"?_/M:M:Math.max(M,_/M))||0)*(s==="edges"?-1:1),x.b=_<0?i-_:i,x.u=Yn(n.amount||n.each)||0,r=r&&_<0?eZ(r):r}return _=(x[m]-x.min)/x.max||0,Wt(x.b+(r?r(_):_)*x.v)+x.u}},D_=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Wt(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(io(r)?0:Yn(r))}},rA=function(e,n){var r=Qn(e),s,i;return!r&&mi(e)&&(s=r=e.radius||hs,e.values?(e=ps(e.values),(i=!io(e[0]))&&(s*=s)):e=D_(e.increment)),ma(n,r?en(e)?function(a){return i=e(a),Math.abs(i-a)<=s?i:a}:function(a){for(var u=parseFloat(i?a.x:a),c=parseFloat(i?a.y:0),d=hs,h=0,p=e.length,m,y;p--;)i?(m=e[p].x-u,y=e[p].y-c,m=m*m+y*y):m=Math.abs(e[p]-u),m<d&&(d=m,h=p);return h=!s||d<=s?e[h]:a,i||h===a||io(a)?h:h+Yn(a)}:D_(e))},sA=function(e,n,r,s){return ma(Qn(e)?!n:r===!0?!!(r=0):!s,function(){return Qn(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})},zK=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)}},UK=function(e,n){return function(r){return e(parseFloat(r))+(n||Yn(r))}},BK=function(e,n,r){return oA(e,n,0,1,r)},iA=function(e,n,r){return ma(r,function(s){return e[~~n(s)]})},WK=function t(e,n,r){var s=n-e;return Qn(e)?iA(e,t(0,e.length),n):ma(r,function(i){return(s+(i-e)%s)%s+e})},GK=function t(e,n,r){var s=n-e,i=s*2;return Qn(e)?iA(e,t(0,e.length-1),n):ma(r,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},uf=function(e){return e.replace(CK,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(kK);return sA(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},oA=function(e,n,r,s,i){var a=n-e,u=s-r;return ma(i,function(c){return r+((c-e)/a*u||0)})},KK=function t(e,n,r,s){var i=isNaN(e+n)?0:function(y){return(1-y)*e+y*n};if(!i){var a=Rn(e),u={},c,d,h,p,m;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(Qn(e)&&!Qn(n)){for(h=[],p=e.length,m=p-2,d=1;d<p;d++)h.push(t(e[d-1],e[d]));p--,i=function(w){w*=p;var _=Math.min(m,~~w);return h[_](w-_)},r=n}else s||(e=qu(Qn(e)?[]:{},e));if(!h){for(c in n)Vw.call(u,e,c,"get",n[c]);i=function(w){return Uw(w,u)||(a?e.p:e)}}}return ma(r,i)},Ok=function(e,n,r){var s=e.labels,i=hs,a,u,c;for(a in s)u=s[a]-n,u<0==!!r&&u&&i>(u=Math.abs(u))&&(c=a,i=u);return c},Gr=function(e,n,r){var s=e.vars,i=s[n],a=zt,u=e._ctx,c,d,h;if(i)return c=s[n+"Params"],d=s.callbackScope||e,r&&Yo.length&&jm(),u&&(zt=u),h=c?i.apply(d,c):i.call(d),zt=a,h},md=function(e){return ia(e),e.scrollTrigger&&e.scrollTrigger.kill(!!$n),e.progress()<1&&Gr(e,"onInterrupt"),e},gu,aA=[],lA=function(e){if(e)if(e=!e.name&&e.default||e,Mw()||e.headless){var n=e.name,r=en(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:lf,render:Uw,add:Vw,kill:cZ,modifier:uZ,rawVars:0},a={targetTest:0,get:0,getSetter:zw,aliases:{},register:0};if(Qu(),e!==s){if(Ur[n])return;Jr(s,Jr(Fm(e,i),a)),qu(s.prototype,qu(i,Fm(e,a))),Ur[s.prop=n]=s,e.targetTest&&(Fp.push(s),Nw[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}BR(n,s),e.register&&e.register(Or,s,Ir)}else aA.push(e)},St=255,gd={aqua:[0,St,St],lime:[0,St,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,St],navy:[0,0,128],white:[St,St,St],olive:[128,128,0],yellow:[St,St,0],orange:[St,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[St,0,0],pink:[St,192,203],cyan:[0,St,St],transparent:[St,St,St,0]},g1=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)*St+.5|0},uA=function(e,n,r){var s=e?io(e)?[e>>16,e>>8&St,e&St]:0:gd.black,i,a,u,c,d,h,p,m,y,w;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),gd[e])s=gd[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),u=e.charAt(3),e="#"+i+i+a+a+u+u+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&St,s&St,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&St,e&St]}else if(e.substr(0,3)==="hsl"){if(s=w=e.match(Tk),!n)c=+s[0]%360/360,d=+s[1]/100,h=+s[2]/100,a=h<=.5?h*(d+1):h+d-h*d,i=h*2-a,s.length>3&&(s[3]*=1),s[0]=g1(c+1/3,i,a),s[1]=g1(c,i,a),s[2]=g1(c-1/3,i,a);else if(~e.indexOf("="))return s=e.match($R),r&&s.length<4&&(s[3]=1),s}else s=e.match(Tk)||gd.transparent;s=s.map(Number)}return n&&!w&&(i=s[0]/St,a=s[1]/St,u=s[2]/St,p=Math.max(i,a,u),m=Math.min(i,a,u),h=(p+m)/2,p===m?c=d=0:(y=p-m,d=h>.5?y/(2-p-m):y/(p+m),c=p===i?(a-u)/y+(a<u?6:0):p===a?(u-i)/y+2:(i-a)/y+4,c*=60),s[0]=~~(c+.5),s[1]=~~(d*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},cA=function(e){var n=[],r=[],s=-1;return e.split(Xo).forEach(function(i){var a=i.match(mu)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},Lk=function(e,n,r){var s="",i=(e+s).match(Xo),a=n?"hsla(":"rgba(",u=0,c,d,h,p;if(!i)return e;if(i=i.map(function(m){return(m=uA(m,n,1))&&a+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(h=cA(e),c=r.c,c.join(s)!==h.c.join(s)))for(d=e.replace(Xo,"1").split(mu),p=d.length-1;u<p;u++)s+=d[u]+(~c.indexOf(u)?i.shift()||a+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!d)for(d=e.split(Xo),p=d.length-1;u<p;u++)s+=d[u]+i[u];return s+d[p]},Xo=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in gd)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),ZK=/hsl[a]?\(/,dA=function(e){var n=e.join(" "),r;if(Xo.lastIndex=0,Xo.test(n))return r=ZK.test(n),e[1]=Lk(e[1],r),e[0]=Lk(e[0],r,cA(e[1])),!0},cf,Br=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,u=[],c,d,h,p,m,y,w=function _(x){var E=t()-s,k=x===!0,P,T,A,L;if((E>e||E<0)&&(r+=E-n),s+=E,A=s-r,P=A-a,(P>0||k)&&(L=++p.frame,m=A-p.time*1e3,p.time=A=A/1e3,a+=P+(P>=i?4:i-P),T=1),k||(c=d(_)),T)for(y=0;y<u.length;y++)u[y](A,m,L,x)};return p={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(x){return m/(1e3/(x||60))},wake:function(){zR&&(!A_&&Mw()&&(ti=A_=window,Ow=ti.document||{},Qr.gsap=Or,(ti.gsapVersions||(ti.gsapVersions=[])).push(Or.version),UR(Dm||ti.GreenSockGlobals||!ti.gsap&&ti||{}),aA.forEach(lA)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&p.sleep(),d=h||function(x){return setTimeout(x,a-p.time*1e3+1|0)},cf=1,w(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(c),cf=0,d=lf},lagSmoothing:function(x,E){e=x||1/0,n=Math.min(E||33,e)},fps:function(x){i=1e3/(x||240),a=p.time*1e3+i},add:function(x,E,k){var P=E?function(T,A,L,O){x(T,A,L,O),p.remove(P)}:x;return p.remove(x),u[k?"unshift":"push"](P),Qu(),P},remove:function(x,E){~(E=u.indexOf(x))&&u.splice(E,1)&&y>=E&&y--},_listeners:u},p})(),Qu=function(){return!cf&&Br.wake()},ut={},qK=/^[\d.\-M][\d.\-,\s]/,YK=/["']/g,XK=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,a=r.length,u,c,d;i<a;i++)c=r[i],u=i!==a-1?c.lastIndexOf(","):c.length,d=c.substr(0,u),n[s]=isNaN(d)?d.replace(YK,"").trim():+d,s=c.substr(u+1).trim();return n},QK=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)},JK=function(e){var n=(e+"").split("("),r=ut[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[XK(n[1])]:QK(e).split(",").map(ZR)):ut._CE&&qK.test(e)?ut._CE("",e):r},eZ=function(e){return function(n){return 1-e(1-n)}},gl=function(e,n){return e&&(en(e)?e:ut[e]||JK(e))||n},bl=function(e,n,r,s){r===void 0&&(r=function(c){return 1-n(1-c)}),s===void 0&&(s=function(c){return c<.5?n(c*2)/2:1-n((1-c)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},a;return Ar(e,function(u){ut[u]=Qr[u]=i,ut[a=u.toLowerCase()]=r;for(var c in i)ut[a+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ut[u+"."+c]=i[c]}),i},fA=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},v1=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/R_*(Math.asin(1/s)||0),u=function(h){return h===1?1:s*Math.pow(2,-10*h)*EK((h-a)*i)+1},c=e==="out"?u:e==="in"?function(d){return 1-u(1-d)}:fA(u);return i=R_/i,c.config=function(d,h){return t(e,d,h)},c},y1=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)}:fA(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;bl(t+",Power"+(n-1),e?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});ut.Linear.easeNone=ut.none=ut.Linear.easeIn;bl("Elastic",v1("in"),v1("out"),v1());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(u){return u<n?t*u*u:u<r?t*Math.pow(u-1.5/e,2)+.75:u<s?t*(u-=2.25/e)*u+.9375:t*Math.pow(u-2.625/e,2)+.984375};bl("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);bl("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});bl("Circ",function(t){return-(FR(1-t*t)-1)});bl("Sine",function(t){return t===1?1:-SK(t*xK)+1});bl("Back",y1("in"),y1("out"),y1());ut.SteppedEase=ut.steps=Qr.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-Ct;return function(u){return((s*Rf(0,a,u)|0)+i)*r}}};of.ease=ut["quad.out"];Ar("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return Dw+=t+","+t+"Params,"});var hA=function(e,n){this.id=bK++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:GR,this.set=n?n.getSetter:zw},df=(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,Xu(this,+n.duration,1,1),this.data=n.data,zt&&(this._ctx=zt,zt.data.push(this)),cf||Br.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,Xu(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(Qu(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(g0(this,r),!i._dp||i.parent||XR(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)&&ai(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Ct||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),KR(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+Ik(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)+Ik(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?Yu(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-Ct?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Vm(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Ct?0:this._rts,this.totalTime(Rf(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),m0(this),LK(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):(Qu(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ct&&(this._tTime-=Ct)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=Wt(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&ai(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?Vm(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=AK);var s=$n;return $n=r,Fw(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),$n=s,this},e.globalTime=function(r){for(var s=this,i=arguments.length?r:s.rawTime();s;)i=s._start+i/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,Mk(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,Mk(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(us(this,r),Rr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Rr(s)),this._dur||(this._zTime=-Ct),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?-Ct:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ct,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)-Ct)},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 u=en(r)?r:qR,c=function(){var h=s.then;s.then=null,i&&i(),en(u)&&(u=u(s))&&(u.then||u===s)&&(s.then=h),a(u),s.then=h};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?c():s._prom=c})},e.kill=function(){md(this)},t})();Jr(df.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:-Ct,_prom:0,_ps:!1,_rts:1});var Cr=(function(t){jR(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),Gt&&ai(r.parent||Gt,Ui(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&QR(Ui(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return Ad(0,arguments,this),this},n.from=function(s,i,a){return Ad(1,arguments,this),this},n.fromTo=function(s,i,a,u){return Ad(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,Rd(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new gn(s,i,us(this,a),1),this},n.call=function(s,i,a){return ai(this,gn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,u,c,d,h){return a.duration=i,a.stagger=a.stagger||u,a.onComplete=d,a.onCompleteParams=h,a.parent=this,new gn(s,a,us(this,c)),this},n.staggerFrom=function(s,i,a,u,c,d,h){return a.runBackwards=1,Rd(a).immediateRender=Rr(a.immediateRender),this.staggerTo(s,i,a,u,c,d,h)},n.staggerFromTo=function(s,i,a,u,c,d,h,p){return u.startAt=a,Rd(u).immediateRender=Rr(u.immediateRender),this.staggerTo(s,i,u,c,d,h,p)},n.render=function(s,i,a){var u=this._time,c=this._dirty?this.totalDuration():this._tDur,d=this._dur,h=s<=0?0:Wt(s),p=this._zTime<0!=s<0&&(this._initted||!d),m,y,w,_,x,E,k,P,T,A,L,O;if(this!==Gt&&h>c&&s>=0&&(h=c),h!==this._tTime||a||p){if(u!==this._time&&d&&(h+=this._time-u,s+=this._time-u),m=h,T=this._start,P=this._ts,E=!P,p&&(d||(u=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(L=this._yoyo,x=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(x*100+s,i,a);if(m=Wt(h%x),h===c?(_=this._repeat,m=d):(A=Wt(h/x),_=~~A,_&&_===A&&(m=d,_--),m>d&&(m=d)),A=Yu(this._tTime,x),!u&&this._tTime&&A!==_&&this._tTime-A*x-this._dur<=0&&(A=_),L&&_&1&&(m=d-m,O=1),_!==A&&!this._lock){var R=L&&A&1,M=R===(L&&_&1);if(_<A&&(R=!R),u=R?0:h%d?d:h,this._lock=1,this.render(u||(O?0:Wt(_*x)),i,!d)._lock=0,this._tTime=h,!i&&this.parent&&Gr(this,"onRepeat"),this.vars.repeatRefresh&&!O&&(this.invalidate()._lock=1,A=_),u&&u!==this._time||E!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,c=this._tDur,M&&(this._lock=2,u=R?d:-1e-4,this.render(u,!0),this.vars.repeatRefresh&&!O&&this.invalidate()),this._lock=0,!this._ts&&!E)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=FK(this,Wt(u),Wt(m)),k&&(h-=m-(m=k._start))),this._tTime=h,this._time=m,this._act=!!P,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,u=0),!u&&h&&d&&!i&&!A&&(Gr(this,"onStart"),this._tTime!==h))return this;if(m>=u&&s>=0)for(y=this._first;y;){if(w=y._next,(y._act||m>=y._start)&&y._ts&&k!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(m-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(m-y._start)*y._ts,i,a),m!==this._time||!this._ts&&!E){k=0,w&&(h+=this._zTime=-Ct);break}}y=w}else{y=this._last;for(var N=s<0?s:m;y;){if(w=y._prev,(y._act||N<=y._end)&&y._ts&&k!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(N-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(N-y._start)*y._ts,i,a||$n&&Fw(y)),m!==this._time||!this._ts&&!E){k=0,w&&(h+=this._zTime=N?-Ct:Ct);break}}y=w}}if(k&&!i&&(this.pause(),k.render(m>=u?0:-Ct)._zTime=m>=u?1:-1,this._ts))return this._start=T,m0(this),this.render(s,i,a);this._onUpdate&&!i&&Gr(this,"onUpdate",!0),(h===c&&this._tTime>=this.totalDuration()||!h&&u)&&(T===this._start||Math.abs(P)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(h===c&&this._ts>0||!h&&this._ts<0)&&ia(this,1),!i&&!(s<0&&!u)&&(h||u||!c)&&(Gr(this,h===c&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<c&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var a=this;if(io(i)||(i=us(this,i,s)),!(s instanceof df)){if(Qn(s))return s.forEach(function(u){return a.add(u,i)}),this;if(Rn(s))return this.addLabel(s,i);if(en(s))s=gn.delayedCall(0,s);else return this}return this!==s?ai(this,s,i):this},n.getChildren=function(s,i,a,u){s===void 0&&(s=!0),i===void 0&&(i=!0),a===void 0&&(a=!0),u===void 0&&(u=-hs);for(var c=[],d=this._first;d;)d._start>=u&&(d instanceof gn?i&&c.push(d):(a&&c.push(d),s&&c.push.apply(c,d.getChildren(!0,i,a)))),d=d._next;return c},n.getById=function(s){for(var i=this.getChildren(1,1,1),a=i.length;a--;)if(i[a].vars.id===s)return i[a]},n.remove=function(s){return Rn(s)?this.removeLabel(s):en(s)?this.killTweensOf(s):(s.parent===this&&p0(this,s),s===this._recent&&(this._recent=this._last),ml(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Wt(Br.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]=us(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var u=gn.delayedCall(0,i||lf,a);return u.data="isPause",this._hasPause=1,ai(this,u,us(this,s))},n.removePause=function(s){var i=this._first;for(s=us(this,s);i;)i._start===s&&i.data==="isPause"&&ia(i),i=i._next},n.killTweensOf=function(s,i,a){for(var u=this.getTweensOf(s,a),c=u.length;c--;)Wo!==u[c]&&u[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],u=ps(s),c=this._first,d=io(i),h;c;)c instanceof gn?IK(c._targets,u)&&(d?(!Wo||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&a.push(c):(h=c.getTweensOf(u,i)).length&&a.push.apply(a,h),c=c._next;return a},n.tweenTo=function(s,i){i=i||{};var a=this,u=us(a,s),c=i,d=c.startAt,h=c.onStart,p=c.onStartParams,m=c.immediateRender,y,w=gn.to(a,Jr({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:u,overwrite:"auto",duration:i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale())||Ct,onStart:function(){if(a.pause(),!y){var x=i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale());w._dur!==x&&Xu(w,x,0,1).render(w._time,!0,!0),y=1}h&&h.apply(w,p||[])}},i));return m?w.render(0):w},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,Jr({startAt:{time:us(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),Ok(this,us(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),Ok(this,us(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Ct)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var u=this._first,c=this.labels,d;for(s=Wt(s);u;)u._start>=a&&(u._start+=s,u._end+=s),u=u._next;if(i)for(d in c)c[d]>=a&&(c[d]+=s);return ml(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={}),ml(this)},n.totalDuration=function(s){var i=0,a=this,u=a._last,c=hs,d,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;u;)d=u._prev,u._dirty&&u.totalDuration(),h=u._start,h>c&&a._sort&&u._ts&&!a._lock?(a._lock=1,ai(a,u,h-u._delay,1)._lock=0):c=h,h<0&&u._ts&&(i-=h,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=Wt(h/a._ts),a._time-=h,a._tTime-=h),a.shiftChildren(-h,!1,-1/0),c=0),u._end>i&&u._ts&&(i=u._end),u=d;Xu(a,a===Gt&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(Gt._ts&&(KR(Gt,Vm(s,Gt)),WR=Br.frame),Br.frame>=Rk){Rk+=Yr.autoSleep||120;var i=Gt._first;if((!i||!i._ts)&&Yr.autoSleep&&Br._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Br.sleep()}}},e})(df);Jr(Cr.prototype,{_lock:0,_hasPause:0,_forcing:0});var tZ=function(e,n,r,s,i,a,u){var c=new Ir(this._pt,e,n,0,1,_A,null,i),d=0,h=0,p,m,y,w,_,x,E,k;for(c.b=r,c.e=s,r+="",s+="",(E=~s.indexOf("random("))&&(s=uf(s)),a&&(k=[r,s],a(k,e,n),r=k[0],s=k[1]),m=r.match(p1)||[];p=p1.exec(s);)w=p[0],_=s.substring(d,p.index),y?y=(y+1)%5:_.substr(-5)==="rgba("&&(y=1),w!==m[h++]&&(x=parseFloat(m[h-1])||0,c._pt={_next:c._pt,p:_||h===1?_:",",s:x,c:w.charAt(1)==="="?Su(x,w)-x:parseFloat(w)-x,m:y&&y<4?Math.round:0},d=p1.lastIndex);return c.c=d<s.length?s.substring(d,s.length):"",c.fp=u,(HR.test(s)||E)&&(c.e=0),this._pt=c,c},Vw=function(e,n,r,s,i,a,u,c,d,h){en(s)&&(s=s(i||0,e,a));var p=e[n],m=r!=="get"?r:en(p)?d?e[n.indexOf("set")||!en(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,y=en(p)?d?oZ:vA:Hw,w;if(Rn(s)&&(~s.indexOf("random(")&&(s=uf(s)),s.charAt(1)==="="&&(w=Su(m,s)+(Yn(m)||0),(w||w===0)&&(s=w))),!h||m!==s||j_)return!isNaN(m*s)&&s!==""?(w=new Ir(this._pt,e,n,+m||0,s-(m||0),typeof p=="boolean"?lZ:yA,0,y),d&&(w.fp=d),u&&w.modifier(u,this,e),this._pt=w):(!p&&!(n in e)&&Lw(n,s),tZ.call(this,e,n,m,s,y,c||Yr.stringFilter,d))},nZ=function(e,n,r,s,i){if(en(e)&&(e=Id(e,i,n,r,s)),!mi(e)||e.style&&e.nodeType||Qn(e)||VR(e))return Rn(e)?Id(e,i,n,r,s):e;var a={},u;for(u in e)a[u]=Id(e[u],i,n,r,s);return a},pA=function(e,n,r,s,i,a){var u,c,d,h;if(Ur[e]&&(u=new Ur[e]).init(i,u.rawVars?n[e]:nZ(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=c=new Ir(r._pt,i,e,0,1,u.render,u,0,u.priority),r!==gu))for(d=r._ptLookup[r._targets.indexOf(i)],h=u._props.length;h--;)d[u._props[h]]=c;return u},Wo,j_,$w=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,u=s.immediateRender,c=s.lazy,d=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,m=s.keyframes,y=s.autoRevert,w=e._dur,_=e._startAt,x=e._targets,E=e.parent,k=E&&E.data==="nested"?E.vars.targets:x,P=e._overwrite==="auto"&&!Aw,T=e.timeline,A=s.easeReverse||p,L,O,R,M,N,j,F,q,G,W,K,X,$;if(T&&(!m||!i)&&(i="none"),e._ease=gl(i,of.ease),e._rEase=A&&(gl(A)||e._ease),e._from=!T&&!!s.runBackwards,e._from&&(e.ratio=1),!T||m&&!s.stagger){if(q=x[0]?pl(x[0]).harness:0,X=q&&s[q.prop],L=Fm(s,Nw),_&&(_._zTime<0&&_.progress(1),n<0&&h&&u&&!y?_.render(-1,!0):_.revert(h&&w?jp:RK),_._lazy=0),a){if(ia(e._startAt=gn.set(x,Jr({data:"isStart",overwrite:!1,parent:E,immediateRender:!0,lazy:!_&&Rr(c),startAt:null,delay:0,onUpdate:d&&function(){return Gr(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&($n||!u&&!y)&&e._startAt.revert(jp),u&&w&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&w&&!_){if(n&&(u=!1),R=Jr({overwrite:!1,data:"isFromStart",lazy:u&&!_&&Rr(c),immediateRender:u,stagger:0,parent:E},L),X&&(R[q.prop]=X),ia(e._startAt=gn.set(x,R)),e._startAt._dp=0,e._startAt._sat=e,n<0&&($n?e._startAt.revert(jp):e._startAt.render(-1,!0)),e._zTime=n,!u)t(e._startAt,Ct,Ct);else if(!n)return}for(e._pt=e._ptCache=0,c=w&&Rr(c)||c&&!w,O=0;O<x.length;O++){if(N=x[O],F=N._gsap||jw(x)[O]._gsap,e._ptLookup[O]=W={},I_[F.id]&&Yo.length&&jm(),K=k===x?O:k.indexOf(N),q&&(G=new q).init(N,X||L,e,K,k)!==!1&&(e._pt=M=new Ir(e._pt,N,G.name,0,1,G.render,G,0,G.priority),G._props.forEach(function(ee){W[ee]=M}),G.priority&&(j=1)),!q||X)for(R in L)Ur[R]&&(G=pA(R,L,e,K,N,k))?G.priority&&(j=1):W[R]=M=Vw.call(e,N,R,"get",L[R],K,k,0,s.stringFilter);e._op&&e._op[O]&&e.kill(N,e._op[O]),P&&e._pt&&(Wo=e,Gt.killTweensOf(N,W,e.globalTime(n)),$=!e.parent,Wo=0),e._pt&&c&&(I_[F.id]=1)}j&&wA(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!$,m&&n<=0&&T.render(hs,!0,!0)},rZ=function(e,n,r,s,i,a,u,c){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,m,y;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,y=e._targets.length;y--;){if(h=m[y][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",$w(e,u),j_=0,c?af(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(h)}for(y=d.length;y--;)p=d[y],h=p._pt||p,h.s=(s||s===0)&&!i?s:h.s+(s||0)+a*h.c,h.c=r-h.s,p.e&&(p.e=an(r)+Yn(p.e)),p.b&&(p.b=h.s+Yn(p.b))},sZ=function(e,n){var r=e[0]?pl(e[0]).harness:0,s=r&&r.aliases,i,a,u,c;if(!s)return n;i=qu({},n);for(a in s)if(a in i)for(c=s[a].split(","),u=c.length;u--;)i[c[u]]=i[a];return i},iZ=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,u;if(Qn(n))u=r[e]||(r[e]=[]),n.forEach(function(c,d){return u.push({t:d/(n.length-1)*100,v:c,e:i})});else for(a in n)u=r[a]||(r[a]=[]),a==="ease"||u.push({t:parseFloat(e),v:n[a],e:i})},Id=function(e,n,r,s,i){return en(e)?e.call(n,r,s,i):Rn(e)&&~e.indexOf("random(")?uf(e):e},mA=Dw+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",gA={};Ar(mA+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return gA[t]=1});var gn=(function(t){jR(e,t);function e(r,s,i,a){var u;typeof s=="number"&&(i.duration=s,s=i,i=null),u=t.call(this,a?s:Rd(s))||this;var c=u.vars,d=c.duration,h=c.delay,p=c.immediateRender,m=c.stagger,y=c.overwrite,w=c.keyframes,_=c.defaults,x=c.scrollTrigger,E=s.parent||Gt,k=(Qn(r)||VR(r)?io(r[0]):"length"in s)?[r]:ps(r),P,T,A,L,O,R,M,N;if(u._targets=k.length?jw(k):af("GSAP target "+r+" not found. https://gsap.com",!Yr.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=y,w||m||pp(d)||pp(h)){s=u.vars;var j=s.easeReverse||s.yoyoEase;if(P=u.timeline=new Cr({data:"nested",defaults:_||{},targets:E&&E.data==="nested"?E.vars.targets:k}),P.kill(),P.parent=P._dp=Ui(u),P._start=0,m||pp(d)||pp(h)){if(L=k.length,M=m&&nA(m),mi(m))for(O in m)~mA.indexOf(O)&&(N||(N={}),N[O]=m[O]);for(T=0;T<L;T++)A=Fm(s,gA),A.stagger=0,j&&(A.easeReverse=j),N&&qu(A,N),R=k[T],A.duration=+Id(d,Ui(u),T,R,k),A.delay=(+Id(h,Ui(u),T,R,k)||0)-u._delay,!m&&L===1&&A.delay&&(u._delay=h=A.delay,u._start+=h,A.delay=0),P.to(R,A,M?M(T,R,k):0),P._ease=ut.none;P.duration()?d=h=0:u.timeline=0}else if(w){Rd(Jr(P.vars.defaults,{ease:"none"})),P._ease=gl(w.ease||s.ease||"none");var F=0,q,G,W;if(Qn(w))w.forEach(function(K){return P.to(k,K,">")}),P.duration();else{A={};for(O in w)O==="ease"||O==="easeEach"||iZ(O,w[O],A,w.easeEach);for(O in A)for(q=A[O].sort(function(K,X){return K.t-X.t}),F=0,T=0;T<q.length;T++)G=q[T],W={ease:G.e,duration:(G.t-(T?q[T-1].t:0))/100*d},W[O]=G.v,P.to(k,W,F),F+=W.duration;P.duration()<d&&P.to({},{duration:d-P.duration()})}}d||u.duration(d=P.duration())}else u.timeline=0;return y===!0&&!Aw&&(Wo=Ui(u),Gt.killTweensOf(k),Wo=0),ai(E,Ui(u),i),s.reversed&&u.reverse(),s.paused&&u.paused(!0),(p||!d&&!w&&u._start===Wt(E._time)&&Rr(p)&&NK(Ui(u))&&E.data!=="nested")&&(u._tTime=-Ct,u.render(Math.max(0,-h)||0)),x&&QR(Ui(u),x),u}var n=e.prototype;return n.render=function(s,i,a){var u=this._time,c=this._tDur,d=this._dur,h=s<0,p=s>c-Ct&&!h?c:s<Ct?0:s,m,y,w,_,x,E,k,P;if(!d)jK(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(_=d+this._rDelay,this._repeat<-1&&h)return this.totalTime(_*100+s,i,a);if(m=Wt(p%_),p===c?(w=this._repeat,m=d):(x=Wt(p/_),w=~~x,w&&w===x?(m=d,w--):m>d&&(m=d)),E=this._yoyo&&w&1,E&&(m=d-m),x=Yu(this._tTime,_),m===u&&!a&&this._initted&&w===x)return this._tTime=p,this;w!==x&&this.vars.repeatRefresh&&!E&&!this._lock&&m!==_&&this._initted&&(this._lock=a=1,this.render(Wt(_*w),!0).invalidate()._lock=0)}if(!this._initted){if(JR(this,h?s:m,a,i,p))return this._tTime=0,this;if(u!==this._time&&!(a&&this.vars.repeatRefresh&&w!==x))return this;if(d!==this._dur)return this.render(s,i,a)}if(this._rEase){var T=m<u;if(T!==this._inv){var A=T?u:d-u;this._inv=T,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=u,this._invRecip=A?(T?-1:1)/A:0,this._invScale=T?-this.ratio:1-this.ratio,this._invEase=T?this._rEase:this._ease}this.ratio=k=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=k=this._ease(m/d);if(this._from&&(this.ratio=k=1-k),this._tTime=p,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!u&&p&&!i&&!x&&(Gr(this,"onStart"),this._tTime!==p))return this;for(y=this._pt;y;)y.r(k,y.d),y=y._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&&M_(this,s,i,a),Gr(this,"onUpdate")),this._repeat&&w!==x&&this.vars.onRepeat&&!i&&this.parent&&Gr(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&M_(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&ia(this,1),!i&&!(h&&!u)&&(p||u||E)&&(Gr(this,p===c?"onComplete":"onReverseComplete",!0),this._prom&&!(p<c&&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,u,c){cf||Br.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||$w(this,d),h=this._ease(d/this._dur),rZ(this,s,i,a,u,h,d,c)?this.resetTo(s,i,a,u,1):(g0(this,0),this.parent||YR(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?md(this):this.scrollTrigger&&this.scrollTrigger.kill(!!$n),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Wo&&Wo.vars.overwrite!==!0)._first||md(this),this.parent&&a!==this.timeline.totalDuration()&&Xu(this,this._dur*this.timeline._tDur/a,0,1),this}var u=this._targets,c=s?ps(s):u,d=this._ptLookup,h=this._pt,p,m,y,w,_,x,E;if((!i||i==="all")&&OK(u,c))return i==="all"&&(this._pt=0),md(this);for(p=this._op=this._op||[],i!=="all"&&(Rn(i)&&(_={},Ar(i,function(k){return _[k]=1}),i=_),i=sZ(u,i)),E=u.length;E--;)if(~c.indexOf(u[E])){m=d[E],i==="all"?(p[E]=i,w=m,y={}):(y=p[E]=p[E]||{},w=i);for(_ in w)x=m&&m[_],x&&((!("kill"in x.d)||x.d.kill(_)===!0)&&p0(this,x,"_pt"),delete m[_]),y!=="all"&&(y[_]=1)}return this._initted&&!this._pt&&h&&md(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Ad(1,arguments)},e.delayedCall=function(s,i,a,u){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:u})},e.fromTo=function(s,i,a){return Ad(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 Gt.killTweensOf(s,i,a)},e})(df);Jr(gn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Ar("staggerTo,staggerFrom,staggerFromTo",function(t){gn[t]=function(){var e=new Cr,n=L_.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var Hw=function(e,n,r){return e[n]=r},vA=function(e,n,r){return e[n](r)},oZ=function(e,n,r,s){return e[n](s.fp,r)},aZ=function(e,n,r){return e.setAttribute(n,r)},zw=function(e,n){return en(e[n])?vA:Iw(e[n])&&e.setAttribute?aZ:Hw},yA=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},lZ=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},_A=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)},Uw=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},uZ=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},cZ=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?p0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},dZ=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},wA=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,u,c,d,h){this.t=r,this.s=i,this.c=a,this.p=s,this.r=u||yA,this.d=c||this,this.set=d||Hw,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=dZ,this.m=r,this.mt=i,this.tween=s},t})();Ar(Dw+"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 Nw[t]=1});Qr.TweenMax=Qr.TweenLite=gn;Qr.TimelineLite=Qr.TimelineMax=Cr;Gt=new Cr({sortChildren:!1,defaults:of,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Yr.stringFilter=dA;var vl=[],Vp={},fZ=[],Nk=0,hZ=0,_1=function(e){return(Vp[e]||fZ).map(function(n){return n()})},F_=function(){var e=Date.now(),n=[];e-Nk>2&&(_1("matchMediaInit"),vl.forEach(function(r){var s=r.queries,i=r.conditions,a,u,c,d;for(u in s)a=ti.matchMedia(s[u]).matches,a&&(c=1),a!==i[u]&&(i[u]=a,d=1);d&&(r.revert(),c&&n.push(r))}),_1("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),Nk=e,_1("matchMedia"))},xA=(function(){function t(n,r){this.selector=r&&N_(r),this.data=[],this._r=[],this.isReverted=!1,this.id=hZ++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){en(r)&&(i=s,s=r,r=en);var a=this,u=function(){var d=zt,h=a.selector,p;return d&&d!==a&&d.data.push(a),i&&(a.selector=N_(i)),zt=a,p=s.apply(a,arguments),en(p)&&a._r.push(p),zt=d,a.selector=h,a.isReverted=!1,p};return a.last=u,r===en?u(a,function(c){return a.add(null,c)}):r?a[r]=u:u},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 gn&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var u=i.getTweens(),c=i.data.length,d;c--;)d=i.data[c],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(h){return u.splice(u.indexOf(h),1)}));for(u.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)}),c=i.data.length;c--;)d=i.data[c],d instanceof Cr?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof gn)&&d.revert&&d.revert(r);i._r.forEach(function(h){return h(r,i)}),i.isReverted=!0})():this.data.forEach(function(u){return u.kill&&u.kill()}),this.clear(),s)for(var a=vl.length;a--;)vl[a].id===this.id&&vl.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),pZ=(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){mi(r)||(r={matches:r});var a=new xA(0,i||this.scope),u=a.conditions={},c,d,h;zt&&!a.selector&&(a.selector=zt.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=r;for(d in r)d==="all"?h=1:(c=ti.matchMedia(r[d]),c&&(vl.indexOf(a)<0&&vl.push(a),(u[d]=c.matches)&&(h=1),c.addListener?c.addListener(F_):c.addEventListener("change",F_)));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})(),$m={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 lA(s)})},timeline:function(e){return new Cr(e)},getTweensOf:function(e,n){return Gt.getTweensOf(e,n)},getProperty:function(e,n,r,s){Rn(e)&&(e=ps(e)[0]);var i=pl(e||{}).get,a=r?qR:ZR;return r==="native"&&(r=""),e&&(n?a((Ur[n]&&Ur[n].get||i)(e,n,r,s)):function(u,c,d){return a((Ur[u]&&Ur[u].get||i)(e,u,c,d))})},quickSetter:function(e,n,r){if(e=ps(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=Ur[n],u=pl(e),c=u.harness&&(u.harness.aliases||{})[n]||n,d=a?function(h){var p=new a;gu._pt=0,p.init(e,r?h+r:h,gu,0,[e]),p.render(1,p),gu._pt&&Uw(1,gu)}:u.set(e,c);return a?d:function(h){return d(e,c,r?h+r:h,u,1)}},quickTo:function(e,n,r){var s,i=Or.to(e,Jr((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(c,d,h){return i.resetTo(n,c,d,h)};return a.tween=i,a},isTweening:function(e){return Gt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=gl(e.ease,of.ease)),Ak(of,e||{})},config:function(e){return Ak(Yr,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,a=e.extendTimeline;(s||"").split(",").forEach(function(u){return u&&!Ur[u]&&!Qr[u]&&af(n+" effect requires "+u+" plugin.")}),m1[n]=function(u,c,d){return r(ps(u),Jr(c||{},i),d)},a&&(Cr.prototype[n]=function(u,c,d){return this.add(m1[n](u,mi(c)?c:(d=c)&&{},this),d)})},registerEase:function(e,n){ut[e]=gl(n)},parseEase:function(e,n){return arguments.length?gl(e,n):ut},getById:function(e){return Gt.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Cr(e),s,i;for(r.smoothChildTiming=Rr(e.smoothChildTiming),Gt.remove(r),r._dp=0,r._time=r._tTime=Gt._time,s=Gt._first;s;)i=s._next,(n||!(!s._dur&&s instanceof gn&&s.vars.onComplete===s._targets[0]))&&ai(r,s,s._start-s._delay),s=i;return ai(Gt,r,0),r},context:function(e,n){return e?new xA(e,n):zt},matchMedia:function(e){return new pZ(e)},matchMediaRefresh:function(){return vl.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||F_()},addEventListener:function(e,n){var r=Vp[e]||(Vp[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Vp[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:WK,wrapYoyo:GK,distribute:nA,random:sA,snap:rA,normalize:BK,getUnit:Yn,clamp:$K,splitColor:uA,toArray:ps,selector:N_,mapRange:oA,pipe:zK,unitize:UK,interpolate:KK,shuffle:tA},install:UR,effects:m1,ticker:Br,updateRoot:Cr.updateRoot,plugins:Ur,globalTimeline:Gt,core:{PropTween:Ir,globals:BR,Tween:gn,Timeline:Cr,Animation:df,getCache:pl,_removeLinkedListItem:p0,reverting:function(){return $n},context:function(e){return e&&zt&&(zt.data.push(e),e._ctx=zt),zt},suppressOverwrites:function(e){return Aw=e}}};Ar("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return $m[t]=gn[t]});Br.add(Cr.updateRoot);gu=$m.to({},{duration:0});var mZ=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},gZ=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=mZ(a,s)),a&&a.modifier&&a.modifier(n[s],e,r[i],s))},w1=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(u){var c,d;if(Rn(i)&&(c={},Ar(i,function(h){return c[h]=1}),i=c),n){c={};for(d in i)c[d]=n(i[d]);i=c}gZ(u,i)}}}},Or=$m.registerPlugin({name:"attr",init:function(e,n,r,s,i){var a,u,c;this.tween=r;for(a in n)c=e.getAttribute(a)||"",u=this.add(e,"setAttribute",(c||0)+"",n[a],s,i,0,0,a),u.op=a,u.b=c,this._props.push(a)},render:function(e,n){for(var r=n._pt;r;)$n?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,n){for(var r=n.length;r--;)this.add(e,r,e[r]||0,n[r],0,0,0,0,0,1)}},w1("roundProps",D_),w1("modifiers"),w1("snap",rA))||$m;gn.version=Cr.version=Or.version="3.15.0";zR=1;Mw()&&Qu();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 Dk,Go,Eu,Bw,Ja,jk,Ww,vZ=function(){return typeof window<"u"},oo={},Ga=180/Math.PI,Cu=Math.PI/180,ru=Math.atan2,Fk=1e8,Gw=/([A-Z])/g,yZ=/(left|right|width|margin|padding|x)/i,_Z=/[\s,\(]\S/,ci={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},V_=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},wZ=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)},xZ=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)},bZ=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)},SZ=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},bA=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},SA=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},EZ=function(e,n,r){return e.style[n]=r},CZ=function(e,n,r){return e.style.setProperty(n,r)},kZ=function(e,n,r){return e._gsap[n]=r},PZ=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},TZ=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},RZ=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},Kt="transform",Mr=Kt+"Origin",AZ=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in oo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=ci[e]||e,~e.indexOf(",")?e.split(",").forEach(function(u){return r.tfm[u]=Wi(s,u)}):this.tfm[e]=a.x?a[e]:Wi(s,e),e===Mr&&(this.tfm.zOrigin=a.zOrigin);else return ci.transform.split(",").forEach(function(u){return t.call(r,u,n)});if(this.props.indexOf(Kt)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Mr,n,"")),e=Kt}(i||n)&&this.props.push(e,n,i[e])},EA=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},IZ=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(Gw,"-$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=Ww(),(!i||!i.isStart)&&!r[Kt]&&(EA(r),s.zOrigin&&r[Mr]&&(r[Mr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},CA=function(e,n){var r={target:e,props:[],revert:IZ,save:AZ};return e._gsap||Or.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},kA,$_=function(e,n){var r=Go.createElementNS?Go.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Go.createElement(e);return r&&r.style?r:Go.createElement(e)},Kr=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(Gw,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Ju(n)||n,1)||""},Vk="O,Moz,ms,Ms,Webkit".split(","),Ju=function(e,n,r){var s=n||Ja,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(Vk[a]+e in i););return a<0?null:(a===3?"ms":a>=0?Vk[a]:"")+e},H_=function(){vZ()&&window.document&&(Dk=window,Go=Dk.document,Eu=Go.documentElement,Ja=$_("div")||{style:{}},$_("div"),Kt=Ju(Kt),Mr=Kt+"Origin",Ja.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",kA=!!Ju("perspective"),Ww=Or.core.reverting,Bw=1)},$k=function(e){var n=e.ownerSVGElement,r=$_("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Eu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Eu.removeChild(r),i},Hk=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},PA=function(e){var n,r;try{n=e.getBBox()}catch{n=$k(e),r=1}return n&&(n.width||n.height)||r||(n=$k(e)),n&&!n.width&&!n.x&&!n.y?{x:+Hk(e,["x","cx","x1"])||0,y:+Hk(e,["y","cy","y1"])||0,width:0,height:0}:n},TA=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&PA(e))},oa=function(e,n){if(n){var r=e.style,s;n in oo&&n!==Mr&&(n=Kt),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(Gw,"-$1").toLowerCase())):r.removeAttribute(n)}},Ko=function(e,n,r,s,i,a){var u=new Ir(e._pt,n,r,0,1,a?SA:bA);return e._pt=u,u.b=s,u.e=i,e._props.push(r),u},zk={deg:1,rad:1,turn:1},MZ={grid:1,flex:1},aa=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",u=Ja.style,c=yZ.test(n),d=e.tagName.toLowerCase()==="svg",h=(d?"client":"offset")+(c?"Width":"Height"),p=100,m=s==="px",y=s==="%",w,_,x,E;if(s===a||!i||zk[s]||zk[a])return i;if(a!=="px"&&!m&&(i=t(e,n,r,"px")),E=e.getCTM&&TA(e),(y||a==="%")&&(oo[n]||~n.indexOf("adius")))return w=E?e.getBBox()[c?"width":"height"]:e[h],an(y?i/w*p:i/100*w);if(u[c?"width":"height"]=p+(m?a:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,E&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Go||!_.appendChild)&&(_=Go.body),x=_._gsap,x&&y&&x.width&&c&&x.time===Br.time&&!x.uncache)return an(i/x.width*p);if(y&&(n==="height"||n==="width")){var k=e.style[n];e.style[n]=p+s,w=e[h],k?e.style[n]=k:oa(e,n)}else(y||a==="%")&&!MZ[Kr(_,"display")]&&(u.position=Kr(e,"position")),_===e&&(u.position="static"),_.appendChild(Ja),w=Ja[h],_.removeChild(Ja),u.position="absolute";return c&&y&&(x=pl(_),x.time=Br.time,x.width=_[h]),an(m?w*i/p:w&&i?p/w*i:0)},Wi=function(e,n,r,s){var i;return Bw||H_(),n in ci&&n!=="transform"&&(n=ci[n],~n.indexOf(",")&&(n=n.split(",")[0])),oo[n]&&n!=="transform"?(i=hf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:zm(Kr(e,Mr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Hm[n]&&Hm[n](e,n,r)||Kr(e,n)||GR(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?aa(e,n,i,r)+r:i},OZ=function(e,n,r,s){if(!r||r==="none"){var i=Ju(n,e,1),a=i&&Kr(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=Kr(e,"borderTopColor"))}var u=new Ir(this._pt,e.style,n,0,1,_A),c=0,d=0,h,p,m,y,w,_,x,E,k,P,T,A;if(u.b=r,u.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=Kr(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=Kr(e,n)||s,_?e.style[n]=_:oa(e,n)),h=[r,s],dA(h),r=h[0],s=h[1],m=r.match(mu)||[],A=s.match(mu)||[],A.length){for(;p=mu.exec(s);)x=p[0],k=s.substring(c,p.index),w?w=(w+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(w=1),x!==(_=m[d++]||"")&&(y=parseFloat(_)||0,T=_.substr((y+"").length),x.charAt(1)==="="&&(x=Su(y,x)+T),E=parseFloat(x),P=x.substr((E+"").length),c=mu.lastIndex-P.length,P||(P=P||Yr.units[n]||T,c===s.length&&(s+=P,u.e+=P)),T!==P&&(y=aa(e,n,_,P)||0),u._pt={_next:u._pt,p:k||d===1?k:",",s:y,c:E-y,m:w&&w<4||n==="zIndex"?Math.round:0});u.c=c<s.length?s.substring(c,s.length):""}else u.r=n==="display"&&s==="none"?SA:bA;return HR.test(s)&&(u.e=0),this._pt=u,u},Uk={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},LZ=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]=Uk[r]||r,n[1]=Uk[s]||s,n.join(" ")},NZ=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,u,c,d;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),d=i.length;--d>-1;)u=i[d],oo[u]&&(c=1,u=u==="transformOrigin"?Mr:Kt),oa(r,u);c&&(oa(r,Kt),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",hf(r,1),a.uncache=1,EA(s)))}},Hm={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new Ir(e._pt,n,r,0,0,NZ);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},ff=[1,0,0,1,0,0],RA={},AA=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Bk=function(e){var n=Kr(e,Kt);return AA(n)?ff:n.substr(7).match($R).map(an)},Kw=function(e,n){var r=e._gsap||pl(e),s=e.style,i=Bk(e),a,u,c,d;return r.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?ff:i):(i===ff&&!e.offsetParent&&e!==Eu&&!r.svg&&(c=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,u=e.nextElementSibling,Eu.appendChild(e)),i=Bk(e),c?s.display=c:oa(e,"display"),d&&(u?a.insertBefore(e,u):a?a.appendChild(e):Eu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},z_=function(e,n,r,s,i,a){var u=e._gsap,c=i||Kw(e,!0),d=u.xOrigin||0,h=u.yOrigin||0,p=u.xOffset||0,m=u.yOffset||0,y=c[0],w=c[1],_=c[2],x=c[3],E=c[4],k=c[5],P=n.split(" "),T=parseFloat(P[0])||0,A=parseFloat(P[1])||0,L,O,R,M;r?c!==ff&&(O=y*x-w*_)&&(R=T*(x/O)+A*(-_/O)+(_*k-x*E)/O,M=T*(-w/O)+A*(y/O)-(y*k-w*E)/O,T=R,A=M):(L=PA(e),T=L.x+(~P[0].indexOf("%")?T/100*L.width:T),A=L.y+(~(P[1]||P[0]).indexOf("%")?A/100*L.height:A)),s||s!==!1&&u.smooth?(E=T-d,k=A-h,u.xOffset=p+(E*y+k*_)-E,u.yOffset=m+(E*w+k*x)-k):u.xOffset=u.yOffset=0,u.xOrigin=T,u.yOrigin=A,u.smooth=!!s,u.origin=n,u.originIsAbsolute=!!r,e.style[Mr]="0px 0px",a&&(Ko(a,u,"xOrigin",d,T),Ko(a,u,"yOrigin",h,A),Ko(a,u,"xOffset",p,u.xOffset),Ko(a,u,"yOffset",m,u.yOffset)),e.setAttribute("data-svg-origin",T+" "+A)},hf=function(e,n){var r=e._gsap||new hA(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,a="px",u="deg",c=getComputedStyle(e),d=Kr(e,Mr)||"0",h,p,m,y,w,_,x,E,k,P,T,A,L,O,R,M,N,j,F,q,G,W,K,X,$,ee,z,D,Y,te,ie,ae;return h=p=m=_=x=E=k=P=T=0,y=w=1,r.svg=!!(e.getCTM&&TA(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[Kt]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[Kt]!=="none"?c[Kt]:"")),s.scale=s.rotate=s.translate="none"),O=Kw(e,r.svg),r.svg&&(r.uncache?($=e.getBBox(),d=r.xOrigin-$.x+"px "+(r.yOrigin-$.y)+"px",X=""):X=!n&&e.getAttribute("data-svg-origin"),z_(e,X||d,!!X||r.originIsAbsolute,r.smooth!==!1,O)),A=r.xOrigin||0,L=r.yOrigin||0,O!==ff&&(j=O[0],F=O[1],q=O[2],G=O[3],h=W=O[4],p=K=O[5],O.length===6?(y=Math.sqrt(j*j+F*F),w=Math.sqrt(G*G+q*q),_=j||F?ru(F,j)*Ga:0,k=q||G?ru(q,G)*Ga+_:0,k&&(w*=Math.abs(Math.cos(k*Cu))),r.svg&&(h-=A-(A*j+L*q),p-=L-(A*F+L*G))):(ae=O[6],te=O[7],z=O[8],D=O[9],Y=O[10],ie=O[11],h=O[12],p=O[13],m=O[14],R=ru(ae,Y),x=R*Ga,R&&(M=Math.cos(-R),N=Math.sin(-R),X=W*M+z*N,$=K*M+D*N,ee=ae*M+Y*N,z=W*-N+z*M,D=K*-N+D*M,Y=ae*-N+Y*M,ie=te*-N+ie*M,W=X,K=$,ae=ee),R=ru(-q,Y),E=R*Ga,R&&(M=Math.cos(-R),N=Math.sin(-R),X=j*M-z*N,$=F*M-D*N,ee=q*M-Y*N,ie=G*N+ie*M,j=X,F=$,q=ee),R=ru(F,j),_=R*Ga,R&&(M=Math.cos(R),N=Math.sin(R),X=j*M+F*N,$=W*M+K*N,F=F*M-j*N,K=K*M-W*N,j=X,W=$),x&&Math.abs(x)+Math.abs(_)>359.9&&(x=_=0,E=180-E),y=an(Math.sqrt(j*j+F*F+q*q)),w=an(Math.sqrt(K*K+ae*ae)),R=ru(W,K),k=Math.abs(R)>2e-4?R*Ga:0,T=ie?1/(ie<0?-ie:ie):0),r.svg&&(X=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!AA(Kr(e,Kt)),X&&e.setAttribute("transform",X))),Math.abs(k)>90&&Math.abs(k)<270&&(i?(y*=-1,k+=_<=0?180:-180,_+=_<=0?180:-180):(w*=-1,k+=k<=0?180:-180)),n=n||r.uncache,r.x=h-((r.xPercent=h&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+a,r.y=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+a,r.z=m+a,r.scaleX=an(y),r.scaleY=an(w),r.rotation=an(_)+u,r.rotationX=an(x)+u,r.rotationY=an(E)+u,r.skewX=k+u,r.skewY=P+u,r.transformPerspective=T+a,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Mr]=zm(d)),r.xOffset=r.yOffset=0,r.force3D=Yr.force3D,r.renderTransform=r.svg?jZ:kA?IA:DZ,r.uncache=0,r},zm=function(e){return(e=e.split(" "))[0]+" "+e[1]},x1=function(e,n,r){var s=Yn(n);return an(parseFloat(n)+parseFloat(aa(e,"x",r+"px",s)))+s},DZ=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,IA(e,n)},$a="0deg",od="0px",Ha=") ",IA=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.z,d=r.rotation,h=r.rotationY,p=r.rotationX,m=r.skewX,y=r.skewY,w=r.scaleX,_=r.scaleY,x=r.transformPerspective,E=r.force3D,k=r.target,P=r.zOrigin,T="",A=E==="auto"&&e&&e!==1||E===!0;if(P&&(p!==$a||h!==$a)){var L=parseFloat(h)*Cu,O=Math.sin(L),R=Math.cos(L),M;L=parseFloat(p)*Cu,M=Math.cos(L),a=x1(k,a,O*M*-P),u=x1(k,u,-Math.sin(L)*-P),c=x1(k,c,R*M*-P+P)}x!==od&&(T+="perspective("+x+Ha),(s||i)&&(T+="translate("+s+"%, "+i+"%) "),(A||a!==od||u!==od||c!==od)&&(T+=c!==od||A?"translate3d("+a+", "+u+", "+c+") ":"translate("+a+", "+u+Ha),d!==$a&&(T+="rotate("+d+Ha),h!==$a&&(T+="rotateY("+h+Ha),p!==$a&&(T+="rotateX("+p+Ha),(m!==$a||y!==$a)&&(T+="skew("+m+", "+y+Ha),(w!==1||_!==1)&&(T+="scale("+w+", "+_+Ha),k.style[Kt]=T||"translate(0, 0)"},jZ=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.rotation,d=r.skewX,h=r.skewY,p=r.scaleX,m=r.scaleY,y=r.target,w=r.xOrigin,_=r.yOrigin,x=r.xOffset,E=r.yOffset,k=r.forceCSS,P=parseFloat(a),T=parseFloat(u),A,L,O,R,M;c=parseFloat(c),d=parseFloat(d),h=parseFloat(h),h&&(h=parseFloat(h),d+=h,c+=h),c||d?(c*=Cu,d*=Cu,A=Math.cos(c)*p,L=Math.sin(c)*p,O=Math.sin(c-d)*-m,R=Math.cos(c-d)*m,d&&(h*=Cu,M=Math.tan(d-h),M=Math.sqrt(1+M*M),O*=M,R*=M,h&&(M=Math.tan(h),M=Math.sqrt(1+M*M),A*=M,L*=M)),A=an(A),L=an(L),O=an(O),R=an(R)):(A=p,R=m,L=O=0),(P&&!~(a+"").indexOf("px")||T&&!~(u+"").indexOf("px"))&&(P=aa(y,"x",a,"px"),T=aa(y,"y",u,"px")),(w||_||x||E)&&(P=an(P+w-(w*A+_*O)+x),T=an(T+_-(w*L+_*R)+E)),(s||i)&&(M=y.getBBox(),P=an(P+s/100*M.width),T=an(T+i/100*M.height)),M="matrix("+A+","+L+","+O+","+R+","+P+","+T+")",y.setAttribute("transform",M),k&&(y.style[Kt]=M)},FZ=function(e,n,r,s,i){var a=360,u=Rn(i),c=parseFloat(i)*(u&&~i.indexOf("rad")?Ga:1),d=c-s,h=s+d+"deg",p,m;return u&&(p=i.split("_")[1],p==="short"&&(d%=a,d!==d%(a/2)&&(d+=d<0?a:-a)),p==="cw"&&d<0?d=(d+a*Fk)%a-~~(d/a)*a:p==="ccw"&&d>0&&(d=(d-a*Fk)%a-~~(d/a)*a)),e._pt=m=new Ir(e._pt,n,r,s,d,wZ),m.e=h,m.u="deg",e._props.push(r),m},Wk=function(e,n){for(var r in n)e[r]=n[r];return e},VZ=function(e,n,r){var s=Wk({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,u,c,d,h,p,m,y,w;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),a[Kt]=n,u=hf(r,1),oa(r,Kt),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Kt],a[Kt]=n,u=hf(r,1),a[Kt]=d);for(c in oo)d=s[c],h=u[c],d!==h&&i.indexOf(c)<0&&(y=Yn(d),w=Yn(h),p=y!==w?aa(r,c,d,w):parseFloat(d),m=parseFloat(h),e._pt=new Ir(e._pt,u,c,p,m-p,V_),e._pt.u=w||0,e._props.push(c));Wk(u,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(u){return e<2?t+u:"border"+u+t});Hm[e>1?"border"+t:t]=function(u,c,d,h,p){var m,y;if(arguments.length<4)return m=a.map(function(w){return Wi(u,w,d)}),y=m.join(" "),y.split(m[0]).length===5?m[0]:y;m=(h+"").split(" "),y={},a.forEach(function(w,_){return y[w]=m[_]=m[_]||m[(_-1)/2|0]}),u.init(c,y,p)}});var MA={name:"css",register:H_,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var a=this._props,u=e.style,c=r.vars.startAt,d,h,p,m,y,w,_,x,E,k,P,T,A,L,O,R,M;Bw||H_(),this.styles=this.styles||CA(e),R=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(h=n[_],!(Ur[_]&&pA(_,n,r,s,e,i)))){if(y=typeof h,w=Hm[_],y==="function"&&(h=h.call(r,s,e,i),y=typeof h),y==="string"&&~h.indexOf("random(")&&(h=uf(h)),w)w(this,e,_,h,r)&&(O=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),h+="",Xo.lastIndex=0,Xo.test(d)||(x=Yn(d),E=Yn(h),E?x!==E&&(d=aa(e,_,d,E)+E):x&&(h+=x)),this.add(u,"setProperty",d,h,s,i,0,0,_),a.push(_),R.push(_,0,u[_]);else if(y!=="undefined"){if(c&&_ in c?(d=typeof c[_]=="function"?c[_].call(r,s,e,i):c[_],Rn(d)&&~d.indexOf("random(")&&(d=uf(d)),Yn(d+"")||d==="auto"||(d+=Yr.units[_]||Yn(Wi(e,_))||""),(d+"").charAt(1)==="="&&(d=Wi(e,_))):d=Wi(e,_),m=parseFloat(d),k=y==="string"&&h.charAt(1)==="="&&h.substr(0,2),k&&(h=h.substr(2)),p=parseFloat(h),_ in ci&&(_==="autoAlpha"&&(m===1&&Wi(e,"visibility")==="hidden"&&p&&(m=0),R.push("visibility",0,u.visibility),Ko(this,u,"visibility",m?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=ci[_],~_.indexOf(",")&&(_=_.split(",")[0]))),P=_ in oo,P){if(this.styles.save(_),M=h,y==="string"&&h.substring(0,6)==="var(--"){if(h=Kr(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var N=e.style.perspective;e.style.perspective=h,h=Kr(e,"perspective"),N?e.style.perspective=N:oa(e,"perspective")}p=parseFloat(h)}if(T||(A=e._gsap,A.renderTransform&&!n.parseTransform||hf(e,n.parseTransform),L=n.smoothOrigin!==!1&&A.smooth,T=this._pt=new Ir(this._pt,u,Kt,0,1,A.renderTransform,A,0,-1),T.dep=1),_==="scale")this._pt=new Ir(this._pt,A,"scaleY",A.scaleY,(k?Su(A.scaleY,k+p):p)-A.scaleY||0,V_),this._pt.u=0,a.push("scaleY",_),_+="X";else if(_==="transformOrigin"){R.push(Mr,0,u[Mr]),h=LZ(h),A.svg?z_(e,h,0,L,0,this):(E=parseFloat(h.split(" ")[2])||0,E!==A.zOrigin&&Ko(this,A,"zOrigin",A.zOrigin,E),Ko(this,u,_,zm(d),zm(h)));continue}else if(_==="svgOrigin"){z_(e,h,1,L,0,this);continue}else if(_ in RA){FZ(this,A,_,m,k?Su(m,k+h):h);continue}else if(_==="smoothOrigin"){Ko(this,A,"smooth",A.smooth,h);continue}else if(_==="force3D"){A[_]=h;continue}else if(_==="transform"){VZ(this,h,e);continue}}else _ in u||(_=Ju(_)||_);if(P||(p||p===0)&&(m||m===0)&&!_Z.test(h)&&_ in u)x=(d+"").substr((m+"").length),p||(p=0),E=Yn(h)||(_ in Yr.units?Yr.units[_]:x),x!==E&&(m=aa(e,_,d,E)),this._pt=new Ir(this._pt,P?A:u,_,m,(k?Su(m,k+p):p)-m,!P&&(E==="px"||_==="zIndex")&&n.autoRound!==!1?SZ:V_),this._pt.u=E||0,P&&M!==h?(this._pt.b=d,this._pt.e=M,this._pt.r=bZ):x!==E&&E!=="%"&&(this._pt.b=d,this._pt.r=xZ);else if(_ in u)OZ.call(this,e,_,d,k?k+h:h);else if(_ in e)this.add(e,_,d||e[_],k?k+h:h,s,i);else if(_!=="parseTransform"){Lw(_,h);continue}P||(_ in u?R.push(_,0,u[_]):typeof e[_]=="function"?R.push(_,2,e[_]()):R.push(_,1,d||e[_])),a.push(_)}}O&&wA(this)},render:function(e,n){if(n.tween._time||!Ww())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Wi,aliases:ci,getSetter:function(e,n,r){var s=ci[n];return s&&s.indexOf(",")<0&&(n=s),n in oo&&n!==Mr&&(e._gsap.x||Wi(e,"x"))?r&&jk===r?n==="scale"?PZ:kZ:(jk=r||{})&&(n==="scale"?TZ:RZ):e.style&&!Iw(e.style[n])?EZ:~n.indexOf("-")?CZ:zw(e,n)},core:{_removeProperty:oa,_getMatrix:Kw}};Or.utils.checkPrefix=Ju;Or.core.getStyleSaver=CA;(function(t,e,n,r){var s=Ar(t+","+e+","+n,function(i){oo[i]=1});Ar(e,function(i){Yr.units[i]="deg",RA[i]=1}),ci[s[13]]=t+","+e,Ar(r,function(i){var a=i.split(":");ci[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){Yr.units[t]="px"});Or.registerPlugin(MA);var As=Or.registerPlugin(MA)||Or;As.core.Tween;const $p="/assets/logo-animation",b1=1280,$Z=[{id:"eraser",src:`${$p}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${$p}/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:`${$p}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],HZ=[{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}],U_=({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 u=window.matchMedia("(prefers-reduced-motion: reduce)").matches,c=(E,k)=>E+Math.random()*(k-E);let d=null,h,p=1;const m=$Z.map(E=>({...E})),y=()=>{s.querySelectorAll(".la-obj").forEach(R=>R.remove());const E=s.getBoundingClientRect(),k=E.width||b1,P=E.height||b1*.64;p=k/b1,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const A=250*p/337,L=[],O=(R,M,N)=>{const j=document.createElement("div");return j.className="la-obj",j.style.width=`${M}px`,j.innerHTML=`<img src="${R}" alt="" style="${N?"transform:scaleX(-1)":""}">`,s.appendChild(j),j};return HZ.forEach((R,M)=>{const N=R.w*p,j=O(`${$p}/sea/${R.k}.png`,N,M%2===0);As.set(j,{x:R.x*k-N/2,y:R.y*P-N/2,rotation:R.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),L.push({el:j,hero:!1,rest:1})}),m.forEach(R=>{const M=R.cssW*p;R.el=O(R.src,M,!!R.flip),R.finalScale=R.fit*A/(R.cssW*p),As.set(R.el,{x:R.seaX*k-M/2,y:R.seaY*P-R.cssH*p/2,rotation:R.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),L.push({el:R.el,hero:!0,rest:150/R.cssW})}),L},w=(E,k)=>{const P=s.getBoundingClientRect(),T=a.getBoundingClientRect();return{x:T.left-P.left+E/326*T.width,y:T.top-P.top+k/337*T.height}},_=()=>{d&&d.revert();const E=y();if(u){d=As.context(()=>{E.filter(T=>!T.hero).forEach(T=>As.set(T.el,{scale:0})),m.forEach(T=>{if(!T.el)return;const A=w(T.localX,T.localY);As.set(T.el,{x:A.x-T.cssW*p/2,y:A.y-T.cssH*p/2,rotation:T.rot,scale:T.finalScale})})},s);return}const k=[],P=[];d=As.context(()=>{const T=As.timeline();T.to(E.map(A=>A.el),{scale:A=>E[A].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),T.add(()=>{E.forEach(({el:A,hero:L},O)=>{const R=L?k:P,M=O%2?1:-1;R.push(As.to(A,{rotation:"+="+c(2.5,6)*M,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),As.to(A,{y:"+="+c(5,11)*M,x:"+="+c(4,9)*-M,duration:c(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:c(0,.4)}))})},"<0.1"),T.to({},{duration:1.1}),T.add("pick"),m.forEach((A,L)=>{A.el&&T.to(A.el,{scale:150/A.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+L*.08)}),T.add("clear","pick+=0.7"),T.add(()=>P.forEach(A=>A.kill()),"clear"),T.to(E.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"),T.add("assemble","clear+=0.25"),T.add(()=>k.forEach(A=>A.kill()),"assemble"),m.forEach((A,L)=>{if(!A.el||A.finalScale===void 0)return;const O=w(A.localX,A.localY);T.to(A.el,{x:O.x-A.cssW*p/2,y:O.y-A.cssH*p/2,rotation:A.rot,scale:A.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+L*.12)}),m.forEach(A=>{!A.el||A.finalScale===void 0||T.to(A.el,{scale:A.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};As.ticker.fps(12),_();const x=()=>{clearTimeout(h),h=setTimeout(_,250)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x),clearTimeout(h),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(E=>E.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},zZ=Object.freeze(Object.defineProperty({__proto__:null,default:U_},Symbol.toStringTag,{value:"Module"})),Gk=({isSigningIn:t})=>t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{children:"Signing in..."})]}):S.jsxs(S.Fragment,{children:[S.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),S.jsx("span",{children:"Sign in with Google"})]}),OA=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,isDesktopShell:r=!1,displayMode:s="full"})=>s==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(U_,{className:"relative z-0 h-44 w-full"}),S.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),S.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(Gk,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[r?S.jsx("div",{className:"fixed left-0 right-0 top-0 z-10 h-8",style:{WebkitAppRegion:"drag"}}):null,S.jsx(U_,{className:"absolute inset-0 z-0"}),S.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[S.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),S.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(Gk,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),UZ="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",BZ=({message:t})=>S.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:S.jsxs("div",{className:"flex flex-col items-center gap-10",children:[S.jsx("img",{src:UZ,alt:"Rivet",className:"h-8 w-auto object-contain"}),S.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[S.jsx(r0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),WZ="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",Um=44,ad=8,mp=16,GZ=4,Kk=-18,KZ=.18,ZZ=[.22,1,.36,1],Zk=.92,qZ=1,YZ=.95,XZ=.4,QZ=[.19,1,.22,1],S1=0,JZ=1,eq=0,tq=0,nq=0,LA=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+ad,s=Math.max(r,e.width-Um-ad),i=Math.max(ad,e.height-Um-ad);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(ad,t.y))}},Zw=()=>({width:window.innerWidth,height:window.innerHeight}),rq=({position:t,boundsLeftPx:e=0})=>LA({position:t,viewport:Zw(),boundsLeft:e}),sq=()=>{if(typeof window>"u")return{x:mp,y:mp};const t=Zw();return{x:t.width-Um-mp,y:t.height-Um-mp}},iq=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=GZ,oq=t=>t.button===void 0||t.button<=nq,qk=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},aq=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:a})=>{const u=v.useRef(null),c=v.useRef(!1),[d,h]=v.useState(!1),[p,m]=v.useState(!1),y=n?!1:{opacity:S1,scale:Zk,x:Kk},w=n?{opacity:S1}:{opacity:S1,scale:Zk,x:Kk},_=n?{duration:tq}:{duration:KZ,ease:ZZ,scale:{duration:XZ,ease:QZ}},x=v.useCallback(()=>{const A=u.current;A&&(c.current=A.hasMoved),u.current=null,h(!1)},[]),E=v.useCallback(A=>{const L=u.current;if(!L)return;const O=qk(A),R=O.x-L.startPointer.x,M=O.y-L.startPointer.y,N=L.hasMoved||iq({deltaX:R,deltaY:M});u.current={...L,hasMoved:N},N&&a(LA({position:{x:L.startPosition.x+R,y:L.startPosition.y+M},viewport:Zw(),boundsLeft:s}))},[a,s]),k=v.useCallback(A=>{if(u.current||!oq(A))return;const L=qk(A);u.current={startPointer:L,startPosition:r,hasMoved:!1},h(!0)},[r]),P=v.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),T=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[d?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:E,onPointerUp:x,onPointerCancel:x,onMouseMove:E,onMouseUp:x}):null,S.jsx(Ji,{children:t?S.jsx(Bo,{label:T,side:"top",forceOpen:p&&!d?void 0:!1,children:S.jsx(fl.button,{type:"button","aria-label":T,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:y,animate:{opacity:JZ,scale:qZ,x:eq},whileTap:{scale:YZ},exit:w,transition:_,onPointerDown:k,onMouseDown:k,onPointerMove:E,onPointerUp:x,onPointerCancel:x,onMouseMove:E,onMouseUp:x,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 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:S.jsx("img",{src:WZ,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},E1=vs("useConfig"),lq=300*1e3,uq=1800*1e3,cq=60*1e3,dq=300*1e3,fq=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},hq=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},pq=t=>({...C5,...t??{}}),mq=()=>{const t=Qe(x_),e=st(x_),n=st(D5),r=st(j5),s=st(s0),i=st(RU),a=st(N5),u=st(PU),c=st(Pf),d=st(R5),h=st(L5),p=v.useCallback(k=>{a(k.agentModeAvailable),d({name:k.name??null,email:k.email??null}),h(k.demoMode===!0),k.isMCPSession&&n(!0),k.mcpEditor&&r(k.mcpEditor),s(k.agentApplyMode??hq()??null),i(k.queueAccessToken??fq())},[s,a,h,n,r,i,d]),m=B1({queryKey:["rivet-config"],queryFn:async()=>{const k=await fetch("/api/config");if(!k.ok)throw new Error(`Failed to fetch config: ${k.statusText}`);return await k.json()},staleTime:lq,gcTime:uq}),y=B1({queryKey:["rivet-feature-flags"],queryFn:async()=>{const k=await fetch("/api/feature-flags");if(!k.ok)throw new Error(`Failed to fetch feature flags: ${k.statusText}`);return await k.json()},staleTime:cq,gcTime:dq}),{refetch:w}=m,{refetch:_}=y;v.useLayoutEffect(()=>{m.data&&(p(m.data),c(!1),E1.info("Config loaded:",m.data)),y.data&&(e(pq(y.data.featureFlags)),u(!0))},[m.data,y.data,p,c,e,u]),v.useLayoutEffect(()=>{m.error&&(u(!0),c(!1),E1.warn("Failed to load config:",m.error instanceof Error?m.error.message:"Failed to load config")),y.error&&(u(!0),E1.warn("Failed to load feature flags:",y.error instanceof Error?y.error.message:"Failed to load feature flags"))},[m.error,y.error,c,u]);const x=v.useCallback(async()=>{const[k]=await Promise.all([w(),_()]);return k.data?k.data:null},[w,_]);let E=null;return m.error instanceof Error?E=m.error.message:m.error&&(E="Failed to load config"),{config:m.data??null,featureFlags:t,loading:m.isPending||!m.error&&y.isPending,error:E,refetchConfig:x}},Hp="rivet_just_signed_in",su=vs("useOAuthCallback"),gq="https://rivet-proxy.onrender.com",vq=()=>{const[t,e]=v.useState({isProcessing:!1,isComplete:!1,error:null});return v.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var u,c,d;const i=window.location.hash,a=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{su.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),m=h.get("refresh_token"),w=new URLSearchParams(a).get("session");if(!p)throw new Error("No access token found in URL");if(!w)throw new Error("No session ID found in URL");su.info(`Completing OAuth with session: ${w}`);const _=await fetch(`${gq}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:w,accessToken:p,refreshToken:m}),signal:n.signal}),x=await _.json();if(!_.ok||!x.success)throw new Error(x.error||x.message||"Failed to complete authentication");if(su.info("OAuth authentication completed successfully"),r)return;if((u=x.user)!=null&&u.id?(Te.identify(x.user.id,{...x.user.email?{email:x.user.email}:{}}),x.user.email&&Te.alias(x.user.email,x.user.id)):(c=x.user)!=null&&c.email&&Te.identify(x.user.email,{email:x.user.email}),(d=x.user)!=null&&d.email&&p)try{const k=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:p,refreshToken:m,userId:x.user.id}),signal:n.signal});k.ok||su.warn(`Local auth store returned ${k.status}`)}catch(k){if(r)return;su.warn("Failed to store auth locally:",k)}if(r)return;window.sessionStorage.setItem(Hp,"1");const E=window.location.pathname;window.history.replaceState({},document.title,E),e({isProcessing:!1,isComplete:!0,error:null})}catch(h){if(r)return;const p=h instanceof Error?h.message:"Unknown error occurred";su.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},C1=vs("useAgentVariantsSession"),yq=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,Yk=(t,e,n)=>{e.size===0&&!n||t.set(Qd,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[a,u]of r)u.status==="sending"&&u.variantRequestId&&(e.has(u.variantRequestId)||n&&u.variantRequest!==void 0)&&(s.delete(a),i=!0);return i?s:r})},_q=(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 u=a.target;if(!u||u.kind!=="variant"||u.sessionId!==e.sessionId)continue;const c=(s=e.variants.find(d=>d.workItemId===u.variantId))==null?void 0:s.refinement;c&&(c.status==="succeeded"?(r.set(i,{...a,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(c.status==="failed"||c.status==="cancelled")&&(r.set(i,{...a,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},wq=({enabled:t=!0}={})=>{const e=st(kf),n=st(k5),r=st(bU),s=st(M5),i=st(kU),a=w2(),u=v.useRef(null);v.useEffect(()=>{if(!t)return;const c=new EventSource("/api/variants/events");return c.onmessage=d=>{try{const h=JSON.parse(d.data),p=u.current;if(h.active){const w=new Set(h.variants.map(_=>_.requestId).filter(_=>!!_));s(_=>_.filter(E=>!w.has(E.requestId))),Yk(a,w,!1),a.set(Qd,_=>{let x=_;for(const E of h.variants){const k=E.adoptedSource;k&&(x=CU(x,{kind:"variant",sessionId:k.sessionId,variantId:k.variantId},{kind:"variant",sessionId:h.sessionId,variantId:E.workItemId}))}return x}),a.set(Qd,_=>_q(_,h)),h.sessionId!==u.current&&(u.current=h.sessionId,n(!0),r("directions"))}else u.current=null,Yk(a,new Set,yq(h));e(h);const m=!h.active&&p!==null,y=h.active&&h.sessionId!==p;if(y&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(w=>C1.warn("failed to reset preview-port on session switch",w)),m||y){const w=new Set;if(h.active)for(const x of h.variants)w.add(Yd({kind:"variant",sessionId:h.sessionId,variantId:x.workItemId}));const _=a.get(na);for(const x of[_==null?void 0:_.left,_==null?void 0:_.right])x&&w.add(Yd({kind:"variant",sessionId:x.sessionId,variantId:x.variantId}));i(w)}}catch(h){C1.warn("failed to parse SSE event payload",h)}},c.onerror=d=>{C1.warn("SSE error (auto-reconnects)",d)},()=>{c.close()}},[t,e,n,r,s,i,a])};function NA(t){const e=t+"CollectionProvider",[n,r]=ua(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=_=>{const{scope:x,children:E}=_,k=v.useRef(null),P=v.useRef(new Map).current;return S.jsx(s,{scope:x,itemMap:P,collectionRef:k,children:E})};a.displayName=e;const u=t+"CollectionSlot",c=Gd(u),d=v.forwardRef((_,x)=>{const{scope:E,children:k}=_,P=i(u,E),T=ln(x,P.collectionRef);return S.jsx(c,{ref:T,children:k})});d.displayName=u;const h=t+"CollectionItemSlot",p="data-radix-collection-item",m=Gd(h),y=v.forwardRef((_,x)=>{const{scope:E,children:k,...P}=_,T=v.useRef(null),A=ln(x,T),L=i(h,E);return v.useEffect(()=>(L.itemMap.set(T,{ref:T,...P}),()=>void L.itemMap.delete(T))),S.jsx(m,{[p]:"",ref:A,children:k})});y.displayName=h;function w(_){const x=i(t+"CollectionConsumer",_);return v.useCallback(()=>{const k=x.collectionRef.current;if(!k)return[];const P=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((L,O)=>P.indexOf(L.ref.current)-P.indexOf(O.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:d,ItemSlot:y},w,r]}var xq=Object.defineProperty,Af=(t,e)=>xq(t,"name",{value:e,configurable:!0}),qw="Collapsible",[bq,DA]=ua(qw),[Sq,Yw]=bq(qw),Eq=v.forwardRef(Af(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:a,onOpenChange:u,...c}=e,[d,h]=ca({prop:s,defaultProp:i??!1,onChange:u,caller:qw});return S.jsx(Sq,{scope:r,disabled:a,contentId:hl(),open:d,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),children:S.jsx(un.div,{"data-state":v0(d),"data-disabled":a?"":void 0,...c,ref:n})})},"Collapsible")),Cq="CollapsibleTrigger",kq=v.forwardRef(Af(function(e,n){const{__scopeCollapsible:r,...s}=e,i=Yw(Cq,r);return S.jsx(un.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":v0(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Lt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),jA="CollapsibleContent",Pq=v.forwardRef(Af(function(e,n){const{forceMount:r,...s}=e,i=Yw(jA,e.__scopeCollapsible);return S.jsx(da,{present:r||i.open,children:({present:a})=>S.jsx(Tq,{...s,ref:n,present:a})})},"CollapsibleContent")),Tq=v.forwardRef(Af(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...a}=e,u=Yw(jA,r),[c,d]=v.useState(s),h=v.useRef(null),p=ln(n,h),m=v.useRef(0),y=m.current,w=v.useRef(0),_=w.current,x=u.open||c,E=v.useRef(x),k=v.useRef(void 0);return v.useEffect(()=>{const P=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(P)},[]),Pr(()=>{const P=h.current;if(P){k.current=k.current||{transitionDuration:P.style.transitionDuration,animationName:P.style.animationName},P.style.transitionDuration="0s",P.style.animationName="none";const T=P.getBoundingClientRect();m.current=T.height,w.current=T.width,E.current||(P.style.transitionDuration=k.current.transitionDuration,P.style.animationName=k.current.animationName),d(s)}},[u.open,s]),S.jsx(un.div,{"data-state":v0(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!x,...a,ref:p,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:x&&i})},"CollapsibleContentImpl"));function v0(t){return t?"open":"closed"}Af(v0,"getState");var Rq=Eq,Aq=kq,Iq=Pq,Mq=v.createContext(void 0);function FA(t){const e=v.useContext(Mq);return t||e||"ltr"}var Oq=Object.defineProperty,Xr=(t,e)=>Oq(t,"name",{value:e,configurable:!0}),gi="Accordion",Lq=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Xw,Nq,Dq]=NA(gi),[y0]=ua(gi,[Dq,DA]),Qw=DA(),jq=v.forwardRef(Xr(function(e,n){const{type:r,...s}=e,i=s,a=s;return S.jsx(Xw.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?S.jsx(Hq,{...a,ref:n}):S.jsx($q,{...i,ref:n})})},"Accordion")),[VA,Fq]=y0(gi),[$A,Vq]=y0(gi,{collapsible:!1}),$q=v.forwardRef(Xr(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Xr(()=>{},"onValueChange"),collapsible:a=!1,...u}=e,[c,d]=ca({prop:r,defaultProp:s??"",onChange:i,caller:gi});return S.jsx(VA,{scope:e.__scopeAccordion,value:v.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:v.useCallback(()=>a&&d(""),[a,d]),children:S.jsx($A,{scope:e.__scopeAccordion,collapsible:a,children:S.jsx(HA,{...u,ref:n})})})},"AccordionImplSingle")),Hq=v.forwardRef(Xr(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Xr(()=>{},"onValueChange"),...a}=e,[u,c]=ca({prop:r,defaultProp:s??[],onChange:i,caller:gi}),d=v.useCallback(p=>c((m=[])=>[...m,p]),[c]),h=v.useCallback(p=>c((m=[])=>m.filter(y=>y!==p)),[c]);return S.jsx(VA,{scope:e.__scopeAccordion,value:u,onItemOpen:d,onItemClose:h,children:S.jsx($A,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(HA,{...a,ref:n})})})},"AccordionImplMultiple")),[zq,_0]=y0(gi),HA=v.forwardRef(Xr(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:a="vertical",...u}=e,c=v.useRef(null),d=ln(c,n),h=Nq(r),m=FA(i)==="ltr",y=Lt(e.onKeyDown,w=>{var M;if(!Lq.includes(w.key))return;const _=w.target,x=h().filter(N=>{var j;return!((j=N.ref.current)!=null&&j.disabled)}),E=x.findIndex(N=>N.ref.current===_),k=x.length;if(E===-1)return;w.preventDefault();let P=E;const T=0,A=k-1,L=Xr(()=>{P=E+1,P>A&&(P=T)},"moveNext"),O=Xr(()=>{P=E-1,P<T&&(P=A)},"movePrev");switch(w.key){case"Home":P=T;break;case"End":P=A;break;case"ArrowRight":a==="horizontal"&&(m?L():O());break;case"ArrowDown":a==="vertical"&&L();break;case"ArrowLeft":a==="horizontal"&&(m?O():L());break;case"ArrowUp":a==="vertical"&&O();break}const R=P%k;(M=x[R].ref.current)==null||M.focus()});return S.jsx(zq,{scope:r,disabled:s,direction:i,orientation:a,children:S.jsx(Xw.Slot,{scope:r,children:S.jsx(un.div,{...u,"data-orientation":a,ref:d,onKeyDown:s?void 0:y})})})},"AccordionImpl")),B_="AccordionItem",[Uq,Jw]=y0(B_),Bq=v.forwardRef(Xr(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,a=_0(B_,r),u=Fq(B_,r),c=Qw(r),d=hl(),h=s&&u.value.includes(s)||!1,p=a.disabled||e.disabled;return S.jsx(Uq,{scope:r,open:h,disabled:p,triggerId:d,children:S.jsx(Rq,{"data-orientation":a.orientation,"data-state":ex(h),...c,...i,ref:n,disabled:p,open:h,onOpenChange:m=>{m?u.onItemOpen(s):u.onItemClose(s)}})})},"AccordionItem")),Wq="AccordionHeader",Gq=v.forwardRef(Xr(function(e,n){const{__scopeAccordion:r,...s}=e,i=_0(gi,r),a=Jw(Wq,r);return S.jsx(un.h3,{"data-orientation":i.orientation,"data-state":ex(a.open),"data-disabled":a.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),Xk="AccordionTrigger",Kq=v.forwardRef(Xr(function(e,n){const{__scopeAccordion:r,...s}=e,i=_0(gi,r),a=Jw(Xk,r),u=Vq(Xk,r),c=Qw(r);return S.jsx(Xw.ItemSlot,{scope:r,children:S.jsx(Aq,{"aria-disabled":a.open&&!u.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...c,...s,ref:n})})},"AccordionTrigger")),Zq="AccordionContent",qq=v.forwardRef(Xr(function(e,n){const{__scopeAccordion:r,...s}=e,i=_0(gi,r),a=Jw(Zq,r),u=Qw(r);return S.jsx(Iq,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...u,...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 ex(t){return t?"open":"closed"}Xr(ex,"getState");var zA=jq,Yq=Bq,Xq=Gq,Qq=Kq,Jq=qq;/**
129
- * @license lucide-react v1.25.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 UA=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
134
- * @license lucide-react v1.25.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 eY=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
139
- * @license lucide-react v1.25.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 tY=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
144
- * @license lucide-react v1.25.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 Qk=t=>{const e=tY(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
149
- * @license lucide-react v1.25.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 k1={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.25.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 nY=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},rY=v.createContext({}),sY=()=>v.useContext(rY),iY=v.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...u},c)=>{const{size:d=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:y=""}=sY()??{},w=r??p?Number(n??h)*24/Number(e??d):n??h;return v.createElement("svg",{ref:c,...k1,width:e??d??k1.width,height:e??d??k1.height,stroke:t??m,strokeWidth:w,className:UA("lucide",y,s),...!i&&!nY(u)&&{"aria-hidden":"true"},...u},[...a.map(([_,x])=>v.createElement(_,x)),...Array.isArray(i)?i:[i]])});/**
159
- * @license lucide-react v1.25.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 Ye=(t,e)=>{const n=v.forwardRef(({className:r,...s},i)=>v.createElement(iY,{ref:i,iconNode:e,className:UA(`lucide-${eY(Qk(t))}`,`lucide-${t}`,r),...s}));return n.displayName=Qk(t),n};/**
164
- * @license lucide-react v1.25.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 oY=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],aY=Ye("arrow-left",oY);/**
169
- * @license lucide-react v1.25.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 lY=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],uY=Ye("arrow-right",lY);/**
174
- * @license lucide-react v1.25.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 cY=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],dY=Ye("arrow-up",cY);/**
179
- * @license lucide-react v1.25.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 fY=[["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"}]],hY=Ye("bell",fY);/**
184
- * @license lucide-react v1.25.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 pY=[["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"}]],mY=Ye("brain",pY);/**
189
- * @license lucide-react v1.25.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 gY=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vY=Ye("check",gY);/**
194
- * @license lucide-react v1.25.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 yY=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_Y=Ye("chevron-down",yY);/**
199
- * @license lucide-react v1.25.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 wY=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xY=Ye("chevron-right",wY);/**
204
- * @license lucide-react v1.25.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 bY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],SY=Ye("circle",bY);/**
209
- * @license lucide-react v1.25.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 EY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],CY=Ye("clock",EY);/**
214
- * @license lucide-react v1.25.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 kY=[["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"}]],PY=Ye("copy",kY);/**
219
- * @license lucide-react v1.25.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 TY=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],RY=Ye("dot",TY);/**
224
- * @license lucide-react v1.25.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 AY=[["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"}]],IY=Ye("globe",AY);/**
229
- * @license lucide-react v1.25.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 MY=[["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"}]],OY=Ye("heart",MY);/**
234
- * @license lucide-react v1.25.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 LY=[["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"}]],NY=Ye("house",LY);/**
239
- * @license lucide-react v1.25.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 DY=[["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"}]],jY=Ye("image",DY);/**
244
- * @license lucide-react v1.25.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 FY=[["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"}]],VY=Ye("inbox",FY);/**
249
- * @license lucide-react v1.25.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 $Y=[["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"}]],HY=Ye("lightbulb",$Y);/**
254
- * @license lucide-react v1.25.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 zY=[["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"}]],UY=Ye("link",zY);/**
259
- * @license lucide-react v1.25.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 BY=[["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"}]],WY=Ye("loader",BY);/**
264
- * @license lucide-react v1.25.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 GY=[["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"}]],KY=Ye("lock",GY);/**
269
- * @license lucide-react v1.25.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 ZY=[["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"}]],qY=Ye("mail",ZY);/**
274
- * @license lucide-react v1.25.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 YY=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],XY=Ye("menu",YY);/**
279
- * @license lucide-react v1.25.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 QY=[["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"}]],JY=Ye("message-circle",QY);/**
284
- * @license lucide-react v1.25.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 eX=[["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"}]],tX=Ye("monitor",eX);/**
289
- * @license lucide-react v1.25.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 nX=[["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"}]],rX=Ye("moon",nX);/**
294
- * @license lucide-react v1.25.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 sX=[["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"}]],iX=Ye("paintbrush",sX);/**
299
- * @license lucide-react v1.25.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 oX=[["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"}]],aX=Ye("palette",oX);/**
304
- * @license lucide-react v1.25.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 lX=[["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"}]],uX=Ye("pause",lX);/**
309
- * @license lucide-react v1.25.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 cX=[["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"}]],dX=Ye("pencil",cX);/**
314
- * @license lucide-react v1.25.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 fX=[["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"}]],hX=Ye("pipette",fX);/**
319
- * @license lucide-react v1.25.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 pX=[["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"}]],mX=Ye("play",pX);/**
324
- * @license lucide-react v1.25.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 gX=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vX=Ye("plus",gX);/**
329
- * @license lucide-react v1.25.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 yX=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],_X=Ye("rectangle-horizontal",yX);/**
334
- * @license lucide-react v1.25.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 wX=[["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"}]],xX=Ye("rocket",wX);/**
339
- * @license lucide-react v1.25.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 bX=[["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"}]],SX=Ye("rotate-ccw",bX);/**
344
- * @license lucide-react v1.25.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 EX=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],CX=Ye("search",EX);/**
349
- * @license lucide-react v1.25.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 kX=[["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"}]],PX=Ye("settings",kX);/**
354
- * @license lucide-react v1.25.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 TX=[["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"}]],RX=Ye("shield",TX);/**
359
- * @license lucide-react v1.25.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 AX=[["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"}]],IX=Ye("skip-forward",AX);/**
364
- * @license lucide-react v1.25.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 MX=[["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"}]],OX=Ye("square-library",MX);/**
369
- * @license lucide-react v1.25.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 LX=[["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"}]],NX=Ye("star",LX);/**
374
- * @license lucide-react v1.25.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 DX=[["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"}]],jX=Ye("sun",DX);/**
379
- * @license lucide-react v1.25.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 FX=[["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"}]],VX=Ye("user",FX);/**
384
- * @license lucide-react v1.25.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 $X=[["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"}]],HX=Ye("users",$X);/**
389
- * @license lucide-react v1.25.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 zX=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],UX=Ye("x",zX),BX={"chevron-right":xY,"chevron-down":_Y,pipette:hX,x:UX,copy:PY,menu:XY,dot:RY,monitor:tX,sun:jX,moon:rX,"rectangle-horizontal":_X,circle:SY,"square-library":OX,clock:CY,star:NX,settings:PX,plus:vX,"arrow-left":aY,"arrow-right":uY,"arrow-up":dY,search:CX,loader:WY,users:HX,lock:KY,mail:qY,bell:hY,shield:RX,palette:aX,lightbulb:HY,rocket:xX,heart:OY,paintbrush:iX,brain:mY,globe:IY,user:VX,image:jY,link:UY,check:vY,"rotate-ccw":SX,play:mX,pause:uX,home:NY,"message-circle":JY,inbox:VY,pencil:dX,"skip-forward":IX},Jk={lucide:BX},BA=v.createContext(null);function WX(t){const e=v.useContext(BA);return e?Jk[e.iconLibrary][t]:Jk.lucide[t]}function GX({children:t,defaultLibrary:e="lucide"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{r(i)},[]);return S.jsx(BA.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const WA=v.createContext(null);function tx(){return v.useContext(WA)}const GA=v.createContext(null);function KA(){const t=v.useContext(GA);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const KX=v.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,a=v.useRef(null),u=v.useRef(new Map),[c,d]=v.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:m,sessionRef:y,handlers:w,registerItem:_,measureItems:x}=w5(a),E=v.useCallback((oe,se)=>{se?u.current.set(oe,se):u.current.delete(oe)},[]),k=v.useCallback(()=>{if(!a.current)return;const oe=new Map;u.current.forEach((se,he)=>{oe.set(he,{top:se.offsetTop,left:se.offsetLeft,width:se.offsetWidth,height:se.offsetHeight})}),d(oe)},[]),[P,T]=v.useState(()=>r==="single"?t.defaultValue??"":""),[A,L]=v.useState(()=>r==="multiple"?t.defaultValue??[]:[]),O=t.onValueChange,R=t.onValueChange,M=t.value,N=new Set(r==="multiple"?t.value??A:(()=>{const oe=t.value??P;return oe?[oe]:[]})()),j=v.useCallback(oe=>{const se=t;se.onValueChange?se.onValueChange(oe):T(oe)},[O]),F=v.useCallback(oe=>{const se=t;se.onValueChange?se.onValueChange(oe):L(oe)},[R]),q=v.useCallback(oe=>{if(r==="multiple"){const se=t.value??A;F(se.filter(he=>he!==oe))}else j("")},[r,j,F,A,M]);v.useEffect(()=>{x(),k()},[x,k,n]);const G=[...N].join(",");v.useEffect(()=>{x(),k()},[x,k,G]);const[W,K]=v.useState(null),X=h!==null?m[h]:null,$=W!==null?m[W]:null,ee=h!==null&&!c.has(h),z=f0(),{value:D,defaultValue:Y,onValueChange:te,collapsible:ie,type:ae,...ue}=i,Ce=r==="multiple"?{type:"multiple",value:t.value??A,onValueChange:F}:{type:"single",collapsible:t.collapsible??!0,value:t.value??P,onValueChange:j};return S.jsx(WA.Provider,{value:{registerItem:_,registerFullItem:E,activeIndex:h,grouped:!0,remeasure:()=>{x(),k()},openValues:N,openItemRects:c,toggleValue:q},children:S.jsx(zA,{...Ce,asChild:!0,children:S.jsxs("div",{ref:oe=>{a.current=oe,typeof e=="function"?e(oe):e&&(e.current=oe)},onMouseEnter:w.onMouseEnter,onMouseMove:oe=>{const se=a.current;if(se){const he=se.getBoundingClientRect(),Pe=se.offsetHeight,be=he.height,$e=Pe>0?be/Pe:1,ot=(oe.clientY-he.top)/$e+se.scrollTop;for(const[Zt,ge]of c){const gt=m[Zt];if(!gt)continue;const dt=gt.top+gt.height,je=ge.top+ge.height;if(ot>=dt&&ot<=je){p(null);return}}}w.onMouseMove(oe)},onMouseLeave:w.onMouseLeave,onFocus:oe=>{var he;const se=(he=oe.target.closest("[data-proximity-index]"))==null?void 0:he.getAttribute("data-proximity-index");if(se!=null){const Pe=Number(se);p(Pe),K(oe.target.matches(":focus-visible")?Pe:null)}},onBlur:oe=>{var se;(se=a.current)!=null&&se.contains(oe.relatedTarget)||(K(null),p(null))},className:dr("relative flex flex-col gap-0.5 w-72 max-w-full",s),...ue,children:[S.jsx(Ji,{children:[...c.entries()].map(([oe,se])=>S.jsx(eo.div,{className:`absolute ${z.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:se.top,left:se.left,width:se.width,height:se.height,opacity:ee?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${oe}`))}),S.jsx(Ji,{children:X&&S.jsx(eo.div,{className:`absolute ${z.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:X.top,left:X.left,width:X.width,height:X.height},animate:{opacity:1,top:X.top,left:X.left,width:X.width,height:X.height},exit:{opacity:0,transition:{duration:.06}},transition:{...qd.fast,opacity:{duration:.08}}},y.current)}),S.jsx(Ji,{children:$&&S.jsx(eo.div,{className:`absolute ${z.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:$.left-2,top:$.top-2,width:$.width+4,height:$.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...qd.fast,opacity:{duration:.08}}})}),n]})})})});KX.displayName="AccordionGroup";const ZA=v.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...u},c)=>{const[d,h]=v.useState(()=>e==="single"?r??"":""),[p,m]=v.useState(()=>e==="multiple"?r??[]:[]),y=new Set(e==="multiple"?s??p:(()=>{const k=s??d;return k?[k]:[]})()),w=v.useCallback(k=>{i?i(k):h(k)},[i]),_=v.useCallback(k=>{i?i(k):m(k)},[i]),x=v.useCallback(k=>{e==="multiple"?_((s??p).filter(T=>T!==k)):w("")},[e,s,p,w,_]),E=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:w};return S.jsx(zA,{...E,asChild:!0,children:S.jsx("div",{ref:c,className:dr("w-72 max-w-full flex flex-col gap-0.5",a),...u,children:S.jsx(qA.Provider,{value:y,children:S.jsx(YA.Provider,{value:x,children:t})})})})});ZA.displayName="Accordion";const qA=v.createContext(new Set),YA=v.createContext(()=>{}),XA=v.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const u=v.useRef(null),c=tx(),d=v.useContext(qA),h=v.useContext(YA),p=f0(),m=c!=null&&c.grouped?c.openValues.has(t):d.has(t),y=v.useRef(null),w=v.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):h(t)},[c,h,t]);return v.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,y.current),()=>c.registerItem(e,null)},[e,c]),v.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return m?c.registerFullItem(e,u.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,m]),S.jsx(GA.Provider,{value:{index:e,value:t,isOpen:m,onToggle:w,triggerRef:y},children:S.jsxs(Yq,{ref:_=>{u.current=_,typeof a=="function"?a(_):a&&(a.current=_)},value:t,disabled:n,"data-proximity-index":e,className:dr(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&S.jsx(Ji,{children:m&&S.jsx(eo.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]})})});XA.displayName="AccordionItem";const QA=v.forwardRef(({children:t,className:e,...n},r)=>{const s=WX("chevron-right"),i=tx(),{index:a,isOpen:u,triggerRef:c}=KA(),d=f0(),[h,p]=v.useState(!1),m=i!=null&&i.grouped?i.activeIndex===a:h,y=S.jsx(Xq,{asChild:!0,children:S.jsx("div",{children:S.jsxs(Qq,{ref:r,className:dr(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Pd.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:dr("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",u||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:u?Pd.semibold:Pd.normal},children:t})]}),S.jsx(eo.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:u?90:0},transition:qd.fast,children:S.jsx(s,{size:16,strokeWidth:u||m?2:1.5,className:dr("transition-[color,stroke-width] duration-80",u||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:c,children:y}):S.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[S.jsx(Ji,{children:h&&S.jsx(eo.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),y]})});QA.displayName="AccordionTrigger";const JA=v.forwardRef(({children:t,className:e,...n},r)=>{const s=tx(),{isOpen:i}=KA();return S.jsx(Ji,{initial:!1,children:i&&S.jsx(Jq,{forceMount:!0,asChild:!0,...n,children:S.jsx(eo.div,{ref:r,className:dr("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...qd.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:S.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});JA.displayName="AccordionContent";const zp=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(ZA,{type:"multiple",defaultValue:e,className:dr("w-full",n),children:t}),ZX=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const u=a.includes("first-item");return S.jsxs(XA,{value:t,className:dr("w-full",!u&&"border-t border-main-border"),children:[S.jsxs(QA,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(JA,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};zp.Item=ZX;const qX=()=>{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},YX=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},e8="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",t8="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",XX="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",Up=["Applying","Thinking","Planning","Crafting"],QX=Up.reduce((t,e)=>t.length>=e.length?t:e),JX=20,eQ="Still working — runs can take a few minutes.",tQ=({hint:t,showElapsed:e=!0})=>{const[n,r]=v.useState(0),s=qX();v.useEffect(()=>{const a=setInterval(()=>{r(u=>(u+1)%Up.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=JX?eQ:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(fl.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:S.jsx(fl.path,{animate:{d:[e8,t8,XX,t8,e8]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),S.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Pd.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:QX}),S.jsx(Ji,{mode:"popLayout",initial:!1,children:S.jsx(fl.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:Up[n]},Up[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:YX(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};function eI(t,[e,n]){return Math.min(n,Math.max(e,t))}function nQ(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])}var rQ=Object.defineProperty,pt=(t,e)=>rQ(t,"name",{value:e,configurable:!0}),tI=["PageUp","PageDown"],nI=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],rI={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},If="Slider",[W_,sQ,iQ]=NA(If),[nx]=ua(If,[iQ]),[oQ,Mf]=nx(If),aQ=v.forwardRef(pt(function(e,n){const{name:r,min:s=0,max:i=100,step:a=1,orientation:u="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[s],value:p,onValueChange:m=pt(()=>{},"onValueChange"),onValueCommit:y=pt(()=>{},"onValueCommit"),inverted:w=!1,form:_,...x}=e,E=v.useRef(new Set),k=v.useRef(0),P=v.useRef(!1),A=u==="horizontal"?lQ:uQ,[L,O]=v.useState(null),R=ln(n,O),[M=[],N]=ca({prop:p,defaultProp:h,onChange:pt(X=>{var ee;(ee=[...E.current][k.current])==null||ee.focus({preventScroll:!0,focusVisible:P.current}),P.current=!1,m(X)},"onChange")}),j=v.useRef(M),F=v.useRef(M);v.useEffect(()=>{const X=_?L==null?void 0:L.ownerDocument.getElementById(_):L==null?void 0:L.closest("form");if(X instanceof HTMLFormElement){const $=pt(()=>N(F.current),"reset");return X.addEventListener("reset",$),()=>X.removeEventListener("reset",$)}},[L,_,N]);function q(X){const $=dI(M,X);K(X,$)}pt(q,"handleSlideStart");function G(X){K(X,k.current)}pt(G,"handleSlideMove");function W(){String(M)!==String(j.current)&&y(M)}pt(W,"handleSlideEnd");function K(X,$,{commit:ee}={commit:!1}){const z=sx(a),D=Md(Math.round((X-s)/a)*a+s,z),Y=eI(D,[s,i]);N((te=[])=>{const ie=uI(te,Y,$);if(pI(ie,d*a)){k.current=ie.indexOf(Y);const ae=String(ie)!==String(te);return ae&&ee&&y(ie),ae?ie:te}else return te})}return pt(K,"updateValues"),S.jsx(oQ,{scope:e.__scopeSlider,name:r,disabled:c,min:s,max:i,valueIndexToChangeRef:k,thumbs:E.current,values:M,orientation:u,form:_,children:S.jsx(W_.Provider,{scope:e.__scopeSlider,children:S.jsx(W_.Slot,{scope:e.__scopeSlider,children:S.jsx(A,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:R,onPointerDown:Lt(x.onPointerDown,()=>{c||(j.current=M,P.current=!1)}),min:s,max:i,inverted:w,onSlideStart:c?void 0:q,onSlideMove:c?void 0:G,onSlideEnd:c?void 0:W,onHomeKeyDown:()=>{c||(P.current=!0,K(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(P.current=!0,K(i,M.length-1,{commit:!0}))},onStepKeyDown:({event:X,direction:$})=>{if(!c){P.current=!0;const D=tI.includes(X.key)||X.shiftKey&&nI.includes(X.key)?10:1,Y=k.current,te=M[Y],ie=mI(te,{min:s,step:a,direction:$,multiplier:D});K(ie,Y,{commit:!0})}}})})})})},"Slider")),[sI,iI]=nx(If,{startEdge:"left",endEdge:"right",size:"width",direction:1}),lQ=v.forwardRef(pt(function(e,n){const{min:r,max:s,dir:i,inverted:a,onSlideStart:u,onSlideMove:c,onSlideEnd:d,onStepKeyDown:h,...p}=e,[m,y]=v.useState(null),w=ln(n,y),_=v.useRef(void 0),x=FA(i),E=x==="ltr",k=E&&!a||!E&&a;function P(T){const A=_.current||m.getBoundingClientRect(),L=[0,A.width],R=w0(L,k?[r,s]:[s,r]);return _.current=A,R(T-A.left)}return pt(P,"getValueFromPointer"),S.jsx(sI,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:S.jsx(oI,{dir:x,"data-orientation":"horizontal",...p,ref:w,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:T=>{const A=P(T.clientX);u==null||u(A)},onSlideMove:T=>{const A=P(T.clientX);c==null||c(A)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:T=>{const L=rI[k?"from-left":"from-right"].includes(T.key);h==null||h({event:T,direction:L?-1:1})}})})},"SliderHorizontal")),uQ=v.forwardRef(pt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:a,onSlideMove:u,onSlideEnd:c,onStepKeyDown:d,...h}=e,p=v.useRef(null),m=ln(n,p),y=v.useRef(void 0),w=!i;function _(x){const E=y.current||p.current.getBoundingClientRect(),k=[0,E.height],T=w0(k,w?[s,r]:[r,s]);return y.current=E,T(x-E.top)}return pt(_,"getValueFromPointer"),S.jsx(sI,{scope:e.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:S.jsx(oI,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const E=_(x.clientY);a==null||a(E)},onSlideMove:x=>{const E=_(x.clientY);u==null||u(E)},onSlideEnd:()=>{y.current=void 0,c==null||c()},onStepKeyDown:x=>{const k=rI[w?"from-bottom":"from-top"].includes(x.key);d==null||d({event:x,direction:k?-1:1})}})})},"SliderVertical")),oI=v.forwardRef(pt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:u,onEndKeyDown:c,onStepKeyDown:d,...h}=e,p=Mf(If,r);return S.jsx(un.span,{...h,ref:n,onKeyDown:Lt(e.onKeyDown,m=>{m.key==="Home"?(u(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):tI.concat(nI).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:Lt(e.onPointerDown,m=>{const y=m.target;y.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(y)?y.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:Lt(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:Lt(e.onPointerUp,m=>{const y=m.target;y.hasPointerCapture(m.pointerId)&&(y.releasePointerCapture(m.pointerId),a(m))})})},"SliderImpl")),cQ="SliderTrack",dQ=v.forwardRef(pt(function(e,n){const{__scopeSlider:r,...s}=e,i=Mf(cQ,r);return S.jsx(un.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),n8="SliderRange",fQ=v.forwardRef(pt(function(e,n){const{__scopeSlider:r,...s}=e,i=Mf(n8,r),a=iI(n8,r),u=v.useRef(null),c=ln(n,u),d=i.values.length,h=i.values.map(y=>rx(y,i.min,i.max)),p=d>1?Math.min(...h):0,m=100-Math.max(...h);return S.jsx(un.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:c,style:{...e.style,[a.startEdge]:p+"%",[a.endEdge]:m+"%"}})},"SliderRange")),hQ="SliderThumb",[pQ,aI]=nx(hQ),mQ="SliderThumbProvider";function lI(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=Mf(mQ,e),a=sQ(e),[u,c]=v.useState(null),d=v.useMemo(()=>u?a().findIndex(x=>x.ref.current===u):-1,[a,u]),h=q5(u),p=u?!!i.form||!!u.closest("form"):!0,m=i.values[d],y=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),w=m===void 0?0:rx(m,i.min,i.max);v.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]);const _={value:m,name:y,form:i.form,isFormControl:p,index:d,thumb:u,onThumbChange:c,percent:w,size:h};return S.jsx(pQ,{scope:e,..._,children:gI(s)?s(_):r})}pt(lI,"SliderThumbProvider");var P1="SliderThumbTrigger",gQ=v.forwardRef(pt(function(e,n){const{__scopeSlider:r,...s}=e,i=Mf(P1,r),a=iI(P1,r),{index:u,value:c,percent:d,size:h,onThumbChange:p}=aI(P1,r),m=ln(n,p),y=cI(u,i.values.length),w=h==null?void 0:h[a.size],_=w?fI(w,d,a.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${d}% + ${_}px)`},children:S.jsx(W_.ItemSlot,{scope:r,children:S.jsx(un.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":i.min,"aria-valuenow":c,"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:c===void 0?{display:"none"}:e.style,onFocus:Lt(e.onFocus,()=>{i.valueIndexToChangeRef.current=u})})})})},"SliderThumbTrigger")),vQ=v.forwardRef(pt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(lI,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:a,isFormControl:u})=>S.jsxs(S.Fragment,{children:[S.jsx(gQ,{...i,ref:n,__scopeSlider:r}),u?S.jsx(_Q,{__scopeSlider:r},a):null]})})},"SliderThumb")),yQ="SliderBubbleInput",_Q=v.forwardRef(pt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:a}=aI(yQ,e),u=v.useRef(null),c=ln(u,r),d=nQ(s);return v.useEffect(()=>{const h=u.current;if(!h)return;const p=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&y){const w=new Event("input",{bubbles:!0});y.call(h,s),h.dispatchEvent(w)}},[d,s]),S.jsx(un.input,{style:{display:"none"},name:i,form:a,...n,ref:c,defaultValue:s})},"SliderBubbleInput"));function uI(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}pt(uI,"getNextSortedValues");function rx(t,e,n){const i=100/(n-e)*(t-e);return eI(i,[0,100])}pt(rx,"convertValueToPercentage");function cI(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}pt(cI,"getLabel");function dI(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(dI,"getClosestValueIndex");function fI(t,e,n){const r=t/2,i=w0([0,50],[0,r]);return(r-i(e)*n)*n}pt(fI,"getThumbInBoundsOffset");function hI(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}pt(hI,"getStepsBetweenValues");function pI(t,e){if(e>0){const n=hI(t);return Math.min(...n)>=e}return!0}pt(pI,"hasMinStepsBetweenValues");function w0(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(w0,"linearScale");function sx(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(sx,"getDecimalCount");function Md(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}pt(Md,"roundValue");function mI(t,{min:e,step:n,direction:r,multiplier:s}){const i=sx(n),a=(t-e)/n,u=Math.round(a),c=Md(u*n+e,i)===Md(t,i);let d;return c?d=u+s*r:r>0?d=Math.ceil(a):d=Math.floor(a),Md(d*n+e,i)}pt(mI,"getNextStepValue");function gI(t){return typeof t=="function"}pt(gI,"isFunction");const G_=v.forwardRef(({className:t,...e},n)=>S.jsxs(aQ,{ref:n,className:dr("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(dQ,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(fQ,{className:"absolute h-full bg-primary"})}),S.jsx(vQ,{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")})]}));G_.displayName="Slider";const wQ=[{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"}],xQ=[{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"}],bQ=[{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"}],gp=[{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."}],SQ=()=>{window.location.hash=""},Di=({title:t,eyebrow:e,description:n,children:r})=>S.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[S.jsxs("div",{className:"mb-5 max-w-2xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),S.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),r8=({swatches:t})=>S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[S.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),S.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),S.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),EQ=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",CQ=()=>{const t=gp.filter(n=>n.status==="showcased").length,e=gp.filter(n=>n.status==="cataloged").length;return S.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[S.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[S.jsxs("button",{type:"button",onClick:SQ,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(cz,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),S.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[S.jsxs("div",{className:"max-w-3xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),S.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),S.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),S.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:S.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[S.jsx(e5,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Di,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"The gallery uses Rivet's tooltip-wrapped button, compound split button, and the lower-level Radix tooltip wrapper so the reusable control APIs are visible.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button wrapper"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(bu,{title:"Primary action",shortcut:"D",className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Design action"}),S.jsx(bu,{title:"Secondary action",className:"border-border bg-surface-4 text-content hover:bg-surface-5 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",children:"Secondary"}),S.jsx(bu,{title:"Disabled action",disabled:!0,className:"border-border bg-muted text-muted-foreground rounded-lg border px-4 py-2 text-sm font-medium opacity-60",children:"Disabled"}),S.jsx(dR,{primaryLabel:"Ship",primaryIcon:i1,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx(Bo,{label:"Rivet tooltip API",side:"bottom",children:S.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),S.jsx(Pw,{content:"Forced open preview",forceOpen:!0,side:"right",children:S.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),S.jsx(Di,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:S.jsx(r8,{swatches:wQ})}),S.jsx(Di,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(r8,{swatches:xQ})}),S.jsx(Di,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),S.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),S.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),S.jsx(Di,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:S.jsx("div",{className:"flex flex-col gap-3",children:bQ.map(n=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),S.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),S.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),S.jsx(Di,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsxs(zp,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(zp.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(i1,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(zp.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:S.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[S.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),S.jsxs("div",{className:"space-y-6",children:[S.jsx(G_,{defaultValue:[64],max:100,step:1}),S.jsx(G_,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Di,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),S.jsx(DR,{message:"Applying visual change..."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),S.jsx(pw,{className:"text-primary text-xl"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),S.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:S.jsx(tQ,{hint:"Reading selected elements"})})]})}),S.jsx(Di,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(T_,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(LR,{icon:S.jsx(i1,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(Nm,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Di,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[S.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),S.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:gp.length})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),S.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),S.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),S.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[S.jsx("span",{children:"Component"}),S.jsx("span",{children:"Status"}),S.jsx("span",{children:"Coverage note"})]}),S.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:gp.map(n=>S.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-foreground font-medium",children:n.name}),S.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),S.jsx("div",{children:S.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${EQ(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},kQ=64,Bm=new Set;let Bp=null;const PQ=()=>{Bp=null;for(const t of Bm)t()},TQ=()=>{Bm.size!==0&&(Bp!==null&&clearTimeout(Bp),Bp=setTimeout(PQ,kQ))},RQ=t=>(Bm.add(t),()=>{Bm.delete(t)}),AQ=(t,e)=>typeof URL<"u"&&t instanceof URL?t:typeof Request<"u"&&t instanceof Request?new URL(t.url):new URL(String(t),e),IQ=(t,e)=>{try{const n=AQ(t,e);return n.origin!==e?!1:n.pathname.startsWith("/api/")}catch{return!1}},MQ=({nativeFetch:t,pageOrigin:e,getShouldIntercept:n})=>{const r=(s,i)=>t(s,i).then(a=>(a.status===401&&n()&&IQ(s,e)&&TQ(),a));return window.fetch=r,()=>{window.fetch=t}},OQ=t=>!t.hasConfig||t.configLoading||t.demoMode!==!0||t.agentModeAvailable!==!0||t.pathnameDemoSessionId!==null?!1:(t.activeDemoSessionId??t.configuredDemoSessionId??null)===null,LQ=(t,e,n)=>t===!0&&e!==!0?null:n,NQ=t=>t?"Preparing your demo session…":null,DQ=t=>!(t==="/rivet"||t.startsWith("/rivet/")),jQ=t=>!DQ(t.pathname)||t.hasConfig?!1:!t.configLoading&&!t.isRetryingConfig,FQ=t=>{const e=t.match(/^\/try\/([^/]+)/);return e!=null&&e[1]?decodeURIComponent(e[1]):null},VQ=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",T1=vs("App"),$Q=2e3,HQ=60,s8="Connecting to Google...",i8="https://rivet-proxy.onrender.com",zQ=`<!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>${s8}</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">${s8}</div>
421
- </body>
422
- </html>`,UQ="Too many people are trying Rivet right now. Please try again in a few minutes.",vI="Failed to start an isolated demo session.",BQ=async t=>{if(t.status===429)return UQ;try{const e=await t.json();if(e.error)return e.error;if(e.message)return e.message}catch{}return vI},K_=274,Wm=395,R1=Math.min(Wm,Math.round((K_+Wm)/2*1.1)),o8="rivet:panelWidth:v2",WQ=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},GQ=({projectPath:t,activeDemoSessionId:e=null,showLoginGate:n=!1,onStartLogin:r,isStartingLogin:s=!1,loginError:i=null,fullPageHostedLoginProgressMessage:a=null,holdHostedTryoutPreviewNavigation:u=!1,hostedTryoutPreviewHoldMessage:c=null,deferInspectorUntilPreviewReady:d=!1})=>{const h=Qe(T5)>0,[p,m]=wP(k5),y=qV(),[w,_]=v.useState(()=>{if(typeof window>"u")return R1;const G=Number(window.localStorage.getItem(o8));return Number.isFinite(G)&&G>=K_&&G<=Wm?G:R1}),[x,E]=v.useState(!1),[k,P]=v.useState(sq),T=p?w:0,[A,L]=v.useState(p);v.useEffect(()=>{if(!p){L(!1);return}P(G=>rq({position:G,boundsLeftPx:w}))},[p,w]),v.useEffect(()=>{window.localStorage.setItem(o8,String(w))},[w]),v.useEffect(()=>{if(!p)return;const G=W=>{W.key==="Escape"&&(WQ(W.target)||(W.preventDefault(),m(!1)))};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[p,m]);const O=v.useCallback(G=>{G.preventDefault(),G.stopPropagation();const W=G.clientX,K=w;E(!0);const X=ee=>{const z=Math.min(Wm,Math.max(K_,K+(ee.clientX-W)));_(z)},$=()=>{window.removeEventListener("pointermove",X),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$),E(!1)};window.addEventListener("pointermove",X),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",$)},[w]),R=v.useCallback(()=>_(R1),[]),M=vq(),N=Qe(Pf);wq({enabled:!N});const j=M.isProcessing?"Completing authentication...":a,F=j!==null,q=st(O5);return v.useEffect(()=>{q(t??null)},[t,q]),v.useEffect(()=>{n&&(document.body.style.cursor="auto")},[n]),S.jsxs(fl.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[j!==null&&!n?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(BZ,{message:j})}):null,n?S.jsx("div",{className:"absolute inset-0 z-40 flex items-center justify-center bg-black/45 backdrop-blur-[2px]",children:S.jsx(OA,{isSigningIn:s||F,onStartSignIn:()=>{r==null||r()},errorMessage:i,displayMode:"modal"})}):null,S.jsxs("div",{className:`relative flex min-w-0 flex-1 flex-col ${n?"pointer-events-none select-none":""}`,children:[S.jsx(_K,{holdHostedTryoutPreviewNavigation:u,isInteractionDisabled:n,activeDemoSessionId:e}),u&&c?S.jsx("div",{className:"bg-main absolute inset-0 z-30 flex items-center justify-center",children:S.jsx("div",{className:"border-divider bg-main-light rounded-lg border p-6 shadow-lg",children:S.jsx(DR,{message:c})})}):null]}),n?null:S.jsx(S.Fragment,{children:!d&&!h?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:A?w:0},children:S.jsxs(fl.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:p?0:-w},transition:y?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{p&&L(!0)},style:{width:w,willChange:"transform"},children:[S.jsx(LG,{onClose:()=>m(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:O,onDoubleClick:R,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:S.jsx("span",{className:`h-full transition-all duration-150 ${x?"w-0.5 bg-content-muted":"w-px bg-divider group-hover/resize:w-0.5 group-hover/resize:bg-content-muted"}`})})]})}),x&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(aq,{isVisible:!0,isPanelOpen:p,isReducedMotion:!!y,position:k,dragBoundsLeftPx:T,onPositionChange:P,onToggle:()=>m(G=>!G)})]}):null}),S.jsx(S$,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},Z_="rivet_connect_deep_link",KQ=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(Z_);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(Z_,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},ZQ=KQ(),qQ=()=>{const[t,e]=v.useState(window.location.hash),[n]=v.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Hp)==="1"),[r,s]=v.useState(!1),[i,a]=v.useState(ZQ);v.useEffect(()=>{n&&window.sessionStorage.removeItem(Hp)},[n]);const{config:u,refetchConfig:c,loading:d,error:h}=mq(),p=st(Pf),[m,y]=v.useState(!1),[w,_]=v.useState(null),[x,E]=v.useState(!1),[k,P]=v.useState(!1),[T,A]=v.useState(null),[L,O]=v.useState(!1),R=v.useRef(!1),M=v.useRef(!1),N=FQ(window.location.pathname),j=(u==null?void 0:u.activeDemoSessionId)??null,F=N??T??j,q=v.useMemo(()=>LQ(u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,F),[u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,F]),G=v.useMemo(()=>OQ({configLoading:d,hasConfig:u!==null,demoMode:u==null?void 0:u.demoMode,agentModeAvailable:u==null?void 0:u.agentModeAvailable,pathnameDemoSessionId:N,activeDemoSessionId:T,configuredDemoSessionId:j}),[u,d,N,T,j]);v.useLayoutEffect(()=>{if(!G){O(!1);return}O(!0)},[G]);const W=L,K=v.useMemo(()=>NQ(W),[W]),X=(u==null?void 0:u.demoMode)===!0&&W,$=v.useRef(null);$.current=F;const ee=v.useCallback(async()=>{if(!R.current)return;A(null);const he=await c();if((he==null?void 0:he.demoMode)===!0&&he.agentModeAvailable!==!0){P(!1);return}(he==null?void 0:he.demoMode)===!0&&P(!0)},[c]);v.useEffect(()=>{if((u==null?void 0:u.demoMode)===!0)return RQ(()=>{ee()})},[u==null?void 0:u.demoMode,ee]),v.useEffect(()=>{if(R.current=(u==null?void 0:u.demoMode)===!0,(u==null?void 0:u.demoMode)!==!0)return;const he=window.fetch.bind(window);return MQ({nativeFetch:he,pageOrigin:window.location.origin,getShouldIntercept:()=>R.current})},[u==null?void 0:u.demoMode]),v.useEffect(()=>{(u==null?void 0:u.agentModeAvailable)===!0&&P(!1)},[u==null?void 0:u.agentModeAvailable]);const z=v.useCallback(async he=>{const Pe=$.current;if(!(he!=null&&he.forceRefresh)&&Pe)return Pe;if(M.current)return"";M.current=!0;try{const be=await fetch("/api/demo/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!be.ok){const ot=await BQ(be);throw new Error(ot)}const $e=await be.json();if(!$e.sessionId)throw new Error("Demo session response missing session id.");return A($e.sessionId),$e.sessionId}finally{M.current=!1}},[]);v.useEffect(()=>{j&&A(j)},[j]),v.useEffect(()=>{u!=null&&u.userId?(Te.identify(u.userId,{...u.email?{email:u.email}:{}}),u.email&&Te.alias(u.email,u.userId)):u!=null&&u.email&&Te.identify(u.email,{email:u.email})},[u==null?void 0:u.userId,u==null?void 0:u.email]),v.useEffect(()=>{if(!u)return;const he=!!u.demoMode,Pe=he?F:null;Te.register({source:he?"tryout":"core",demo_mode:he,...Pe?{demo_session_id:Pe}:{}})},[u,F]);const D=v.useCallback(async()=>{var Pe;y(!0),_(null);let he=null;try{if(he=window.open("","_blank"),!he)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{he.document.open(),he.document.write(zQ),he.document.close()}catch(ot){T1.warn("Failed to render loading state in auth popup:",ot)}const be=await fetch(`${i8}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),$e=await be.json();if(!be.ok||!$e.success||!$e.authUrl||!$e.sessionId||!$e.pollSecret)throw new Error($e.error||$e.message||"Failed to start Google login");if(he.closed)throw new Error("Sign-in window was closed before Google login started.");he.location.href=$e.authUrl;for(let ot=0;ot<HQ;ot+=1){if(he.closed)throw new Error("Sign-in window was closed before authentication completed.");const ge=await(await fetch(`${i8}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:$e.sessionId,pollSecret:$e.pollSecret})})).json();if(ge.success&&ge.token&&((Pe=ge.user)!=null&&Pe.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:ge.user.email,token:ge.token,refreshToken:ge.refreshToken,userId:ge.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");if(he.close(),window.sessionStorage.setItem(Hp,"1"),(u==null?void 0:u.demoMode)===!0){await z({forceRefresh:!0}),window.location.reload();return}window.location.reload();return}if(ge.error&&ge.error!=="Pending")throw new Error(ge.error||"Google login failed");await new Promise(gt=>setTimeout(gt,$Q))}throw new Error("Authentication timed out. Please try again.")}catch(be){he&&!he.closed&&he.close();const $e=be instanceof Error?be.message:"Failed to start login flow";T1.warn("Hosted login failed:",$e),_($e),y(!1)}},[u==null?void 0:u.demoMode,z]),Y=(u==null?void 0:u.demoMode)===!0&&((u==null?void 0:u.agentModeAvailable)!==!0||k||m),te=u!=null&&u.agentModeAvailable!==!0,ie=VQ(t),ae=v.useCallback(async()=>{E(!0),p(!0);try{await c()}finally{p(!1),E(!1)}},[c,p]);if(v.useEffect(()=>{if(!G)return;let he=!1;return z({forceRefresh:!0}).catch(Pe=>{const be=Pe instanceof Error?Pe.message:vI;T1.warn("Hosted session bootstrap failed:",be),_(be),ht.error(be)}).finally(()=>{he||O(!1)}),()=>{he=!0}},[G,z]),v.useEffect(()=>{const he=()=>{const Pe=window.location.hash;e(Pe)};return window.addEventListener("hashchange",he),()=>window.removeEventListener("hashchange",he)},[]),ie==="design-system")return S.jsx(CQ,{});const ue={pathname:window.location.pathname,configLoading:d,hasConfig:u!==null,isRetryingConfig:x};if(jQ(ue)){const he=h||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-dim mt-2 text-xs",children:he}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{ae()},children:"Retry"})]})})}if(te)return S.jsx(OA,{isSigningIn:m,onStartSignIn:()=>{D()},errorMessage:w,displayMode:"full"});const oe=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&i!==null,se=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&n&&!r&&!oe;return S.jsxs(S.Fragment,{children:[S.jsx(GQ,{projectPath:u==null?void 0:u.projectPath,activeDemoSessionId:q,showLoginGate:Y,onStartLogin:D,isStartingLogin:m,loginError:w,fullPageHostedLoginProgressMessage:(u==null?void 0:u.demoMode)===!0&&m?"Completing sign-in...":null,holdHostedTryoutPreviewNavigation:W,hostedTryoutPreviewHoldMessage:K,deferInspectorUntilPreviewReady:X}),S.jsx(P_,{context:"onboarding",isOpen:se,onClose:()=>s(!0)}),S.jsx(P_,{context:"menu",isOpen:oe,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(Z_),a(null)}})]})},YQ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",XQ=new PO,QQ={session_recording:{maskAllInputs:!1,maskInputOptions:{password:!0},maskTextSelector:null}},JQ=()=>S.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:S.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})});wD.createRoot(document.getElementById("root")).render(S.jsx(_e.StrictMode,{children:S.jsx(uD,{apiKey:YQ,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",...QQ,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"core",rivet_version:"0.14.6",env:"production"})}},children:S.jsx(pD,{fallback:S.jsx(JQ,{}),children:S.jsx(TO,{client:XQ,children:S.jsx(DW,{defaultShape:"rounded",children:S.jsx(GX,{defaultLibrary:"lucide",children:S.jsx(qQ,{})})})})})})}));