rivet-design 0.14.21 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/agent-variants/SessionStore.d.ts +15 -0
  2. package/dist/agent-variants/SessionStore.d.ts.map +1 -1
  3. package/dist/agent-variants/SessionStore.js +28 -1
  4. package/dist/agent-variants/SessionStore.js.map +1 -1
  5. package/dist/agent-variants/WorktreeOrchestrator.d.ts +21 -0
  6. package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  7. package/dist/agent-variants/WorktreeOrchestrator.js +59 -5
  8. package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
  9. package/dist/agent-variants/contextAssets.d.ts +2 -0
  10. package/dist/agent-variants/contextAssets.d.ts.map +1 -1
  11. package/dist/agent-variants/contextAssets.js +7 -1
  12. package/dist/agent-variants/contextAssets.js.map +1 -1
  13. package/dist/cli/commands/mcpServe.d.ts.map +1 -1
  14. package/dist/cli/commands/mcpServe.js +9 -0
  15. package/dist/cli/commands/mcpServe.js.map +1 -1
  16. package/dist/cli/commands/variants.d.ts.map +1 -1
  17. package/dist/cli/commands/variants.js +0 -4
  18. package/dist/cli/commands/variants.js.map +1 -1
  19. package/dist/cli/handoff.d.ts +15 -0
  20. package/dist/cli/handoff.d.ts.map +1 -1
  21. package/dist/cli/handoff.js +51 -1
  22. package/dist/cli/handoff.js.map +1 -1
  23. package/dist/cli/router.d.ts.map +1 -1
  24. package/dist/cli/router.js +1 -21
  25. package/dist/cli/router.js.map +1 -1
  26. package/dist/install/harnesses.d.ts +11 -0
  27. package/dist/install/harnesses.d.ts.map +1 -1
  28. package/dist/install/harnesses.js +57 -58
  29. package/dist/install/harnesses.js.map +1 -1
  30. package/dist/install/legacyMcp.d.ts +15 -6
  31. package/dist/install/legacyMcp.d.ts.map +1 -1
  32. package/dist/install/legacyMcp.js +20 -46
  33. package/dist/install/legacyMcp.js.map +1 -1
  34. package/dist/install/mcpRegistration.d.ts +24 -7
  35. package/dist/install/mcpRegistration.d.ts.map +1 -1
  36. package/dist/install/mcpRegistration.js +88 -15
  37. package/dist/install/mcpRegistration.js.map +1 -1
  38. package/dist/routes/agentVariants.d.ts.map +1 -1
  39. package/dist/routes/agentVariants.js +65 -11
  40. package/dist/routes/agentVariants.js.map +1 -1
  41. package/dist/services/OperatingSystemServices.d.ts +12 -1
  42. package/dist/services/OperatingSystemServices.d.ts.map +1 -1
  43. package/dist/services/OperatingSystemServices.js +27 -0
  44. package/dist/services/OperatingSystemServices.js.map +1 -1
  45. package/dist/services/TelemetryService.d.ts +8 -0
  46. package/dist/services/TelemetryService.d.ts.map +1 -1
  47. package/dist/services/TelemetryService.js +7 -0
  48. package/dist/services/TelemetryService.js.map +1 -1
  49. package/dist/services/VariantGenerationService.d.ts +4 -6
  50. package/dist/services/VariantGenerationService.d.ts.map +1 -1
  51. package/dist/services/VariantGenerationService.js +32 -20
  52. package/dist/services/VariantGenerationService.js.map +1 -1
  53. package/dist/services/VariantHistoryService.d.ts +18 -1
  54. package/dist/services/VariantHistoryService.d.ts.map +1 -1
  55. package/dist/services/VariantHistoryService.js +33 -3
  56. package/dist/services/VariantHistoryService.js.map +1 -1
  57. package/package.json +1 -1
  58. package/src/ui/dist/assets/main-B2nKlm8o.css +1 -0
  59. package/src/ui/dist/assets/main-BsX3wuvL.js +423 -0
  60. package/src/ui/dist/index.html +2 -2
  61. package/src/ui/dist/assets/main-BvCYfVyA.js +0 -423
  62. package/src/ui/dist/assets/main-Dad5qwqj.css +0 -1
@@ -0,0 +1,423 @@
1
+ var vO=Object.defineProperty;var h4=t=>{throw TypeError(t)};var gO=(t,e,n)=>e in t?vO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Uo=(t,e,n)=>gO(t,typeof e!="symbol"?e+"":e,n),Rg=(t,e,n)=>e.has(t)||h4("Cannot "+n);var U=(t,e,n)=>(Rg(t,e,"read from private field"),n?n.call(t):e.get(t)),Be=(t,e,n)=>e.has(t)?h4("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ce=(t,e,n,r)=>(Rg(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),lt=(t,e,n)=>(Rg(t,e,"access private method"),n);var ip=(t,e,n,r)=>({set _(s){Ce(t,e,s,n)},get _(){return U(t,e,r)}});function yO(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 x0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ag={exports:{}},hd={},Mg={exports:{}},ot={};/**
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 p4;function _O(){if(p4)return ot;p4=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"),f=Symbol.for("react.lazy"),p=Symbol.iterator;function m(N){return N===null||typeof N!="object"?null:(N=p&&N[p]||N["@@iterator"],typeof N=="function"?N:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function w(N,Y,oe){this.props=N,this.context=Y,this.refs=y,this.updater=oe||_}w.prototype.isReactComponent={},w.prototype.setState=function(N,Y){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,Y,"setState")},w.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function S(){}S.prototype=w.prototype;function C(N,Y,oe){this.props=N,this.context=Y,this.refs=y,this.updater=oe||_}var P=C.prototype=new S;P.constructor=C,x(P,w.prototype),P.isPureReactComponent=!0;var T=Array.isArray,I=Object.prototype.hasOwnProperty,A={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function R(N,Y,oe){var J,se={},pe=null,Se=null;if(Y!=null)for(J in Y.ref!==void 0&&(Se=Y.ref),Y.key!==void 0&&(pe=""+Y.key),Y)I.call(Y,J)&&!O.hasOwnProperty(J)&&(se[J]=Y[J]);var ce=arguments.length-2;if(ce===1)se.children=oe;else if(1<ce){for(var ae=Array(ce),$e=0;$e<ce;$e++)ae[$e]=arguments[$e+2];se.children=ae}if(N&&N.defaultProps)for(J in ce=N.defaultProps,ce)se[J]===void 0&&(se[J]=ce[J]);return{$$typeof:t,type:N,key:pe,ref:Se,props:se,_owner:A.current}}function L(N,Y){return{$$typeof:t,type:N.type,key:Y,ref:N.ref,props:N.props,_owner:N._owner}}function D(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function j(N){var Y={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(oe){return Y[oe]})}var F=/\/+/g;function Z(N,Y){return typeof N=="object"&&N!==null&&N.key!=null?j(""+N.key):Y.toString(36)}function Q(N,Y,oe,J,se){var pe=typeof N;(pe==="undefined"||pe==="boolean")&&(N=null);var Se=!1;if(N===null)Se=!0;else switch(pe){case"string":case"number":Se=!0;break;case"object":switch(N.$$typeof){case t:case e:Se=!0}}if(Se)return Se=N,se=se(Se),N=J===""?"."+Z(Se,0):J,T(se)?(oe="",N!=null&&(oe=N.replace(F,"$&/")+"/"),Q(se,Y,oe,"",function($e){return $e})):se!=null&&(D(se)&&(se=L(se,oe+(!se.key||Se&&Se.key===se.key?"":(""+se.key).replace(F,"$&/")+"/")+N)),Y.push(se)),1;if(Se=0,J=J===""?".":J+":",T(N))for(var ce=0;ce<N.length;ce++){pe=N[ce];var ae=J+Z(pe,ce);Se+=Q(pe,Y,oe,ae,se)}else if(ae=m(N),typeof ae=="function")for(N=ae.call(N),ce=0;!(pe=N.next()).done;)pe=pe.value,ae=J+Z(pe,ce++),Se+=Q(pe,Y,oe,ae,se);else if(pe==="object")throw Y=String(N),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return Se}function K(N,Y,oe){if(N==null)return N;var J=[],se=0;return Q(N,J,"","",function(pe){return Y.call(oe,pe,se++)}),J}function q(N){if(N._status===-1){var Y=N._result;Y=Y(),Y.then(function(oe){(N._status===0||N._status===-1)&&(N._status=1,N._result=oe)},function(oe){(N._status===0||N._status===-1)&&(N._status=2,N._result=oe)}),N._status===-1&&(N._status=0,N._result=Y)}if(N._status===1)return N._result.default;throw N._result}var W={current:null},H={transition:null},X={ReactCurrentDispatcher:W,ReactCurrentBatchConfig:H,ReactCurrentOwner:A};function z(){throw Error("act(...) is not supported in production builds of React.")}return ot.Children={map:K,forEach:function(N,Y,oe){K(N,function(){Y.apply(this,arguments)},oe)},count:function(N){var Y=0;return K(N,function(){Y++}),Y},toArray:function(N){return K(N,function(Y){return Y})||[]},only:function(N){if(!D(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},ot.Component=w,ot.Fragment=n,ot.Profiler=s,ot.PureComponent=C,ot.StrictMode=r,ot.Suspense=c,ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,ot.act=z,ot.cloneElement=function(N,Y,oe){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var J=x({},N.props),se=N.key,pe=N.ref,Se=N._owner;if(Y!=null){if(Y.ref!==void 0&&(pe=Y.ref,Se=A.current),Y.key!==void 0&&(se=""+Y.key),N.type&&N.type.defaultProps)var ce=N.type.defaultProps;for(ae in Y)I.call(Y,ae)&&!O.hasOwnProperty(ae)&&(J[ae]=Y[ae]===void 0&&ce!==void 0?ce[ae]:Y[ae])}var ae=arguments.length-2;if(ae===1)J.children=oe;else if(1<ae){ce=Array(ae);for(var $e=0;$e<ae;$e++)ce[$e]=arguments[$e+2];J.children=ce}return{$$typeof:t,type:N.type,key:se,ref:pe,props:J,_owner:Se}},ot.createContext=function(N){return N={$$typeof:a,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},N.Provider={$$typeof:i,_context:N},N.Consumer=N},ot.createElement=R,ot.createFactory=function(N){var Y=R.bind(null,N);return Y.type=N,Y},ot.createRef=function(){return{current:null}},ot.forwardRef=function(N){return{$$typeof:u,render:N}},ot.isValidElement=D,ot.lazy=function(N){return{$$typeof:f,_payload:{_status:-1,_result:N},_init:q}},ot.memo=function(N,Y){return{$$typeof:d,type:N,compare:Y===void 0?null:Y}},ot.startTransition=function(N){var Y=H.transition;H.transition={};try{N()}finally{H.transition=Y}},ot.unstable_act=z,ot.useCallback=function(N,Y){return W.current.useCallback(N,Y)},ot.useContext=function(N){return W.current.useContext(N)},ot.useDebugValue=function(){},ot.useDeferredValue=function(N){return W.current.useDeferredValue(N)},ot.useEffect=function(N,Y){return W.current.useEffect(N,Y)},ot.useId=function(){return W.current.useId()},ot.useImperativeHandle=function(N,Y,oe){return W.current.useImperativeHandle(N,Y,oe)},ot.useInsertionEffect=function(N,Y){return W.current.useInsertionEffect(N,Y)},ot.useLayoutEffect=function(N,Y){return W.current.useLayoutEffect(N,Y)},ot.useMemo=function(N,Y){return W.current.useMemo(N,Y)},ot.useReducer=function(N,Y,oe){return W.current.useReducer(N,Y,oe)},ot.useRef=function(N){return W.current.useRef(N)},ot.useState=function(N){return W.current.useState(N)},ot.useSyncExternalStore=function(N,Y,oe){return W.current.useSyncExternalStore(N,Y,oe)},ot.useTransition=function(){return W.current.useTransition()},ot.version="18.3.1",ot}var m4;function L2(){return m4||(m4=1,Mg.exports=_O()),Mg.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 v4;function xO(){if(v4)return hd;v4=1;var t=L2(),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 f,p={},m=null,_=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(_=c.ref);for(f in c)r.call(c,f)&&!i.hasOwnProperty(f)&&(p[f]=c[f]);if(u&&u.defaultProps)for(f in c=u.defaultProps,c)p[f]===void 0&&(p[f]=c[f]);return{$$typeof:e,type:u,key:m,ref:_,props:p,_owner:s.current}}return hd.Fragment=n,hd.jsx=a,hd.jsxs=a,hd}var g4;function wO(){return g4||(g4=1,Ag.exports=xO()),Ag.exports}var E=wO(),v=L2();const we=x0(v),Df=yO({__proto__:null,default:we},[v]),v6=v.createContext(void 0),g6=t=>{const e=v.useContext(v6);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},bO=({client:t,children:e})=>(v.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),E.jsx(v6.Provider,{value:t,children:e})),SO={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var Ko,M2,o6,EO=(o6=class{constructor(){Be(this,Ko,SO);Be(this,M2,!1)}setTimeoutProvider(t){Ce(this,Ko,t)}setTimeout(t,e){return U(this,Ko).setTimeout(t,e)}clearTimeout(t){U(this,Ko).clearTimeout(t)}setInterval(t,e){return U(this,Ko).setInterval(t,e)}clearInterval(t){U(this,Ko).clearInterval(t)}},Ko=new WeakMap,M2=new WeakMap,o6);const al=new EO;function kO(t){setTimeout(t,0)}const CO=typeof window>"u"||"Deno"in globalThis;function Vr(){}function PO(t,e){return typeof t=="function"?t(e):t}function y6(t){return typeof t=="number"&&t>=0&&t!==1/0}function _6(t,e){return Math.max(t+(e||0)-Date.now(),0)}function dn(t,e){return typeof t=="function"?t(e):t}function y4(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==O2(a,e.options))return!1}else if(!sc(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 _4(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Xd(e.options.mutationKey)!==Xd(i))return!1}else if(!sc(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function O2(t,e){return((e==null?void 0:e.queryKeyHashFn)||Xd)(t)}function Xd(t){return JSON.stringify(t,(e,n)=>py(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function sc(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(!sc(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!sc(t[r],e[r]))return!1;return!0}return!1}const TO=Object.prototype.hasOwnProperty;function x6(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=x4(t)&&x4(e);if(!r&&!(py(t)&&py(e)))return e;const s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),a=i.length,u=r?new Array(a):{};let c=0;for(let d=0;d<a;d++){const f=r?d:i[d],p=t[f],m=e[f];if(p===m){u[f]=p,(r?d<s:TO.call(t,f))&&c++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){u[f]=m;continue}const _=x6(p,m,n+1);u[f]=_,_===p&&c++}return s===a&&c===s?t:u}function Lg(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 x4(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function py(t){if(!w4(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!w4(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function w4(t){return Object.prototype.toString.call(t)==="[object Object]"}function IO(t){return new Promise(e=>{al.setTimeout(e,t)})}function my(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?x6(t,e):e}function RO(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function AO(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}const D2=Symbol();function w6(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===D2?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function b6(t,e){return typeof t=="function"?t(...e):!!t}function MO(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}let LO=()=>CO;const N2=()=>LO();var Nf=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(){}},pl,Yo,Wu,a6,OO=(a6=class extends Nf{constructor(){super();Be(this,pl);Be(this,Yo);Be(this,Wu);Ce(this,Wu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Yo)||this.setEventListener(U(this,Wu))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,Yo))==null||e.call(this),Ce(this,Yo,void 0))}setEventListener(e){var n;Ce(this,Wu,e),(n=U(this,Yo))==null||n.call(this),Ce(this,Yo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){U(this,pl)!==e&&(Ce(this,pl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof U(this,pl)=="boolean"?U(this,pl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},pl=new WeakMap,Yo=new WeakMap,Wu=new WeakMap,a6);const j2=new OO,DO=kO;function NO(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=DO;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}}}const Yn=NO();var qu,Xo,Zu,l6,jO=(l6=class extends Nf{constructor(){super();Be(this,qu,!0);Be(this,Xo);Be(this,Zu);Ce(this,Zu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){U(this,Xo)||this.setEventListener(U(this,Zu))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,Xo))==null||e.call(this),Ce(this,Xo,void 0))}setEventListener(e){var n;Ce(this,Zu,e),(n=U(this,Xo))==null||n.call(this),Ce(this,Xo,e(this.setOnline.bind(this)))}setOnline(e){U(this,qu)!==e&&(Ce(this,qu,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return U(this,qu)}},qu=new WeakMap,Xo=new WeakMap,Zu=new WeakMap,l6);const ym=new jO;function FO(t){return Math.min(1e3*2**t,3e4)}function S6(t){return(t??"online")==="online"?ym.isOnline():!0}var vy=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function E6(t){let e=!1,n=0,r,s="pending",i,a;const u=new Promise((C,P)=>{i=C,a=P});u.catch(Vr);const c=()=>s!=="pending",d=C=>{var P;if(!c()){const T=new vy(C);y(T),(P=t.onCancel)==null||P.call(t,T)}},f=()=>{e=!0},p=()=>{e=!1},m=()=>j2.isFocused()&&(t.networkMode==="always"||ym.isOnline())&&t.canRun(),_=()=>S6(t.networkMode)&&t.canRun(),x=C=>{c()||(r==null||r(),s="resolved",i(C))},y=C=>{c()||(r==null||r(),s="rejected",a(C))},w=()=>new Promise(C=>{var P;r=T=>{(c()||m())&&C(T)},(P=t.onPause)==null||P.call(t)}).then(()=>{var C;r=void 0,c()||(C=t.onContinue)==null||C.call(t)}),S=()=>{if(c())return;let C;const P=n===0?t.initialPromise:void 0;try{C=P??t.fn()}catch(T){C=Promise.reject(T)}Promise.resolve(C).then(x).catch(T=>{var L;if(c())return;const I=t.retry??(N2()?0:3),A=t.retryDelay??FO,O=typeof A=="function"?A(n,T):A,R=I===!0||typeof I=="number"&&n<I||typeof I=="function"&&I(n,T);if(e||!R){y(T);return}n++,(L=t.onFail)==null||L.call(t,n,T),IO(O).then(()=>m()?void 0:w()).then(()=>{e?y(T):S()})})};return{promise:u,status:()=>s,cancel:d,continue:()=>(r==null||r(),u),cancelRetry:f,continueRetry:p,canStart:_,start:()=>(_()?S():w().then(S),u)}}var ml,u6,k6=(u6=class{constructor(){Be(this,ml)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),y6(this.gcTime)&&Ce(this,ml,al.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(N2()?1/0:3e5))}clearGcTimeout(){U(this,ml)!==void 0&&(al.clearTimeout(U(this,ml)),Ce(this,ml,void 0))}},ml=new WeakMap,u6);function VO(t){return{onFetch:(e,n)=>{var f,p,m,_,x;const r=e.options,s=(m=(p=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((_=e.state.data)==null?void 0:_.pages)||[],a=((x=e.state.data)==null?void 0:x.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const d=async()=>{let y=!1;const w=P=>{MO(P,()=>e.signal,()=>y=!0)},S=w6(e.options,e.fetchOptions),C=async(P,T,I)=>{if(y)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:I?"backward":"forward",meta:e.options.meta};return w(j),j})(),R=await S(O),{maxPages:L}=e.options,D=I?AO:RO;return{pages:D(P.pages,R,L),pageParams:D(P.pageParams,T,L)}};if(s&&i.length){const P=s==="backward",T=P?$O:b4,I={pages:i,pageParams:a};u=await C(I,T(r,I),P)}else{const P=t??i.length;do{const T=c===0?a[0]??r.initialPageParam:b4(r,u);if(c>0&&T==null)break;u=await C(u,T),c++}while(c<P)}return u};e.options.persister?e.fetchFn=()=>{var y,w;return(w=(y=e.options).persister)==null?void 0:w.call(y,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function b4(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 $O(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 Gu,vl,Ku,Cs,gl,An,Rf,yl,Zs,Xi,c6,HO=(c6=class extends k6{constructor(e){super();Be(this,Zs);Be(this,Gu);Be(this,vl);Be(this,Ku);Be(this,Cs);Be(this,gl);Be(this,An);Be(this,Rf);Be(this,yl);Ce(this,yl,!1),Ce(this,Rf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ce(this,gl,e.client),Ce(this,Cs,U(this,gl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ce(this,vl,E4(this.options)),this.state=e.state??U(this,vl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return U(this,Gu)}get promise(){var e;return(e=U(this,An))==null?void 0:e.promise}setOptions(e){if(this.options={...U(this,Rf),...e},e!=null&&e._type&&Ce(this,Gu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=E4(this.options);n.data!==void 0&&(this.setState(S4(n.data,n.dataUpdatedAt)),Ce(this,vl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,Cs).remove(this)}setData(e,n){const r=my(this.state.data,e,this.options);return lt(this,Zs,Xi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){lt(this,Zs,Xi).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=U(this,An))==null?void 0:r.promise;return(s=U(this,An))==null||s.cancel(e),n?n.then(Vr).catch(Vr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return U(this,vl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>dn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D2||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>dn(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:!_6(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=U(this,An))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=U(this,An))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),U(this,Cs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(U(this,An)&&(U(this,yl)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?U(this,An).cancel({revert:!0}):U(this,An).cancelRetry()),this.scheduleGc()),U(this,Cs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||lt(this,Zs,Xi).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,p,m,_,x,y,w,S,C,P,T;if(this.state.fetchStatus!=="idle"&&((d=U(this,An))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,An))return U(this,An).continueRetry(),U(this,An).promise}if(e&&this.setOptions(e),!this.options.queryFn){const I=this.observers.find(A=>A.options.queryFn);I&&this.setOptions(I.options)}const r=new AbortController,s=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(Ce(this,yl,!0),r.signal)})},i=()=>{const I=w6(this.options,n),O=(()=>{const R={client:U(this,gl),queryKey:this.queryKey,meta:this.meta};return s(R),R})();return Ce(this,yl,!1),this.options.persister?this.options.persister(I,O,this):I(O)},u=(()=>{const I={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:U(this,gl),state:this.state,fetchFn:i};return s(I),I})();(f=U(this,Gu)==="infinite"?VO(this.options.pages):this.options.behavior)==null||f.onFetch(u,this),Ce(this,Ku,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=u.fetchOptions)==null?void 0:p.meta))&&lt(this,Zs,Xi).call(this,{type:"fetch",meta:(m=u.fetchOptions)==null?void 0:m.meta});const c=Ce(this,An,E6({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:I=>{I instanceof vy&&I.revert&&this.setState({...U(this,Ku),fetchStatus:"idle"}),r.abort()},onFail:(I,A)=>{lt(this,Zs,Xi).call(this,{type:"failed",failureCount:I,error:A})},onPause:()=>{lt(this,Zs,Xi).call(this,{type:"pause"})},onContinue:()=>{lt(this,Zs,Xi).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const I=await c.start();if(I===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(I),(x=(_=U(this,Cs).config).onSuccess)==null||x.call(_,I,this),(w=(y=U(this,Cs).config).onSettled)==null||w.call(y,I,this.state.error,this),I}catch(I){if(I instanceof vy){if(I.silent)return U(this,An).promise;if(I.revert){if(this.state.data===void 0)throw I;return this.state.data}}throw lt(this,Zs,Xi).call(this,{type:"error",error:I}),(C=(S=U(this,Cs).config).onError)==null||C.call(S,I,this),(T=(P=U(this,Cs).config).onSettled)==null||T.call(P,this.state.data,I,this),I}finally{U(this,An)===c&&Ce(this,An,void 0),this.scheduleGc()}}},Gu=new WeakMap,vl=new WeakMap,Ku=new WeakMap,Cs=new WeakMap,gl=new WeakMap,An=new WeakMap,Rf=new WeakMap,yl=new WeakMap,Zs=new WeakSet,Xi=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,...C6(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...S4(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ce(this,Ku,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),Yn.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),U(this,Cs).notify({query:this,type:"updated",action:e})})},c6);function C6(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:S6(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function S4(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function E4(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 yr,dt,Af,_r,_l,Yu,io,Mf,Xu,Qu,xl,wl,Qo,Ju,xt,Td,gy,yy,_y,xy,wy,by,Sy,Ey,d6,zO=(d6=class extends Nf{constructor(e,n){super();Be(this,xt);Be(this,yr);Be(this,dt);Be(this,Af);Be(this,_r);Be(this,_l);Be(this,Yu);Be(this,io);Be(this,Mf);Be(this,Xu);Be(this,Qu);Be(this,xl);Be(this,wl);Be(this,Qo);Be(this,Ju,new Set);this.options=n,Ce(this,yr,e),Ce(this,io,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,dt).addObserver(this),k4(U(this,dt),this.options)?lt(this,xt,Td).call(this):this.updateResult(),lt(this,xt,wy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ky(U(this,dt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ky(U(this,dt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,lt(this,xt,by).call(this),lt(this,xt,Sy).call(this),U(this,dt).removeObserver(this)}setOptions(e){const n=this.options,r=U(this,dt);if(this.options=U(this,yr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof dn(this.options.enabled,U(this,dt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");lt(this,xt,Ey).call(this),U(this,dt).setOptions(this.options),n._defaulted&&!Lg(this.options,n)&&U(this,yr).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,dt),observer:this});const s=this.hasListeners();s&&C4(U(this,dt),r,this.options,n)&&lt(this,xt,Td).call(this),this.updateResult(),s&&(U(this,dt)!==r||dn(this.options.enabled,U(this,dt))!==dn(n.enabled,U(this,dt))||dn(this.options.staleTime,U(this,dt))!==dn(n.staleTime,U(this,dt)))&&lt(this,xt,yy).call(this);const i=lt(this,xt,_y).call(this);s&&(U(this,dt)!==r||dn(this.options.enabled,U(this,dt))!==dn(n.enabled,U(this,dt))||i!==U(this,Qo))&&lt(this,xt,xy).call(this,i)}getOptimisticResult(e){const n=U(this,yr).getQueryCache().build(U(this,yr),e),r=this.createResult(n,e);return Lg(this.getCurrentResult(),r)||(Ce(this,_r,r),Ce(this,Yu,this.options),Ce(this,_l,U(this,dt).state)),r}getCurrentResult(){return U(this,_r)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){U(this,Ju).add(e)}getCurrentQuery(){return U(this,dt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=U(this,yr).defaultQueryOptions(e),r=U(this,yr).getQueryCache().build(U(this,yr),n);let s=()=>{},i;const a=new Promise(u=>{i=u,s=U(this,yr).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),u(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const u=this.createResult(r,n);return i==null||i(u),u}).finally(()=>{s()}),a])}fetch(e){return lt(this,xt,Td).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,_r)))}createResult(e,n){var A;const r=U(this,dt),s=this.options,i=U(this,_r),a=U(this,_l),u=U(this,Yu),c=e!==r?e.state:U(this,Af),{state:d}=e;let f={...d},p=!1,m;if(n._optimisticResults){const O=this.hasListeners(),R=!O&&k4(e,n),L=O&&C4(e,r,n,s);(R||L)&&(f={...f,...C6(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:_,errorUpdatedAt:x,status:y}=f;m=f.data;let w=!1;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let O;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(O=i.data,w=!0):O=typeof n.placeholderData=="function"?n.placeholderData((A=U(this,Qu))==null?void 0:A.state.data,U(this,Qu)):n.placeholderData,O!==void 0&&(y="success",m=my(i==null?void 0:i.data,O,n),p=!0)}if(n.select&&m!==void 0&&!w)if(i&&m===(a==null?void 0:a.data)&&n.select===U(this,Mf))m=U(this,Xu);else try{Ce(this,Mf,n.select),m=n.select(m),m=my(i==null?void 0:i.data,m,n),Ce(this,Xu,m),Ce(this,io,null)}catch(O){Ce(this,io,O)}else m===void 0&&Ce(this,io,null);U(this,io)&&(_=U(this,io),m=U(this,Xu),x=Date.now(),y="error",p=!1);const S=f.fetchStatus==="fetching",C=y==="pending",P=y==="error",T=C&&S,I=m!==void 0;return{status:y,fetchStatus:f.fetchStatus,isPending:C,isSuccess:y==="success",isError:P,isInitialLoading:T,isLoading:T,data:m,dataUpdatedAt:f.dataUpdatedAt,error:_,errorUpdatedAt:x,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:S,isRefetching:S&&!C,isLoadingError:P&&!I,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:P&&I,isStale:F2(e,n),refetch:this.refetch,isEnabled:dn(n.enabled,e)!==!1}}updateResult(){const e=U(this,_r),n=this.createResult(U(this,dt),this.options);if(Ce(this,_l,U(this,dt).state),Ce(this,Yu,this.options),U(this,_l).data!==void 0&&Ce(this,Qu,U(this,dt)),Lg(n,e))return;Ce(this,_r,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!U(this,Ju).size)return!0;const u=new Set(a??U(this,Ju));return this.options.throwOnError&&u.add("error"),Object.keys(U(this,_r)).some(c=>{const d=c;return U(this,_r)[d]!==e[d]&&u.has(d)})})();Yn.batch(()=>{s&&this.listeners.forEach(i=>{i(U(this,_r))}),U(this,yr).getQueryCache().notify({query:U(this,dt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&lt(this,xt,wy).call(this)}},yr=new WeakMap,dt=new WeakMap,Af=new WeakMap,_r=new WeakMap,_l=new WeakMap,Yu=new WeakMap,io=new WeakMap,Mf=new WeakMap,Xu=new WeakMap,Qu=new WeakMap,xl=new WeakMap,wl=new WeakMap,Qo=new WeakMap,Ju=new WeakMap,xt=new WeakSet,Td=function(e){lt(this,xt,Ey).call(this);let n=U(this,dt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Vr)),n},gy=function(e){return!N2()&&dn(this.options.enabled,U(this,dt))!==!1&&y6(e)},yy=function(){lt(this,xt,by).call(this);const e=dn(this.options.staleTime,U(this,dt));if(U(this,_r).isStale||!lt(this,xt,gy).call(this,e))return;const n=_6(U(this,_r).dataUpdatedAt,e)+1;Ce(this,xl,al.setTimeout(()=>{U(this,_r).isStale||this.updateResult()},n))},_y=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,dt)):this.options.refetchInterval)??!1},xy=function(e){lt(this,xt,Sy).call(this),Ce(this,Qo,e),!(U(this,Qo)===0||!lt(this,xt,gy).call(this,U(this,Qo)))&&Ce(this,wl,al.setInterval(()=>{(this.options.refetchIntervalInBackground||j2.isFocused())&&lt(this,xt,Td).call(this)},U(this,Qo)))},wy=function(){lt(this,xt,yy).call(this),lt(this,xt,xy).call(this,lt(this,xt,_y).call(this))},by=function(){U(this,xl)!==void 0&&(al.clearTimeout(U(this,xl)),Ce(this,xl,void 0))},Sy=function(){U(this,wl)!==void 0&&(al.clearInterval(U(this,wl)),Ce(this,wl,void 0))},Ey=function(){const e=U(this,yr).getQueryCache().build(U(this,yr),this.options);if(e===U(this,dt))return;const n=U(this,dt);Ce(this,dt,e),Ce(this,Af,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},d6);function UO(t,e){return dn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&dn(e.retryOnMount,t)===!1)}function k4(t,e){return UO(t,e)||t.state.data!==void 0&&ky(t,e,e.refetchOnMount)}function ky(t,e,n){if(dn(e.enabled,t)!==!1&&dn(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&F2(t,e)}return!1}function C4(t,e,n,r){return(t!==e||dn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&F2(t,n)}function F2(t,e){return dn(e.enabled,t)!==!1&&t.isStaleByTime(dn(e.staleTime,t))}var Lf,_i,or,bl,xi,Zo,f6,BO=(f6=class extends k6{constructor(e){super();Be(this,xi);Be(this,Lf);Be(this,_i);Be(this,or);Be(this,bl);Ce(this,Lf,e.client),this.mutationId=e.mutationId,Ce(this,or,e.mutationCache),Ce(this,_i,[]),this.state=e.state||WO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){U(this,_i).includes(e)||(U(this,_i).push(e),this.clearGcTimeout(),U(this,or).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ce(this,_i,U(this,_i).filter(n=>n!==e)),this.scheduleGc(),U(this,or).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){U(this,_i).length||(this.state.status==="pending"?this.scheduleGc():U(this,or).remove(this))}continue(){var e;return((e=U(this,bl))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var u,c,d,f,p,m,_,x,y,w,S,C,P,T,I,A,O,R;const n=()=>{lt(this,xi,Zo).call(this,{type:"continue"})},r={client:U(this,Lf),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Ce(this,bl,E6({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,D)=>{lt(this,xi,Zo).call(this,{type:"failed",failureCount:L,error:D})},onPause:()=>{lt(this,xi,Zo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,or).canRun(this)})),i=this.state.status==="pending",a=!s.canStart();try{if(i)n();else{lt(this,xi,Zo).call(this,{type:"pending",variables:e,isPaused:a}),U(this,or).config.onMutate&&await U(this,or).config.onMutate(e,this,r);const D=await((c=(u=this.options).onMutate)==null?void 0:c.call(u,e,r));D!==this.state.context&&lt(this,xi,Zo).call(this,{type:"pending",context:D,variables:e,isPaused:a})}const L=await s.start();return await((f=(d=U(this,or).config).onSuccess)==null?void 0:f.call(d,L,e,this.state.context,this,r)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,L,e,this.state.context,r)),await((x=(_=U(this,or).config).onSettled)==null?void 0:x.call(_,L,null,this.state.variables,this.state.context,this,r)),await((w=(y=this.options).onSettled)==null?void 0:w.call(y,L,null,e,this.state.context,r)),lt(this,xi,Zo).call(this,{type:"success",data:L}),L}catch(L){try{await((C=(S=U(this,or).config).onError)==null?void 0:C.call(S,L,e,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((T=(P=this.options).onError)==null?void 0:T.call(P,L,e,this.state.context,r))}catch(D){Promise.reject(D)}try{await((A=(I=U(this,or).config).onSettled)==null?void 0:A.call(I,void 0,L,this.state.variables,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((R=(O=this.options).onSettled)==null?void 0:R.call(O,void 0,L,e,this.state.context,r))}catch(D){Promise.reject(D)}throw lt(this,xi,Zo).call(this,{type:"error",error:L}),L}finally{U(this,bl)===s&&Ce(this,bl,void 0),U(this,or).runNext(this)}}},Lf=new WeakMap,_i=new WeakMap,or=new WeakMap,bl=new WeakMap,xi=new WeakSet,Zo=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),Yn.batch(()=>{U(this,_i).forEach(r=>{r.onMutationUpdate(e)}),U(this,or).notify({mutation:this,type:"updated",action:e})})},f6);function WO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oo,Gs,Of,h6,qO=(h6=class extends Nf{constructor(e={}){super();Be(this,oo);Be(this,Gs);Be(this,Of);this.config=e,Ce(this,oo,new Set),Ce(this,Gs,new Map),Ce(this,Of,0)}build(e,n,r){const s=new BO({client:e,mutationCache:this,mutationId:++ip(this,Of)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){U(this,oo).add(e);const n=op(e);if(typeof n=="string"){const r=U(this,Gs).get(n);r?r.push(e):U(this,Gs).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(U(this,oo).delete(e)){const n=op(e);if(typeof n=="string"){const r=U(this,Gs).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&U(this,Gs).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=op(e);if(typeof n=="string"){const s=(r=U(this,Gs).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r,s;const n=op(e);return typeof n=="string"?((s=(r=U(this,Gs).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Yn.batch(()=>{U(this,oo).forEach(e=>{this.notify({type:"removed",mutation:e})}),U(this,oo).clear(),U(this,Gs).clear()})}getAll(){return Array.from(U(this,oo))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>_4(n,r))}findAll(e={}){return this.getAll().filter(n=>_4(e,n))}notify(e){Yn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Yn.batch(()=>Promise.all(e.map(n=>n.continue().catch(Vr))))}},oo=new WeakMap,Gs=new WeakMap,Of=new WeakMap,h6);function op(t){var e;return(e=t.options.scope)==null?void 0:e.id}var wi,p6,ZO=(p6=class extends Nf{constructor(e={}){super();Be(this,wi);this.config=e,Ce(this,wi,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??O2(s,n);let a=this.get(i);return a||(a=new HO({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){U(this,wi).has(e.queryHash)||(U(this,wi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=U(this,wi).get(e.queryHash);n&&(e.destroy(),n===e&&U(this,wi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Yn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return U(this,wi).get(e)}getAll(){return[...U(this,wi).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>y4(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>y4(e,r)):n}notify(e){Yn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Yn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Yn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},wi=new WeakMap,p6),en,Jo,ea,ec,tc,ta,nc,rc,m6,GO=(m6=class{constructor(t={}){Be(this,en);Be(this,Jo);Be(this,ea);Be(this,ec);Be(this,tc);Be(this,ta);Be(this,nc);Be(this,rc);Ce(this,en,t.queryCache||new ZO),Ce(this,Jo,t.mutationCache||new qO),Ce(this,ea,t.defaultOptions||{}),Ce(this,ec,new Map),Ce(this,tc,new Map),Ce(this,ta,0)}mount(){ip(this,ta)._++,U(this,ta)===1&&(Ce(this,nc,j2.subscribe(async t=>{t&&(await this.resumePausedMutations(),U(this,en).onFocus())})),Ce(this,rc,ym.subscribe(async t=>{t&&(await this.resumePausedMutations(),U(this,en).onOnline())})))}unmount(){var t,e;ip(this,ta)._--,U(this,ta)===0&&((t=U(this,nc))==null||t.call(this),Ce(this,nc,void 0),(e=U(this,rc))==null||e.call(this),Ce(this,rc,void 0))}isFetching(t){return U(this,en).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return U(this,Jo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=U(this,en).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=U(this,en).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(dn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return U(this,en).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var a;const r=this.defaultQueryOptions({queryKey:t}),s=(a=U(this,en).get(r.queryHash))==null?void 0:a.state.data,i=PO(e,s);if(i!==void 0)return U(this,en).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return Yn.batch(()=>U(this,en).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=U(this,en).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=U(this,en);Yn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=U(this,en);return Yn.batch(()=>{const r=n.findAll(t),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},r=Yn.batch(()=>U(this,en).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Vr).catch(Vr)}invalidateQueries(t,e={}){return Yn.batch(()=>(U(this,en).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=Yn.batch(()=>U(this,en).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Vr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Vr)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=U(this,en).build(this,e),r=n.isStaleByTime(dn(e.staleTime,n))?await n.fetch(e):n.state.data,s=e.select;return s?s(r):r}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=U(this,en).build(this,e);return n.isStaleByTime(dn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Vr).catch(Vr)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Vr).catch(Vr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return ym.isOnline()?U(this,Jo).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,en)}getMutationCache(){return U(this,Jo)}getDefaultOptions(){return U(this,ea)}setDefaultOptions(t){Ce(this,ea,t)}setQueryDefaults(t,e){U(this,ec).set(Xd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...U(this,ec).values()],n={};return e.forEach(r=>{sc(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){U(this,tc).set(Xd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...U(this,tc).values()],n={};return e.forEach(r=>{sc(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...U(this,ea).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=O2(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===D2&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...U(this,ea).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){U(this,en).clear(),U(this,Jo).clear()}},en=new WeakMap,Jo=new WeakMap,ea=new WeakMap,ec=new WeakMap,tc=new WeakMap,ta=new WeakMap,nc=new WeakMap,rc=new WeakMap,m6);const P6=v.createContext(!1),KO=()=>v.useContext(P6);P6.Provider;function YO(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const XO=v.createContext(YO()),QO=()=>v.useContext(XO),JO=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?b6(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},eD=t=>{v.useEffect(()=>{t.clearReset()},[t])},tD=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||b6(n,[t.error,r])),nD=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))}},rD=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,sD=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function iD(t,e,n){const r=KO(),s=QO(),i=g6(),a=i.defaultQueryOptions(t),u=i.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,nD(a),JO(a,s,u),eD(s);const[d]=v.useState(()=>new e(i,a)),f=d.getOptimisticResult(a),p=!r&&c;if(v.useSyncExternalStore(v.useCallback(m=>{const _=p?d.subscribe(Yn.batchCalls(m)):Vr;return d.updateResult(),_},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v.useEffect(()=>{d.setOptions(a)},[a,d]),rD(a,f))throw sD(a,d,s);if(tD({result:f,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw f.error;return a.notifyOnChangeProps?f:d.trackResult(f)}function Cy(t,e){return iD(t,zO)}var ne=typeof window<"u"?window:void 0,ur=typeof globalThis<"u"?globalThis:ne,br=ur==null?void 0:ur.navigator,fe=ur==null?void 0:ur.document,Ht=ur==null?void 0:ur.location,V2=ur==null?void 0:ur.fetch,Py=ur!=null&&ur.XMLHttpRequest&&"withCredentials"in new ur.XMLHttpRequest?ur.XMLHttpRequest:void 0,P4=ur==null?void 0:ur.AbortController,oD=ur==null?void 0:ur.CompressionStream,jr=br==null?void 0:br.userAgent;function T6(){return!(!ne||ne.navigator.onLine===!1)}var pd=typeof globalThis<"u"?globalThis:ne;pd&&typeof self>"u"&&(pd.self=pd),pd&&typeof File>"u"&&(pd.File=function(){});var je=ne??{},Pt={DEBUG:!1,LIB_VERSION:"0.6.0",LIB_NAME:"browser-common"};function T4(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 Tt(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(c){T4(i,r,s,a,u,"next",c)}function u(c){T4(i,r,s,a,u,"throw",c)}a(void 0)}))}}function ue(){return ue=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ue.apply(null,arguments)}function I6(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 I4=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function R4(t){return typeof t=="string"||t}function A4(t){return typeof t=="string"?t:void 0}var md,aD=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],eo=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),M4=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),lD=["$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"],uD=["token"],R6="NativeGzipValidationError",Ty=t=>t.length>=2&&t[0]===31&&t[1]===139,L4=(t,e)=>t===M4.GZipJS||e===M4.GZipJS||e==="gzip",O4=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",ap=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=R6,e},cD=(function(){var t=Tt((function*(e,n){18>e.size&&ap("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());Ty(r)&&r[2]===8||ap("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var u=(()=>{if(md)return md;md=[];for(var f=0;256>f;f++){for(var p=f,m=0;8>m;m++)p=1&p?3988292384^p>>>1:p>>>1;md[f]=p>>>0}return md})(),c=4294967295,d=0;a.length>d;d++)c=u[255&(c^a[d])]^c>>>8;return(4294967295^c)>>>0})(n)&&ap("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&ap("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function Iy(){return Iy=Tt((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=Tt((function*(f){try{yield i.abort(f)}catch{}throw f}));return function(f){return d.apply(this,arguments)}})()),u=new Response(s.readable).blob(),c=(yield Promise.all([u,a]))[0];return yield cD(c,r),c}catch(d){if(n!=null&&n.rethrow)throw d;return e&&console.error("Failed to gzip compress data",d),null}})),Iy.apply(this,arguments)}var dD=20,A6=1e3,fD=1e4,hD="[Circular]",Ry="[Truncated]",w0="[Unserializable]",pD="[Function]";function Lu(t){for(var e="",n=0;t.length>n;n++){var r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{var s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}var mD=["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"],D4=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return mD.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Ke(t,e){return t.indexOf(e)!==-1}var b0=function(t){return t.trim()},Ay=function(t){return t.replace(/^\$/,"")};function M6(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 L6=Object.prototype,O6=L6.hasOwnProperty,S0=L6.toString,Ge=Array.isArray||function(t){return S0.call(t)==="[object Array]"},ar=t=>typeof t=="function",bt=t=>t===Object(t)&&!Ge(t),Ks=t=>{if(bt(t)){for(var e in t)if(O6.call(t,e))return!1;return!0}return!1},de=t=>t===void 0,ut=t=>S0.call(t)=="[object String]",_m=t=>ut(t)&&t.trim().length===0,Xn=t=>t===null,Qe=t=>de(t)||Xn(t),pn=t=>S0.call(t)=="[object Number]"&&t==t,Qi=t=>pn(t)&&t>0,wr=t=>S0.call(t)==="[object Boolean]",vD=t=>t instanceof FormData,gD=t=>Ke(lD,t),yD=t=>Ke(uD,t);function D6(t){return t===null||typeof t!="object"}function xm(t,e){return{}.toString.call(t)==="[object "+e+"]"}function N6(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return j6(t,Error)}}function $2(t){return typeof Event<"u"&&j6(t,Event)}function j6(t,e){try{return t instanceof e}catch{return!1}}var _D=[!0,"true",1,"1","yes"],Og=t=>Ke(_D,t),xD=[!1,"false",0,"0","no"];function Ci(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),pn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),Ci(s||n,e,n,r))}class wD{constructor(e){this.k={},this.S=e.S,this.C=Ci(e.bucketSize,0,100,e.I),this.R=Ci(e.refillRate,0,this.C,e.I),this.A=Ci(e.refillInterval,0,864e5,e.I)}O(e,n){var r=Math.floor((n-e.lastAccess)/this.A);r>0&&(e.tokens=Math.min(e.tokens+r*this.R,this.C),e.lastAccess=e.lastAccess+r*this.A)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.k[s];return i?this.O(i,r):this.k[s]=i={tokens:this.C,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.S)==null||n.call(this,e)),i.tokens===0)}stop(){this.k={}}}var as="Mobile",wm="iOS",fo="Android",ic="Tablet",F6=fo+" "+ic,V6="iPad",$6="Apple",H6=$6+" Watch",Nd="Safari",oc="BlackBerry",z6="Samsung",U6=z6+"Browser",B6=z6+" Internet",Sl="Chrome",bD=Sl+" OS",W6=Sl+" "+wm,H2="Internet Explorer",q6=H2+" "+as,z2="Opera",SD=z2+" Mini",U2="Edge",Z6="Microsoft "+U2,Ou="Firefox",G6=Ou+" "+wm,Qd="Nintendo",Jd="PlayStation",Du="Xbox",K6=fo+" "+as,Y6=as+" "+Nd,Id="Windows",My=Id+" Phone",N4="Nokia",Ly="Ouya",X6="Generic",ED=X6+" "+as.toLowerCase(),Q6=X6+" "+ic.toLowerCase(),Oy="Konqueror",J6="Oculus Browser",bm="Vivaldi",eP="Yandex",Sm="Whale",Dy="DuckDuckGo",tP="Pale Moon",Em="Waterfox",jd="Brave",nP="Google Search App",qt="(\\d+(\\.\\d+)?)",Dg=new RegExp("Version/"+qt),kD=new RegExp(Du,"i"),CD=new RegExp(Jd+" \\w+","i"),PD=new RegExp(Qd+" \\w+","i"),B2=new RegExp(oc+"|PlayBook|BB10","i"),TD={"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"},rP=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?jd:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Ke(t,"GSA/")?nP:Ke(t," OPR/")&&Ke(t,"Mini")?SD:Ke(t," OPR/")?z2:B2.test(t)?oc:Ke(t,"IE"+as)||Ke(t,"WPDesktop")?q6:Ke(t,"OculusBrowser")?J6:Ke(t,U6)?B6:Ke(t,U2)||Ke(t,"Edg/")?Z6:Ke(t,bm+"/")?bm:Ke(t,"YaBrowser/")?eP:Ke(t,Sm+"/")?Sm:Ke(t,Dy+"/")||Ke(t,"Ddg/")?Dy:Ke(t,"FBIOS")?"Facebook "+as:Ke(t,"UCWEB")||Ke(t,"UCBrowser")?"UC Browser":Ke(t,"CriOS")?W6:Ke(t,"CrMo")||Ke(t,Sl)?Sl:Ke(t,fo)&&Ke(t,Nd)?K6:Ke(t,"FxiOS")?G6:Ke(t.toLowerCase(),Oy.toLowerCase())?Oy:Ke(t,jd+"/")?jd:((i,a)=>a&&Ke(a,$6)||(function(u){return Ke(u,Nd)&&!Ke(u,Sl)&&!Ke(u,fo)})(i))(t,e)?Ke(t,as)?Y6:Nd:Ke(t,"PaleMoon/")?tP:Ke(t,Em+"/")?Em:Ke(t,Ou)?Ou:Ke(t,"MSIE")||Ke(t,"Trident/")?H2:Ke(t,"Gecko")?Ou:"")},ID={[q6]:[new RegExp("rv:"+qt)],[Z6]:[new RegExp(U2+"?\\/"+qt)],[Sl]:[new RegExp("("+Sl+"|CrMo)\\/"+qt)],[W6]:[new RegExp("CriOS\\/"+qt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+qt)],[Nd]:[Dg],[Y6]:[Dg],[z2]:[new RegExp("(Opera|OPR)\\/"+qt)],[Ou]:[new RegExp(Ou+"\\/"+qt)],[G6]:[new RegExp("FxiOS\\/"+qt)],[Oy]:[new RegExp("Konqueror[:/]?"+qt,"i")],[oc]:[new RegExp(oc+" "+qt),Dg],[K6]:[new RegExp("android\\s"+qt,"i")],[B6]:[new RegExp(U6+"\\/"+qt)],[J6]:[new RegExp("OculusBrowser\\/"+qt)],[bm]:[new RegExp(bm+"\\/"+qt)],[eP]:[new RegExp("YaBrowser\\/"+qt)],[Sm]:[new RegExp(Sm+"\\/"+qt)],[jd]:[new RegExp(jd+"\\/"+qt)],[Dy]:[new RegExp("(DuckDuckGo|Ddg)\\/"+qt)],[tP]:[new RegExp("PaleMoon\\/"+qt)],[Em]:[new RegExp(Em+"\\/"+qt)],[nP]:[new RegExp("GSA\\/"+qt)],[H2]:[new RegExp("(rv:|MSIE )"+qt)],Mozilla:[new RegExp("rv:"+qt)]},RD=function(t,e,n,r){var s=rP(t,e,n,r),i=ID[s];if(de(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},j4=[[new RegExp(Du+"; "+Du+" (.*?)[);]","i"),t=>[Du,t&&t[1]||""]],[new RegExp(Qd,"i"),[Qd,""]],[new RegExp(Jd,"i"),[Jd,""]],[B2,[oc,""]],[new RegExp(Id,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[My,""];if(new RegExp(as).test(e)&&!/IEMobile\b/.test(e))return[Id+" "+as,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=TD[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[Id,r]}return[Id,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[wm,[t[3],t[4],t[5]||"0"].join(".")]:[wm,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=de(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+fo+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+fo+")","i"),t=>t&&t[2]?[fo,[t[2],t[3],t[4]||"0"].join(".")]:[fo,""]],[/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/,[bD,""]],[/Linux|debian/i,["Linux",""]]],F4=function(t){return PD.test(t)?Qd:CD.test(t)?Jd:kD.test(t)?Du:new RegExp(Ly,"i").test(t)?Ly:new RegExp("("+My+"|WPDesktop)","i").test(t)?My:/iPad/.test(t)?V6:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?H6:B2.test(t)?oc:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(N4,"i").test(t)?N4:/(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(as).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)?fo:F6:new RegExp("(pda|"+as+")","i").test(t)?ED:new RegExp(ic,"i").test(t)&&!new RegExp(ic+" pc","i").test(t)?Q6:""},AD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function V4(t,e){return typeof(n=t)=="string"&&AD.test(n)?t:e();var n}function ca(t){return t&&t.split("#")[0]}function W2(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function $4(t,e,n){return sP.apply(this,arguments)}function sP(){return(sP=Tt((function*(t,e,n){var r;try{return yield Promise.race([t,new Promise(((s,i)=>{r=W2((()=>{try{n==null||n(),s()}catch(a){i(a)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var iP={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}},MD=iP.info,H4=9223372036854776e3,LD={}.propertyIsEnumerable;function km(t,e){try{return oP(t,e,{ancestors:new WeakSet,remainingNodes:fD},0)}catch{return[]}}function q2(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:Ry};if(n.remainingNodes--,wr(t))return{boolValue:t};if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};var s=BigInt(t).toString();return t>=H4||-H4>t?(e==null||e.debug("Attribute "+s+" is outside the int64 range; encoding it as a string"),{stringValue:s}):{intValue:s}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Lu(t)};if(typeof t=="function")return{stringValue:pD};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:hD};if(r>=dD)return{stringValue:Ry};if(t instanceof Date){var i=t.getTime(),a=Number.isFinite(i)?t.toISOString():String(t);return{stringValue:typeof a=="string"?Lu(a):String(a)}}n.ancestors.add(t);try{try{var u=t.toJSON;if(typeof u=="function")return q2(u.call(t),e,n,r+1)}catch{}return Ge(t)?{arrayValue:{values:OD(t,e,n,r+1)}}:{kvlistValue:{values:oP(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Lu(String(t))}}function OD(t,e,n,r){for(var s=[],i=Math.min(t.length,A6),a=0;i>a&&n.remainingNodes>0;a++)try{var u=a in t?t[a]:void 0;if(Qe(u))continue;s.push(q2(u,e,n,r))}catch{s.push({stringValue:w0})}return t.length>a&&s.push({stringValue:Ry}),s}function oP(t,e,n,r){var s=[];for(var i in t)if(LD.call(t,i)){if(s.length>=A6||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=t[i];if(Xn(a)||de(a))continue;s.push({key:Lu(i),value:q2(a,e,n,r)})}catch{s.push({key:Lu(i),value:{stringValue:w0}})}}return s}function DD(t){try{return Lu(String(t))}catch{return w0}}function ND(t,e,n){var r=iP[t.level||"info"]||MD,s=r.text,i=r.number,a=String(Date.now())+"000000",u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),Qe(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),Qe(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);var c=ue({},u),d=t.attributes;if(d){var f=[];try{f=Object.keys(d)}catch{f=[]}for(var p of f){var m=void 0;try{m=d[p]}catch{m=w0}Object.defineProperty(c,p,{value:m,enumerable:!0,writable:!0,configurable:!0})}}var _={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:i,severityText:s,body:{stringValue:DD(t.body)},attributes:km(c,n)};return t.trace_id&&(_.traceId=t.trace_id),t.span_id&&(_.spanId=t.span_id),de(t.trace_flags)||(_.flags=t.trace_flags),_}function aP(t,e,n){return ue({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function lP(t,e,n,r){return{resourceLogs:[{resource:{attributes:km(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let jD=class{constructor(t,e,n,r,s,i,a){var u;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.Wi=e,this.I=n,this.hn=r,this.dn=s,this.vn=i,this.cn=a,this.fn=null,this.pn=0,this.gn=0,this.mn=0,this.yn=0,this.bn=!1,this._n=e.maxBufferSize,this.wn=Math.max((u=e.maxQueueSize)!==null&&u!==void 0?u:e.maxBufferSize,e.maxBufferSize),this.kn=e.flushIntervalMs,this.Sn=e.maxBatchRecordsPerPost,this.xn=e.rateCapWindowMs,this.Cn=e.maxLogsPerInterval}reset(){this.Tn(),this.fn=null,this.mn=0,this.yn=0,this.bn=!1,this.pn=0,this.gn=0,this.Sn=this.Wi.maxBatchRecordsPerPost}onReconnect(){this.gn=0,this.Mn()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.En(t);if(e!==null)if(e.body){if(this.In()){var n={record:ND(e,this.hn(),this.I)};this.dn((()=>this.Rn(n)))}}else this.I.info("Log was rejected in beforeSend function")}}En(t){var e=this.Wi.beforeSend;if(!e)return t;var n=Ge(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.I.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.I.error("Error in beforeSend function for log:",a),null}return r}In(){if(this.Cn===void 0)return!0;var t=Date.now(),e=t-this.mn;return this.xn>e&&e>=0||(this.mn=t,this.yn=0,this.bn=!1),this.Cn>this.yn?(this.yn++,!0):(this.bn||(this.I.warn("captureLog dropping logs: exceeded "+this.Cn+" logs per "+this.xn+"ms"),this.bn=!0),!1)}flush(){var t=this;return Tt((function*(){if(!t._instance.isDisabled)return t.fn||(t.fn=t.Pn().finally((()=>{t.fn=null}))),t.fn}))()}Pn(){var t=this;return Tt((function*(){var e;t.Tn();var n=(e=t._instance.getPersistedProperty(eo.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.pn=0;var u=Math.min(n.length,t.Sn),c=n.slice(0,u),d=lP(c.map((p=>p.record)),t.An(),(i=t.cn)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),f=yield t._instance.Fn(d);if(f.kind==="too-large"&&c.length>1)t.Sn=Math.max(1,Math.floor(c.length/2)),t.I.warn("Received 413 when sending logs batch of size "+c.length+", reducing batch size to "+t.Sn);else if(f.kind==="retry-later"||(f.kind==="too-large"?t.I.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."):f.kind==="ok"&&t.Wi.maxBatchRecordsPerPost>t.Sn&&(t.Sn=Math.min(t.Wi.maxBatchRecordsPerPost,t.Sn+1)),yield t.On(c.length),n=(a=t._instance.getPersistedProperty(eo.LogsQueue))!==null&&a!==void 0?a:[],s+=c.length,f.kind==="fatal"))throw f.error}}))()}On(t){var e=this;return Tt((function*(){var n,r=Math.max(0,t-e.pn),s=(n=e._instance.getPersistedProperty(eo.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(eo.LogsQueue,s.slice(r)),yield e.vn()}))()}An(){return aP(this.Wi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Rn(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(eo.LogsQueue))!==null&&e!==void 0?e:[];this.wn>n.length||(n.shift(),this.pn++,this.I.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(eo.LogsQueue,n),this._n>n.length?this.Ln():this.Mn()}}Ln(t){t===void 0&&(t=this.kn),this.Dn||(this.Dn=W2((()=>{this.Dn=void 0,this.Mn()}),t))}$n(){var t=Math.min(Math.max(0,this.gn-1),6);return this.kn*Math.pow(2,t)}Nn(){var t=this._instance.getPersistedProperty(eo.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Tt((function*(){e.Tn();var n=e.flush().catch((()=>{}));t!==void 0?yield $4(n,t):yield n}))()}flushWithTimeout(t){var e=this;return Tt((function*(){var n=e.flush();yield $4(n,t,(()=>{n.catch((()=>{}))}))}))()}Mn(){this.flush().then((()=>{this.gn=0}),(t=>{this.gn++,this.I.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.Nn()&&this.Ln(this.$n())}))}Tn(){this.Dn&&(clearTimeout(this.Dn),this.Dn=void 0)}};var Ng=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function z4(t){return String(t)+"000000"}function U4(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 FD=class{constructor(t,e,n){this._instance=t,this.Wi=e,this.I=n,this.qn=new Map,this.fn=null,this.jn=!1,this.Bn=new Map,this.Hn=new Set,this.Un=0}count(t,e,n){e===void 0&&(e=1),this.zn({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.zn({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.zn({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.fn,n=(function(){var s=Tt((function*(){e&&(yield e.catch((()=>{}))),yield t.Wn()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.fn===r&&(this.fn=null)}));return this.fn=r,r}drainWindow(){if(this.qn.size===0)return null;var t=this.qn;return this.qn=new Map,this.jn=!1,this.Bn=new Map,this.Hn=new Set,this.Vn(t)}reset(){this.Un++,this.Tn(),this.qn=new Map,this.fn=null,this.jn=!1,this.Bn=new Map,this.Hn=new Set}zn(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.En(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.I.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?ue({},e.attributes):void 0,r=U4(e.type,e.name,e.unit,n)}catch(a){return void this.I.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var s=this.qn.get(r);if(!s){if(!this.Gn())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.qn.set(r,s)}var i=this.Bn.get(e.name);i===void 0?this.Bn.set(e.name,e.type):i===e.type||this.Hn.has(e.name)||(this.Hn.add(e.name),this.I.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.Zn(s,e.value),this.Ln()}else this.I.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}Gn(){return this.Wi.maxSeriesPerFlush>this.qn.size||(this.jn||(this.jn=!0,this.I.warn("Metric series cap reached ("+this.Wi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Zn(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(Ng.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,Ng)]+=1}}En(t){var e=this.Wi.beforeSend;if(!e)return t;var n=Ge(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.I.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.I.error("Error in beforeSend function for metric:",a),null}return r}Ln(){this.Dn||(this.Dn=W2((()=>{this.Dn=void 0,this.flush().catch((t=>{this.I.error("Metrics flush failed:",t)}))}),this.Wi.flushIntervalMs))}Tn(){this.Dn&&(clearTimeout(this.Dn),this.Dn=void 0)}Wn(){var t=this;return Tt((function*(){if(t.qn.size!==0){var e=t.qn;t.qn=new Map,t.jn=!1,t.Bn=new Map,t.Hn=new Set;var n=t.Un,r=yield t._instance.Qn(t.Vn(e));if(n===t.Un)switch(r.kind){case"ok":return;case"retry-later":return t.Jn(e),void t.Ln();case"too-large":return void t.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.I.error("Failed to send metrics batch:",r.error)}}}))()}Vn(t){return e=this.Kn(t),n=(function(i,a,u){return ue({},i.resourceAttributes,{"service.name":i.serviceName||"unknown_service"},i.environment&&{"deployment.environment":i.environment},i.serviceVersion&&{"service.version":i.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":u})})(this.Wi,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:km(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}Kn(t){var e=z4(Date.now()),n=new Map;for(var r of t.values()){var s,i=U4(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=ue({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,a));var u=km((s=r.attributes)!==null&&s!==void 0?s:{},this.I),c=z4(r.windowStartMs);if(r.type==="count"){var d,f={attributes:u,startTimeUnixNano:c,timeUnixNano:e,asDouble:(d=r.total)!==null&&d!==void 0?d:0};a.sum.dataPoints.push(f)}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:Ng})}return Array.from(n.values())}Jn(t){var e,n;for(var r of t){var s=r[0],i=r[1],a=this.qn.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.Gn()&&this.qn.set(s,i)}}};var lp,B4,jg;function VD(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return jg&&n.length===B4||(B4=n.length,jg=n.reduce(((r,s)=>{lp||(lp={});var i=lp[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,f=e[s];if(d&&f){r[d]=f,lp[s]=[d,f];break}}return r}),{})),jg}}class $D{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 Tt((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Ge(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),ue({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Tt((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,ue({},n,{handled:!0}))),u}buildParsingContext(e){var n;return{chunkIdMap:VD(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 ue({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var ac="?";function Ny(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?ac:n,in_app:!(e!=null&&e.startsWith("webkit-masked-url://"))&&e!=="<anonymous>"};return de(r)||(i.lineno=r),de(s)||(i.colno=s),i}var uP=(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]:ac,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},HD=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,zD=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,UD=/\((\S*)(?::(\d+))(?::(\d+))\)/,BD=(t,e)=>{var n=HD.exec(t);if(n)return Ny(e,n[1],ac,+n[2],+n[3]);var r=zD.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=UD.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=uP(r[1]||ac,r[2]);return Ny(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},WD=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qD=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ZD=(t,e)=>{var n=WD.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=qD.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]||ac,a=uP(i,s);return Ny(e,s=a[1],i=a[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},W4=/\(error: (.*)\)/;class GD{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=ut(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 xm(e,"DOMException")}isDOMError(e){return xm(e,"DOMError")}}class KD{match(e){return N6(e)}coerce(e,n){var r,s=this.getStack(e),i=s===void 0;return{type:this.getType(e),value:this.getMessage(e,n),stack:s??((r=n.syntheticException)==null?void 0:r.stack),cause:e.cause?n.next(e.cause):void 0,synthetic:i}}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 YD{constructor(){}match(e){return!!xm(e,"ErrorEvent")&&(e.error!=null||this.wi(e))}coerce(e,n){var r;if(e.error!=null)return n.apply(e.error);var s=n.apply(e.message);return ue({},s,{stack:(r=this.ki(e))!==null&&r!==void 0?r:s.stack,synthetic:!0})}wi(e){return ut(e.message)&&e.message.length>0}ki(e){var n,r,s=e,i=(n=s.lineno)!==null&&n!==void 0?n:0,a=(r=s.colno)!==null&&r!==void 0?r:0;if(ut(s.filename)&&s.filename.length!==0&&i!==0)return`Error
18
+ at `+s.filename+":"+i+":"+a}}var XD=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class QD{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(XD);return s&&(n=s[1],r=s[2]),[n,r]}}var JD=["fatal","error","warning","log","info","debug"];function cP(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 eN{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=this.getStack(e))!==null&&r!==void 0?r:(s=n.syntheticException)==null?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if($2(e))return e.constructor.name;var n="name"in e?e.name:void 0;return ut(n)&&!_m(n)?n:"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: "+cP(e)}isSeverityLevel(e){return ut(e)&&!_m(e)&&JD.indexOf(e)>=0}getStack(e){try{return ut(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:ut(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(N6(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class tN{match(e){return $2(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+cP(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class nN{match(e){return D6(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 rN{match(e){return xm(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!$2(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return D6(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 Cm="$message",Pm="$timestamp",sN=new Set([Cm,Pm]),Fg={enabled:!0,max_bytes:32768};function Tm(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:Fg.enabled,max_bytes:oN(t.max_bytes,Fg.max_bytes)}:ue({},Fg)}class iN{constructor(e){this.Yn=[],this.Xn=0,this.Wi=Tm(e)}setConfig(e){this.Wi=Tm(e),this.ts()}add(e){var n=(function(s){var i;try{i=M6(s)}catch{return}try{var a=JSON.parse(i);if(!bt(a))return;var u=a,c=u[Cm],d=u[Pm];return!ut(c)||c.trim().length===0||!ut(d)&&!pn(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.Wi.max_bytes||(this.Yn.push({step:n.step,bytes:r}),this.Xn+=r,this.ts())}}getAttachable(){return this.Yn.map((e=>e.step))}clear(){this.Yn=[],this.Xn=0}size(){return this.Yn.length}ts(){for(;this.Xn>this.Wi.max_bytes&&this.Yn.length>0;){var e=this.Yn.shift();e&&(this.Xn-=e.bytes)}}}function oN(t,e){if(!pn(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var dP=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={P(s){if(ne&&(Pt.DEBUG||ne.POSTHOG_DEBUG||n)&&!de(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.P("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.P("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.P("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.P("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)=>dP(t+" "+s,i)};return r},ge=dP("[PostHog.js]"),jt=ge.createLogger,aN=jt("[ExternalScriptsLoader]"),Im=t=>{var e=fe==null?void 0:fe.querySelectorAll("script");if(e){for(var n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},tl=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return aN.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Im(e);if(r){if(r.__posthog_loading_callback_fired)return n();var s=r.__posthog_loading_error;return s?n(s):(r.addEventListener("load",(a=>{r.__posthog_loading_callback_fired=!0,n(void 0,a)})),void r.addEventListener("error",(a=>{r.__posthog_loading_error=a,n(a)})))}var i=()=>{if(!fe)return n("document not found");if(Im(e))return tl(t,e,n);var a=fe.createElement("script");if(a.type="text/javascript",a.crossOrigin="anonymous",a.src=e,a.onload=d=>{a.__posthog_loading_callback_fired=!0,n(void 0,d)},a.onerror=d=>{a.__posthog_loading_error=d,n(d)},t.config.prepare_external_dependency_script&&(a=t.config.prepare_external_dependency_script(a)),!a)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")fe.head.appendChild(a);else{var u,c=fe.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(a,c[0]):fe.body.appendChild(a)}};fe!=null&&fe.body?i():fe==null||fe.addEventListener("DOMContentLoaded",i)},Vg={},q4=(t,e)=>{var n="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",n)};je.__PosthogExtensions__=je.__PosthogExtensions__||{},je.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r=t.config.strict_script_versioning;if(r){var s=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),i=Vg[s];if(r==="fallback"&&i){if(Im(i))return void tl(t,i,n);delete Vg[s]}tl(t,s,r==="fallback"?(u,c)=>{if(u)if(typeof u=="string")n(u);else{var d,f=q4(t,e);Vg[s]=f;var p=Im(s);p==null||(d=p.parentNode)==null||d.removeChild(p),tl(t,f,n)}else n(void 0,c)}:n)}else tl(t,q4(t,e),n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");tl(t,a,n)}},je.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);tl(t,r,n)};Pt.DEBUG=!1,Pt.LIB_VERSION="1.421.0",Pt.LIB_NAME="web";var fP="$people_distinct_id",gr="distinct_id",ef="$device_id",$g="$device_model",ku="__alias",Rd="__timers",jy="$autocapture_disabled_server_side",Fy="$heatmaps_enabled_server_side",Vy="$exception_capture_enabled_server_side",$y="$error_tracking_suppression_rules",Hy="$error_tracking_capture_extension_exceptions",zy="$web_vitals_enabled_server_side",Z2="$dead_clicks_enabled_server_side",G2="$product_tours_enabled_server_side",Uy="$web_vitals_allowed_metrics",ll="$session_recording_remote_config",hP="$replay_sample_rate",pP="$replay_override_sampling",mP="$replay_override_linked_flag",vP="$replay_override_url_trigger",gP="$replay_override_event_trigger",Cu="$sesid",K2="$session_is_sampled",ro="$enabled_feature_flags",ul="$active_feature_flags",Up="$early_access_features",tf="$feature_flag_details",cl="$feature_flag_payloads",Nu="$feature_flag_request_id",Rm="$minimal_flag_called_events",pi="$override_feature_flags",nl="$override_feature_flag_payloads",Ws="$stored_person_properties",bi="$stored_group_properties",yP="$groups",By="$surveys",Am="$surveys_loaded_at",Wy="$surveys_activated",Bp="$surveys_activated_session",Wp="$surveys_activated_timestamps",Ad="ph_product_tours",ao="$flag_call_reported",Md="$flag_call_reported_session_id",ju="$feature_flag_errors",El="$feature_flag_evaluated_at",nt="$user_state",qy="$client_session_props",Zy="$capture_rate_limit",Gy="$initial_campaign_params",Ky="$initial_referrer_info",Mm="$initial_person_info",Lm="$epp",cu="$posthog_cookieless",_P="$cookieless_mode",xP="$sdk_debug_extensions_init_method",wP="$sdk_debug_extensions_init_time_ms",Yy="$sdk_debug_recording_script_not_loaded",Y2="PostHog loadExternalDependency extension not found.",rl="on_reject",lo="always",cn="anonymous",Kn="identified",Xy="identified_only",lc="visibilitychange",Om="beforeunload",wu="$pageview",Hg="$pageleave",zg="$identify",Z4="$groupidentify";function up(t,e){Ge(t)&&t.forEach(e)}function _t(t,e){if(!Qe(t))if(Ge(t))t.forEach(e);else if(vD(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)O6.call(t,n)&&e(t[n],n)}var St=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 qp(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 G4=function(t){try{return t()}catch{return}},lN=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){ge.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ge.critical(s)}}},X2=function(t){var e={};return _t(t,(function(n,r){(ut(n)&&n.length>0||pn(n))&&(e[r]=n)})),e},uN=["herokuapp.com","vercel.app","netlify.app"];function cN(t){var e=t==null?void 0:t.hostname;if(!ut(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of uN)if(n===r)return!1;return!0}function It(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 Qy(t){return t.name==="ph_toolbar_internal"}var bP=t=>{if(fe){try{for(var e=t+"=",n=fe.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 pn(t)&&isFinite(t)&&Math.floor(t)===t});class Dm{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 Dm(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 Dm(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 dN{generate(){var e=this.generateOrAbort();if(!de(e))return e;this.Dr=0;var n=this.generateOrAbort();if(de(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.Dr)this.Dr=e,this.Fr();else{if(this.Dr>=e+1e4)return;this.Nr++,this.Nr>4398046511103&&(this.Dr++,this.Fr())}return Dm.fromFieldsV7(this.Dr,Math.trunc(this.Nr/Math.pow(2,30)),this.Nr&Math.pow(2,30)-1,this.qr.nextUint32())}Fr(){this.Nr=1024*this.qr.nextUint32()+(1023&this.qr.nextUint32())}constructor(){this.Dr=0,this.Nr=0,this.qr=new fN}}var K4,SP=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&&!de(ne.crypto)&&crypto.getRandomValues&&(SP=t=>crypto.getRandomValues(t));class fN{nextUint32(){return this.yt.length>this.jr||(SP(this.yt),this.jr=0),this.yt[this.jr++]}constructor(){this.yt=new Uint32Array(8),this.jr=1/0}}var gi=()=>hN().toString(),hN=()=>(K4||(K4=new dN)).generate(),vd="",pN=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,yn={Br:()=>!!fe,Wr(t){ge.error("cookieStore error: "+t)},Ur:bP,zr(t){var e;try{e=JSON.parse(yn.Ur(t))||{}}catch{}return e},Hr(t,e,n,r,s){if(!fe)return!1;try{var i="",a="",u=(function(f,p){if(p){var m=(function(x,y){if(y===void 0&&(y=fe),vd)return vd;if(!y||["localhost","127.0.0.1"].includes(x))return"";for(var w=x.split("."),S=Math.min(w.length,8),C="dmn_chk_"+gi();!vd&&S--;){var P=w.slice(S).join("."),T=C+"=1;domain=."+P+";path=/";y.cookie=T+";max-age=3",y.cookie.includes(C)&&(y.cookie=T+";max-age=0",vd=P)}return vd})(f);if(!m){var _=(x=>{var y=x.match(pN);return y?y[0]:""})(f);_!==m&&ge.info("Warning: cookie subdomain discovery mismatch",_,m),m=_}return m?"; domain=."+m:""}return""})(fe.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&&ge.warn("cookieStore warning: large cookie, len="+d.length),fe.cookie=d,!0}catch{return!1}},$r(t,e){if(fe!=null&&fe.cookie)try{yn.Hr(t,"",-1,e)}catch{return}}},Ug=null,wt={Br(){if(!Xn(Ug))return Ug;var t=!0;if(de(ne))t=!1;else try{var e="__mplssupport__";wt.Hr(e,"xyz"),wt.Ur(e)!=='"xyz"'&&(t=!1),wt.$r(e)}catch{t=!1}return t||ge.error("localStorage unsupported; falling back to cookie store"),Ug=t,t},Wr(t){ge.error("localStorage error: "+t)},Ur(t){try{return ne==null?void 0:ne.localStorage.getItem(t)}catch(e){wt.Wr(e)}return null},zr(t){try{return JSON.parse(wt.Ur(t))||{}}catch{}return null},Hr(t,e){try{return ne==null||ne.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){wt.Wr(n)}return!1},$r(t){try{ne==null||ne.localStorage.removeItem(t)}catch(e){wt.Wr(e)}}},Bg=[Ws,ul,ro,tf,cl,Nu,El,ju,ao],sl=[ef,gr,Cu,K2,Lm,Mm,nt],Nm=t=>t+"_cpm",mN=["__proto__","constructor","prototype"],Wg=t=>{if(!bt(t))return{};var e={};return Object.keys(t).forEach((n=>{mN.indexOf(n)===-1&&(e[n]=t[n])})),e},qg=function(t,e){e===void 0&&(e=[]);var n={};return[...sl,...e].forEach((r=>{var s=t[r];de(s)||Xn(s)||s===""||(n[r]=s)})),n},EP=t=>{for(var e=5381,n=2166136261,r=0;t.length>r;r++){var s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},Y4=(t,e)=>({p:e,f:EP(JSON.stringify(t))}),X4=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var n=yn.zr(Nm(t)),r=(n==null?void 0:n.f)===EP(e)&&Ge(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},Zg=(t,e)=>e+"|"+(yn.Ur(Nm(t))||""),cp={},vN={Br:()=>!0,Wr(t){ge.error("memoryStorage error: "+t)},Ur:t=>cp[t]||null,zr:t=>cp[t]||null,Hr:(t,e)=>(cp[t]=e,!0),$r(t){delete cp[t]}},Ua=null,Et={Br(){if(!Xn(Ua))return Ua;if(Ua=!0,de(ne))Ua=!1;else try{var t="__support__";Et.Hr(t,"xyz"),Et.Ur(t)!=='"xyz"'&&(Ua=!1),Et.$r(t)}catch{Ua=!1}return Ua},Wr(t){ge.error("sessionStorage error: ",t)},Ur(t){try{return ne==null?void 0:ne.sessionStorage.getItem(t)}catch(e){Et.Wr(e)}return null},zr(t){try{return JSON.parse(Et.Ur(t))||null}catch{}return null},Hr(t,e){try{return ne==null||ne.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Et.Wr(n)}return!1},$r(t){try{ne==null||ne.sessionStorage.removeItem(t)}catch(e){Et.Wr(e)}}};class gN{constructor(e){this._instance=e}get Wi(){return this._instance.config}get consent(){return this._s()?0:this.ws}isOptedOut(){return this.Wi.cookieless_mode===lo||this.isRejected()||this.consent===-1&&this.Wi.cookieless_mode===rl}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Wi.opt_out_capturing_by_default}optInOut(e){this.ks.Hr(this.Ss,e?1:0,this.Wi.cookie_expiration,this.Wi.cross_subdomain_cookie,this.Wi.secure_cookie)}reset(){this.ks.$r(this.Ss,this.Wi.cross_subdomain_cookie)}get Ss(){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 ws(){var e=this.ks.Ur(this.Ss);return Og(e)?1:Ke(xD,e)?0:-1}get ks(){var e=this.Wi.opt_out_capturing_persistence_type,n=e==="localStorage"?wt:yn;if(!this.xs||this.xs!==n){this.xs=n;var r=e==="localStorage"?yn:wt;r.Ur(this.Ss)&&(this.xs.Ur(this.Ss)||this.optInOut(Og(r.Ur(this.Ss))),r.$r(this.Ss,this.Wi.cross_subdomain_cookie))}return this.xs}_s(){return!!this.Wi.respect_dnt&&[br==null?void 0:br.doNotTrack,br==null?void 0:br.msDoNotTrack,je.doNotTrack].some((e=>Og(e)))}}function kP(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!ar(r))return e;try{var s=r(e);return ut(s)&&s?s:e}catch(i){return ge.error("Error in get_current_url, falling back to window.location.href",i),e}}var CP="__POSTHOG_TOOLBAR__",yN=1,_N=3,xN=11;function Q4(t){return t instanceof Element&&(t.id===CP||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function da(t){return!!t&&t.nodeType===yN}function ss(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function PP(t){return!!t&&t.nodeType===_N}function TP(t){return!!t&&t.nodeType===xN&&da(t.host)}var IP=1e3;function Q2(t){return t?b0(t).split(/\s+/):[]}function J4(t,e){var n=(function(r){var s,i=ne==null||(s=ne.location)==null?void 0:s.href;return de(i)?void 0:kP(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function jm(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 Q2(e)}function RP(t){return Qe(t)?null:b0(t).split(/(\s+)/).filter((e=>Fd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function nf(t){var e="";return t_(t)&&!DP(t)&&t.childNodes&&t.childNodes.length&&_t(t.childNodes,(function(n){var r;PP(n)&&n.textContent&&(e+=(r=RP(n.textContent))!==null&&r!==void 0?r:"")})),b0(e)}function Jy(t){var e;return de(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var J2=["a","button","form","input","select","textarea","label"];function e_(t,e){if(de(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 AP(t){var e=t.parentNode;return!(!e||!da(e))&&e}var wN=[".ph-no-autocapture","[data-ph-no-autocapture]"],MP=["next","previous","prev",">","<"],bN=[...MP,"+","-","−","–"],eE=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,tE=[".ph-no-rageclick",".ph-no-capture"],SN=["","text","search","email","password","url","tel","number"];function LP(t,e){if(!ne||ex(t))return!1;var n,r,s,i,a;if(wr(e)?(n=!!e&&tE,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:tE,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||!da(c))&&(!!ss(c,"textarea")||(ss(c,"input")?Ke(SN,(c.getAttribute("type")||"").toLowerCase()):(function(d){if(d.isContentEditable)return!0;var f=d.getAttribute==null?void 0:d.getAttribute("contenteditable");return f==="true"||f===""})(c)))})(t))return!1;var u=OP(t,!1).targetElementList;return!(function(c,d){if(c===!1||de(c))return!1;var f;if(c===!0)f=MP;else{if(!Ge(c))return!1;if(c.length>10)return ge.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;f=c.map((p=>p.toLowerCase()))}return d.some((p=>{var m=p.safeText,_=p.ariaLabel;return f.some((x=>eE(m,x)||eE(_,x)))}))})(r,u.map((c=>{var d;return{safeText:nf(c).toLowerCase(),ariaLabel:((d=c.getAttribute("aria-label"))==null?void 0:d.toLowerCase().trim())||""}})))&&!e_(u,n)}var ex=t=>!t||ss(t,"html")||!da(t),OP=(t,e)=>{if(!ne||ex(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!ss(s,"body");)if(TP(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=AP(s);if(!i)break;if(e||J2.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 t_(t){for(var e=new Set,n=0,r=t;r.parentNode&&!ss(r,"body");r=r.parentNode){if(n++>=IP||e.has(r))return!1;e.add(r);var s=jm(r);if(Ke(s,"ph-sensitive")||Ke(s,"ph-no-capture"))return!1}if(Ke(jm(t),"ph-include"))return!0;var i=t.type||"";if(ut(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!ut(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 DP(t){return!!(ss(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ss(t,"select")||ss(t,"textarea")||t.getAttribute("contenteditable")==="true")}var nE=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),rE=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,EN=[16,15,14,13],kN=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),sE=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),iE=/[0-9A-Za-z_]/;function CN(t){for(var e=0,n=!1,r=t.length-1;r>=0;r--){var s=t.charCodeAt(r)-48;n&&(s*=2)>9&&(s-=9),e+=s,n=!n}return e%10==0}function Fd(t,e){if(e===void 0&&(e=!0),Qe(t))return!1;if(ut(t)){t=b0(t);var n=e?nE.test((t||"").replace(/[- ]/g,"")):(function(s){var i;for(rE.lastIndex=0;i=rE.exec(s);){var a=i[2];if(a)for(var u=a.replace(/[- ]/g,""),c=0;u.length>c;c++)for(var d of EN){var f=c+d;if(u.length>=f){var p=u.slice(c,f);if(nE.test(p)&&CN(p))return!0}}}return!1})(t);if(n)return!1;var r=e?kN.test(t):(function(s){var i;for(sE.lastIndex=0;i=sE.exec(s);){var a=i[1],u=i[3];if(!(a&&u&&iE.test(a)&&iE.test(u)))return!0}return!1})(t);if(r)return!1}return!0}function oE(t){var e=nf(t);return Fd(e=(e+" "+NP(t)).trim())?e:""}function NP(t){var e="";return t&&t.childNodes&&t.childNodes.length&&_t(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=nf(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+NP(n)).trim())}catch(i){ge.error("[AutoCapture]",i)}})),e}function aE(t){return t.replace(/"|\\"/g,'\\"')}function PN(t){var e=t.attr__class;if(e)return Ge(e)?e:Q2(e)}var dp=jt("[Dead Clicks]"),TN=()=>!0,IN=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Z2)),r=t.instance.config.capture_dead_clicks;return wr(r)?r:!!bt(r)||n};class lE{get lazyLoadedDeadClicksAutocapture(){return this.Cs}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({[Z2]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ts((()=>{this.Ms()})):this.stop()}Ts(e){var n,r;(n=je.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=je.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?dp.error("failed to load script",s):e()}))}Ms(){var e;if(fe){if(!this.Cs&&(e=je.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=bt(this.instance.config.capture_dead_clicks)?ue({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Cs=je.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Cs.start(fe),dp.info("starting...")}}else dp.error("`document` not found. Cannot start.")}stop(){this.Cs&&(this.Cs.stop(),this.Cs=void 0,dp.info("stopping..."))}}var Gg=jt("[SegmentIntegration]"),jP="posthog-js";function FP(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 f=>{var p,m,_,x,y;if(u!=="*"&&!u.includes(f.level)||!t.__loaded)return f;f.tags||(f.tags={});var w=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());f.tags["PostHog Person URL"]=w,t.sessionRecordingStarted()&&(f.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S,C=((p=f.exception)==null?void 0:p.values)||[],P=C.map((I=>ue({},I,{stacktrace:I.stacktrace?ue({},I.stacktrace,{type:"raw",frames:(I.stacktrace.frames||[]).map((A=>ue({},A,{platform:"web:javascript"})))}):void 0}))),T={$exception_message:((m=C[0])==null?void 0:m.value)||f.message,$exception_type:(_=C[0])==null?void 0:_.type,$exception_level:f.level,$exception_list:P,$sentry_event_id:f.event_id,$sentry_exception:f.exception,$sentry_exception_message:((x=C[0])==null?void 0:x.value)||f.message,$sentry_exception_type:(y=C[0])==null?void 0:y.type,$sentry_tags:f.tags};return r&&s&&(T.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+f.event_id),d&&((S=t.exceptions)==null||S.sendExceptionEvent(T)),f}}class RN{constructor(e,n,r,s,i,a){this.name=jP,this.setupOnce=function(u){u(FP(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}class uE{constructor(e){this.Es=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(ge.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.Is=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Rs()}Rs(){var e;this.Ps=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Es)}destroy(){var e;(e=this.Ps)==null||e.call(this),this.Ps=void 0}doPageView(e,n){var r,s=this.As(e,n);return this.Is={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.As(e,(n=this.Is)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Is)==null?void 0:e.pageViewId}}As(e,n){var r=this.Is;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,f=i.lastContentY,p=i.maxContentY;if(!(de(a)||de(u)||de(c)||de(d)||de(f)||de(p))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d),f=Math.ceil(f),p=Math.ceil(p);var m=a>1?Ci(u/a,0,1,ge):1,_=a>1?Ci(c/a,0,1,ge):1,x=d>1?Ci(f/d,0,1,ge):1,y=d>1?Ci(p/d,0,1,ge):1;s=St(s,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:m,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:_,$prev_pageview_last_content:f,$prev_pageview_last_content_percentage:x,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:y})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var Kg=["flags","surveys"],AN={[fP]:{exposure:"hidden"},[ku]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Rd]:{exposure:"hidden"},[jy]:{exposure:"event"},[Fy]:{exposure:"hidden"},[Vy]:{exposure:"event"},[$y]:{exposure:"hidden"},[Hy]:{exposure:"event"},[zy]:{exposure:"event"},[Z2]:{exposure:"event"},[G2]:{exposure:"hidden"},[Uy]:{exposure:"event"},[ll]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Cu]:{exposure:"hidden"},[K2]:{exposure:"event"},[hP]:{exposure:"event",shouldSkipFromEventProperties:t=>Xn(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"},[ro]:{exposure:"hidden",storageGroup:"flags"},[ul]:{exposure:"hidden",storageGroup:"flags"},[Up]:{exposure:"hidden"},[tf]:{exposure:"hidden",storageGroup:"flags"},[cl]:{exposure:"hidden",storageGroup:"flags"},[Nu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Rm]:{exposure:"hidden",storageGroup:"flags"},[pi]:{exposure:"hidden"},[nl]:{exposure:"hidden"},[Ws]:{exposure:"hidden"},[bi]:{exposure:"hidden"},[By]:{exposure:"hidden",storageGroup:"surveys"},[Am]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Wy]:{exposure:"event"},[Bp]:{exposure:"hidden"},[Wp]:{exposure:"hidden"},[Ad]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ao]:{exposure:"hidden"},[Md]:{exposure:"hidden"},[yP]:{exposure:"event"},[ju]:{exposure:"hidden"},[El]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[nt]:{exposure:"hidden"},[qy]:{exposure:"hidden"},[Zy]:{exposure:"hidden"},[Gy]:{exposure:"hidden"},[Ky]:{exposure:"hidden"},[Mm]:{exposure:"hidden"},[Lm]:{exposure:"hidden"},[pP]:{exposure:"event"},[mP]:{exposure:"event"},[vP]:{exposure:"event"},[gP]:{exposure:"event"},[xP]:{exposure:"event"},[wP]:{exposure:"event"},[Yy]:{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_pending_trigger_conditions:{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"}},MN=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],mi=t=>{var e=AN[t];if(e)return e;for(var n of MN){var r=n[1];if(t.indexOf(n[0])===0)return r}},Pu=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return M6(t)}},uc=t=>{var e=fe==null?void 0:fe.createElement("a");return de(e)?null:(e.href=t,e)},cc=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(!Ge(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{ge.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rf=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=[],f=0;c.length>f;f++){var p=c[f].split("=");Ge(p)&&(e.includes(p[0])?d.push(p[0]+"="+n):d.push(c[f]))}var m=u;return a!=null&&(m+="?"+d.join("&")),s!=null&&(m+="#"+s),m},Fm=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},VP=(t,e)=>t>=e&&T6(),$P=(t,e,n,r)=>{if(t===0){if(T6()){var s=e+1;return s===n&&r(),s}return e}return 0},fp="https?://(.*)",dc=["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",...dc],sf="<masked>",ON=["li_fat_id"];function HP(t,e,n){if(!fe)return{};var r,s=e?[...dc,...n||[]]:[],i=zP(rf(fe.URL,s,sf),t),a=(r={},_t(ON,(function(u){var c=bP(u);r[u]=c||null})),r);return St(a,i)}function zP(t,e){var n=LN.concat(e||[]),r={};return _t(n,(function(s){var i=cc(t,s);r[s]=i||null})),r}function UP(t){var e=(function(i){return i?i.search(fp+"google.([^/?]*)")===0?"google":i.search(fp+"bing.com")===0?"bing":i.search(fp+"yahoo.com")===0?"yahoo":i.search(fp+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!Xn(e)){r.$search_engine=e;var s=fe?cc(fe.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function cE(){return navigator.language||navigator.userLanguage}var Vm="$direct";function BP(){return(fe==null?void 0:fe.referrer)||Vm}function WP(t,e,n){n===void 0&&(n=!1);var r=t?[...dc,...e||[]]:[],s=n?ca(Ht==null?void 0:Ht.href):Ht==null?void 0:Ht.href,i=s==null?void 0:s.substring(0,1e3);return{r:BP().substring(0,1e3),u:i?rf(i,r,sf):void 0}}function qP(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?ca(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==Vm?Vm:(n=uc(r))==null?void 0:n.host};if(i){a.$current_url=i;var u=uc(i);a.$host=u==null?void 0:u.host,a.$pathname=u==null?void 0:u.pathname;var c=zP(i);St(a,c)}if(r){var d=UP(r);St(a,d)}return a}function ZP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function DN(){try{return new Date().getTimezoneOffset()}catch{return}}var NN={flags:El,surveys:Am},jN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],hp=t=>t+"_cookie_identity_change_pending",Bo="main",dE=(t,e)=>{_t(t,((n,r)=>{var s=mi(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class Yg{constructor(e,n,r){if(r===void 0&&(r=!0),this.Fs={},this.Os=!1,this.Ls=!1,this.Ds=!1,this.$s=!1,this.Wi=e,this.Ns=r,this.props={},this.qs=void 0,this.js=(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.ks=this.Bs(e),this.Ls=this.Hs(e),this.load(),e.debug&&ge.info("Persistence loaded",e.persistence,ue({},this.props)),this.update_config(e,e,n),this.save(),ne){var s=()=>this.flush();It(ne,"beforeunload",s,{capture:!1}),It(ne,"pagehide",s,{capture:!1})}}Us(){var e,n=(e=this.Wi)==null?void 0:e.persistence_save_debounce_ms;return pn(n)&&n>0?n:0}zs(e){if(this.Wi.cookieWinsOnConflict&&this.Wi.persistence.toLowerCase()==="localstorage+cookie")if(e)try{var n=qg(e,this.Wi.cookie_persisted_properties||[]),r=Y4(n,this.Wi.cookie_persisted_properties||[]),s=JSON.stringify(n)+"|"+JSON.stringify(r),i=yn.Ur(this.js)||void 0;i&&Zg(this.js,i)===s&&(this.Ws=s,this.Vs=i)}catch{}else try{var a=yn.Ur(this.js)||void 0;this.Ws=a?Zg(this.js,a):void 0,this.Vs=a}catch{}}syncCookieProperties(){return this.Gs(this.Wi)}Gs(e,n){if(n===void 0&&(n=!1),this.Zs&&!n||this.$s||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;var r;try{r=yn.Ur(this.js)||void 0}catch{}if(!r||r===this.Vs)return!1;var s,i=Zg(this.js,r);try{s=Wg(JSON.parse(r))}catch{return!1}if((yn.Ur(this.js)||void 0)!==r)return!1;this.Ws=i,this.Vs=r;var a=X4(this.js,r),u=[...sl,...a.properties],c={};if(Object.keys(s).forEach((y=>{var w=s[y];(de(w)||Xn(w)||w===""||y===nt&&w!==cn&&w!==Kn)&&(c[y]=!0,delete s[y])})),Ks(s))return!1;var d=gr in s||s[nt]===cn||s[nt]===Kn,f=this.props[gr],p=this.props[nt],m=St({},this.props);[...sl,...e.cookie_persisted_properties||[]].forEach((y=>{if(u.indexOf(y)!==-1&&!(y in s)&&!c[y]&&(d||y!==gr&&y!==nt)){var w=m[y];!a.isValid&&sl.indexOf(y)!==-1&&(w===!1||w===0)||delete m[y]}})),this.props=St(m,s),!d||nt in s||nt in this.props||this.Qs(nt,cn);var _=this.props[gr],x=this.props[nt];return!d||_===f&&x===p||(this.Ds=!0,Et.Hr(hp(this.js),!0),this.Js(Ws),this.Js(ul),this.Js(ro),this.Js(tf),this.Js(cl),this.Js(Nu),this.Js(El),this.Js(ju),this.Js(ao),x===cn&&(p===Kn||s[nt]===cn||!de(f)&&_!==f)&&(dE(this.props,s),this.Js(bi)),x===Kn?this.props.$user_id=_:delete this.props.$user_id,this.Js(ku)),!0}consumeCookieIdentityChange(){var e=hp(this.js),n=this.Ds||!!Et.Ur(e);return this.Ds=!1,n&&Et.$r(e),n}Ks(e){return e===void 0&&(e=!1),!(this.$s||this.Zs&&!e||!this.Wi.cookieWinsOnConflict||this.Wi.persistence.toLowerCase()!=="localstorage+cookie"||(this.$s=!0,0))}Ys(){this.$s&&(de(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0),delete this.Fs[Bo],this.ta(!0))}ea(e){if(e===void 0&&(e=!0),this.$s)try{e?this.Ys():de(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0)}finally{this.$s=!1}}isDisabled(){return!!this.Zs}Bs(e){jN.indexOf(e.persistence.toLowerCase())===-1&&(ge.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=[...sl,...a];return ue({},wt,{zr(d){try{var f,p={};try{f=yn.Ur(d)||void 0,p=f?Wg(JSON.parse(f)):{}}catch{}var m,_=JSON.parse(wt.Ur(d)||"{}");if(u){var x=X4(d,f),y=[...sl,...x.properties],w={};Object.keys(p).forEach((I=>{var A=p[I];Xn(A)||A===""||I===nt&&A!==cn&&A!==Kn||(w[I]=A)}));var S=gr in w||w[nt]===cn||w[nt]===Kn;if(Object.keys(w).length>0){var C,P=_[gr],T=(C=_[nt])!==null&&C!==void 0?C:cn;c.forEach((I=>{if(y.indexOf(I)!==-1&&!(I in p)&&(S||I!==gr&&I!==nt)){var A=_[I];!x.isValid&&sl.indexOf(I)!==-1&&(A===!1||A===0)||delete _[I]}})),!S||nt in p||nt in _||(_[nt]=cn),!S||(gr in w?w[gr]:_[gr])===P&&(nt in w?w[nt]:_[nt])===T||(Bg.forEach((I=>delete _[I])),w[nt]===Kn&&gr in w?_.$user_id=w[gr]:delete _.$user_id,w[nt]!==Kn&&(delete _[yP],delete _[bi]),delete _.__alias)}m=St(_,w)}else m=St(p,_);return wt.Hr(d,m),m}catch{}return null},Hr(d,f,p,m,_,x){var y=wt.Hr(d,f,void 0,void 0,x);try{var w=qg(f,a);if(Object.keys(w).length){if(u){var S=Nm(d),C=Y4(w,a);if(yn.Hr(S,C,p,m,_,x),yn.Ur(S)!==JSON.stringify(C)){yn.$r(S,m);var P=qg(f);return yn.Hr(d,P,p,m,_,x),y}}yn.Hr(d,w,p,m,_,x)}}catch(T){wt.Wr(T)}return y},$r(d,f){try{ne==null||ne.localStorage.removeItem(d),yn.$r(d,f),yn.$r(Nm(d),f)}catch(p){wt.Wr(p)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&wt.Br()?(n=wt,s=!0):i==="localstorage+cookie"&&r.Br()?(n=r,s=!0):i==="sessionstorage"&&Et.Br()?n=Et:i==="memory"?n=vN:i==="cookie"?n=yn:r.Br()?(n=r,s=!0):n=yn,this.Os=s,n}ia(e){return this.js+"__"+e}Hs(e){return this.Os&&!!e.split_storage}properties(){var e={};return _t(this.props,((n,r)=>{var s=mi(r);if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n))return;e[r]=n}})),e}load(e){if(e===void 0&&(e=!1),!this.Zs||e){var n=this.Wi.cookieWinsOnConflict&&this.Wi.persistence.toLowerCase()==="localstorage+cookie",r=n?wt.zr(this.js):null,s={};if(n)try{_t(s=Wg(yn.zr(this.js)),((x,y)=>{(de(x)||Xn(x)||x==="")&&delete s[y]}))}catch{}var i=this.ks.zr(this.js);if(i&&(this.props=St({},i)),this.Ls&&this.ra(),n&&i){var a,u,c=r==null?void 0:r[gr],d=(a=r==null?void 0:r[nt])!==null&&a!==void 0?a:cn,f=i[gr],p=(u=i[nt])!==null&&u!==void 0?u:cn;if(f!==c||p!==d){this.Ds=!0,Et.Hr(hp(this.js),!0);var m=St({},this.props);Bg.forEach((x=>delete m[x])),p===cn&&(d===Kn||s[nt]===cn||!de(c)&&f!==c)&&(dE(m,s),delete m[bi]),this.props=m;var _=new Set;Bg.forEach((x=>{var y,w=(y=mi(x))==null?void 0:y.storageGroup;w&&_.add(w)})),_.forEach((x=>{var y={};_t(this.props,((w,S)=>{var C;((C=mi(S))==null?void 0:C.storageGroup)===x&&(y[S]=w)})),Ks(y)?(wt.$r(this.ia(x)),this.Fs[x]={}):wt.Hr(this.ia(x),y)&&(this.Fs[x]={persisted:!0,fingerprint:this.na(y,x)})}))}}Et.Ur(hp(this.js))&&(this.Ds=!0)}}ra(){for(var e of Kg){var n=wt.zr(this.ia(e));if(n&&!Ks(n)){var r=this.sa(e);r.persisted=!0,this.aa(e)||(r.fingerprint=this.na(n,e)),this.oa(e,n)||St(this.props,n)}}}aa(e){return Object.keys(this.props).some((n=>{var r;return((r=mi(n))==null?void 0:r.storageGroup)===e}))}oa(e,n){var r=NN[e];if(!r)return!1;var s=n[r],i=this.props[r];return pn(s)&&pn(i)&&i>s}refreshKey(e){var n;if(!this.Zs){var r=this.Ls?(n=mi(e))==null?void 0:n.storageGroup:void 0,s=r?wt.zr(this.ia(r)):this.ks.zr(this.js);if(s&&e in s)this.Qs(e,s[e]);else{if(r){var i=this.ks.zr(this.js);if(i&&e in i)return void this.Qs(e,i[e])}this.Js(e)}}}save(){if(!this.Zs){var e=this.Us();e>0?de(this.Xs)&&(this.Xs=setTimeout((()=>{this.Xs=void 0,this.ta()}),e)):this.ta()}}flush(){de(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0,this.ta())}ta(e){e===void 0&&(e=!1),this.Zs||this.$s&&!e||(e||this.syncCookieProperties(),this.Ls?this.la():this.ua(this.ks,this.js,this.props,Bo)&&this.zs(this.props))}la(){var e=this.ha(),n=e.main,r=e.groups;for(var s of(this.ua(this.ks,this.js,n,Bo)&&this.zs(n),Kg)){var i,a=r[s];(!Ks(a)||(i=this.Fs[s])!=null&&i.persisted)&&this.ua(wt,this.ia(s),a,s)}}ha(){var e={},n={flags:{},surveys:{}};return _t(this.props,((r,s)=>{var i,a=(i=mi(s))==null?void 0:i.storageGroup;a?n[a][s]=r:e[s]=r})),{main:e,groups:n}}na(e,n){if(n===Bo)return JSON.stringify(e)+"|"+this.da+"|"+this.va+"|"+this.ca;var r={};return _t(e,((s,i)=>{var a;r[i]=(a=mi(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}ua(e,n,r,s){var i,a=this.sa(s);if(s!==Bo&&!a.dirty&&!de(a.fingerprint))return!1;try{if((i=this.na(r,s))===a.fingerprint)return a.dirty=!1,!1}catch{i=void 0}return e.Hr(n,r,this.da,this.va,this.ca,this.Wi.debug)?(a.dirty=!1,s!==Bo&&(a.persisted=!0),de(i)||(a.fingerprint=i),!0):(this.Wi.debug&&ge.warn('failed to persist storage entry "'+n+'"; will retry on next save'),!1)}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(de(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0),this.ks.$r(this.js,!1),this.ks.$r(this.js,!0),!r&&this.Ns)for(var s of Kg)wt.$r(this.ia(s));r?delete this.Fs[Bo]:this.Fs={},this.Ws=void 0,this.Vs=void 0}clear(){this.remove(),this.props={}}register_once(e,n,r){if(bt(e)){this.syncCookieProperties(),de(n)&&(n="None"),this.da=de(r)?this.fa:r;var s=!1;if(_t(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.Qs(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(bt(e)){this.syncCookieProperties(),this.da=de(n)?this.fa:n;var r=!1;if(_t(e,((s,i)=>{e.hasOwnProperty(i)&&(this.props[i]!==s||bt(s)||Ge(s))&&(this.Qs(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var n=typeof e=="string"?[e]:e,r=!1;for(var s of n)s in this.props&&(this.Js(s),r=!0);r&&this.save()}update_campaign_params(){var e=fe==null?void 0:fe.URL;if(e!==this.qs){var n=HP(this.Wi.custom_campaign_params,this.Wi.mask_personal_data_properties,this.Wi.custom_personal_data_properties);Ks(X2(n))||this.register(n),this.qs=e}}update_search_keyword(){var e;this.register((e=fe==null?void 0:fe.referrer)?UP(e):{})}update_referrer_info(){var e;this.register_once({$referrer:BP(),$referring_domain:fe!=null&&fe.referrer&&((e=uc(fe.referrer))==null?void 0:e.host)||Vm},void 0)}set_initial_person_info(){this.props[Gy]||this.props[Ky]||this.register_once({[Mm]:WP(this.Wi.mask_personal_data_properties,this.Wi.custom_personal_data_properties,this.Wi.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};_t([Ky,Gy],(s=>{var i=this.props[s];i&&_t(i,(function(a,u){e["$initial_"+Ay(u)]=a}))}));var n=this.props[Mm];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=qP(s,i),u={};return _t(a,(function(c,d){u["$initial_"+Ay(d)]=c})),u})(n,this.Wi.disable_capture_url_hashes);St(e,r)}return e}safe_merge(e){return _t(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){var s=e.persistence!==n.persistence,i=!((y,w)=>{if(y.length!==w.length)return!1;var S=[...y].sort(),C=[...w].sort();return S.every(((P,T)=>P===C[T]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),a=s||i,u=e.cookieWinsOnConflict!==n.cookieWinsOnConflict,c=e.disable_persistence||!!r,d=!!this.Zs&&!c;c||this.Gs(n,d),this.Wi=e,!c&&(s||i||u)&&(this.Ws=void 0,this.Vs=void 0,this.Gs(ue({},e,{cookie_persisted_properties:n.cookie_persisted_properties}),d));var f=a||u?this.Bs(e):this.ks,p=this.Hs(e),m=a||p!==this.Ls,_=!c&&(m||e.cross_subdomain_cookie!==this.va||e.secure_cookie!==this.ca)&&this.Ks(d);try{if(this.fa=this.da=e.cookie_expiration,this.set_disabled(c),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),m){var x=this.props;this.clear(),this.ks=f,this.Ls=p,this.props=x,this.save()}else u&&(this.ks=f,c||(delete this.Fs[Bo],this.ta()))}finally{_&&this.ea()}}set_disabled(e){this.Zs=e,this.Zs?this.remove():this.save()}set_cross_subdomain(e){e!==this.va&&(this.va=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ca&&(this.ca=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[Rd]||{};r[e]=n,this.Qs(Rd,r),this.save()}remove_event_timer(e){var n=this.props[Rd]||{},r=n[e];return de(r)||(delete n[e],this.Qs(Rd,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.Qs(e,n),this.save()}Qs(e,n){var r;this.props[e]=n,(r=mi(e))!=null&&r.volatile||this.pa(e)}Js(e){delete this.props[e],this.pa(e)}pa(e){var n,r=(n=mi(e))==null?void 0:n.storageGroup;r&&(this.sa(r).dirty=!0)}sa(e){return this.Fs[e]||(this.Fs[e]={})}}function pp(t){var e=!0;return{dispose(){if(e){e=!1;var n=t();n&&ar(n.then)&&n.then(void 0,(()=>{}))}}}}var xr={GZipJS:"gzip-js",Base64:"base64"},gd={Activation:"events",Cancellation:"cancelEvents"},Xg={Popover:"popover",API:"api",Widget:"widget"},uo={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Qg={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},n_={Popover:"popover",Inline:"inline"},FN={SHOWN:"product tour shown"},fE={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},hE=jt("[RateLimiter]");class VN{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=>{hE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void hE.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(Zy))!==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;if(d||e||(c.tokens=Math.max(0,c.tokens-1)),d&&!e){var f=(pn(c.dropped)?c.dropped:0)+1;c.dropped=f,!this.lastEventRateLimited&&this.ga(f)&&(c.dropped=0)}return this.lastEventRateLimited=d,(s=this.instance.persistence)==null||s.set_property(Zy,c),{isRateLimited:d,remainingTokens:c.tokens}}ma(e){var n=this.instance.config.property_denylist;return!Ge(n)||!n.includes(e)}ya(){var e;if(this.ma("$current_url")&&this.ma("$pathname")&&Ht!=null&&Ht.pathname)return""+((e=Ht.origin)!==null&&e!==void 0?e:"")+Ht.pathname}ga(e){var n,r,s=this.captureEventsBurstLimit,i=this.captureEventsPerSecond,a=this.ya(),u=this.ma("$session_id")?(n=(r=this.instance).get_session_id)==null?void 0:n.call(r):void 0,c=[e+" event(s) dropped since the last warning",a?"triggered on "+a:void 0,u?"session "+u:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+c+". Config is set to "+i+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Wo=jt("[RemoteConfig]");class GP{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=je._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}ba(e){var n,r;(n=je.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=je.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}_a(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return Wo.info("Using preloaded remote config",this.remoteConfig),void this.wa(this.remoteConfig);if(this._instance.ka())return void Wo.warn("Remote config is disabled. Falling back to local config.");this.ba((e=>{if(!e)return Wo.info("No config found after loading remote JS config. Falling back to JSON."),void this._a((n=>{this.wa(n.json,n)}));this.wa(e)}))}catch(e){Wo.error("Error loading remote config",e),this.wa()}}wa(e,n){!e&&n&&(n.statusCode===0?n.error||Wo.warn("Failed to fetch remote config from PostHog."):Wo.error("Failed to fetch remote config from PostHog."));try{this._instance.wa(e?{ok:!0,config:e}:{ok:!1})}catch(s){Wo.error("Error applying remote config",s)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded()}catch(s){Wo.error("Error loading feature flags",s)}}}var As=Uint8Array,Hr=Uint16Array,fc=Uint32Array,tx=new As([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]),nx=new As([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]),pE=new As([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),KP=function(t,e){for(var n=new Hr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new fc(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]},YP=KP(tx,2),r_=YP[1];YP[0][28]=258,r_[258]=28;for(var mE=KP(nx,0)[1],XP=new Hr(32768),Ut=0;32768>Ut;++Ut){var du=(43690&Ut)>>>1|(21845&Ut)<<1;XP[Ut]=((65280&(du=(61680&(du=(52428&du)>>>2|(13107&du)<<2))>>>4|(3855&du)<<4))>>>8|(255&du)<<8)>>>1}var Vd=function(t,e,n){for(var r=t.length,s=0,i=new Hr(e);r>s;++s)++i[t[s]-1];var a,u=new Hr(e);for(s=0;e>s;++s)u[s]=u[s-1]+i[s-1]<<1;for(a=new Hr(r),s=0;r>s;++s)a[s]=XP[u[t[s]-1]++]>>>15-t[s];return a},Al=new As(288);for(Ut=0;144>Ut;++Ut)Al[Ut]=8;for(Ut=144;256>Ut;++Ut)Al[Ut]=9;for(Ut=256;280>Ut;++Ut)Al[Ut]=7;for(Ut=280;288>Ut;++Ut)Al[Ut]=8;var $m=new As(32);for(Ut=0;32>Ut;++Ut)$m[Ut]=5;var $N=Vd(Al,9),HN=Vd($m,5),QP=function(t){return(t/8>>0)+(7&t&&1)},JP=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Hr?Hr:t instanceof fc?fc:As)(n-e);return r.set(t.subarray(e,n)),r},qi=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},yd=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Jg=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 As(0),0];if(s==1){var a=new As(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(I,A){return I.f-A.f})),n.push({s:-1,f:25001});var u=n[0],c=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};f!=s-1;)u=n[n[p].f>n[d].f?d++:p++],c=n[d!=f&&n[p].f>n[d].f?d++:p++],n[f++]={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 _=new Hr(m+1),x=s_(n[f-1],_,0);if(x>e){r=0;var y=0,w=x-e,S=1<<w;for(i.sort((function(I,A){return _[A.s]-_[I.s]||I.f-A.f}));s>r;++r){var C=i[r].s;if(e>=_[C])break;y+=S-(1<<x-_[C]),_[C]=e}for(y>>>=w;y>0;){var P=i[r].s;e>_[P]?y-=1<<e-_[P]++-1:++r}for(;r>=0&&y;--r){var T=i[r].s;_[T]==e&&(--_[T],++y)}x=e}return[new As(_),x]},s_=function(t,e,n){return t.s==-1?Math.max(s_(t.l,e,n+1),s_(t.r,e,n+1)):e[t.s]=n},vE=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Hr(++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]},_d=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},i_=function(t,e,n){var r=n.length,s=QP(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;r>i;++i)t[s+i+4]=n[i];return 8*(s+4+r)},gE=function(t,e,n,r,s,i,a,u,c,d,f){qi(e,f++,n),++s[256];for(var p=Jg(s,15),m=p[0],_=p[1],x=Jg(i,15),y=x[0],w=x[1],S=vE(m),C=S[0],P=S[1],T=vE(y),I=T[0],A=T[1],O=new Hr(19),R=0;C.length>R;++R)O[31&C[R]]++;for(R=0;I.length>R;++R)O[31&I[R]]++;for(var L=Jg(O,7),D=L[0],j=L[1],F=19;F>4&&!D[pE[F-1]];--F);var Z,Q,K,q,W=d+5<<3,H=_d(s,Al)+_d(i,$m)+a,X=_d(s,m)+_d(i,y)+a+14+3*F+_d(O,D)+(2*O[16]+3*O[17]+7*O[18]);if(H>=W&&X>=W)return i_(e,f,t.subarray(c,c+d));if(qi(e,f,1+(H>X)),f+=2,H>X){Z=Vd(m,_),Q=m,K=Vd(y,w),q=y;var z=Vd(D,j);for(qi(e,f,P-257),qi(e,f+5,A-1),qi(e,f+10,F-4),f+=14,R=0;F>R;++R)qi(e,f+3*R,D[pE[R]]);f+=3*F;for(var N=[C,I],Y=0;2>Y;++Y){var oe=N[Y];for(R=0;oe.length>R;++R)qi(e,f,z[J=31&oe[R]]),f+=D[J],J>15&&(qi(e,f,oe[R]>>>5&127),f+=oe[R]>>>12)}}else Z=$N,Q=Al,K=HN,q=$m;for(R=0;u>R;++R)if(r[R]>255){var J;yd(e,f,Z[257+(J=r[R]>>>18&31)]),f+=Q[J+257],J>7&&(qi(e,f,r[R]>>>23&31),f+=tx[J]);var se=31&r[R];yd(e,f,K[se]),f+=q[se],se>3&&(yd(e,f,r[R]>>>5&8191),f+=nx[se])}else yd(e,f,Z[r[R]]),f+=Q[r[R]];return yd(e,f,Z[256]),f+Q[256]},zN=new fc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),UN=(function(){for(var t=new fc(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),e1=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function BN(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(m){for(var _=p,x=0;m.length>x;++x)_=UN[255&_^m[x]]^_>>>8;p=_},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,_,x,y,w){var S=p.length,C=new As(x+S+5*(1+Math.floor(S/7e3))+y),P=C.subarray(x,C.length-y),T=0;if(!m||8>S)for(var I=0;S>=I;I+=65535){var A=I+65535;S>A?T=i_(P,T,p.subarray(I,A)):(P[I]=!0,T=i_(P,T,p.subarray(I,S)))}else{for(var O=zN[m-1],R=O>>>13,L=8191&O,D=(1<<_)-1,j=new Hr(32768),F=new Hr(D+1),Z=Math.ceil(_/3),Q=2*Z,K=function(sn){return(p[sn]^p[sn+1]<<Z^p[sn+2]<<Q)&D},q=new fc(25e3),W=new Hr(288),H=new Hr(32),X=0,z=0,N=(I=0,0),Y=0,oe=0;S>I;++I){var J=K(I),se=32767&I,pe=F[J];if(j[se]=pe,F[J]=se,I>=Y){var Se=S-I;if((X>7e3||N>24576)&&Se>423){T=gE(p,P,0,q,W,H,z,N,oe,I-oe,T),N=X=z=0,oe=I;for(var ce=0;286>ce;++ce)W[ce]=0;for(ce=0;30>ce;++ce)H[ce]=0}var ae=2,$e=0,We=L,He=se-pe&32767;if(Se>2&&J==K(I-He))for(var Fe=Math.min(R,Se)-1,ct=Math.min(32767,I),Gt=Math.min(258,Se);ct>=He&&--We&&se!=pe;){if(p[I+ae]==p[I+ae-He]){for(var rt=0;Gt>rt&&p[I+rt]==p[I+rt-He];++rt);if(rt>ae){if(ae=rt,$e=He,rt>Fe)break;var Ve=Math.min(He,rt-2),Oe=0;for(ce=0;Ve>ce;++ce){var Je=I-He+ce+32768&32767,kt=Je-j[Je]+32768&32767;kt>Oe&&(Oe=kt,pe=Je)}}}He+=(se=pe)-(pe=j[se])+32768&32767}if($e){q[N++]=268435456|r_[ae]<<18|mE[$e];var vt=31&r_[ae],xe=31&mE[$e];z+=tx[vt]+nx[xe],++W[257+vt],++H[xe],Y=I+ae,++X}else q[N++]=p[I],++W[p[I]]}}T=gE(p,P,!0,q,W,H,z,N,oe,I-oe,T)}return JP(C,0,x+QP(T)+y)})(i=t,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+a.mem,u,c)),f=d.length;return(function(p,m){var _=m.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>m.level?4:m.level==9?2:0,p[9]=3,m.mtime!=0&&e1(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),_){p[3]=8;for(var x=0;_.length>=x;++x)p[x+10]=_.charCodeAt(x)}})(d,e),e1(d,f-8,n.d()),e1(d,f-4,r),d}var WN=!!Py||!!V2,e3="text/plain",Zp=!1,t3=(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:"")},jf=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],a=s[1],u=ue({},e),c=(r=a==null?void 0:a.split("&").map((f=>{var p,m=f.split("="),_=m[0],x=n&&(p=u[_])!==null&&p!==void 0?p:m[1];return delete u[_],_+"="+x})))!==null&&r!==void 0?r:[],d=(function(f,p){var m,_;p===void 0&&(p="&");var x=[];return _t(f,(function(y,w){de(y)||de(w)||w==="undefined"||(m=encodeURIComponent((S=>S instanceof File)(y)?y.name:y.toString()),_=encodeURIComponent(w),x[x.length]=_+"="+m)})),x.join(p)})(u);return d&&c.push(d),c.length>0?i+"?"+c.join("&"):i},t1=t=>{if(t.Sa)return t.Sa;var e=t.data,n=t.compression;if(e){if(n===xr.GZipJS){var r=BN((function(u,c){var d=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var f=new As(u.length+(u.length>>>1)),p=0,m=function(w){f[p++]=w},_=0;d>_;++_){if(p+5>f.length){var x=new As(p+8+(d-_<<1));x.set(f),f=x}var y=u.charCodeAt(_);128>y?m(y):2048>y?(m(192|y>>>6),m(128|63&y)):y>55295&&57344>y?(m(240|(y=65536+(1047552&y)|1023&u.charCodeAt(++_))>>>18),m(128|y>>>12&63),m(128|y>>>6&63),m(128|63&y)):(m(224|y>>>12),m(128|y>>>6&63),m(128|63&y))}return JP(f,0,p)})(Pu(e)),{mtime:0});return{contentType:e3,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===xr.Base64){var s=(function(u){return u&&btoa(encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,((c,d)=>String.fromCharCode(parseInt(d,16)))))})(Pu(e)),i=(u=>"data="+encodeURIComponent(typeof u=="string"?u:Pu(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=Pu(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},n3=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:jf(t.url,{compression:xr.Base64}),encodedBody:t1(ue({},t,{compression:xr.Base64,Sa:void 0}))}:{url:t3(t.url,"compression"),encodedBody:t1(ue({},t,{compression:void 0,Sa:void 0}))};try{e=t1(t)}catch(s){if(L4(t.compression,cc(t.url,"compression")))return ge.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&L4(t.compression,cc(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?Ty(new Uint8Array(n)):ArrayBuffer.isView(n)&&Ty(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Zp=!0,r()):{url:t.url,encodedBody:e}},r3=t=>{try{return n3(t)}catch(e){return ge.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},qN=(function(){var t=Tt((function*(e){var n=Pu(e.data),r=yield(function(i,a,u){return Iy.apply(this,arguments)})(n,Pt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return ue({},e,{Sa:{contentType:e3,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),ZN=/Failed to fetch|NetworkError|Load failed/i,s3=t=>(t==null?void 0:t.name)==="TypeError"&&ZN.test((t==null?void 0:t.message)||""),i3=t=>{var e=r3(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},i=s.contentType,a=s.body,u=s.estimatedSize,c=new Headers;_t(t.headers,(function(x,y){c.append(y,x)})),i&&c.append("Content-Type",i);var d=null,f=!1;if(P4){var p=new P4;d={signal:p.signal,timeout:setTimeout((()=>{var x,y;f=!0,p.abort((x=t.timeout,(y=new Error("PostHog request timed out"+(x?" after "+x+"ms":""))).name="AbortError",y))}),t.timeout)}}var m=x=>{f&&(x==null?void 0:x.name)==="AbortError"||s3(x)?ge.warn(x):ge.error(x),t.callback==null||t.callback({statusCode:0,error:x})};try{var _;V2(n,ue({method:(t==null?void 0:t.method)||"GET",headers:c,keepalive:t.method==="POST"&&!t.xa&&52428.8>(u||0),body:a,signal:(_=d)==null?void 0:_.signal},t.fetchOptions)).then((x=>x.text().then((y=>{var w={statusCode:x.status,text:y};if(x.status===200)try{w.json=JSON.parse(y)}catch(S){ge.error(S)}t.callback==null||t.callback(w)})))).catch(m).finally((()=>d?clearTimeout(d.timeout):null))}catch(x){d&&clearTimeout(d.timeout),m(x)}}},o_=t=>{try{var e,n=n3(t),r=n.url,s=n.encodedBody,i=s??{},a=i.body,u=i.estimatedSize;if(!a)return;var c=a instanceof Blob?a:new Blob([a],{type:i.contentType});if(br.sendBeacon(r,c))return;var d=Ge(t.data)?t.data:(e=t.data)==null?void 0:e.batch;if(Ge(d)&&d.length>1&&(u??0)>16384){var f=Math.ceil(d.length/2),p=m=>Ge(t.data)?m:ue({},t.data,{batch:m});return o_(ue({},t,{data:p(d.slice(0,f))})),void o_(ue({},t,{data:p(d.slice(f))}))}ge.warn("Beacon of ~"+(u??0)+" bytes was rejected by the browser, falling back to fetch"),i3(ue({},t,{xa:!0}))}catch(m){ge.warn("Beacon send failed",m)}},yE=(t,e,n,r)=>{var s=r==="query"?e==="POST"?"sent_at":"_":void 0;return jf(n===xr.GZipJS?t3(t,"compression"):t,ue({},s?{[s]:Date.now().toString()}:{},n===xr.GZipJS?{}:{compression:n}))},Gp=[];V2&&Gp.push({transport:"fetch",method:i3}),Py&&Gp.push({transport:"XHR",method(t){var e=r3(t);if(e){var n=new Py,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,a=s.body;_t(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)}}}),br!=null&&br.sendBeacon&&Gp.push({transport:"sendBeacon",method:o_});var a_=3e3;class GN{constructor(e,n){this.Ca=!0,this.Ta=[],this.Ma=Ci((n==null?void 0:n.flush_interval_ms)||a_,250,5e3,ge.createLogger("flush interval"),a_),this.Ea=e}enqueue(e){this.Ta.push(e),this.Ia||this.Ra()}unload(){this.Pa();var e=this.Ta.length>0?this.Aa():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Fa(ue({},r,{transport:"sendBeacon"}))}))}enable(){this.Ca=!1,this.Ra()}Ra(){var e=this;this.Ca||(this.Ia=setTimeout((()=>{if(this.Pa(),this.Ta.length>0){var n=this.Aa(),r=function(){var i=n[s],a=new Date().getTime();i.data&&Ge(i.data)&&_t(i.data,(u=>{u.offset=Math.abs(u.timestamp-a),delete u.timestamp})),e.Fa(i)};for(var s in n)r()}}),this.Ma))}Fa(e){try{this.Ea(e)}catch(n){ge.error(n)}}Pa(){clearTimeout(this.Ia),this.Ia=void 0}Aa(){var e={};return _t(this.Ta,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;de(e[i])&&(e[i]=ue({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.Ta=[],e}}var KN=["retriesPerformedSoFar"];class YN{constructor(e){this.Oa=!1,this.La=3e3,this.Ta=[],this._instance=e,this.Ta=[],this.Da=!0,!de(ne)&&"onLine"in ne.navigator&&(this.Da=ne.navigator.onLine,this.$a=()=>{this.Da=!0,this.Na()},this.qa=()=>{this.Da=!1},It(ne,"online",this.$a),It(ne,"offline",this.qa))}get length(){return this.Ta.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=I6(e,KN);Qi(n)&&(r.url=jf(r.url,{retry_count:n})),this._instance._send_request(ue({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Rn(ue({retriesPerformedSoFar:n},r));s.statusCode===0&&ge.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)}}))}Rn(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),f=Math.random()-.5;return Math.ceil(d+f*(d-c))})(n),s=Date.now()+r;this.Ta.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),ge.warn(i),this.Oa||(this.Oa=!0,this.ja())}ja(){if(this.Ba&&clearTimeout(this.Ba),this.Ta.length===0)return this.Oa=!1,void(this.Ba=void 0);this.Ba=setTimeout((()=>{this.Da&&this.Ta.length>0&&this.Na(),this.ja()}),this.La)}Na(){var e=Date.now(),n=[],r=this.Ta.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.Ta=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.Ba&&(clearTimeout(this.Ba),this.Ba=void 0),this.Oa=!1,de(ne)||(this.$a&&(ne.removeEventListener("online",this.$a),this.$a=void 0),this.qa&&(ne.removeEventListener("offline",this.qa),this.qa=void 0)),this.Ta)){var n=e.requestOptions;try{this._instance._send_request(ue({},n,{transport:"sendBeacon"}))}catch(r){ge.error(r)}}this.Ta=[]}}class XN{constructor(e){this.Ha=()=>{var n,r,s,i;this.Ua||(this.Ua={});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),f=(a==null?void 0:a.scrollHeight)||0;this.Ua.lastScrollY=Math.ceil(u),this.Ua.maxScrollY=Math.max(u,(n=this.Ua.maxScrollY)!==null&&n!==void 0?n:0),this.Ua.maxScrollHeight=Math.max(c,(r=this.Ua.maxScrollHeight)!==null&&r!==void 0?r:0),this.Ua.lastContentY=d,this.Ua.maxContentY=Math.max(d,(s=this.Ua.maxContentY)!==null&&s!==void 0?s:0),this.Ua.maxContentHeight=Math.max(f,(i=this.Ua.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get za(){return this._instance.config.scroll_root_selector}getContext(){return this.Ua}resetContext(){var e=this.Ua;return setTimeout(this.Ha,0),e}startMeasuringScrollPosition(){It(ne,"scroll",this.Ha,{capture:!0}),It(ne,"scrollend",this.Ha,{capture:!0}),It(ne,"resize",this.Ha)}scrollElement(){if(!this.za)return ne==null?void 0:ne.document.documentElement;var e=Ge(this.za)?this.za:[this.za];for(var n of e){var r=ne==null?void 0:ne.document.querySelector(n);if(r)return r}}Wa(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.za){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.Wa("y")}scrollX(){return this.Wa("x")}}var QN=t=>WP(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 _E{constructor(e,n,r,s){this.st=i=>{var a=this.Va();if(!a||a.sessionId!==i){var u={sessionId:i,props:this.Ga(this._instance)};this.Za.register({[qy]:u})}},this._instance=e,this.Qa=n,this.Za=r,this.Ga=s||QN,this.Qa.onSessionId(this.st)}Va(){return this.Za.props[qy]}getSetOnceProps(){var e,n=(e=this.Va())==null?void 0:e.props;return n?"r"in n?qP(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 _t(X2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Ay(r)]=n})),e}}class Hm{on(e,n){return this.Ja[e]||(this.Ja[e]=[]),this.Ja[e].push(n),()=>{this.Ja[e]=this.Ja[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.Ja[e]||[])r(n);for(var s of this.Ja["*"]||[])s(e,n)}constructor(){this.Ja={}}}var fu=jt("[SessionId]"),xE=864e5;class wE{on(e,n){return this.Ka.on(e,n)}constructor(e,n,r){var s;if(this.Ya=null,this.Xa=null,this.eo=[],this.io=void 0,this.ro=!1,this.Ka=new Hm,this.no=(c,d)=>!(!Qi(c)||!Qi(d))&&Math.abs(c-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===lo)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Wi=e.config,this.Za=e.persistence,this.ut=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.so=void 0,this._sessionActivityTimestamp=null,this.ao=n||gi,this.oo=r||gi;var i=this.Wi.persistence_name||this.Wi.token;if(this._sessionTimeoutMs=1e3*Ci(this.Wi.session_idle_timeout_seconds||1800,60,36e3,fu.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lo(),this.uo="ph_"+i+"_window_id",this.ho="ph_"+i+"_primary_window_exists",this.do()){var a=Et.zr(this.uo),u=Et.zr(this.ho);a&&!u?this.ut=a:Et.$r(this.uo),Et.Hr(this.ho,!0)}(s=this.Wi.bootstrap)!=null&&s.sessionID&&this.setBootstrapSessionId(this.Wi.bootstrap.sessionID),this.vo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return de(this.eo)&&(this.eo=[]),this.eo.push(e),this._e&&e(this._e,this.ut),()=>{this.eo=this.eo.filter((n=>n!==e))}}do(){return this.Wi.persistence!=="memory"&&!this.Za.Zs&&Et.Br()}co(e){e!==this.ut&&(this.ut=e,this.do()&&Et.Hr(this.uo,e))}fo(){return this.ut?this.ut:this.do()?Et.zr(this.uo):null}po(e){var n=this.Ya;return!Xn(n)&&!Xn(e)&&5e3>Math.abs(e-n)}mo(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this._e||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this._e=e,i&&!s||i&&this.po(n)||(this.Ya=n,this.Za.register({[Cu]:[n,e,r]}))}yo(){var e,n=(e=this.Wi)==null?void 0:e.persistence_save_debounce_ms;return Qi(n)&&n>0}bo(){this.yo()?this.Za.refreshKey(Cu):(this.Za.flush(),this.Za.load())}_o(){var e;if(!Xn(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Ya){this.bo();var n=this.wo();n[1]===this._e&&n[2]===this._sessionStartTimestamp&&(this.Ya=this._sessionActivityTimestamp,this.Za.register({[Cu]:[this._sessionActivityTimestamp,(e=this._e)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Za.flush())}}ko(){var e=this.wo()[0],n=Qi(e)?e:0,r=Qi(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}So(e){return this.bo(),this.no(e,this.ko())}wo(){var e=this.Za.props[Cu];return Ge(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ya=null,this.so=void 0,clearTimeout(this.xo),this.xo=void 0,this.mo(null,null,null)}setBootstrapSessionId(e,n){n===void 0&&(n=!1);var r=(function(s,i){i===void 0&&(i=new Date().getTime());try{var a=(u=>{var c=u.replace(/-/g,"");if(c.length!==32)throw new Error("Not a valid UUID");if(c[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(c.substring(0,12),16)})(s);return a>i+6e4?void fu.error("Bootstrap sessionID cannot be in the future"):a}catch(u){return void fu.error("Invalid sessionID in bootstrap",u)}})(e);return!de(r)&&(n?this.so={sessionId:e,sessionStartTimestamp:r}:this.mo(e,new Date().getTime(),r),!0)}destroy(){this.ro=!0,this._o(),clearTimeout(this.xo),this.xo=void 0,this.io&&ne&&(ne.removeEventListener(Om,this.io,{capture:!1}),this.io=void 0),this.eo=[]}vo(){this.io=()=>{this._o(),this.do()&&Et.$r(this.ho)},It(ne,Om,this.io,{capture:!1})}checkAndGetSessionAndWindowId(e,n,r){if(e===void 0&&(e=!1),n===void 0&&(n=null),r===void 0&&(r=!1),this.Wi.cookieless_mode===lo)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=n||new Date().getTime(),i=this._e;if(r)this.Xa=s;else if(Xn(this.Xa)||this.Xa>s||s-this.Xa>=1e3){var a,u;(a=(u=this.Za).syncCookieProperties)==null||a.call(u),this.Xa=s}var c=this.wo(),d=c[1],f=c[2],p=!de(i)&&d!==i,m=this.ko(),_=this.fo(),x=this.so,y=!!x&&(x.sessionStartTimestamp>s+6e4||s-x.sessionStartTimestamp>xE),w=x?y:Qi(f)&&Math.abs(s-f)>xE,S=!1,C=p,P=!d||!!x,T=d,I=!P&&!e&&this.no(s,m);if(I){(I=this.So(s))||fu.info("cross-tab refresh kept the session alive",{sessionId:d});var A=this.wo();d=A[1],f=A[2]}if(P||I||w){C=!1;var O=x&&!y;d=O?x.sessionId:this.ao(),_=this.oo(),fu.info("new session ID assigned",{sessionId:d,windowId:_,bootstrapped:!!O,changeReason:{noSessionId:P,activityTimeout:I,sessionPastMaximumLength:w}}),f=O?x.sessionStartTimestamp:s,this.so=void 0,S=!0}else _||(_=this.oo(),S=!0),(C=C||d!==T)&&(fu.info("adopted cross-tab session id",{sessionId:d,windowId:_}),S=!0);var R=Qi(m)&&e&&!w?m:s,L=Qi(f)?f:new Date().getTime();this.co(_),this.mo(d,R,L),e||this.lo();var D={noSessionId:P,activityTimeout:I,sessionPastMaximumLength:w,crossTabAdoption:C};return S&&this.eo.forEach((j=>j(d,_,D))),{sessionId:d,windowId:_,sessionStartTimestamp:L,changeReason:S?D:void 0,lastActivityTimestamp:m}}lo(){this.ro||(clearTimeout(this.xo),this.xo=setTimeout((()=>{if(!this.ro)if(this.So(new Date().getTime())){var e=this._e;this.resetSessionId(),this.Ka.emit("forcedIdleReset",{idleSessionId:e})}else this.lo()}),1.1*this.sessionTimeoutMs))}}var o3=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&D4(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>D4(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function a3(){return(a3=Tt((function*(){var t=br==null?void 0:br.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return ut(n)&&n.length>0?n:void 0}catch(r){return void ge.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}function l3(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var zm=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},mp=t=>t.toLowerCase(),u3={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=>zm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!zm(n,r))))),icontains:(t,e)=>e.map(mp).some((n=>t.map(mp).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(mp).every((n=>t.map(mp).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)))}))};function c3(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(s==null)return!1;var i=u3[r.operator];return!!i&&i(r.values,[String(s)])}))}function n1(t,e,n){return Pu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var l_="custom",bE="i.posthog.com",JN=/^\/static\//,e9=["/s/","/e/","/i/"];class t9{constructor(e){this.Co={},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("."+bE,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Co[this.apiHost]||(this.Co[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":l_),this.Co[this.apiHost]}To(e){if(JN.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}Mo(e){var n=uc(e);return n?n.protocol+"//"+n.host+n.pathname:void 0}Eo(e,n,r){if(e==="ui")return r;var s=r,i=this.instance.config.rewriteRequestPath;if(i){var a,u=((a=uc(r))==null?void 0:a.href)||r;s=i(new URL(u)).toString()}if(i&&e==="api"&&e9.some((m=>n.indexOf(m)===0))){var c=this.Mo(s);if(c){var d,f=this.apiHost,p=this.Io;((d=p)==null?void 0:d.apiHost)===f&&p.rewriteRequestPath===i||(p={apiHost:f,rewriteRequestPath:i,urls:new Set},this.Io=p),p.urls.add(c)}}return s}isIngestionEndpoint(e){var n=this.Io,r=this.Mo(e);return(n==null?void 0:n.apiHost)===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!r&&n.urls.has(r)}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.Eo(e,n,this.uiHost+n);if(e==="flags")return this.Eo(e,n,this.flagsApiHost+n);if(e==="assets"){var r=this.To(n);if(r)return this.Eo(e,n,""+r+n)}if(this.region===l_)return this.Eo(e,n,this.apiHost+n);var s=bE+n;switch(e){case"assets":return this.Eo(e,n,"https://"+this.region+"-assets."+s);case"api":return this.Eo(e,n,"https://"+this.region+"."+s)}}}var pt=jt("[Surveys]"),d3="seenSurvey_",f3=t=>{try{var e=(n=>((r,s)=>""+d3+(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){pt.error("Failed to persist survey seen state",n)}},n9=[Xg.Popover,Xg.Widget,Xg.API],r9={ignoreConditions:!1,ignoreDelay:!1,displayType:n_.Popover},s9=jt("[PostHog ExternalIntegrations]"),i9={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class o9{constructor(e){this._instance=e}Ts(e,n){var r;(r=je.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return s9.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=je.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[c]||e.Ts(i9[c],(()=>{var f;(f=je.__PosthogExtensions__)==null||(f=f.integrations)==null||(f=f[c])==null||f.start(e._instance)})),!d&&(a=je.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[c]&&((u=je.__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()}}}class a9{constructor(e,n){this.I=e,this.ds=n,this.Ro=new Map,this.os=!1}add(e){var n=this;return Tt((function*(){if(n.os)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.Ro.has(e.name))throw new Error('Browser extension "'+e.name+'" is already registered');n.Ro.set(e.name,e);try{var r=e.setup(n.ds);r&&(yield r)}catch(i){var s=n.Ro.get(e.name)===e;s&&n.Ro.delete(e.name),n.I.error('Failed to set up browser extension "'+e.name+'"',i),s&&n.Po(e)}}))()}getExtension(e){return this.Ro.get(e)}dispose(){if(!this.os){this.os=!0;var e=Array.from(this.Ro.values()).reverse();for(var n of(this.Ro.clear(),e))this.Po(n)}}Po(e){try{var n=e.dispose==null?void 0:e.dispose();n&&ar(n.then)&&n.then(void 0,(r=>{this.I.error('Failed to dispose browser extension "'+e.name+'"',r)}))}catch(r){this.I.error('Failed to dispose browser extension "'+e.name+'"',r)}}}class l9{constructor(e){this._instance=e}initialize(){}get(e){var n=this._instance.persistence;if(typeof e=="string")return n==null?void 0:n.get_property(e);var r={};for(var s of e){var i=n==null?void 0:n.get_property(s);de(i)||(r[s]=i)}return r}set(e,n){var r;(r=this._instance.persistence)==null||r.register(typeof e=="string"?{[e]:n}:e)}remove(e){var n;(n=this._instance.persistence)==null||n.unregister(e)}}var SE="extensionsRemoteConfig";class u9{constructor(e){this.os=!1,this.instance=e,this.I=ge,this.Ao=e.Fo,this.kv=new l9(e),this.onEvent=n=>pp(this.instance.on("eventCaptured",(r=>{try{n({event:r.event,properties:r.properties})}catch(s){this.I.error("Browser extension event listener failed",s)}}))),this.onRemoteConfig=n=>{if(this.os)return pp((()=>{}));var r=i=>{try{n(i)}catch(a){this.I.error("Browser extension remote config listener failed",a)}},s=this.instance.Oo.on(SE,r);return this.Ao&&r(this.Ao),pp(s)},this.Lo=new a9(ge.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property(ef))!==null&&e!==void 0?e:this.distinctId}get deviceId(){var e=this.instance.get_property(ef);return typeof e=="string"?e:void 0}get library(){return{name:Pt.LIB_NAME,version:Pt.LIB_VERSION}}get initialPersonProperties(){var e,n;return(e=(n=this.instance.persistence)==null?void 0:n.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,n,r,s,i=(e=this.instance.sessionManager)==null?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=i==null?void 0:i.sessionId)!==null&&n!==void 0?n:"",windowId:(r=i==null?void 0:i.windowId)!==null&&r!==void 0?r:"",sessionStartTimestamp:(s=i==null?void 0:i.sessionStartTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.Lo.add(e)}getExtension(e){return this.Lo.getExtension(e)}capture(e,n,r){var s=this;return Tt((function*(){r?s.instance.capture(e,n,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):s.instance.capture(e,n)}))()}registerDynamicEventProperties(e){return pp(this.instance.Do(e))}handleRemoteConfig(e){this.os||(this.Ao=e,this.instance.Oo.emit(SE,e))}sendRequest(e,n){var r=this;return Tt((function*(){var s;n===void 0&&(n={});var i=r.instance.requestRouter.endpointFor((s=n.target)!==null&&s!==void 0?s:"api",e),a={method:n.method,url:n.query?jf(i,n.query):i,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,timestampMode:n.sentAt};return n.transport==="sendBeacon"?(r.instance._send_request(a),{statusCode:202}):new Promise((u=>{a.callback=u,r.instance._send_request(a)}))}))()}dispose(){this.os||(this.os=!0,this.Lo.dispose())}}var $d={},r1=0,Um=()=>{},EE='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',xd="Surveys module not available",kE="sanitize_properties is deprecated. Use before_send instead",h3="Invalid value for property_denylist config: ",c9=["token","distinct_id",_P],bu="posthog",p3=!WN&&(jr==null?void 0:jr.indexOf("MSIE"))===-1&&(jr==null?void 0:jr.indexOf("Mozilla"))===-1,d9=t=>{var e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},s1=t=>{var e;return ue({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:cN(fe==null?void 0:fe.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Um,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:Ht&&ut(Ht==null?void 0:Ht.search)&&Ht.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:"fallback",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){ge.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:Xy,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:a_},error_tracking:{},_onCapture:Um},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:bN,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:d9(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},f9=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],CE=t=>{var e={};for(var n of f9){var r=n[0],s=n[1];de(t[r])||(e[s]=t[r])}var i=St({},e,t),a=t.__preview_external_dependency_versioned_paths;return de(a)||(de(t.strict_script_versioning)&&(i.strict_script_versioning=!!a),ut(a)&&de(t.asset_host)&&(i.asset_host=a)),Ge(t.property_blacklist)&&(de(t.property_denylist)?i.property_denylist=t.property_blacklist:Ge(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:ge.error(h3+t.property_denylist)),i};class h9{constructor(){this.__forceAllowLocalhost=!1}get $o(){return this.__forceAllowLocalhost}set $o(e){ge.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ts{No(e,n){if(e){var r=this.Ro.indexOf(e);r!==-1&&this.Ro.splice(r,1)}return this.Ro.push(n),n.initialize==null||n.initialize(),n}qo(){return this.config.cookieless_mode===lo||this.config.cookieless_mode===rl&&this.consent.isRejected()}jo(){if(!this.qo()&&this.get_distinct_id()===cu){var e=this.persistence;if(e){this.Bo()||e.load(!0);var n=this.get_distinct_id();if(!n||n===cu){var r=this.config.get_device_id(gi());this.register({distinct_id:r,$device_id:r}),e.set_property(nt,cn)}this.Ho()}}}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 h9,this.Uo=!1,this.version=Pt.LIB_VERSION,this.zo=new Set,this.Wo="",this.Oo=new Hm,this.Ro=[],this.Vo=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=s1(),this.SentryIntegration=RN,this.sentryIntegration=r=>(function(s,i){var a=FP(s,i);return{name:jP,processEvent:u=>a(u)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Go=!1,this.Zo=null,this.Qo=null,this.Jo=null,this.scrollManager=new XN(this),this.pageViewManager=new uE(this),this.rateLimiter=new VN(this),this.requestRouter=new t9(this),this.consent=new gN(this),this.externalIntegrations=new o9(this);var n=(e=ts.__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=ut(r)?{[r]:s}:r;this.setPersonProperties(a),i==null||i({})},set_once:(r,s,i)=>{var a=ut(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),i==null||i({})}},this.on("eventCaptured",(r=>ge.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==bu){var s,i=(s=$d[r])!==null&&s!==void 0?s:new ts;return i._init(e,n,r),$d[r]=i,$d[bu][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var a,u=ut(e)?e.trim():"";if(!u)return ge.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 u!==((a=this.config)==null?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=s1(n.defaults),n.debug=this.Ko(n.debug),this.Yo=n,this.Xo=[],n.person_profiles?this.Qo=n.person_profiles:n.process_person&&(this.Qo=n.process_person);var c=s1(n.defaults),d=CE(n),f=St({},c,d,{name:r,token:u});bt(c.rageclick)&&bt(d.rageclick)&&(f.rageclick=St({},c.rageclick,d.rageclick)),bt(c.session_recording)&&bt(d.session_recording)&&(f.session_recording=St({},c.session_recording,d.session_recording)),this.set_config(f),this.config.on_xhr_error&&ge.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:xr.GZipJS;var p=this.Bo();if(this.persistence=new Yg(this.config,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Yg(ue({},this.config,{persistence:"sessionStorage"}),p,!1),this.Wo="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!p&&Et.Br()){var m=Et.zr(this.Wo);Ge(m)&&m.forEach((A=>{ut(A)&&this.zo.add(A)}))}else Et.$r(this.Wo);var _=ue({},this.persistence.props),x=ue({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.tl=new GN((A=>this.el(A)),this.config.request_queue_config),this.il=new YN(this),this.__request_queue=[];var y=this.qo();if(y||(this.sessionManager=new wE(this),this.sessionPropsManager=new _E(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((A,O,R)=>{(R!=null&&R.activityTimeout||R!=null&&R.sessionPastMaximumLength||R!=null&&R.crossTabAdoption)&&this.rl()}))),this.nl(),this.config.__preview_deferred_init_extensions?(ge.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.sl(y)}),0)):(ge.info("Initializing extensions synchronously"),this.sl(y)),Pt.DEBUG=Pt.DEBUG||this.config.debug,Pt.DEBUG&&ge.info("Starting in debug mode",{this:this,config:n,thisC:ue({},this.config),p:_,s:x}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=ue({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var w=n.bootstrap.distinctID,S=this.get_distinct_id(),C=this.persistence.get_property(nt);if(n.bootstrap.isIdentifiedID&&S!=null&&S!==w&&C===cn)this.identify(w);else if(n.bootstrap.isIdentifiedID&&S!=null&&S!==w&&C===Kn)ge.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 P=this.config.get_device_id(gi()),T=n.bootstrap.isIdentifiedID?P:w;this.persistence.set_property(nt,n.bootstrap.isIdentifiedID?Kn:cn),this.register({distinct_id:w,$device_id:T})}}if(y)this.register_once({distinct_id:cu,$device_id:null},"");else if(!this.get_distinct_id()){var I=this.config.get_device_id(gi());this.register_once({distinct_id:I,$device_id:I},""),this.persistence.set_property(nt,cn)}return It(ne,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(A,O){var R=A.config.segment;if(!R)return O();(function(L,D){var j=L.config.segment;if(!j)return D();var F=Q=>{var K=()=>Q.anonymousId()||gi();L.config.get_device_id=K,Q.id()&&(L.register({distinct_id:Q.id(),$device_id:K()}),L.persistence.set_property(nt,Kn)),D()},Z=j.user();"then"in Z&&ar(Z.then)?Z.then(F):F(Z)})(A,(()=>{R.register((L=>{typeof Promise<"u"&&Promise.resolve||Gg.warn("This browser does not have Promise support, and can not use the segment integration");var D=(j,F)=>{if(!F)return j;j.event.userId||j.event.anonymousId===L.get_distinct_id()||(Gg.info("No userId set, resetting PostHog"),L.reset()),j.event.userId&&j.event.userId!==L.get_distinct_id()&&(Gg.info("UserId set, identifying with PostHog"),L.identify(j.event.userId));var Z=L.calculateEventProperties(F,j.event.properties);return j.event.properties=Object.assign({},Z,j.event.properties),j};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:j=>D(j,j.event.event),page:j=>D(j,wu),identify:j=>D(j,zg),screen:j=>D(j,"$screen")}})(A)).then((()=>{O()}))}))})(this,(()=>this.al())):this.al(),ar(this.config._onCapture)&&this.config._onCapture!==Um&&(ge.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(A=>this.config._onCapture(A.event,A)))),this.config.ip&&ge.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 a3.apply(this,arguments)})().then((A=>{A&&this.register({[$g]:A})})).catch(Um),this}ol(e){var n=e;return ut(n.name)&&ar(n.setup)}ll(e,n){this.ol(e)?n.push((()=>{this.ul().add(e).catch((()=>e.dispose==null?void 0:e.dispose())).catch((r=>{ge.error('Failed to dispose browser extension "'+e.name+'"',r)}))})):this.Ro.push(e)}nl(){var e,n,r,s,i,a,u=(e=(n=this.config.__extensionClasses)==null?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=ts.__defaultExtensionClasses)==null?void 0:r.featureFlags;u&&(this.featureFlags&&this.featureFlags instanceof u||((s=this.hl)==null||s.call(this),this.hl=void 0,this.featureFlags=new u(this)),ar(this.featureFlags.onReloading)&&ar(this.featureFlags.setup)?this.hl||(this.hl=this.featureFlags.onReloading((()=>{this.Oo.emit("featureFlagsReloading",!0)})),this.ul().add(this.featureFlags)):(i=(a=this.featureFlags).initialize)==null||i.call(a))}sl(e){var n,r,s,i,a,u,c,d=performance.now(),f=ue({},ts.__defaultExtensionClasses,this.config.__extensionClasses),p=[];f.exceptions&&this.Ro.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new f.exceptions(this)),f.historyAutocapture&&this.Ro.push(this.historyAutocapture=new f.historyAutocapture(this)),f.tracingHeaders&&this.Ro.push(this.tracingHeaders=new f.tracingHeaders(this)),f.siteApps&&this.Ro.push(this.siteApps=new f.siteApps(this)),f.sessionRecording&&!e&&this.Ro.push(this.sessionRecording=new f.sessionRecording(this)),this.config.disable_scroll_properties||p.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),f.autocapture&&this.ll(this.autocapture=new f.autocapture(this),p),f.surveys&&this.ll(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new f.surveys(this),p),f.logs&&this.ll(this.logs=(s=this.logs)!==null&&s!==void 0?s:new f.logs(this),p),f.metrics&&this.Ro.push(this.metrics=(i=this.metrics)!==null&&i!==void 0?i:new f.metrics(this)),f.conversations&&this.Ro.push(this.conversations=(a=this.conversations)!==null&&a!==void 0?a:new f.conversations(this)),f.productTours&&this.Ro.push(this.productTours=new f.productTours(this)),f.heatmaps&&this.Ro.push(this.heatmaps=new f.heatmaps(this)),f.webVitalsAutocapture&&this.Ro.push(this.webVitalsAutocapture=new f.webVitalsAutocapture(this)),f.exceptionObserver&&this.Ro.push(this.exceptionObserver=new f.exceptionObserver(this)),f.deadClicksAutocapture&&this.Ro.push(this.deadClicksAutocapture=new f.deadClicksAutocapture(this,IN)),f.toolbar&&this.Ro.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new f.toolbar(this)),f.experiments&&this.Ro.push(this.experiments=(c=this.experiments)!==null&&c!==void 0?c:new f.experiments(this)),this.Ro.forEach((m=>{m.initialize&&p.push((()=>{m.initialize==null||m.initialize()}))})),p.push((()=>{if(this.dl){var m=this.dl;this.dl=void 0,this.Ro.forEach((_=>_.onRemoteConfig==null?void 0:_.onRemoteConfig(m)))}})),this.vl(p,d)}vl(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.vl(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){ge.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[xP]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[wP]:s}),this.config.__preview_deferred_init_extensions&&ge.info("PostHog extensions initialized ("+s+"ms)")}wa(e){var n;if(!fe||!fe.body)return ge.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.wa(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.dl=e),this.Fo=e,this.compression=void 0,e.ok){var r,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=Ke(s.supportedCompression,xr.GZipJS)?xr.GZipJS:Ke(s.supportedCompression,xr.Base64)?xr.Base64:void 0),(r=s.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Qo?this.Qo:Xy}),(n=this.cl)==null||n.handleRemoteConfig(e),this.Ro.forEach((i=>i.onRemoteConfig==null?void 0:i.onRemoteConfig(e)))}al(){try{this.config.loaded(this)}catch(r){ge.critical("`loaded` function failed",r)}if(this.fl(),this.config.internal_or_test_user_hostname&&Ht!=null&&Ht.hostname){var e=Ht.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.qo())&&this.pl()}),1),this.gl=new GP(this),this.gl.load()}fl(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.tl)==null||e.enable())}_dom_loaded(){this.is_capturing()&&up(this.__request_queue,(e=>this.el(e))),this.__request_queue=[],this.fl()}_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.ml()&&this.capture(Hg),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.tl)==null||s.unload(),(i=this.il)==null||i.unload()):this.ml()&&this.capture(Hg,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?p3?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=ue({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(de(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,a=ue({},n);a.timeout=a.timeout||6e4;var u,c,d,f,p,m=(r=a.transport)!==null&&r!==void 0?r:"fetch";m==="sendBeacon"&&de(a.compression)&&a.data&&(a.compression=xr.Base64),a.method==="POST"&&a.data&&(a.timestampMode==="capture-body"?a.data={api_key:(c=(p=(f=(Ge(u=a.data)?u:[u]).map((w=>ue({},w,w.timestamp instanceof Date&&!isNaN(w.timestamp.getTime())?{timestamp:w.timestamp.toISOString()}:{}))))[0])==null||(d=p.properties)==null?void 0:d.token)!==null&&c!==void 0?c:p==null?void 0:p.token,batch:f,sent_at:new Date().toISOString()}:a.timestampMode==="body"&&(a.data=(function(w,S){return S===void 0&&(S=new Date().toISOString()),Ge(w)?w.map((C=>ue({},C,{sent_at:S}))):ue({},w,{sent_at:S})})(a.data))),a.url=yE(a.url,a.method,a.compression,a.timestampMode);var _=Gp.filter((w=>!a.disableTransport||!w.transport||!a.disableTransport.includes(w.transport))),x=(s=(i=(function(w,S){for(var C=0;w.length>C;C++)if(w[C].transport===m)return w[C]})(_))==null?void 0:i.method)!==null&&s!==void 0?s:_[0].method;if(!x)throw new Error("No available transport method");var y=w=>{try{x(w)}catch(S){s3(S)?ge.warn(S):ge.error(S),a.callback==null||a.callback({statusCode:0,error:S})}};m!=="sendBeacon"&&a.data&&a.compression===xr.GZipJS&&oD&&typeof Promise<"u"&&!Zp?qN(a).then((w=>{y(w)})).catch((w=>{if(O4(w))return Zp=!0,void y(ue({},a,{compression:void 0,url:yE(n.url,n.method,void 0,n.timestampMode)}));(S=>{if(!S||typeof S!="object")return!1;var C="name"in S?String(S.name):"";return O4(S)||C===R6})(w)&&(Zp=!0),y(a)})):x(a)})(ue({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}el(e){this.il?this.il.retriableRequest(e):this._send_request(e)}_execute_array(e){r1++;try{var n,r=[],s=[],i=[];up(e,(u=>{if(u)if(Ge(n=u[0]))i.push(u);else if(ar(u))try{u.call(this)}catch(c){ge.error("Error executing queued PostHog call",u,c)}else Ge(u)&&n==="alias"?r.push(u):Ge(u)&&n.indexOf("capture")!==-1&&ar(this[n])?i.push(u):s.push(u)}));var a=function(u,c){up(u,(function(d){try{if(Ge(d[0])){var f=c;_t(d,(function(p){f=f[p[0]].apply(f,p.slice(1))}))}else c[d[0]].apply(c,d.slice(1))}catch(p){ge.error("Error executing queued PostHog call",d,p)}}))};a(r,this),a(s,this),a(i,this)}finally{r1--}}push(e){if(r1>0&&Ge(e)&&ut(e[0])){var n=ts.prototype[e[0]];ar(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.tl){if(this.is_capturing())if(!de(e)&&ut(e)){this.jo();var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||this.config.__preview_capture_bot_pageviews){var f=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(f==null||!f.isRateLimited){n!=null&&n.$current_url&&!ut(n==null?void 0:n.$current_url)&&(ge.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.yl||ge.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,_=V4(r==null?void 0:r.uuid,gi),x={uuid:_,event:e,properties:this.calculateEventProperties(e,n||{},m,_)};e===wu&&this.config.__preview_capture_bot_pageviews&&d&&(x.event="$bot_pageview",x.properties.$browser_type="bot"),f&&(x.properties.$lib_rate_limit_remaining_tokens=f.remainingTokens);var y=e==="$feature_flag_called"&&x.properties.$feature_flag_has_experiment===!1&&this.get_property(Rm)===!0;r!=null&&r.$set&&!y&&(x.$set=r==null?void 0:r.$set);var w=r==null?void 0:r.$unset;w&&(x.$unset=w);var S,C,P,T=y?void 0:this.bl(r==null?void 0:r.$set_once,e!==Z4,e===zg);if(T&&(x.$set_once=T),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=x,u=F=>ut(F)?F.slice(0,i):F,c=new Set,x=(function F(Z,Q){if(Z!==Object(Z))return u?u(Z):Z;if(!c.has(Z)){var K;if(c.add(Z),Ge(Z))K=[],up(Z,(W=>{K.push(F(W))}));else{var q={};_t(Z,((W,H)=>{c.has(W)||(q[H]=F(W))})),K=q}return K}})(a)),x.timestamp=m,de(r==null?void 0:r.timestamp)||(x.properties.$event_time_override_provided=!0,x.properties.$event_time_override_system_time=p),y&&(x.properties=(function(F,Z){Z===void 0&&(Z=[]);var Q={},K=q=>{F[q]!==void 0&&(Q[q]=F[q])};return aD.forEach(K),Z.forEach(K),Q})(x.properties,c9)),e===uo.DISMISSED||e===uo.SENT){var I=n==null?void 0:n[Qg.SURVEY_ID],A=n==null?void 0:n[Qg.SURVEY_ITERATION];f3({id:I,current_iteration:A}),x.$set=ue({},x.$set,{[(S={id:I,current_iteration:A},C=e===uo.SENT?"responded":"dismissed",P="$survey_"+C+"/"+S.id,S.current_iteration&&S.current_iteration>0&&(P="$survey_"+C+"/"+S.id+"/"+S.current_iteration),P)]:!0})}else e===uo.SHOWN&&(x.$set=ue({},x.$set,{[Qg.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===FN.SHOWN){var O=n==null?void 0:n[fE.TOUR_TYPE];O&&(x.$set=ue({},x.$set,{[fE.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var R=ue({},x.properties.$set,x.$set);if(Ks(R)||this.setPersonPropertiesForFlags(R),!Qe(this.config.before_send)){var L=this.En(x);if(!L)return;(x=L).uuid=V4(x.uuid,gi)}this.Oo.emit("eventCaptured",x);var D=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),j={method:"POST",url:D,data:x,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(D)?"body":"capture-body",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.el(j):this.tl.enqueue(j),x}ge.critical("This capture call is ignored due to client rate limiting.")}}else ge.error("No event name provided to posthog.capture")}else ge.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}getExtension(e){var n;return(n=this.cl)==null?void 0:n.getExtension(e)}ul(){var e;return(e=this.cl)!==null&&e!==void 0?e:this.cl=new u9(this)}Do(e){this.Vo.push(e);var n=!0;return()=>{if(n){n=!1;var r=this.Vo.indexOf(e);r!==-1&&this.Vo.splice(r,1)}}}_l(e){var n,r,s;return e===void 0&&(e=!0),!((n=this.persistence)==null||!n.consumeCookieIdentityChange())&&(this.Jo=null,this.persistence.get_property(nt)===cn&&((s=this.sessionPersistence)==null||s.clear(),this.zo.clear(),this.wl()),(r=this.featureFlags)==null||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this._l();var a=i?void 0:this.persistence.remove_event_timer(e),u=ue({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.qo()&&(u[_P]=!0),e==="$snapshot"){var c=ue({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=c.distinct_id,(!ut(u.distinct_id)&&!pn(u.distinct_id)||_m(u.distinct_id))&&ge.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d,f=(function(I,A,O,R){var L,D,j,F;if(R===void 0&&(R=!1),!jr)return{};var Z,Q=I?[...dc,...A||[]]:[],K=(function(Gt){for(var rt=0;j4.length>rt;rt++){var Ve=j4[rt],Oe=Ve[1],Je=Ve[0].exec(Gt),kt=Je&&(ar(Oe)?Oe(Je,Gt):Oe);if(kt)return kt}return["",""]})(jr),q=K[0],W=K[1],H=(Z=typeof navigator<"u"?navigator:void 0)!=null&&Z.brave?{brave:!0}:{},X={};de(O)||(X.detectGoogleSearchApp=O);var z={},N=(L=navigator)==null||(L=L.userAgentData)==null?void 0:L.platform,Y=(D=navigator)==null?void 0:D.maxTouchPoints,oe=ne==null||(j=ne.screen)==null?void 0:j.width,J=ne==null||(F=ne.screen)==null?void 0:F.height,se=ne==null?void 0:ne.devicePixelRatio;de(N)||(z.userAgentDataPlatform=N),de(Y)||(z.maxTouchPoints=Y),de(oe)||(z.screenWidth=oe),de(J)||(z.screenHeight=J),de(se)||(z.devicePixelRatio=se);var pe,Se,ce,ae,$e,We,He,Fe,ct=St(X2({$os:q,$os_version:W,$browser:rP(jr,navigator.vendor,H,X),$device:F4(jr),$device_type:(Se=jr,ce=z,Fe=F4(Se),Fe===V6||Fe===F6||Fe==="Kobo"||Fe==="Kindle Fire"||Fe===Q6?ic:Fe===Qd||Fe===Du||Fe===Jd||Fe===Ly?"Console":Fe===H6?"Wearable":Fe?as:(ce==null?void 0:ce.userAgentDataPlatform)==="Android"&&((ae=ce==null?void 0:ce.maxTouchPoints)!==null&&ae!==void 0?ae:0)>0?600>Math.min(($e=ce==null?void 0:ce.screenWidth)!==null&&$e!==void 0?$e:0,(We=ce==null?void 0:ce.screenHeight)!==null&&We!==void 0?We:0)/((He=ce==null?void 0:ce.devicePixelRatio)!==null&&He!==void 0?He:1)?as:ic:"Desktop"),$timezone:ZP(),$timezone_offset:DN()}),{$current_url:rf(R?ca(Ht==null?void 0:Ht.href):Ht==null?void 0:Ht.href,Q,sf),$host:Ht==null?void 0:Ht.host,$pathname:Ht==null?void 0:Ht.pathname,$raw_user_agent:jr.length>1e3?jr.substring(0,997)+"...":jr,$browser_version:RD(jr,navigator.vendor,H,X),$browser_language:cE(),$browser_language_prefix:(pe=cE(),typeof pe=="string"?pe.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:Pt.LIB_NAME,$lib_version:Pt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Pt.SDK_DIST_CHANNEL&&(ct.$sdk_dist_channel=Pt.SDK_DIST_CHANNEL),ct})(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(),!0),m=p.windowId;u.$session_id=p.sessionId,u.$window_id=m}this.sessionPropsManager&&St(u,this.sessionPropsManager.getSessionProps());try{var _;this.sessionRecording&&St(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=(_=this.il)==null?void 0:_.length}catch(I){u.$sdk_debug_error_capturing_properties=String(I)}if(this.requestRouter.region===l_&&(u.$lib_custom_api_host=this.config.api_host),d=e!==wu||i?e!==Hg||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=St(u,d),e===wu&&fe&&(u.title=fe.title),!de(a)){var x=r.getTime()-a;u.$duration=parseFloat((x/1e3).toFixed(3))}jr&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var y=this.persistence.properties(),w=this.sessionPersistence.properties();_t(["$referrer","$referring_domain"],(I=>{I in y&&delete w[I]}));var S={};if(this.Vo.length>0)for(var C of this.Vo.slice())try{St(S,C())}catch(I){ge.error("Failed to produce browser extension event properties",I)}(u=St({},f,y,w,ue({},S,u))).$is_identified=this._isIdentified(),Ge(this.config.property_denylist)?_t(this.config.property_denylist,(function(I){delete u[I]})):ge.error(h3+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var P=this.config.sanitize_properties;P&&(ge.error(kE),u=P(u,e));var T=this.kl();return u.$process_person_profile=T,T&&!i&&this.Sl("_calculate_event_properties"),u}bl(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.kl()||this.Uo&&!r)return e;var i=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),u=St({},i,a||{},e||{}),c=this.config.sanitize_properties;return c&&(ge.error(kE),u=c(u,"$set_once")),n&&(this.Uo=!0),Ks(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,r;(n=this.persistence)==null||n.syncCookieProperties(),this._l(),(r=this.sessionPersistence)==null||r.register(e),Object.keys(e).forEach((s=>this.zo.add(s))),this.wl()}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e),this.zo.delete(e),this.wl()}xl(e,n){this.register({[e]:n})}rl(){this.zo.forEach((e=>{var n;(n=this.sessionPersistence)==null||n.unregister(e)})),this.zo.clear(),this.wl()}wl(){var e;if(this.Wo)if(this.config.persistence==="memory"||(e=this.sessionPersistence)!=null&&e.Zs||!Et.Br())Et.$r(this.Wo);else{var n=[];this.zo.forEach((r=>n.push(r))),n.length>0?Et.Hr(this.Wo,n):Et.$r(this.Wo)}}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Oo.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:xd}),()=>{})}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:xd})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:xd})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=r9),(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:xd}}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:xd})}Cl(e){return!e||_m(e)?(ge.critical("Unique user id has not been set in posthog.identify"),!1):e===cu?(ge.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())||(ge.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 ge.uninitializedWarning("posthog.identify");if(pn(e)&&(e=e.toString(),ge.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Cl(e)&&this.Sl("posthog.identify")){this.jo();var s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,a=this._l(!1),u=this.persistence.Ks(),c=!1;try{var d=this.get_distinct_id();this.register({$user_id:e}),this.get_property(ef)||this.register_once({$had_persisted_distinct_id:!0,$device_id:d},""),e!==d&&e!==this.get_property(ku)&&(this.unregister(ku),this.register({distinct_id:e}));var f,p=(this.persistence.get_property(nt)||cn)===cn,m=e!==d,_=!m&&p;if(m&&p)this.persistence.set_property(nt,Kn),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ys(),this.capture(zg,{distinct_id:e,$anon_distinct_id:d},{$set:n||{},$set_once:r||{}}),this.Jo=n1(e,n,r),(f=this.featureFlags)==null||f.setAnonymousDistinctId(d);else if(_){this.persistence.set_property(nt,Kn);var x=n||{},y=r||{};this.setPersonPropertiesForFlags({$set:x,$set_once:y},!1),this.config.cookieWinsOnConflict&&this.persistence.Ys(),this.capture("$set",{$set:x,$set_once:y}),this.Jo=n1(e,n,r)}else(n||r)&&this.setPersonProperties(n,r);m||i||a?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ao)):_&&(n||r)&&this.reloadFeatureFlags(),c=!0}finally{u&&this.persistence.ea(c)}}}setPersonProperties(e,n){if((e||n)&&this.Sl("posthog.setPersonProperties")){var r=n1(this.get_distinct_id(),e,n);this.Jo!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Jo=r):ge.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(Ge(e)?e:[e]).filter((s=>ut(s)&&s.length>0));r.length!==0&&this.Sl("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Jo=null)}group(e,n,r){var s;if(e&&n){(s=this.persistence)==null||s.syncCookieProperties(),this._l();var i=this.getGroups(),a=i[e]!==n;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ue({},i,{[e]:n})}),a||r){var u={$group_type:e,$group_key:n};r&&(u.$group_set=r),this.capture(Z4,u)}r&&this.setGroupPropertiesForFlags({[e]:r}),a&&!r&&this.reloadFeatureFlags()}else ge.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.Sl("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=wr(e)?e:e==null?void 0:e.resetDeviceID,r=wr(e)||e==null?void 0:e.bootstrap;this.Tl(n,!1,r)}Tl(e,n,r){var s,i,a;if(n===void 0&&(n=!1),ge.info("reset"),!this.__loaded)return ge.uninitializedWarning("posthog.reset");var u=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Yo)==null?void 0:s.bootstrap)||{},(i=this.featureFlags)==null||i.updateConfig==null||i.updateConfig(this.config,this.ka());var c=this.get_property(ef),d=this.get_property($g),f=this.get_property(ll),p=this.is_capturing();this.consent.reset(),n||!p||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var m=(a=this.persistence)==null||a.Ks==null?void 0:a.Ks(),_=!1;try{var x,y,w,S,C,P,T,I,A,O,R,L,D;if((x=this.persistence)==null||x.clear(),(y=this.sessionPersistence)==null||y.clear(),this.zo.clear(),this.wl(),de(f)||(O=this.persistence)==null||O.register({[ll]:f}),(w=this.surveys)==null||w.reset(),(S=this.featureFlags)==null||S.reset(),(C=this.conversations)==null||C.reset(),(P=this.logs)==null||P.reset(),(T=this.metrics)==null||T.reset(),(I=this.persistence)==null||I.set_property(nt,cn),(A=this.sessionManager)==null||A.resetSessionId(),this.Jo=null,this.config.cookieless_mode===lo)this.register_once({distinct_id:cu,$device_id:null},"");else{var j=this.config.get_device_id(gi());this.register_once({distinct_id:j,$device_id:e?j:c},""),e||de(d)||this.register({[$g]:d})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID===void 0||this.qo()||((D=this.persistence)==null||D.set_property(nt,r.isIdentifiedID?Kn:cn),this.register({distinct_id:r.distinctID})),(R=this.featureFlags)==null||R.initialize(),!(de(u)||(L=this.sessionManager)!=null&&L.setBootstrapSessionId(u,!0)))){var F=ue({},r);delete F.sessionID,this.config.bootstrap=F}delete this.config.identity_distinct_id,delete this.config.identity_hash,_=!0}finally{var Z;m&&((Z=this.persistence)==null||Z.ea==null||Z.ea(_))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Tt((function*(){var r,s,i,a,u;if(n.__loaded){n.ul().dispose(),(r=n.sessionRecording)==null||r.dispose(),(s=n.logs)==null||s.flushLogs("sendBeacon"),(i=n.metrics)==null||i.flush("sendBeacon"),(a=n.tl)==null||a.unload(),(u=n.il)==null||u.unload();try{var c;(c=n.featureFlags)==null||c.destroy()}catch(d){ge.error("Error while destroying feature flags",d)}}else ge.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.Ml()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.El()}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(fP)?(ge.critical("Attempting to create alias for existing People user - aborting."),-2):this.Sl("posthog.alias")?(de(n)&&(n=this.get_distinct_id()),e!==n?(this.xl(ku,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ge.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=ue({},this.config);if(bt(e)){var r,s,i,a,u,c,d,f,p,m,_,x;St(this.config,CE(e));var y=this.Bo();(r=this.persistence)==null||r.update_config(this.config,n,y),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Yg(ue({},this.config,{persistence:"sessionStorage"}),y,!1);var w,S=this.Ko(this.config.debug);wr(S)&&(this.config.debug=S),wr(this.config.debug)&&(this.config.debug?(Pt.DEBUG=!0,wt.Br()&&wt.Hr("ph_debug",!0),ge.info("set_config",{config:e,oldConfig:n,newConfig:ue({},this.config)})):(Pt.DEBUG=!1,wt.Br()&&wt.$r("ph_debug"))),(s=this.featureFlags)==null||s.updateConfig==null||s.updateConfig(this.config,this.ka()),(i=this.exceptionObserver)==null||i.onConfigChange(),(a=this.exceptions)==null||a.onConfigChange(),(u=this.sessionRecording)==null||u.startIfEnabledOrStop(),(c=this.tracingHeaders)==null||c.startIfEnabledOrStop(),(d=this.autocapture)==null||d.startIfEnabled(),(f=this.heatmaps)==null||f.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((w=this.historyAutocapture)==null||w.startIfEnabledOrStop()),(p=this.exceptionObserver)==null||p.startIfEnabledOrStop(),(m=this.deadClicksAutocapture)==null||m.startIfEnabledOrStop(),(_=this.surveys)==null||_.loadIfEnabled(),this.Ho(),(x=this.externalIntegrations)==null||x.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){Pt.LIB_NAME=e,Pt.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(ue({},s,n))}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:ts.Il}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:bu;return n!==bu&&(n=bu+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(nt))===Kn||((n=this.sessionPersistence)==null?void 0:n.get_property(nt))===Kn}kl(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===Xy&&!this._isIdentified()&&Ks(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ku])&&((n=this.persistence)==null||(n=n.props)==null||!n[Lm]))}ml(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.kl()||this.Sl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Sl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Sl(e){return this.config.person_profiles==="never"?(ge.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.xl(Lm,!0),!0)}Bo(){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!==rl)}Ho(){var e,n,r,s,i=this.Bo();return((e=this.persistence)==null?void 0:e.Zs)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.Zs)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i&&(this.zo.clear(),this.wl()),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==lo){if(this.qo()){var r,s,i,a,u;this.Tl(!0,!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new wE(this),this.pageViewManager=new uE(this),this.persistence&&(this.sessionPropsManager=new _E(this,this.sessionManager,this.persistence));var c,d=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(u=ts.__defaultExtensionClasses)==null?void 0:u.sessionRecording;d&&(this.sessionRecording=this.No(this.sessionRecording,new d(this)),this.Fo&&((c=this.sessionRecording)==null||c.onRemoteConfig==null||c.onRemoteConfig(this.Fo)))}var f,p;this.consent.optInOut(!0),this.Ho(),this.fl(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==rl&&((f=this.surveys)==null||f.loadIfEnabled()),(de(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.pl()}else ge.warn(EE)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==lo?(this.config.cookieless_mode===rl&&this.consent.isOptedIn()&&this.Tl(!0,!0),this.consent.optInOut(!1),this.Ho(),this.config.cookieless_mode===rl&&(this.register({distinct_id:cu,$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.pl(),this.fl())):ge.warn(EE)}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===lo||(this.config.cookieless_mode===rl?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Ho()}_is_bot(){return br?o3(br,this.config.custom_blocked_useragents):void 0}pl(){fe&&(fe.visibilityState==="visible"?this.Go||(this.Go=!0,this.capture(wu,{title:fe.title},{send_instantly:!0}),this.Zo&&(fe.removeEventListener(lc,this.Zo),this.Zo=null)):this.Zo||(this.Zo=this.pl.bind(this),It(fe,lc,this.Zo)))}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}))}ka(){var e=this.Yo||{};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?(ge.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&&!Qe(n[r]),c=s in n&&!Qe(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,ge)}En(e){var n;if(Qe(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(yD),s=Ge(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s)try{if(i=a(i),Qe(i)){var u="Event '"+e.event+"' was rejected in beforeSend function";return gD(e.event)?ge.warn(u+". This can cause unexpected behavior."):ge.info(u),null}i.properties&&!Ks(i.properties)||ge.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(d){return ge.error("Error in beforeSend function for event '"+e.event+"':",d),null}for(var c of r)if(i.properties&&Qe(i.properties[c]))return ge.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.Is)==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)})}Ko(e){var n=wr(e)&&!e,r=wt.Br()&&wt.Ur("ph_debug")==="true";return!n&&(!!r||e)}}ts.__defaultExtensionClasses={},ts.Il=(()=>{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]]=lN(t.prototype[e[n]])})(ts,["identify"]);class m3{constructor(e){this.disabled=e===!1;var n=bt(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 i1="$copy_autocapture",vp=jt("[AutoCapture]");function o1(t,e){return e.length>t?e.slice(0,t)+"...":e}function p9(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!da(e));return e}function m9(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,c=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!da(t))return{props:{}};for(var f=[t],p=new Set([t]),m=t;m.parentNode&&!ss(m,"body")&&IP>f.length;)if(TP(m.parentNode)){var _=m.parentNode.host;if(p.has(_))break;p.add(_),f.push(_),m=_}else{if(!da(m.parentNode)||p.has(m.parentNode))break;p.add(m.parentNode),f.push(m.parentNode),m=m.parentNode}var x,y,w=[],S={},C=!1,P=!1;if(_t(f,(R=>{var L=t_(R);if(ss(R,"a")){var D=R.getAttribute("href");C=!!(L&&D&&Fd(D))&&(d?ca(D):D)}Ke(jm(R),"ph-no-capture")&&(P=!0),w.push((function(F,Z,Q,K,q){q===void 0&&(q=!1);var W=F.tagName.toLowerCase(),H={tag_name:W};J2.indexOf(W)>-1&&!Q&&(H.$el_text=W.toLowerCase()==="a"||W.toLowerCase()==="button"?o1(1024,oE(F)):o1(1024,nf(F)));var X=jm(F);X.length>0&&(H.classes=X.filter((function(oe){return oe!==""}))),_t(F.attributes,(function(oe){var J;if((!DP(F)||["name","id","class","aria-label"].indexOf(oe.name)!==-1)&&(K==null||!K.includes(oe.name))&&!Z&&Fd(oe.value)&&(!ut(J=oe.name)||J.substring(0,10)!=="_ngcontent"&&J.substring(0,7)!=="_nghost")){var se=oe.value;oe.name==="class"&&(se=Q2(se).join(" ")),H["attr__"+oe.name]=o1(1024,oe.name==="href"&&q?ca(se):se)}}));for(var z=1,N=1,Y=F;Y=p9(Y);)z++,Y.tagName===F.tagName&&N++;return H.nth_child=z,H.nth_of_type=N,H})(R,i,a,u,d));var j=(function(F){if(!t_(F))return{};var Z={};return _t(F.attributes,(function(Q){if(Q.name&&Q.name.indexOf("data-ph-capture-attribute")===0){var K=Q.name.replace("data-ph-capture-attribute-",""),q=Q.value;K&&q&&Fd(q)&&(Z[K]=q)}})),Z})(R);St(S,j)})),P)return{props:{},explicitNoCapture:P};if(a||(w[0].$el_text=ss(t,"a")||ss(t,"button")?oE(t):nf(t)),C){var T,I;w[0].attr__href=C;var A=(T=uc(C))==null?void 0:T.host,O=ne==null||(I=ne.location)==null?void 0:I.host;A&&O&&A!==O&&(x=C)}return{props:St({$event_type:s.type,$ce_version:1},c?{}:{$elements:w},{$elements_chain:(y=w,(function(R){return R.map((L=>{var D,j,F="";if(L.tag_name&&(F+=L.tag_name),L.attr_class)for(var Z of(L.attr_class.sort(),L.attr_class))F+="."+Z.replace(/"/g,"");var Q=ue({},L.text?{text:L.text}:{},{"nth-child":(D=L.nth_child)!==null&&D!==void 0?D:0,"nth-of-type":(j=L.nth_of_type)!==null&&j!==void 0?j:0},L.href?{href:L.href}:{},L.attr_id?{attr_id:L.attr_id}:{},L.attributes),K={};return qp(Q).sort(((q,W)=>q[0].localeCompare(W[0]))).forEach((q=>{var W=q[1];return K[aE(q[0].toString())]=aE(W.toString())})),(F+=":")+qp(K).map((q=>q[0]+'="'+q[1]+'"')).join("")})).join(";")})((function(R){return R.map((L=>{var D,j,F={text:(D=L.$el_text)==null?void 0:D.slice(0,400),tag_name:L.tag_name,href:(j=L.attr__href)==null?void 0:j.slice(0,2048),attr_class:PN(L),attr_id:L.attr__id,nth_child:L.nth_child,nth_of_type:L.nth_of_type,attributes:{}};return qp(L).filter((Z=>Z[0].indexOf("attr__")===0)).forEach((Z=>F.attributes[Z[0]]=Z[1])),F}))})(y)))},(n=w[0])!=null&&n.$el_text?{$el_text:(r=w[0])==null?void 0:r.$el_text}:{},x&&s.type==="click"?{$external_click_url:x}:{},S)}}class v9{constructor(e){this.name="autocapture",this.es=!1,this.rs=null,this.ns=!1,this.ss=!1,this.Wi={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.os=!1,this.ls=e,this.ls.refresh(this.Wi),this.rageclicks=new m3(this.Wi.rageclick),this.us=null}setup(e){this.hs(),this.ds=e;var n=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.os?n.dispose():(this.vs=n,this.startIfEnabled())}dispose(){var e;this.os||(this.os=!0,this.ds=void 0,(e=this.vs)==null||e.dispose(),this.vs=void 0,this.cs())}fs(){return this.ls.refresh(this.Wi),this.Wi}hs(){var e,n;return this.fs(),this.Wi.url_allowlist=(e=this.Wi.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),this.Wi.url_ignorelist=(n=this.Wi.url_ignorelist)==null?void 0:n.map((r=>new RegExp(r))),this.Wi}ps(){if(this.isBrowserSupported()){if(ne&&fe){var e=this.gs=r=>{r=r||(ne==null?void 0:ne.event);try{this.ys(r)}catch(s){vp.error("Failed to capture event",s)}};if(It(fe,"submit",e,{capture:!0}),It(fe,"change",e,{capture:!0}),It(fe,"click",e,{capture:!0}),this.fs().capture_copied_text){var n=this.bs=r=>{r=r||(ne==null?void 0:ne.event);try{this.ys(r,i1)}catch(s){vp.error("Failed to capture clipboard event",s)}};It(fe,"copy",n,{capture:!0}),It(fe,"cut",n,{capture:!0}),It(fe,"paste",n,{capture:!0})}}}else vp.info("Disabling Automatic Event Collection because this browser is not supported")}cs(){this.gs&&(fe==null||fe.removeEventListener("submit",this.gs,!0),fe==null||fe.removeEventListener("change",this.gs,!0),fe==null||fe.removeEventListener("click",this.gs,!0),this.gs=void 0),this.bs&&(fe==null||fe.removeEventListener("copy",this.bs,!0),fe==null||fe.removeEventListener("cut",this.bs,!0),fe==null||fe.removeEventListener("paste",this.bs,!0),this.bs=void 0),this.es=!1}startIfEnabled(){!this.os&&this.ds&&this.isEnabled&&!this.es&&(this.ps(),this.es=!0)}onRemoteConfig(e){if(!this.os)if(this.ns=!0,e.ok){var n=e.config;n.elementsChainAsString&&(this.ss=n.elementsChainAsString);var r,s=n.autocapture_opt_out;wr(s)&&((r=this.ds)==null||r.kv.set(jy,s),this.rs=s),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.us=e}getElementSelectors(e){var n,r=[];return(n=this.us)==null||n.forEach((s=>{var i=fe==null?void 0:fe.querySelectorAll(s);i==null||i.forEach((a=>{e===a&&r.push(s)}))})),r}get isEnabled(){var e,n;if(this.os)return!1;var r=(e=this.ds)==null?void 0:e.kv.get(jy),s=this.rs,i=this.fs(),a=i.remoteRequestsDisabled&&!this.ns;if(Xn(s)&&!wr(r)&&!a)return!1;var u=(n=this.rs)!==null&&n!==void 0?n:!!r;return!!i.enabled&&!u}ys(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r=Jy(e);PP(r)&&(r=r.parentNode||null);var s,i=this.hs();n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&i.rageclick&&(s=this.rageclicks)!=null&&s.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&LP(r,i.rageclick)&&this.ys(e,"$rageclick");var a=n===i1,u=a?ue({},i,{dom_event_allowlist:void 0}):i;if(r&&(function(S,C,P,T,I,A){var O;if(!ne||ex(S)||P!=null&&P.url_allowlist&&!J4(P.url_allowlist,A)||P!=null&&P.url_ignorelist&&J4(P.url_ignorelist,A))return!1;if(P!=null&&P.dom_event_allowlist){var R=P.dom_event_allowlist;if(R&&!R.some((Q=>C.type===Q)))return!1}var L=OP(S,T),D=L.parentIsUsefulElement,j=L.targetElementList;if(!(function(Q,K){var q=K==null?void 0:K.element_allowlist;if(de(q))return!0;var W,H=function(z){if(q.some((N=>z.tagName.toLowerCase()===N)))return{v:!0}};for(var X of Q)if(W=H(X))return W.v;return!1})(j,P)||!e_(j,P==null?void 0:P.css_selector_allowlist)||e_(j,(O=P==null?void 0:P.css_selector_ignorelist)!==null&&O!==void 0?O:wN))return!1;try{var F=ne.getComputedStyle(S);if(F&&F.getPropertyValue("cursor")==="pointer"&&C.type==="click")return!0}catch{}var Z=S.tagName.toLowerCase();switch(Z){case"html":return!1;case"form":return(I||["submit"]).indexOf(C.type)>=0;case"input":case"select":case"textarea":return(I||["change","click"]).indexOf(C.type)>=0;default:return D?(I||["click"]).indexOf(C.type)>=0:(I||["click"]).indexOf(C.type)>=0&&(J2.indexOf(Z)>-1||S.getAttribute("contenteditable")==="true")}})(r,e,u,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:i.getCurrentUrl}})){var c,d=m9(r,{e,maskAllElementAttributes:i.maskAllElementAttributes,maskAllText:i.maskAllText,elementAttributeIgnoreList:i.element_attribute_ignorelist,elementsChainAsString:this.ss,disableCaptureUrlHashes:i.disableCaptureUrlHashes}),f=d.props;if(d.explicitNoCapture)return!1;var p=this.getElementSelectors(r);if(p&&p.length>0&&(f.$element_selectors=p),n===i1){var m=e.type||"clipboard";if(m!=="paste"){var _,x,y=ne==null||(_=ne.getSelection())==null?void 0:_.toString(),w=RP(y);if(!w)return!1;f.$selected_content=w,f.$clipboard_text_length=(x=y==null?void 0:y.length)!==null&&x!==void 0?x:0}f.$copy_type=m}return(c=this.ds)==null||c.capture(n,f).catch((S=>vp.error("Failed to capture event",S))),!0}}}isBrowserSupported(){return ar(fe==null?void 0:fe.querySelectorAll)}}class g9{constructor(e){this._instance=e}refresh(e){var n=this._instance.config,r=bt(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance.ka(),e.url_allowlist=r==null?void 0:r.url_allowlist,e.url_ignorelist=r==null?void 0:r.url_ignorelist,e.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,e.element_allowlist=r==null?void 0:r.element_allowlist,e.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,e.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,e.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,e.capture_copied_text=r==null?void 0:r.capture_copied_text}}var wd=jt("[ExceptionAutocapture]"),PE=()=>{},y9=jt("[TracingHeaders]"),Ba=jt("[Web Vitals]"),TE=9e5,IE=["CLS","FCP","INP","LCP"],_9=["INP","LCP"],x9=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],RE="disabled",AE="lazy_loading",bd="awaiting_config",gp="missing_config";jt("[SessionRecording]"),jt("[SessionRecording]");var u_="[SessionRecording]",Zi=jt(u_),w9=jt("[Heatmaps]");function a1(t){return bt(t)&&"clientX"in t&&"clientY"in t&&pn(t.clientX)&&pn(t.clientY)}var yp=jt("[Product Tours]"),l1=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(G2))},b9=["$set_once","$set"],ui=jt("[SiteApps]"),ME="Error while initializing PostHog app with config id ",v3=(t,e)=>t!=null&&t.then?t.then(e):e(t),hu="SDK is not enabled or survey functionality is not yet loaded",LE="Disabled. Not loading surveys.";class S9{constructor(e,n){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Rl=!1,this.Pl=[],this.Al=null,this.Fl=null,this.os=!1,this.Ol=new Set,this.onRemoteConfig=r=>{if(!this.os&&!this.Wi.disableSurveys){if(!r.ok)return pt.warn("Remote config unavailable. Not loading surveys.");var s=r.config.surveys;if(Qe(s))return pt.warn("Flags not loaded yet. Not loading surveys.");this.Ll=wr(s)?s:s.length>0,pt.info("flags response received, isSurveysEnabled: "+this.Ll),this.loadIfEnabled()}},this.ls=e,this.Dl=n}setup(e){if(!this.os)return this.$l=e,v3(e.kv.initialize(),(()=>{if(this.$l===e&&!this.os){this.$l=void 0,this.ds=e;var n=e.onRemoteConfig(this.onRemoteConfig);this.os?n.dispose():(this.vs=n,this.loadIfEnabled())}}))}dispose(){var e,n,r;this.os||(this.os=!0,this.$l=void 0,this.ds=void 0,(e=this.vs)==null||e.dispose(),this.vs=void 0,(n=this._surveyEventReceiver)==null||n.dispose(),this._surveyEventReceiver=null,(r=this._surveyManager)==null||r.dispose==null||r.dispose(),this._surveyManager=null,this.Pl=[],this.Al=null,this.Ol.forEach((s=>clearTimeout(s))),this.Ol.clear())}get Wi(){return this.ls.get()}initialize(){this.loadIfEnabled()}reset(){try{var e;(e=this._surveyEventReceiver)==null||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var n=[],r=0;r<localStorage.length;r++){var s=localStorage.key(r);(s!=null&&s.startsWith(d3)||s!=null&&s.startsWith("inProgressSurvey_"))&&n.push(s)}n.forEach((i=>localStorage.removeItem(i)))}catch{}}loadIfEnabled(){if(!this.os&&this.ds){var e=this.Wi;if(!this._surveyManager)if(this.Rl)pt.info("Already initializing surveys, skipping...");else if(e.disableSurveys)pt.info(LE);else if(e.cookielessMode&&this.ls.isOptedOut())pt.info("Not loading surveys in cookieless mode without consent.");else{var n=this.ls.getExtensions();if(n){if(!de(this.Ll)||e.advancedEnableSurveys){var r=this.Ll||e.advancedEnableSurveys;this.Rl=!0;try{var s=n.generateSurveys;if(s)return this.Nl(s,r),void(this.Rl=!1);var i=n.loadExternalDependency;if(!i)return this.ql(Y2),void(this.Rl=!1);i((a=>{try{if(this.os)return;var u=this.ls.getExtensions();a||u==null||!u.generateSurveys?this.ql("Could not load surveys script",a):this.Nl(u.generateSurveys,r)}finally{this.Rl=!1}}))}catch(a){throw this.Rl=!1,this.ql("Error initializing surveys",a),a}}}else pt.error("PostHog Extensions not found.")}}}Nl(e,n){this.os||(this._surveyManager=e(n),this._surveyEventReceiver=this.ls.createEventReceiver(),pt.info("Surveys loaded successfully"),this.jl({isLoaded:!0}))}ql(e,n){pt.error(e,n),this.jl({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Pl.push(e),this._surveyManager&&this.jl({isLoaded:!0}),()=>{this.Pl=this.Pl.filter((n=>n!==e))}}getSurveys(e,n){var r;n===void 0&&(n=!1);var s=(r=this.ds)!==null&&r!==void 0?r:this.Dl;if(s&&!this.os){if(this.Wi.disableSurveys)return pt.info(LE),e([]);var i=s.kv.get(By);if(i&&!n)return e(i,{isLoaded:!0}),void(this.Bl()&&this.getSurveys((()=>{}),!0));if(this.Al)this.Al.then((c=>{this.os||e(c.surveys,c.context)})).catch((c=>pt.error("Error in survey callback",c)));else{var a=this.Hl("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.Wi.requestTimeoutMs}).then((c=>{try{return this.Ul(s,c)}catch(d){return pt.error("Error processing surveys response",d),this.Ul(s,{statusCode:0,error:d})}}),(c=>this.Ul(s,{statusCode:0,error:c})));this.Al=a;var u=()=>{this.Al===a&&(this.Al=null)};a.then((c=>{u(),this.os||e(c.surveys,c.context)}),u).catch((c=>pt.error("Error in survey callback",c)))}}}Hl(e,n){var r=this.ds;return r?r.sendRequest(e,n):new Promise((s=>s({statusCode:0,error:new Error(hu)})))}Ul(e,n){if(this.os)return{surveys:[],context:{isLoaded:!1,error:hu}};var r=n.statusCode;if(r!==200||!n.json){var s="Surveys API could not be loaded, status: "+r;return r!==0?pt.error(s):n.error||pt.warn(s),this.Fl=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Fl=null;var i,a=n.json.surveys||[],u=a.filter((c=>(function(d){return!(!d.start_date||d.end_date)})(c)&&(l3(c)||(function(d){var f;return!((f=d.conditions)==null||(f=f.actions)==null||(f=f.values)==null||!f.length)})(c))));return u.length>0&&((i=this._surveyEventReceiver)==null||i.register(u)),e.kv.set({[By]:a,[Am]:Date.now()}),{surveys:a,context:{isLoaded:!0}}}Bl(){return this.zl()&&!this.Al&&!this.Wl()}zl(){var e,n,r=(e=(n=this.ds)!==null&&n!==void 0?n:this.Dl)==null?void 0:e.kv.get(Am);return pn(r)&&Date.now()-r>3e5}Wl(){return pn(this.Fl)&&3e5>Date.now()-this.Fl}markSurveyAsSeen(e,n){var r,s={id:e,current_iteration:(r=n==null?void 0:n.iteration)!==null&&r!==void 0?r:null};f3(s);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}jl(e){for(var n of this.Pl)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){pt.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!Qe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);pt.warn("init was not called")}Vl(e){var n=null;return this.getSurveys((r=>{var s;n=(s=r.find((i=>i.id===e)))!==null&&s!==void 0?s:null})),n}Gl(e){if(Qe(this._surveyManager))return{eligible:!1,reason:hu};var n=typeof e=="string"?this.Vl(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}Zl(e){if(Qe(this._surveyManager))return{eligible:!1,reason:hu};var n=typeof e=="string"?this.Vl(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Qe(this._surveyManager))return pt.warn("init was not called"),{visible:!1,disabledReason:hu};var n=this.Zl(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Qe(this._surveyManager)?(pt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:hu})):new Promise((r=>{this.getSurveys((s=>{var i,a=(i=s.find((c=>c.id===e)))!==null&&i!==void 0?i:null;if(a){var u=this.Zl(a);r({visible:u.eligible,disabledReason:u.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n,r){var s;if(Qe(this._surveyManager))pt.warn("init was not called");else{var i=typeof e=="string"?this.Vl(e):e;if(i!=null&&i.id)if(n9.includes(i.type)){var a=fe==null?void 0:fe.querySelector(n);if(a)if((s=i.appearance)!=null&&s.surveyPopupDelaySeconds){pt.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds");var u=setTimeout((()=>{var c,d;this.Ol.delete(u),this.os||(pt.info("Rendering survey "+i.id+" with delay of "+((c=i.appearance)==null?void 0:c.surveyPopupDelaySeconds)+" seconds"),(d=this._surveyManager)==null||d.renderSurvey(i,a,r),pt.info("Survey "+i.id+" rendered"))}),1e3*i.appearance.surveyPopupDelaySeconds);this.Ol.add(u)}else this._surveyManager.renderSurvey(i,a,r);else pt.warn("Survey element not found")}else pt.warn("Surveys of type "+i.type+" cannot be rendered in the app");else pt.warn("Survey not found")}}displaySurvey(e,n){var r;if(Qe(this._surveyManager))pt.warn("init was not called");else{var s=this.Vl(e);if(s){var i=s;if((r=s.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(i=ue({},s,{appearance:ue({},s.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==n_.Popover&&n.initialResponses&&pt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var a=this.Gl(s);if(!a.eligible)return void pt.warn("Survey is not eligible to be displayed: ",a.reason)}n.displayType!==n_.Inline?this._surveyManager.handlePopoverSurvey(i,n):this.renderSurvey(i,n.selector,n.properties)}else pt.warn("Survey not found")}}cancelPendingSurvey(e){Qe(this._surveyManager)?pt.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload==null||e.handlePageUnload()}}function pu(t,e,n){if(Qe(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 E9{constructor(e){this.Ql=new Set,this.Jl=new Set,this.Kl=new Hm,this.Yl=(n,r)=>this.Xl(n,r)&&this.tu(n,r)&&this.eu(n,r)&&this.iu(n,r),this.Xl=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e}init(){var e,n;de((e=this._instance)==null?void 0:e._addCaptureHook)||(this.ru=(n=this._instance)==null?void 0:n._addCaptureHook(((r,s)=>{this.on(r,s)})))}dispose(){var e;(e=this.ru)==null||e.call(this),this.ru=void 0,this.Kl=new Hm}register(e){var n,r;if(!de((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((i=>{var a;this.Ql.add(i),(a=i.steps)==null||a.forEach((u=>{this.Jl.add((u==null?void 0:u.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s=new Set;this.Ql.forEach((i=>{var a;(a=i.steps)==null||a.forEach((u=>{u!=null&&u.selector&&s.add(u.selector)}))})),this._instance.autocapture.setElementSelectors(s)}}replace(e){this.Ql.clear(),this.Jl.clear(),this.register(e)}on(e,n){n!=null&&e.length!=0&&(this.Jl.has(e)||this.Jl.has(n.event))&&this.Ql.forEach((r=>{this.nu(n,r)&&this.Kl.emit("actionCaptured",r.name)}))}su(e){this.onAction("actionCaptured",(n=>e(n)))}nu(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Yl(e,r))return!0;return!1}onAction(e,n){return this.Kl.on(e,n)}tu(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"||!pu(s,n.url,n.url_matching||"contains"))return!1}return!0}eu(e,n){return!!this.au(e,n)&&!!this.ou(e,n)&&!!this.lu(e,n)}au(e,n){var r;if(n==null||!n.href)return!0;var s=this.uu(e);if(s.length>0)return s.some((u=>pu(u.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&pu((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}ou(e,n){var r;if(n==null||!n.text)return!0;var s=this.uu(e);if(s.length>0)return s.some((d=>pu(d.text,n.text,n.text_matching||"exact")||pu(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 f,p=[],m=/(?::|")text="(.*?)"/g;!Qe(f=m.exec(d));)p.includes(f[1])||p.push(f[1]);return p})(c),a=n.text,u=n.text_matching||"exact",i.some((d=>pu(d,a,u))))}lu(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}uu(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}iu(e,n){return n==null||!n.properties||n.properties.length===0||c3(n.properties.reduce(((r,s)=>{var i=Ge(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 k9{constructor(e){var n;this.hu=[],this._instance=e,this.du=new Map,this.vu=new Map,this.cu=new Map,this.fu=(n=this._instance)==null||n.onSessionId==null?void 0:n.onSessionId((r=>this.pu(r)))}gu(e){return!1}mu(){return null}yu(e){}bu(){}_u(e,n){return!!e&&c3(e.propertyFilters,n==null?void 0:n.properties)}wu(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}ku(e,n,r){var s=(r===gd.Activation?this.du:this.vu).get(e),i=[];return this.Su((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._u(c,n)}))}register(e){this.xu(e,!1)}replace(e){this.xu(e,!0)}xu(e,n){var r;de((r=this._instance)==null?void 0:r._addCaptureHook)||(this.Cu(e,n),this.Tu(e,n))}Tu(e,n){var r=e.filter((a=>{var u;return(u=a.conditions)==null||(u=u.actions)==null||(u=u.values)==null?void 0:u.length}));if(n&&this.cu.clear(),r.length!==0){this.Mu||(this.Mu=new E9(this._instance),this.Mu.init(),this.Mu.su((a=>this.onAction(a))));var s=[];r.forEach((a=>{var u;(u=a.conditions)==null||(u=u.actions)==null||u.values.forEach((c=>{if(s.push(c),c.name){var d,f=(d=this.cu.get(c.name))!==null&&d!==void 0?d:[];f.includes(a.id)||f.push(a.id),this.cu.set(c.name,f)}}))})),n?this.Mu.replace(s):this.Mu.register(s)}else{var i;n&&((i=this.Mu)==null||i.replace([]))}}Eu(e,n){n.forEach(((r,s)=>{var i,a=(i=e.get(s))!==null&&i!==void 0?i:[];r.forEach((u=>{a.includes(u)||a.push(u)})),e.set(s,a)}))}Cu(e,n){var r,s,i=e.filter((d=>{var f,p;return((f=d.conditions)==null?void 0:f.events)&&((p=d.conditions)==null||(p=p.events)==null||(p=p.values)==null?void 0:p.length)>0})),a=e.filter((d=>{var f,p;return((f=d.conditions)==null?void 0:f.cancelEvents)&&((p=d.conditions)==null||(p=p.cancelEvents)==null||(p=p.values)==null?void 0:p.length)>0})),u=this.wu(e,gd.Activation),c=this.wu(e,gd.Cancellation);n?(this.du=u,this.vu=c):(this.Eu(this.du,u),this.Eu(this.vu,c)),(i.length!==0||a.length!==0)&&((r=this.ru)!==null&&r!==void 0||(this.ru=(s=this._instance)==null?void 0:s._addCaptureHook(((d,f)=>{this.onEvent(d,f)}))))}onEvent(e,n){var r,s,i=this.Iu(),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.Ru(e,a);if(u==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.Pu([a]);if(u==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),this.Au(a),void this.Fu([a])}if(this.vu.has(e)){var c=this.ku(e,n,gd.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((f=>f.id))}),this.Pu(c.map((f=>f.id))),c.forEach((f=>this.Ou(f.id))))}if(this.du.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.du.get(e)});var d=this.ku(e,n,gd.Activation);this.Lu(d.map((f=>f.id)))}}onAction(e){this.cu.has(e)&&this.Lu(this.cu.get(e)||[])}Lu(e){var n;if(e.length!==0){var r=!((n=this._instance)==null||n.get_session_id==null||!n.get_session_id()),s=[];for(var i of e)r&&this.gu(i)?this.Au(i)&&this.Du(i):s.push(i);s.length>0&&(this.hu=[...new Set([...this.hu,...s])]),this.Iu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Au(e){this.hu=this.hu.filter((r=>r!==e));var n=this.$u();return!n.includes(e)&&(this.Nu([...n,e]),this.qu(),!0)}Pu(e){var n=new Set(e);this.hu=this.hu.filter((i=>!n.has(i)));var r=this.ju(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&(this.Nu(s),s.length===0&&this.Bu()),this.Fu(e)}Hu(){var e,n=this.mu();if(!n)return{};var r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return r&&typeof r=="object"?r:{}}Du(e){if(this.mu()){var n=this.Hu();this.yu(ue({},n,{[e]:Date.now()}))}}Fu(e){if(this.mu()){var n=this.Hu(),r={},s=!1;for(var i of Object.entries(n)){var a=i[0],u=i[1];e.includes(a)?s=!0:r[a]=u}s&&(Ks(r)?this.bu():this.yu(r))}}Uu(){this.mu()&&this.bu()}getActivationTimestamp(e){if(this.$u().includes(e)){var n=this.Hu()[e];return pn(n)?n:void 0}}ju(){var e,n=this.zu();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}$u(){var e,n,r=this.ju();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this.Wu()],i=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return i&&s===i?r:[]}qu(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.Vu(n)}Bu(){this.Gu()}pu(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this.Wu()];if(r&&r!==e){var s=this.ju(),i=this.Hu();s.length>0&&(this.Nu([]),s.filter((a=>pn(i[a]))).forEach((a=>this.Ou(a)))),this.Bu(),this.Uu()}}getActivatedIds(){return[...new Set([...this.$u(),...this.hu])].filter((e=>!this.Zu(e)))}dispose(){var e,n,r;(e=this.fu)==null||e.call(this),this.fu=void 0,(n=this.ru)==null||n.call(this),this.ru=void 0,(r=this.Mu)==null||r.dispose(),this.Mu=void 0}reset(){this.hu=[],this.ju().length>0&&this.Nu([]),this.Bu(),this.Uu()}getEventToItemsMap(){return this.du}Qu(){return this.Mu}}class C9 extends k9{constructor(e){super(e)}zu(){return Wy}Wu(){return Bp}mu(){return Wp}yu(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Wp]:e})}bu(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Wp)}gu(e){var n,r;this.Su((i=>{r=i.find((a=>a.id===e))}));var s=(n=r)==null||(n=n.appearance)==null?void 0:n.surveyPopupDelaySeconds;return pn(s)&&s>0}Ju(){return uo.SHOWN}Su(e){var n;(n=this._instance)==null||n.getSurveys(e)}Ou(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Iu(){return pt}Nu(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Wy]:e})}Vu(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Bp]:e})}Gu(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Bp)}Zu(){return!1}Ru(e,n){var r;this.Su((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a;return l3(i)&&!((a=i.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||i.schedule==="always"})(r);return s?e===uo.SHOWN?"consume":"ignore":e===uo.SHOWN?"persist":e===uo.DISMISSED||e===uo.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class P9{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);var n={};for(var r of e){var s=this._instance.get_property(r);de(s)||(n[r]=s)}return n}set(e,n){this._instance.register(typeof e=="string"?{[e]:n}:e)}remove(e){typeof e!="string"?e.forEach((n=>this._instance.unregister(n))):this._instance.unregister(e)}}let T9=class{constructor(e){this._instance=e}get(){var e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var e=je==null?void 0:je.__PosthogExtensions__;if(e){var n=e.generateSurveys,r=e.loadExternalDependency;return{generateSurveys:n?s=>n(this._instance,s):void 0,loadExternalDependency:r?s=>r(this._instance,"surveys",s):void 0}}}createEventReceiver(){return new C9(this._instance)}};var I9=ne!=null&&ne.location?Fm(ne.location.hash,"__posthog")||Fm(location.hash,"state"):null,OE="_postHogToolbarParams",DE=jt("[Toolbar]"),NE=jt("[FeatureFlags]");class R9{constructor(e,n){n===void 0&&(n=!1),this.Ku=!1,this.update(e,n)}update(e,n){this.Yu=((r,s)=>{var i,a,u,c,d;return{bootstrap:{featureFlags:(i=r.bootstrap)==null?void 0:i.featureFlags,featureFlagPayloads:(a=r.bootstrap)==null?void 0:a.featureFlagPayloads},remoteRequestsDisabled:s,featureFlagsDisabled:!!r.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!r.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!r.advanced_feature_flags_dedup_per_session,cacheTtlMs:r.feature_flag_cache_ttl_ms,refreshIntervalMs:(u=r.remote_config_refresh_interval_ms)!==null&&u!==void 0?u:3e5,requestTimeoutMs:r.feature_flag_request_timeout_ms,compression:r.disable_compression?"none":"base64",evaluationContexts:(c=(d=r.evaluation_contexts)!==null&&d!==void 0?d:r.evaluation_environments)!==null&&c!==void 0?c:[],flagKeys:Ge(r.flag_keys)?r.flag_keys:void 0}})(e,n),!e.evaluation_environments||e.evaluation_contexts||this.Ku||(NE.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Ku=!0),de(e.flag_keys)||Ge(e.flag_keys)||NE.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Yu}}var jE=jt("[FeatureFlags]"),Wa=jt("[FeatureFlags]",{debugEnabled:!0}),u1=`" failed. Feature flags didn't load in time.`,FE="connection_error",VE=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},$E=t=>{var e={};for(var n of qp(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},Hs=jt("[Error tracking]"),A9=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],M9=["__firefox__","__gCrWeb"],HE="Refusing to render web experiment since the viewer is a likely bot",L9={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>zm(e,t),not_regex:(t,e)=>!zm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class ir{get Wi(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{ir.Xu("retrieved web experiments from the server"),n.th=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n.th&&(ir.Xu("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.th)==null||a.set(i.feature_flag_key,i));var u=n._instance.getFeatureFlag(i.feature_flag_key);ut(u)&&i.variants[u]&&n.eh(i.name,u,i.variants[u].transforms)}else if(i.variants)for(var c in i.variants){var d=i.variants[c];ir.ih(d,n._instance)&&n.eh(i.name,c,d.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())ir.Xu(HE);else if(!this.Wi.disable_web_experiments){if(Qe(this.th))return this.th=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ir.Xu("applying feature flags",e),e.forEach((n=>{var r;if(this.th&&(r=this.th)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this.th)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.eh(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=ir.getWindowLocation();if(e!=null&&e.search){var n=cc(e==null?void 0:e.search,"__experiment_id"),r=cc(e==null?void 0:e.search,"__experiment_variant");n&&r&&(ir.Xu("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.rh(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Wi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Wi.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.Wi.token),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}rh(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(ir.Xu("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.eh(s[0].name,n,s[0].variants[n].transforms))}static ih(e,n){return!Qe(e.conditions)&&ir.nh(e,n)&&ir.sh(e)}static nh(e,n){var r;if(Qe(e.conditions)||Qe((r=e.conditions)==null?void 0:r.url))return!0;var s=ir.getWindowLocation();if(s){var i,a,u,c=kP(n,s.href);return(i=e.conditions)==null||!i.url||L9[(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 sh(e){var n;if(Qe(e.conditions)||Qe((n=e.conditions)==null?void 0:n.utm))return!0;var r=HP();if(r.utm_source){var s,i,a,u,c,d,f,p,m=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,_=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_source)==r.utm_source,x=(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,y=(f=e.conditions)==null||(f=f.utm)==null||!f.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return m&&x&&y&&_}return!1}static Xu(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];ge.info("[WebExperiments] "+e,r)}eh(e,n,r){this._is_bot()?ir.Xu(HE):n!=="control"?r.forEach((s=>{if(s.selector){var i;ir.Xu("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)}))}})):ir.Xu("Control variants leave the page unmodified.")}_is_bot(){return br&&this._instance?o3(br,this.Wi.custom_blocked_useragents):void 0}}var Es=jt("[Conversations]"),qa="Conversations not available yet.",zE="console",g3="__posthogHandledLogsRequestError",c1=(t,e)=>{var n=t instanceof Error?t:new Error(e);return n[g3]=!0,n},UE=t=>!!t&&typeof t=="object"&&t[g3]===!0,E0={featureFlags:class{constructor(t){this.name="featureFlags",this.ah=!1,this.featureFlagEventHandlers=[],this.I=jE,this.oh={},this.lh={},this.uh=[],this.hh=!1,this.dh=!1,this.fh=0,this.ph=!1,this.gh=!1,this.mh=!1,this.yh=!1,this.bh=0,this.It=()=>{var e=this._h();this.bh=0,e&&this.reloadFeatureFlags()},this.wh=()=>{var e,n=this.kh;de(n)||this.Wi.remoteRequestsDisabled||!fe||fe.visibilityState==="hidden"||Date.now()-((e=this.Sh)!==null&&e!==void 0?e:0)<n||(this.reloadFeatureFlags(),this.xh())},this.Et=()=>{(fe==null?void 0:fe.visibilityState)==="visible"&&this.wh()},"get"in t?this.ls=t:(this.Ch=new R9(t.config,t.ka()),this.ls=this.Ch)}updateConfig(t,e){var n;(n=this.Ch)==null||n.update(t,e),this.ds&&this.Th()}setup(t){return this.$l=t,this.I=t.logger.createLogger("[FeatureFlags]"),v3(t.kv.initialize(),(()=>{this.$l===t&&(this.$l=void 0,this.ds=t,this.Mh(t))}))}Mh(t){if(this.ds===t)return ne&&It(ne,"online",this.It),this.Th(),this.Eh=t.registerDynamicEventProperties((()=>this.Ih()?this.oh:this.lh)),this.Rh(),this.initialize()}Th(){var t=this.Wi.refreshIntervalMs,e=!this.Wi.remoteRequestsDisabled&&fe&&!de(t)&&t>0?t:void 0;e!==this.kh&&(this.Ph(),de(e)||(this.kh=e,this.xh(),fe!=null&&fe.addEventListener&&It(fe,lc,this.Et)))}xh(){de(this.kh)||(de(this.Ah)||clearInterval(this.Ah),this.Sh=Date.now(),this.Ah=setInterval(this.wh,this.kh))}Ph(){de(this.Ah)||(clearInterval(this.Ah),this.Ah=void 0,fe==null||fe.removeEventListener==null||fe.removeEventListener(lc,this.Et)),this.kh=void 0,this.Sh=void 0}destroy(){this.Fh()}dispose(){this.Fh()}Fh(){var t;this.Ph(),this.fh++,this.gh=!1,this.$l=void 0,this.ds&&(this.Oh(),(t=this.Eh)==null||t.dispose(),this.Eh=void 0,this.uh=[],ne==null||ne.removeEventListener("online",this.It),this.ds=void 0)}get Wi(){return this.ls.get()}Lh(t){var e;return(e=this.ds)==null?void 0:e.kv.get(t)}Hr(t){this.Dh((()=>{var e;return(e=this.ds)==null?void 0:e.kv.set(t)}))}$r(t){this.Dh((()=>{var e;return(e=this.ds)==null?void 0:e.kv.remove(t)}))}Dh(t){try{t()}catch(e){this.I.error("Failed to update feature flag persistence",e)}}Rh(){var t={};for(var e of[ul,cl,Nu,pi]){var n=this.Lh(e);de(n)||(t[e]=n)}this.oh=t;var r=ue({},t),s=this.Lh(ro);if(s)for(var i of Object.entries(s))r["$feature/"+i[0]]=i[1];this.lh=r}Ih(){var t=this.Wi.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Lh(El);return typeof e!="number"||Date.now()-e>t}$h(){return!!this.Ih()&&(this.yh||this.dh||(this.yh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Nh(){var t=this.Wi.evaluationContexts;return t!=null&&t.length?t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.I.error("Invalid evaluation context found:",e,"Expected non-empty string"),n})):[]}qh(){var t=this.Wi.flagKeys;if(!de(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.I.error("Invalid flag key found:",e,"Expected non-empty string"),n}))}initialize(){var t,e,n=this.Wi,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,f)=>(d[f]=r[f]||!1,d)),{}),c=Object.keys(a).filter((d=>u[d])).reduce(((d,f)=>(d[f]=a[f],d)),{});return this.jh({featureFlags:u,featureFlagPayloads:c})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.Lh(ro))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.Lh(cl))!==null&&s!==void 0?s:{},u=ue({},i,t),c=ue({},a,e),d={};for(var f of Object.entries(u)){var p=f[0],m=f[1];d[p]={key:p,enabled:R4(m),variant:A4(m),reason:void 0,metadata:de(c==null?void 0:c[p])?void 0:{id:0,version:void 0,description:void 0,payload:c[p]}}}this.jh({flags:d})}get hasLoadedFlags(){return this.hh}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Lh(tf),e=this.Lh(pi),n=this.Lh(nl);if(!n&&!e)return t||{};var r=St({},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],f=de(d)?(a=c==null?void 0:c.enabled)!==null&&a!==void 0&&a:!!d,p=de(d)?c==null?void 0:c.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[i],_=ue({},c,{enabled:f,variant:f?p??(c==null?void 0:c.variant):void 0});f!==(c==null?void 0:c.enabled)&&(_.original_enabled=c==null?void 0:c.enabled),p!==(c==null?void 0:c.variant)&&(_.original_variant=c==null?void 0:c.variant),m&&(_.metadata=ue({},c==null?void 0:c.metadata,{payload:m,original_payload:c==null||(u=c.metadata)==null?void 0:u.payload})),r[i]=_}return this.ah||(this.I.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.ah=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:R4(r),variant:A4(r),payload:I4(e[n])}}))}getFlagVariants(){var t=this.Lh(ro),e=this.Lh(pi);if(!e)return t||{};for(var n=St({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ah||(this.I.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.ah=!0),n}getFlagPayloads(){var t=this.Lh(cl),e=this.Lh(nl);if(!e)return t||{};for(var n=St({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ah||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.ah=!0),n}reloadFeatureFlags(){this.ph||this.Wi.featureFlagsDisabled||this._h()||this.Bh||(this.uh.slice().forEach((t=>{try{t()}catch(e){this.I.error("Error while running feature flags reloading callback",e)}})),this.Bh=setTimeout((()=>{this.Hh()}),5))}Oh(){clearTimeout(this.Bh),this.Bh=void 0}onReloading(t){return this.uh.push(t),()=>{this.uh=this.uh.filter((e=>e!==t))}}ensureFlagsLoaded(){this.hh||this.dh||this.Bh||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ph=t}resetFlagCallReported(){this.$r(ao)}Hh(t){this.Oh();var e=this.ds;if(e&&!this.Wi.remoteRequestsDisabled&&!this._h())if(this.dh)this.gh=!0;else{var n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:ue({},e.initialPersonProperties,this.Lh(Ws)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Lh(bi),timezone:ZP()};de(e.deviceId)||(n.$device_id=e.deviceId),(t!=null&&t.disableFlags||this.Wi.featureFlagsDisabled)&&(n.disable_flags=!0);var r=this.Nh();r.length&&(n.evaluation_contexts=r);var s=this.qh();de(s)||(n.flag_keys=s);var i=this.Wi.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(i?"&only_evaluate_survey_feature_flags=true":""),u=this.fh;this.dh=!0;var c=()=>{this.gh&&(this.gh=!1,this.Hh())},d=f=>{this.dh=!1,u===this.fh&&(this.Hr({[ju]:[FE]}),this.I.error("Feature flag request failed",f)),c()};try{e.sendRequest(a,{target:"flags",method:"POST",body:n,compression:this.Wi.compression==="base64"?xr.Base64:void 0,sentAt:"body",timeoutMs:this.Wi.requestTimeoutMs}).then((f=>{var p,m,_=(p=f.json)!==null&&p!==void 0?p:{},x=f.statusCode!==200;if(this.dh=!1,u===this.fh){if(this.Uh(f.statusCode),x||this.gh||(this.$anon_distinct_id=void 0),!n.disable_flags||this.gh){this.mh=!x;var y=[];f.error?y.push(f.error instanceof Error&&f.error.name==="AbortError"?"timeout":f.error instanceof Error?FE:"unknown_error"):f.statusCode!==200&&y.push("api_error_"+f.statusCode),_.errorsWhileComputingFlags&&y.push("errors_while_computing_flags");var w=!((m=_.quotaLimited)==null||!m.includes("feature_flags"));w&&y.push("quota_limited"),this.Hr({[ju]:y}),w?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.jh(_,x,{partialResponse:i}),c()}}else c()})).catch(d)}catch(f){d(f)}}}_h(){return VP(this.bh,3)}Uh(t){this.bh=$P(t,this.bh,3,(()=>this.I.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.mh)if(this.hh||this.getFlags()&&this.getFlags().length>0){if(!this.$h()){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 this.I.warn('getFeatureFlag for key "'+t+u1)}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.mh)if(this.hh||this.getFlags()&&this.getFlags().length>0){if(!this.$h()){var n,r=this.getFlagVariants(),s=t in r,i=r[t],a=this.getFlagPayloads()[t],u=String(i),c=this.Lh(Nu)||void 0,d=this.Lh(El)||void 0,f=this.Lh(ao)||{};if(this.Wi.deduplicateCallsPerSession){var p,m=(p=this.ds)==null?void 0:p.session.sessionId,_=this.Lh(Md);m&&m!==_&&(f={},n=m)}if(e.send_event||!("send_event"in e))if(t in f&&f[t].includes(u))n&&this.Hr({[ao]:f,[Md]:n});else{var x,y,w,S,C,P,T,I,A,O,R,L;Ge(f[t])?f[t].push(u):f[t]=[u],this.Hr(ue({[ao]:f},n?{[Md]:n}:{}));var D=this.getFeatureFlagDetails(t),j=[...(x=this.Lh(ju))!==null&&x!==void 0?x:[]];de(i)&&j.push("flag_missing");var F={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:a??null,$feature_flag_request_id:c,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:(y=(w=this.Wi.bootstrap)==null||(w=w.featureFlags)==null?void 0:w[t])!==null&&y!==void 0?y:null,$feature_flag_bootstrapped_payload:(S=(C=this.Wi.bootstrap)==null||(C=C.featureFlagPayloads)==null?void 0:C[t])!==null&&S!==void 0?S:null,$used_bootstrap_value:!this.mh};de(D==null||(P=D.metadata)==null?void 0:P.has_experiment)||(F.$feature_flag_has_experiment=D.metadata.has_experiment),de(D==null||(T=D.metadata)==null?void 0:T.version)||(F.$feature_flag_version=D.metadata.version);var Z,Q=(I=D==null||(A=D.reason)==null?void 0:A.description)!==null&&I!==void 0?I:D==null||(O=D.reason)==null?void 0:O.code;Q&&(F.$feature_flag_reason=Q),D!=null&&(R=D.metadata)!=null&&R.id&&(F.$feature_flag_id=D.metadata.id),de(D==null?void 0:D.original_variant)&&de(D==null?void 0:D.original_enabled)||(F.$feature_flag_original_response=de(D.original_variant)?D.original_enabled:D.original_variant),D!=null&&(L=D.metadata)!=null&&L.original_payload&&(F.$feature_flag_original_payload=D==null||(Z=D.metadata)==null?void 0:Z.original_payload),j.length&&(F.$feature_flag_error=j.join(",")),this.zh(F)}else n&&this.Hr({[ao]:f,[Md]:n});if(s)return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:I4(a)}}}else this.I.warn('getFeatureFlagResult for key "'+t+u1)}zh(t){try{var e;(e=this.ds)==null||e.capture("$feature_flag_called",t).catch((n=>{this.I.error("Failed to capture feature flag call",n)}))}catch(n){this.I.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.Wh(t,e)}Wh(t,e){var n=this;return Tt((function*(){var r=n.ds;if(r){var s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.Nh();i.length&&(s.evaluation_contexts=i);var a,u=n.qh();de(u)||(s.flag_keys=u);try{var c,d=(c=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Wi.compression==="base64"?xr.Base64:void 0,sentAt:"body",timeoutMs:n.Wi.requestTimeoutMs})).json)==null?void 0:c.featureFlagPayloads;a=(d==null?void 0:d[t])||void 0}catch(f){return void n.I.error("Remote config feature flag request failed",f)}try{e(a)}catch(f){n.I.error("Remote config feature flag callback failed",f)}}}))()}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this.mh)return e.defaultValue;if(!(this.hh||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+t+u1),e.defaultValue;var n=this.getFeatureFlag(t,e);return de(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){this.jh(t,e,n)}jh(t,e,n){if(this.ds){this.hh=!0;var r=(function(s,i,a,u,c,d){i===void 0&&(i={}),a===void 0&&(a={}),u===void 0&&(u={}),d===void 0&&(d=jE);var f=((A,O)=>{var R=A.flags;return R?ue({},A,{featureFlags:Object.fromEntries(Object.keys(R).map((L=>{var D;return[L,(D=R[L].variant)!==null&&D!==void 0?D:R[L].enabled]}))),featureFlagPayloads:Object.fromEntries(Object.keys(R).filter((L=>R[L].enabled)).filter((L=>{var D;return(D=R[L].metadata)==null?void 0:D.payload})).map((L=>{var D;return[L,(D=R[L].metadata)==null?void 0:D.payload]})))}):(A.featureFlags&&O.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),A)})(s,d),p=f.flags,m=f.featureFlags,_=f.featureFlagPayloads;if(m){var x=s.requestId,y=s.evaluatedAt;if(Ge(m)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var w={};if(m)for(var S=0;m.length>S;S++)w[m[S]]=!0;return{[ul]:m,[ro]:w,[Rm]:!1}}var C=m,P=_,T=p;if(c!=null&&c.partialResponse)C=ue({},i,C),P=ue({},a,P),T=ue({},u,T);else if(s.errorsWhileComputingFlags)if(p){var I=new Set(Object.keys(p).filter((A=>{var O;return!((O=p[A])!=null&&O.failed)})));C=ue({},i,Object.fromEntries(Object.entries(C).filter((A=>I.has(A[0]))))),P=ue({},a,Object.fromEntries(Object.entries(P||{}).filter((A=>I.has(A[0]))))),T=ue({},u,Object.fromEntries(Object.entries(T||{}).filter((A=>I.has(A[0])))))}else C=ue({},i,C),P=ue({},a,P),T=ue({},u,T);return ue({[ul]:Object.keys($E(C)),[ro]:C||{},[cl]:P||{},[tf]:T||{},[Rm]:s.minimalFlagCalledEvents===!0},x?{[Nu]:x}:{},y?{[El]:y}:{})}})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.I);r&&this.Hr(r),e||(this.yh=!1),this.Vh(e)}}override(t,e){e===void 0&&(e=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Gh(t)}Gh(t){if(this.ds){if(t===!1)return this.$r([pi,nl]),this.Vh(),void Wa.info("All overrides cleared");if(Ge(t))return this.Hr({[pi]:VE(t)}),this.Vh(),void Wa.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e,n=t;this.ah=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);var r={},s=n.flags,i=n.payloads;return s&&(r[pi]=Ge(s)?VE(s):s),i&&(r[nl]=i),Object.keys(r).length&&this.Hr(r),s===!1&&i===!1?this.$r([pi,nl]):s===!1?this.$r(pi):i===!1&&this.$r(nl),this.Vh(),s===!1?Wa.info("Flag overrides cleared"):s&&Wa.info("Flag overrides set",{flags:s}),void(i===!1?Wa.info("Payload overrides cleared"):i&&Wa.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.Hr({[pi]:t}),this.Vh(),void Wa.info("Flag overrides set",{flags:t});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.hh){var e=this.Zh(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){this.I.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r=(this.Lh(Up)||[]).find((c=>c.flagKey===t)),s={["$feature_enrollment/"+t]:e},i={$feature_flag:t,$feature_enrollment:e,$set:s};r&&(i.$early_access_feature_name=r.name),n&&(i.$feature_enrollment_stage=n);var a=ue({},this.getFlagVariants(),{[t]:e});this.Hr({[ul]:Object.keys($E(a)),[ro]:a,[Ws]:ue({},this.Lh(Ws)||{},s)}),this.Vh();try{var u;(u=this.ds)==null||u.capture("$feature_enrollment_update",i).catch((c=>{this.I.error("Failed to capture early access feature enrollment",c)}))}catch(c){this.I.error("Failed to capture early access feature enrollment",c)}}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.Lh(Up);!r||e?this.Qh(t,n):t(r)}Qh(t,e){var n=this;return Tt((function*(){var r=n.ds;if(r){var s,i=e?"&"+e.map((u=>"stage="+u)).join("&"):"";try{var a=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+i,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;n.Hr({[Up]:s=a.json.earlyAccessFeatures})}catch(u){return void n.I.error("Early access feature request failed",u)}try{t(s)}catch(u){n.I.error("Early access feature callback failed",u)}}}))()}Zh(){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)),{})}}Vh(t){this.Rh();var e=this.Zh(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){this.I.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0),this.Jh(t,e)}Jh(t,e){e===void 0&&(e=!0);var n=this.Lh(Ws)||{},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.Hr({[Ws]:ue({},n,i,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=ue({},this.Lh(Ws)||{});t.forEach((r=>{delete n[r]})),this.Hr({[Ws]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this.$r(Ws),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.Lh(bi)||{},r=ue({},n);for(var s of Object.keys(t))r[s]=ue({},n[s],t[s]);this.Hr({[bi]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Lh(bi)||{};this.Hr({[bi]:ue({},e,{[t]:{}})})}else this.$r(bi)}reset(){this.fh++,this.gh=!1,this.oh={},this.lh={},this.hh=!1,this.ph=!1,this.mh=!1,this.$anon_distinct_id=void 0,this.Oh(),this.ah=!1,this.bh=0}}},O9={sessionRecording:class{get Wi(){return this._instance.config}get Za(){return this._instance.persistence}get started(){var t;return!((t=this.Kh)==null||!t.isStarted)}get status(){var t,e;return this.Yh===bd||this.Yh===gp?this.Yh:(t=(e=this.Kh)==null?void 0:e.status)!==null&&t!==void 0?t:this.Yh}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Yh=RE,this.Xh=void 0,this.td=!1,this._t=(()=>{var e;if(fe==null||!fe.visibilityState||fe.visibilityState==="visible")return!0;var n=ne==null||(e=ne.performance)==null||e.getEntriesByType==null?void 0:e.getEntriesByType("visibility-state");return!(n!=null&&n.length)||n.some((r=>r.name==="visible"))})(),this.Et=()=>{var e;(fe==null?void 0:fe.visibilityState)==="visible"&&(this._t=!0,(e=this.Kh)==null||e.setDocumentWasEverVisible==null||e.setDocumentWasEverVisible(!0))},this._instance=t,!this._instance.sessionManager)throw Zi.error("started without valid sessionManager"),new Error(u_+" started without valid sessionManager. This is a bug.");if(this.Wi.cookieless_mode===lo)throw new Error(u_+' cannot be used with cookieless_mode="always"');fe!=null&&fe.addEventListener&&It(fe,"visibilitychange",this.Et)}initialize(){this.startIfEnabledOrStop()}dispose(){this.td=!0,fe==null||fe.removeEventListener==null||fe.removeEventListener("visibilitychange",this.Et),this.stopRecording()}get ed(){var t,e=!((t=this._instance.get_property(ll))==null||!t.enabled),n=!this.Wi.disable_session_recording,r=this.Wi.disable_session_recording||this._instance.consent.isOptedOut();return ne&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!(this.td||this.ed&&(e=this.Kh)!=null&&e.isStarted)){var n=!de(Object.assign)&&!de(Array.from);this.ed&&n?(this.rd(t),Zi.info("starting")):(this.Yh=RE,this.stopRecording())}}rd(t){var e,n,r;this.ed&&(this.Yh!==bd&&this.Yh!==gp&&(this.Yh=AE),je!=null&&(e=je.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=je.__PosthogExtensions__)!=null&&n.initSessionRecording?this.nd(t):(r=je.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.sd,(s=>{if(s)return this._instance.register_for_session({[Yy]:!0}),Zi.error("could not load recorder",s);this.nd(t)})))}stopRecording(){var t,e;(t=this.Xh)==null||t.call(this),this.Xh=void 0,(e=this.Kh)==null||e.stop()}ad(){var t,e;(t=this.Xh)==null||t.call(this),this.Xh=void 0,(e=this.Kh)==null||e.discard()}od(){var t,e;(t=this.Za)==null||t.unregister(K2),(e=this.Za)==null||e.unregister(hP)}ld(t,e){if(Qe(t))return null;var n,r=pn(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Zi.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}ud(t){if(this.Za){var e,n,r=this.Za,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,u=this.ld((i=this.Wi.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.ld(a==null?void 0:a.sampleRate,"remote config sampleRate"),d=u??c;Qe(d)&&this.od();var f=a==null?void 0:a.minimumDurationMilliseconds;r.register({[ll]:ue({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:ue({capturePerformance:t.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:d,minimumDurationMilliseconds:de(f)?null:f,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.Xh)==null||e.call(this),this.Xh=(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.ud(e),void this.ad()):(this.ud(e),void this.startIfEnabledOrStop()):(this.Yh===bd&&(this.Yh=gp,Zi.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.Kh)!=null&&n.log?this.Kh.log(t,e):Zi.warn("log called before recorder was ready")}get sd(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(ll);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}hd(){var t,e=this._instance.get_property(ll);if(!e)return!1;try{t=typeof e=="object"?e:JSON.parse(e)}catch(n){return Zi.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!Qe(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}nd(t){var e,n,r;if(!this.td){if((e=je.__PosthogExtensions__)==null||!e.initSessionRecording)return Zi.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Yy]:!0});var s;if(this.Kh||(this.Kh=(s=je.__PosthogExtensions__)==null?void 0:s.initSessionRecording(this._instance,this._t),this.Kh._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.hd())return this.Yh===gp||this.Yh===bd?void 0:(this.Yh=bd,Zi.info("persisted remote config is stale, requesting fresh config before starting"),void new GP(this._instance).load());this.Yh=AE,(n=(r=this.Kh).setDocumentWasEverVisible)==null||n.call(r,this._t),this.Kh.start(t)}}onRRwebEmit(t){var e;(e=this.Kh)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Kh||(e=this.Za)==null||e.register({[mP]:!0}),(t=this.Kh)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Kh||(e=this.Za)==null||e.register({[pP]:!0}),(t=this.Kh)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.Kh||(n=this.Za)==null||n.register({[t==="url"?vP:gP]:!0}),(e=this.Kh)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Kh)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.Kh)==null||!n.tryAddCustomEvent(t,e))}}},D9={autocapture:class extends v9{constructor(t){super(new g9(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.dd=this.vd()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.fd();return!!(t.path||t.search||this.pd(t))}startIfEnabled(){this.isEnabled&&(ge.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.dd=this.vd(),this.startIfEnabled()}stop(){this.gd&&this.gd(),this.gd=void 0,this.md&&this.md(),this.md=void 0,ge.info("History API monitoring stopped")}monitorHistoryChanges(){ne&&ne.history&&(this.yd("pushState"),this.yd("replaceState"),this.bd(),this.pd()&&this._d())}yd(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 PE;var a={next:r[s]},u=i((function(){for(var c=arguments.length,d=new Array(c),f=0;c>f;f++)d[f]=arguments[f];return a.next.apply(this,d)}));return ar(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];ar(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 PE}})(ne.history,t,(r=>function(s,i,a){r.call(this,s,i,a),n.wd(t)}))}}vd(){var t=ne==null?void 0:ne.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}fd(){var t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:bt(t)?t:{}}pd(t){return t===void 0&&(t=this.fd()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}kd(t){var e=this.fd(),n=this.dd;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.pd(e)&&t.hash!==n.hash))}wd(t){try{var e=this.vd();if(!e)return;this.kd(e)&&this._instance.capture(wu,{navigation_type:t}),this.dd=e}catch(n){ge.error("Error capturing "+t+" pageview",n)}}bd(){if(!this.gd){var t=()=>{this.wd("popstate")};It(ne,"popstate",t),this.gd=()=>{ne&&ne.removeEventListener("popstate",t)}}}_d(){if(!this.md){var t=()=>{this.wd("hashchange")};It(ne,"hashchange",t),this.md=()=>{ne&&ne.removeEventListener("hashchange",t)}}}},heatmaps:class{get Wi(){return this.instance.config}constructor(t){var e;this.Sd=!1,this.es=!1,this.xd=null,this.instance=t,this.Sd=!((e=this.instance.persistence)==null||!e.props[Fy]),this.rageclicks=new m3(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return bt(this.Wi.capture_heatmaps)&&this.Wi.capture_heatmaps.flush_interval_milliseconds&&(t=this.Wi.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Qe(this.Wi.capture_heatmaps)?Qe(this.Wi.enable_heatmaps)?this.Sd:this.Wi.enable_heatmaps:this.Wi.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.es)return;w9.info("starting..."),this.Cd(),this.Et()}else{var t;clearInterval((t=this.xd)!==null&&t!==void 0?t:void 0),this.Td(),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({[Fy]:n}),this.Sd=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.yt;return this.yt=void 0,t}Md(t){a1(t.originalEvent)&&this.Ii(t.originalEvent,"deadclick")}Et(){this.xd&&clearInterval(this.xd),this.xd=(fe==null?void 0:fe.visibilityState)==="visible"?setInterval(this.Na.bind(this),this.flushIntervalMilliseconds):null}Cd(){ne&&fe&&(this.Ed=this.Na.bind(this),It(ne,Om,this.Ed),this.Id=t=>this.Ii(t||(ne==null?void 0:ne.event)),It(fe,"click",this.Id,{capture:!0}),this.Rd=t=>this.Pd(t||(ne==null?void 0:ne.event)),It(fe,"mousemove",this.Rd,{capture:!0}),this.Ad=new lE(this.instance,TN,this.Md.bind(this)),this.Ad.startIfEnabledOrStop(),this.Fd=this.Et.bind(this),It(fe,lc,this.Fd),this.es=!0)}Td(){var t;ne&&fe&&(this.Ed&&ne.removeEventListener(Om,this.Ed),this.Id&&fe.removeEventListener("click",this.Id,{capture:!0}),this.Rd&&fe.removeEventListener("mousemove",this.Rd,{capture:!0}),this.Fd&&fe.removeEventListener(lc,this.Fd),clearTimeout(this.Od),(t=this.Ad)==null||t.stop(),this.es=!1)}Ld(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&&da(d)&&!ss(d,"body");){if(d===c)return!1;var f=void 0;try{var p,m,_;f=(p=(m=(_=d.ownerDocument)==null?void 0:_.defaultView)!==null&&m!==void 0?m:ne)==null?void 0:p.getComputedStyle(d).position}catch{return!1}if(Ke(u,f))return!0;d=AP(d)}return!1})(Jy(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Ii(t,e){var n;if(e===void 0&&(e="click"),!Q4(t.target)&&a1(t)){var r=this.Ld(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&LP(Jy(t),this.instance.config.rageclick)&&this.zn(ue({},r,{type:"rageclick"})),this.zn(r)}}Pd(t){!Q4(t.target)&&a1(t)&&(clearTimeout(this.Od),this.Od=setTimeout((()=>{this.zn(this.Ld(t,"mousemove"))}),500))}zn(t){if(ne){var e=this.Wi.disable_capture_url_hashes?ca(ne.location.href):ne.location.href,n=this.Wi.custom_personal_data_properties,r=this.Wi.mask_personal_data_properties?[...dc,...n||[]]:[],s=rf(e,r,sf);this.yt=this.yt||{},this.yt[s]||(this.yt[s]=[]),this.yt[s].push(t)}}Na(){this.yt&&!Ks(this.yt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:lE,webVitalsAutocapture:class{constructor(t){var e;this.Sd=!1,this.es=!1,this.yt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Dd=()=>{clearTimeout(this.$d),this.$d=void 0,this.yt.metrics.length!==0&&(this._instance.capture("$web_vitals",ue({$current_url:this.yt.url},this.yt.metrics.reduce(((n,r)=>ue({},n,{["$web_vitals_"+r.name+"_event"]:ue({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{}))),this.yt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Nd=n=>{var r;if(this.yt=this.yt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Qe(n==null?void 0:n.name)||Qe(n==null?void 0:n.value))Ba.error("Invalid metric received",n);else{var s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.qd(s);if(!de(i)){var a=pn(n.navigationId)||typeof n.navigationId=="string"?"navigation:"+n.navigationId:"url:"+i;if(!this.jd||this.jd>n.value){this.yt.navigationKey!==a&&(this.Dd(),this.$d=setTimeout(this.Dd,this.flushToCaptureTimeoutMs)),de(this.yt.navigationKey)&&(this.yt.navigationKey=a,this.yt.url=i),this.yt.firstMetricTimestamp=de(this.yt.firstMetricTimestamp)?Date.now():this.yt.firstMetricTimestamp;var u=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),c=ue({},n,s?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});if(delete c.entries,bt(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){var d={};for(var f of x9){var p=f==="url"&&typeof n.attribution[f]=="string"?this.qd(n.attribution[f]):n.attribution[f];de(p)||(d[f]=p)}c.attribution=d}else delete c.attribution;de(u)||(c.$session_id=u.sessionId,c.$window_id=u.windowId),this.yt.metrics.push(c),this.yt.metrics.length===this.allowedMetrics.length&&this.Dd()}else Ba.error("Ignoring metric with value >= "+this.jd,n)}}},this.Bd=()=>{if(!this.es){var n,r,s,i,a=!1,u=je.__PosthogExtensions__,c=u==null?void 0:u.postHogWebVitalsCallbacksByFlavor,d=(c==null?void 0:c[this.Hd])||(this.Hd==="web-vitals"&&de(c)?u==null?void 0:u.postHogWebVitalsCallbacks:void 0);if(!de(d)){var f=d.withoutAttribution,p=this.attributionMetrics;a=!de(f),n=p.indexOf("LCP")>-1?d.onLCP:(f==null?void 0:f.onLCP)||d.onLCP,r=p.indexOf("CLS")>-1?d.onCLS:(f==null?void 0:f.onCLS)||d.onCLS,s=p.indexOf("FCP")>-1?d.onFCP:(f==null?void 0:f.onFCP)||d.onFCP,i=p.indexOf("INP")>-1?d.onINP:(f==null?void 0:f.onINP)||d.onINP}if(n&&r&&s&&i){var m={reportSoftNavs:this.useSoftNavs},_=a&&this.attributionMetrics.indexOf("INP")>-1?ue({},m,{includeProcessedEventEntries:!1}):m;this.allowedMetrics.indexOf("LCP")>-1&&n(this.Nd.bind(this),m),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Nd.bind(this),m),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Nd.bind(this),m),this.allowedMetrics.indexOf("INP")>-1&&i(this.Nd.bind(this),_),this.es=!0}else Ba.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Sd=!((e=this._instance.persistence)==null||!e.props[zy]),this.startIfEnabled()}get Ud(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=bt(this.Ud)?(t=this.Ud)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Qe(n)?((e=this._instance.persistence)==null?void 0:e.props[Uy])||IE:n}get flushToCaptureTimeoutMs(){return(bt(this.Ud)?this.Ud.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=bt(this.Ud)?this.Ud.web_vitals_attribution:void 0;return wr(t)?t?IE:[]:Ge(t)?t:_9}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=bt(this.Ud)?this.Ud.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get jd(){var t=bt(this.Ud)&&pn(this.Ud.__web_vitals_max_value)?this.Ud.__web_vitals_max_value:TE;return t>0&&6e4>=t?TE:t}get isEnabled(){var t=Ht==null?void 0:Ht.protocol;if(t!=="http:"&&t!=="https:")return Ba.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=bt(this.Ud)?this.Ud.web_vitals:wr(this.Ud)?this.Ud:void 0;return wr(e)?e:this.Sd}startIfEnabled(){this.isEnabled&&!this.es&&(Ba.info("enabled, starting..."),this.Ts(this.Bd))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=bt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=bt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[zy]:n}),this._instance.persistence.register({[Uy]:r})),this.Sd=n,this.startIfEnabled()}}}get Hd(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ts(t){var e=je.__PosthogExtensions__,n=this.Hd,r=e==null?void 0:e.postHogWebVitalsCallbacksByFlavor;r!=null&&r[n]||n==="web-vitals"&&de(r)&&e!=null&&e.postHogWebVitalsCallbacks?t():e==null||e.loadExternalDependency==null||e.loadExternalDependency(this._instance,n,(s=>{s?Ba.error("failed to load script",s):t()}))}qd(t){var e=t||(ne==null?void 0:ne.location.href);if(e){var n=this._instance.config.disable_capture_url_hashes?ca(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...dc,...r||[]]:[];return rf(n,s,sf)}Ba.error("Could not determine current URL")}}},N9={exceptionObserver:class{constructor(t){var e;this.Bd=()=>{var n;if(ne&&this.isEnabled&&(n=je.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=je.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=je.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=je.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.zd&&this.Wi.capture_unhandled_errors&&(this.zd=r(this.captureException.bind(this))),!this.Wd&&this.Wi.capture_unhandled_rejections&&(this.Wd=s(this.captureException.bind(this))),!this.Vd&&this.Wi.capture_console_errors&&(this.Vd=i(this.captureException.bind(this)))}catch(a){wd.error("failed to start",a),this.Gd()}}},this._instance=t,this.Zd=!((e=this._instance.persistence)==null||!e.props[Vy]),this.oe=new wD(ue({},(function(n){var r,s,i,a;return n===void 0&&(n={}),{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(a=n.exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking),{refillInterval:1e4,I:wd})),this.Wi=this.Qd(),this.startIfEnabledOrStop()}Qd(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return bt(t)?e=ue({},e,t):(de(t)?this.Zd:t)&&(e=ue({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Wi.capture_console_errors||this.Wi.capture_unhandled_errors||this.Wi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(wd.info("enabled"),this.Gd(),this.Ts(this.Bd)):this.Gd()}Ts(t){var e,n;(e=je.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return wd.error("failed to load script",r);t()}))}Gd(){var t,e,n;(t=this.zd)==null||t.call(this),this.zd=void 0,(e=this.Wd)==null||e.call(this),this.Wd=void 0,(n=this.Vd)==null||n.call(this),this.Vd=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Zd=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Vy]:this.Zd}),this.Wi=this.Qd(),this.startIfEnabledOrStop())}}onConfigChange(){this.Wi=this.Qd()}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.oe.consumeRateLimit(s)?wd.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.Jd=[],this.Kd=new $D([new GD,new rN,new YD,new KD,new tN,new eN,new QD,new nN],(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=[],f=u.split(`
19
+ `),p=c;f.length>p;p++){var m=f[p];if(1024>=m.length){var _=W4.test(m)?m.replace(W4,"$1"):m;if(!_.match(/\S*Error: /)){for(var x of i){var y=x(_,r);if(y){d.push(y);break}}if(d.length>=50)break}}}return(function(w){if(!w.length)return[];var S=Array.from(w);return S.reverse(),S.slice(0,50).map((C=>{return ue({},C,{filename:C.filename||(P=S,P[P.length-1]||{}).filename,function:C.function||ac});var P}))})(d)}})("web:javascript",BD,ZD)),this._instance=t,this.Jd=(e=(n=this._instance.persistence)==null?void 0:n.get_property($y))!==null&&e!==void 0?e:[],this.Yd=Tm(this.Xd()),this.tv=new iN(this.Yd)}onConfigChange(){this.Yd=Tm(this.Xd()),this.tv.setConfig(this.Yd)}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.Jd=i,this._instance.persistence&&this._instance.persistence.register({[$y]:this.Jd,[Hy]:a})}}}get ev(){var t,e=!!this._instance.get_property(Hy),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Kd.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Yd.enabled)try{if(!ut(t)||t.trim().length===0)return void Hs.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)=>sN.has(c)?(a.push(c),u):(u[c]=i[c],u)),{}),droppedKeys:a}})(this.iv(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&Hs.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.tv.add(ue({[Cm]:t,[Pm]:new Date().toISOString()},r))}catch(i){Hs.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.rv(e)){if(this.nv(e))return this.sv("Exception dropped: matched a suppression rule"),void Hs.info("Skipping exception capture because a suppression rule matched");if(!this.ev&&this.av(e))return this.sv("Exception dropped: thrown by a browser extension"),void Hs.info("Skipping exception capture because it was thrown by an extension");if(!this.ev&&this.ov(e))return this.sv("Exception dropped: thrown by an injected browser script"),void Hs.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.lv(e))return this.sv("Exception dropped: thrown by the PostHog SDK"),void Hs.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.Yd.enabled&&Qe(t.$exception_steps)?this.uv(t):t,r=typeof(i=globalThis._posthogReleaseId)=="string"&&i.length>0?i:void 0;r&&(n.$release_id=r);try{var s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",yl:!0});return s&&this.tv.clear(),s}catch(a){return Hs.error("Failed to capture exception event. Dropping this exception.",a),void this.tv.clear()}}catch(a){return void Hs.error("Failed to process exception event. Ignoring this exception.",a)}var i}uv(t){try{var e=this.tv.getAttachable();return e.length===0?t:ue({},t,{$exception_steps:e})}catch(n){return Hs.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}sv(t){this.Yd.enabled&&this.tv.add({[Cm]:t,[Pm]:new Date().toISOString()})}iv(t){return bt(t)?ue({},t):{}}Xd(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}nv(t){if(t.length===0)return!1;try{var e=t.reduce(((n,r)=>{var s=r.type,i=r.value;return ut(s)&&s.length>0&&n.$exception_types.push(s),ut(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.Jd.some((n=>{var r=n.values.map((s=>{var i=u3[s.operator],a=e[s.key];if(!i||!a)return!1;var u=Ge(s.value)?s.value:[s.value];return u.length>0&&i(u,a)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}catch(n){return Hs.warn("Failed to evaluate suppression rules. Capturing the exception.",n),!1}}av(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=>{var n=e.filename;return!!n&&A9.some((r=>n.startsWith(r)))}))}ov(t){return t.some((e=>{var n=e.value;return ut(n)&&M9.some((r=>n.includes(r)))}))}lv(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}rv(t){return!Qe(t)&&Ge(t)}}},j9=ue({productTours:class{get Za(){return this._instance.persistence}constructor(t){this.hv=null,this.dv=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.Za&&this.Za.register({[G2]:!!e.productTours}),!l1(this._instance))return!this.hv&&Qe((n=this.Za)==null?void 0:n.props[Ad])||yp.info("product tours disabled; stopping and clearing cached tours"),(r=this.hv)==null||r.stop(),this.hv=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.hv&&l1(this._instance)&&this.Ts((()=>this.vv()))}Ts(t){var e,n;(e=je.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?yp.error("Could not load product tours script",r):t()}))}vv(){var t;!this.hv&&(t=je.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.hv=je.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!Ge(this.dv)||e){var n=this.Za;if(n){var r=n.props[Ad];if(Ge(r)&&!e)return this.dv=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:s=>{if(l1(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return i===0?s.error||yp.warn(a):yp.error(a),void t([],{isLoaded:!1,error:a})}var u=Ge(s.json.product_tours)?s.json.product_tours:[];this.dv=u,n&&n.register({[Ad]:u}),t(u,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.dv,{isLoaded:!0})}getActiveProductTours(t){Qe(this.hv)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.hv.getActiveProductTours(t)}showProductTour(t){var e;(e=this.hv)==null||e.showTourById(t)}previewTour(t){this.hv?this.hv.previewTour(t):this.Ts((()=>{var e;this.vv(),(e=this.hv)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.hv)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.hv)==null||t.nextStep()}previousStep(){var t;(t=this.hv)==null||t.previousStep()}clearCache(){var t;this.dv=null,(t=this.Za)==null||t.unregister(Ad)}resetTour(t){var e;(e=this.hv)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.hv)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.hv)==null||e.cancelPendingTour(t)}}},E0),F9={siteApps:class{constructor(t){this.fv=0,this._instance=t,this.pv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}gv(t,e){if(e){var n=this.globalsForEvent(e);this.pv.push(n),this.pv.length>1e3&&(this.pv=this.pv.slice(10))}}get siteAppLoaders(){var t;return(t=je._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.gv.bind(this));this.mv=()=>{t(),this.pv=[],this.mv=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")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(f)){var m=p[0];c[m]={id:d[m],type:m,properties:p[1]}}var _=t.$set_once,x=t.$set;return{event:ue({},I6(t,b9),{properties:ue({},t.properties,x?{$set:ue({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},x)}:{},_?{$set_once:ue({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},_)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(u=t.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}yv(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)||(ui.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)||(ui.error("prepare_external_dependency_script returned null"),null):t}bv(){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=fe==null?void 0:fe.defaultView,d=c==null||(t=c.Node)==null?void 0:t.prototype;if(!c||!d)return()=>{};if(this.fv++,this._v)return this.wv();var f=[],p=this,m=new WeakSet,_=(w,S,C)=>{if(w!=null&&w[S]){var P=w[S];w[S]=C(P),f.push((()=>{w[S]=P}))}},x=w=>{if(m.has(w))return w;var S=p.yv(w);return S&&m.add(S),S},y=w=>w.map((S=>typeof S=="string"?S:x(S))).filter((S=>!Xn(S)));return _(d,"appendChild",(w=>function(S){var C=x(S);return C?w.call(this,C):S})),_(d,"insertBefore",(w=>function(S,C){var P=x(S);return P?w.call(this,P,C):S})),_(d,"replaceChild",(w=>function(S,C){var P=x(S);return P?w.call(this,P,C):C})),[(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((w=>{_(w,"append",(S=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return S.apply(this,y(P))})),_(w,"prepend",(S=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return S.apply(this,y(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((w=>{_(w,"before",(S=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return S.apply(this,y(P))})),_(w,"after",(S=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return S.apply(this,y(P))})),_(w,"replaceWith",(S=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];var I=y(P);return P.length&&!I.length?void 0:S.apply(this,I)}))})),_((u=c.Element)==null?void 0:u.prototype,"insertAdjacentElement",(w=>function(S,C){var P=x(C);return P?w.call(this,S,P):null})),this._v=()=>{f.forEach((w=>w())),this._v=void 0},this.wv()}wv(){var t=!1;return()=>{var e;t||(t=!0,this.fv--,this.fv===0&&((e=this._v)==null||e.call(this)))}}Sv(t,e){e===void 0&&(e=!0);var n=this.bv();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.pv.length&&(ui.info("Processing "+this.pv.length+" events for site app with id "+t.id),this.pv.forEach((u=>this.Sv((()=>e.processEvent==null?void 0:e.processEvent(u))))),e.processedBuffer=!0),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((a=this.mv)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,ui.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var i=this.Sv((a=>t.init({posthog:this._instance,callback(u){a(),s(u)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(a){ui.error(ME+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){ui.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}xv(){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)}Cv(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.Sv((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){ui.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.xv(),void this._instance.on("eventCaptured",(c=>this.Cv(c)))):void ui.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.mv)==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,f=u.url;je["__$$ph_site_app_"+d]=s._instance,(c=je.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(s._instance,f,(p=>{if(p)return ui.error(ME+d,p)}))};for(var u of i.siteApps)a()}else ui.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},V9={tracingHeaders:class{constructor(t){this.Tv=void 0,this.Mv=void 0,this.Ev=void 0,this.Bd=()=>{var e,n,r=this.Iv();r?(de(this.Tv)&&(this.Tv=(e=je.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),de(this.Mv)&&(this.Mv=(n=je.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Gd()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Ts(t){var e,n;(e=je.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return y9.error("failed to load script",r);t()}))}Rv(){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}Iv(){var t=this.Rv();return Ge(t)?(Ge(this.Ev)?this.Ev.splice(0,this.Ev.length,...t):this.Ev=[...t],t.length>0?this.Ev:void 0):(Ge(this.Ev)&&this.Ev.splice(0),this.Ev=t||void 0,this.Ev)}Gd(){var t,e;(t=this.Tv)==null||t.call(this),(e=this.Mv)==null||e.call(this),this.Tv=void 0,this.Mv=void 0}startIfEnabledOrStop(){this.Iv()?this.Ts(this.Bd):this.Gd()}}},$9=ue({surveys:class extends S9{constructor(t){var e;super(new T9(t),{get projectToken(){return e.config.token},kv:new P9(e=t)}),this._instance=t}Hl(t,e){var n=e.query?jf(t,e.query):t;return new Promise((r=>{var s;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((s=e.target)!==null&&s!==void 0?s:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:r})}))}}},E0),H9={toolbar:class{constructor(t){this.instance=t}Pv(t){je.ph_toolbar_state=t}Av(){var t;return(t=je.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),Qy(this.instance.config)||!ne||!fe)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=I9||Fm(t.hash,"__posthog")||Fm(t.hash,"state"),i=s?G4((()=>JSON.parse(atob(decodeURIComponent(s)))))||G4((()=>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(OE)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Fv(t){var e=je.ph_load_toolbar||je.ph_load_editor;!Qe(e)&&ar(e)?e(t,this.instance):DE.warn("No toolbar load function found")}loadToolbar(t){var e=!(fe==null||!fe.getElementById(CP));if(!ne||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=ue({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ne.localStorage.setItem(OE,JSON.stringify(ue({},r,{source:void 0}))),this.Av()===2)this.Fv(r);else if(this.Av()===0){var s;this.Pv(1),(s=je.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return DE.error("[Toolbar] Failed to load",i),void this.Pv(0);this.Pv(2),this.Fv(r)})),It(ne,"turbolinks:load",(()=>{this.Pv(0),this.loadToolbar(r)}))}return!0}Ov(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)}}},z9=ue({experiments:ir},E0),U9={conversations:class{constructor(t){this.Lv=void 0,this._conversationsManager=null,this.Dv=!1,this.Me=null,this.$v=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Nv=t.ok,t.ok)){var e=t.config.conversations;Qe(e)||(wr(e)?this.Lv=e:(this.Lv=e.enabled,this.Me=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Lv=void 0,this.Me=null,this.Nv=void 0,this.$v=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Dv||this._instance.config.disable_conversations||Qy(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=je==null?void 0:je.__PosthogExtensions__;if(t&&!de(this.Lv)&&this.Lv)if(this.Me&&this.Me.token){this.Dv=!0;try{var e=t.initConversations;if(e)return this.qv(e),void(this.Dv=!1);var n=t.loadExternalDependency;if(!n)return void this.jv(Y2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.jv("Could not load conversations script",r):this.qv(t.initConversations),this.Dv=!1}))}catch(r){this.jv("Error initializing conversations",r),this.Dv=!1}}else Es.error("Conversations enabled but missing token in remote config.")}}qv(t){if(this.Me)try{this._conversationsManager=t(this.Me,this._instance),this.$v=!1,Es.info("Conversations loaded successfully")}catch(e){this.jv("Error completing conversations initialization",e)}else Es.error("Cannot complete initialization: remote config is null")}jv(t,e){Es.error(t,e),this._conversationsManager=null,this.Dv=!1,this.$v=!0}show(){this._conversationsManager?this._conversationsManager.show():Es.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Lv===!0&&!Xn(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Qy(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Nv===!1?"remote_config_failed":de(this.Lv)?this.Nv?"disabled_in_project":"remote_config_pending":this.Lv?Qe(this.Me)||!this.Me.token?"missing_token":je!=null&&je.__PosthogExtensions__?this.Dv?"initializing":this.$v?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}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 Tt((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Es.warn(qa),null)}))()}getMessages(t,e){var n=this;return Tt((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Es.warn(qa),null)}))()}markAsRead(t){var e=this;return Tt((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Es.warn(qa),null)}))()}getTickets(t){var e=this;return Tt((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Es.warn(qa),null)}))()}requestRestoreLink(t){var e=this;return Tt((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Es.warn(qa),null)}))()}restoreFromToken(t){var e=this;return Tt((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Es.warn(qa),null)}))()}restoreFromUrlToken(){var t=this;return Tt((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Es.warn(qa),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}Ml(){var t;(t=this._conversationsManager)==null||t.setIdentity()}El(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},B9={logs:class{constructor(t){var e,n=this;this.name="logs",this.Bv=!1,this.Hv=!1,this.Uv=!1,this.I=jt("[logs]"),this.zv=ue({},this.I,{error(){for(var r=arguments.length,s=new Array(r),i=0;r>i;i++)s[i]=arguments[i];s.some(UE)||n.I.error(...s)}}),this.Ta=[],this.Wv=[],this.bh=0,this.os=!1,this.Vv=()=>{var r,s;this.os||(this.bh=0,(r=this.Gv)==null||r.onReconnect(),(s=this.Zv)==null||s.onReconnect())},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Bv=!0),ne&&It(ne,"online",this.Vv)}Qv(t,e,n,r){var s,i=(function(a,u){var c,d,f,p,m,_,x,y=(c=a==null?void 0:a.flushIntervalMs)!==null&&c!==void 0?c:3e3,w=(d=a==null?void 0:a.maxBufferSize)!==null&&d!==void 0?d:100,S=u!=null&&u.consoleCapture?void 0:(f=a==null?void 0:a.maxLogsPerInterval)!==null&&f!==void 0?f:1e3,C=de(S)?Math.max(w,2048):Math.max(w,S),P=a==null?void 0:a.resourceAttributes;return{serviceName:(p=(m=P==null?void 0:P["service.name"])!==null&&m!==void 0?m:a==null?void 0:a.serviceName)!==null&&p!==void 0?p:u==null?void 0:u.serviceNameDefault,serviceVersion:(_=P==null?void 0:P["service.version"])!==null&&_!==void 0?_:a==null?void 0:a.serviceVersion,environment:(x=P==null?void 0:P["deployment.environment"])!==null&&x!==void 0?x:a==null?void 0:a.environment,resourceAttributes:P,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:y,maxBufferSize:w,maxQueueSize:C,maxBatchRecordsPerPost:100,rateCapWindowMs:y,maxLogsPerInterval:S,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new jD(this.Jv(t,e),i,this.zv,(()=>this.Kv()),(a=>a()),void 0,r),i]}Yv(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Gv||this.Xv!==e){var n;(n=this.Gv)==null||n.reset(),this.Xv=e;var r=this.Qv((()=>this.Ta),(s=>{this.Ta=s}));this.Gv=r[0],this.tc=r[1]}return this.Gv}ec(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Zv||this.ic!==e){var n;(n=this.Zv)==null||n.reset(),this.ic=e;var r=this.Qv((()=>this.Wv),(s=>{this.Wv=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},zE);this.Zv=r[0],this.rc=r[1]}return this.Zv}setup(t){if(!this.os){this.ds=t;var e=!1,n=t.onRemoteConfig((r=>{var s;e=r.ok&&((s=r.config.logs)==null?void 0:s.captureConsoleLogs)===!0,this.onRemoteConfig(r)}));this.os?n.dispose():(this.vs=n,e||this.loadIfEnabled())}}dispose(){var t,e,n,r;this.os||(this.os=!0,(t=this.vs)==null||t.dispose(),this.vs=void 0,this.ds=void 0,this.Uv=!1,ne==null||ne.removeEventListener("online",this.Vv),(e=this.nc)==null||e.call(this),this.nc=void 0,(n=this.Gv)==null||n.reset(),(r=this.Zv)==null||r.reset())}onRemoteConfig(t){var e;if(!this.os&&t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!Qe(n)&&n&&(this.Bv=!0,this.loadIfEnabled())}}reset(){var t,e;this.Ta=[],(t=this.Gv)==null||t.reset(),this.Wv=[],(e=this.Zv)==null||e.reset(),this.bh=0}captureLog(t){this.os||this.Yv().captureLog(t)}captureConsoleLog(t){this.os||this.ec().captureLog(t)}get logger(){return this.sc||(this.sc={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.sc}flushLogs(t){t?this.ac(t):(this.Gv&&this.Gv.flush().catch((e=>this.oc(e))),this.Zv&&this.Zv.flush().catch((e=>this.oc(e))))}oc(t){UE(t)||this.I.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.os&&this.Bv&&!this.Hv&&!this.Uv){var t=je==null?void 0:je.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;if(e){this.Uv=!0;try{e(this._instance,"logs",(n=>{if(this.Uv=!1,!this.os){var r,s=t.logs;n||s==null||!s.initializeLogs?this.I.error("Could not load logs script",n):(this.nc=s.initializeLogs((r=this.ds)!==null&&r!==void 0?r:this._instance),this.Hv=!0)}}))}catch(n){throw this.Uv=!1,n}}else this.I.error(Y2)}else this.I.error("PostHog Extensions not found.")}}Jv(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===eo.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===eo.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},Fn:r=>this.Fn(r),getLibraryId:()=>Pt.LIB_NAME,getLibraryVersion:()=>Pt.LIB_VERSION}}Fn(t){return new Promise((e=>{if(VP(this.bh,3))e({kind:"fatal",error:c1(void 0,"logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout((()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:c1(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.lc(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this.uc(a),a>=200&&300>a)r({kind:"ok"});else if(a===413)r({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)r({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var u;a===0?(i.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:c1(i.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(u=i.error)!==null&&u!==void 0?u:new Error("logs request failed with status "+a)})}}})}}))}uc(t){(t!==0||this._instance.__loaded)&&(this.bh=$P(t,this.bh,3,(()=>this.I.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."))))}ac(t){this.Ta.length>0&&this.hc(t,this.Ta,this.tc,Pt.LIB_NAME,(e=>{this.Ta=e})),this.Wv.length>0&&this.hc(t,this.Wv,this.rc,zE,(e=>{this.Wv=e}))}hc(t,e,n,r,s){if(e.length!==0){var i=e.map((u=>u.record));s([]);var a=lP(i,aP(n,Pt.LIB_NAME,Pt.LIB_VERSION),r,Pt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.lc(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}lc(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Kv(){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,Qe(s)||(e.sessionStartTimestamp=s),Qe(i)||(e.lastActivityTimestamp=i)}if(je!=null&&(t=je.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ca(je.location.href):je.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},W9={metrics:class{constructor(t){this.I=jt("[metrics]"),this._instance=t}initialize(){}Yv(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.Gv&&this.Xv===n||((e=this.Gv)==null||e.reset(),this.Xv=n,this.Gv=new FD(this.Jv(),(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.I)),this.Gv}count(t,e,n){e===void 0&&(e=1),this.Yv().count(t,e,n)}gauge(t,e,n){this.Yv().gauge(t,e,n)}histogram(t,e,n){this.Yv().histogram(t,e,n)}flush(t){if(!this.Gv)return Promise.resolve();if(t){var e=this.Gv.drainWindow();return e&&this.Qn(e,t),Promise.resolve()}return this.Gv.flush().catch((n=>this.I.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.Gv)==null||t.reset()}Jv(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Qn:n=>e.Qn(n),getLibraryId:()=>Pt.LIB_NAME,getLibraryVersion:()=>Pt.LIB_VERSION}}Qn(t,e){return new Promise((n=>{var r=!1,s=a=>{r||(r=!0,clearTimeout(i),n(a))},i=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(ue({method:"POST",url:this.dc(),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!==408&&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)})}}}))}))}dc(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},q9=ue({},E0,O9,D9,N9,j9,F9,$9,V9,H9,z9,U9,B9,W9);ts.__defaultExtensionClasses=ue({},q9);var Ee=(function(){Pt.SDK_DIST_CHANNEL="npm";var t=$d[bu]=new ts;return(function(){function e(){e.done||(e.done=!0,p3=!1,_t($d,(function(n){n._dom_loaded()})))}fe!=null&&fe.addEventListener?fe.readyState==="complete"?e():It(fe,"DOMContentLoaded",e,{capture:!1}):ne&&ge.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),y3;function Z9(t){y3=t}function c_(){return y3}var rx=v.createContext({get client(){return c_()},bootstrap:void 0});function _3(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)||!_3(t[u],e[u],n))return!1}return!0}function G9(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=c_();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=c_(),f=u.current;f?(i!==f.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!_3(a,f.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)]),we.createElement(rx.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 d1=function(t){return typeof t=="function"},K9=function(t){return t===void 0},Ff=function(){var t=v.useContext(rx).client;return t},d_=function(t,e){return d_=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])},d_(t,e)};function Y9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");d_(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Kp=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},X9=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!Kp(r.cause)){K9(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},Q9=function(t,e){if(!e)return t;var n=new Error(Kp(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return n.name="React ErrorBoundary ".concat(Kp(t)?t.name:"Error"),n.stack=e,Kp(t)?(X9(t,n),t):n},J9={componentStack:null,exceptionEvent:null,error:null},ej={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},tj=(function(t){Y9(e,t);function e(n){var r=t.call(this,n)||this;return r.state=J9,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;d1(s)?i=s(n,r):typeof s=="object"&&(i=s);var a=this.context.client,u=r.componentStack,c=a.captureException(Q9(n,u),i);this.setState({error:n,componentStack:u??null,exceptionEvent:c})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return d1(r)?r():r;var a=d1(s)?we.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return we.isValidElement(a)?a:(console.warn(ej.INVALID_FALLBACK),we.createElement(we.Fragment,null))},e.contextType=rx,e})(we.Component);Z9(Ee);var _p={},f1={exports:{}},Nr={},h1={exports:{}},p1={};/**
20
+ * @license React
21
+ * scheduler.production.min.js
22
+ *
23
+ * Copyright (c) Facebook, Inc. and its affiliates.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */var BE;function nj(){return BE||(BE=1,(function(t){function e(H,X){var z=H.length;H.push(X);e:for(;0<z;){var N=z-1>>>1,Y=H[N];if(0<s(Y,X))H[N]=X,H[z]=Y,z=N;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var X=H[0],z=H.pop();if(z!==X){H[0]=z;e:for(var N=0,Y=H.length,oe=Y>>>1;N<oe;){var J=2*(N+1)-1,se=H[J],pe=J+1,Se=H[pe];if(0>s(se,z))pe<Y&&0>s(Se,se)?(H[N]=Se,H[pe]=z,N=pe):(H[N]=se,H[J]=z,N=J);else if(pe<Y&&0>s(Se,z))H[N]=Se,H[pe]=z,N=pe;else break e}}return X}function s(H,X){var z=H.sortIndex-X.sortIndex;return z!==0?z:H.id-X.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=[],f=1,p=null,m=3,_=!1,x=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,C=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(H){for(var X=n(d);X!==null;){if(X.callback===null)r(d);else if(X.startTime<=H)r(d),X.sortIndex=X.expirationTime,e(c,X);else break;X=n(d)}}function T(H){if(y=!1,P(H),!x)if(n(c)!==null)x=!0,q(I);else{var X=n(d);X!==null&&W(T,X.startTime-H)}}function I(H,X){x=!1,y&&(y=!1,S(R),R=-1),_=!0;var z=m;try{for(P(X),p=n(c);p!==null&&(!(p.expirationTime>X)||H&&!j());){var N=p.callback;if(typeof N=="function"){p.callback=null,m=p.priorityLevel;var Y=N(p.expirationTime<=X);X=t.unstable_now(),typeof Y=="function"?p.callback=Y:p===n(c)&&r(c),P(X)}else r(c);p=n(c)}if(p!==null)var oe=!0;else{var J=n(d);J!==null&&W(T,J.startTime-X),oe=!1}return oe}finally{p=null,m=z,_=!1}}var A=!1,O=null,R=-1,L=5,D=-1;function j(){return!(t.unstable_now()-D<L)}function F(){if(O!==null){var H=t.unstable_now();D=H;var X=!0;try{X=O(!0,H)}finally{X?Z():(A=!1,O=null)}}else A=!1}var Z;if(typeof C=="function")Z=function(){C(F)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,K=Q.port2;Q.port1.onmessage=F,Z=function(){K.postMessage(null)}}else Z=function(){w(F,0)};function q(H){O=H,A||(A=!0,Z())}function W(H,X){R=w(function(){H(t.unstable_now())},X)}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(H){H.callback=null},t.unstable_continueExecution=function(){x||_||(x=!0,q(I))},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(H){switch(m){case 1:case 2:case 3:var X=3;break;default:X=m}var z=m;m=X;try{return H()}finally{m=z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(H,X){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var z=m;m=H;try{return X()}finally{m=z}},t.unstable_scheduleCallback=function(H,X,z){var N=t.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?N+z:N):z=N,H){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,H={id:f++,callback:X,priorityLevel:H,startTime:z,expirationTime:Y,sortIndex:-1},z>N?(H.sortIndex=z,e(d,H),n(c)===null&&H===n(d)&&(y?(S(R),R=-1):y=!0,W(T,z-N))):(H.sortIndex=Y,e(c,H),x||_||(x=!0,q(I))),H},t.unstable_shouldYield=j,t.unstable_wrapCallback=function(H){var X=m;return function(){var z=m;m=X;try{return H.apply(this,arguments)}finally{m=z}}}})(p1)),p1}var WE;function rj(){return WE||(WE=1,h1.exports=nj()),h1.exports}/**
28
+ * @license React
29
+ * react-dom.production.min.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */var qE;function sj(){if(qE)return Nr;qE=1;var t=L2(),e=rj();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,h=1;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h]);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]*$/,f={},p={};function m(o){return c.call(p,o)?!0:c.call(f,o)?!1:d.test(o)?p[o]=!0:(f[o]=!0,!1)}function _(o,l,h,g){if(h!==null&&h.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:h!==null?!h.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function x(o,l,h,g){if(l===null||typeof l>"u"||_(o,l,h,g))return!0;if(g)return!1;if(h!==null)switch(h.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function y(o,l,h,g,b,k,M){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=b,this.mustUseProperty=h,this.propertyName=o,this.type=l,this.sanitizeURL=k,this.removeEmptyString=M}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new y(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];w[l]=new y(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new y(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new y(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){w[o]=new y(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new y(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new y(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new y(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new y(o,5,!1,o.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function C(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var l=o.replace(S,C);w[l]=new y(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(S,C);w[l]=new y(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(S,C);w[l]=new y(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new y(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new y(o,1,!1,o.toLowerCase(),null,!0,!0)});function P(o,l,h,g){var b=w.hasOwnProperty(l)?w[l]:null;(b!==null?b.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(x(l,h,b,g)&&(h=null),g||b===null?m(l)&&(h===null?o.removeAttribute(l):o.setAttribute(l,""+h)):b.mustUseProperty?o[b.propertyName]=h===null?b.type===3?!1:"":h:(l=b.attributeName,g=b.attributeNamespace,h===null?o.removeAttribute(l):(b=b.type,h=b===3||b===4&&h===!0?"":""+h,g?o.setAttributeNS(g,l,h):o.setAttribute(l,h))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),A=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),j=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),H=Symbol.iterator;function X(o){return o===null||typeof o!="object"?null:(o=H&&o[H]||o["@@iterator"],typeof o=="function"?o:null)}var z=Object.assign,N;function Y(o){if(N===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);N=l&&l[1]||""}return`
36
+ `+N+o}var oe=!1;function J(o,l){if(!o||oe)return"";oe=!0;var h=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(`
37
+ `),k=g.stack.split(`
38
+ `),M=b.length-1,$=k.length-1;1<=M&&0<=$&&b[M]!==k[$];)$--;for(;1<=M&&0<=$;M--,$--)if(b[M]!==k[$]){if(M!==1||$!==1)do if(M--,$--,0>$||b[M]!==k[$]){var B=`
39
+ `+b[M].replace(" at new "," at ");return o.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",o.displayName)),B}while(1<=M&&0<=$);break}}}finally{oe=!1,Error.prepareStackTrace=h}return(o=o?o.displayName||o.name:"")?Y(o):""}function se(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=J(o.type,!1),o;case 11:return o=J(o.type.render,!1),o;case 1:return o=J(o.type,!0),o;default:return""}}function pe(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 A:return"Portal";case L:return"Profiler";case R:return"StrictMode";case Z:return"Suspense";case Q:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case j:return(o.displayName||"Context")+".Consumer";case D: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 K:return l=o.displayName||null,l!==null?l:pe(o.type)||"Memo";case q:l=o._payload,o=o._init;try{return pe(o(l))}catch{}}return null}function Se(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 pe(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 ce(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ae(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function $e(o){var l=ae(o)?"checked":"value",h=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),g=""+o[l];if(!o.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var b=h.get,k=h.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return b.call(this)},set:function(M){g=""+M,k.call(this,M)}}),Object.defineProperty(o,l,{enumerable:h.enumerable}),{getValue:function(){return g},setValue:function(M){g=""+M},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function We(o){o._valueTracker||(o._valueTracker=$e(o))}function He(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var h=l.getValue(),g="";return o&&(g=ae(o)?o.checked?"true":"false":o.value),o=g,o!==h?(l.setValue(o),!0):!1}function Fe(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 ct(o,l){var h=l.checked;return z({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??o._wrapperState.initialChecked})}function Gt(o,l){var h=l.defaultValue==null?"":l.defaultValue,g=l.checked!=null?l.checked:l.defaultChecked;h=ce(l.value!=null?l.value:h),o._wrapperState={initialChecked:g,initialValue:h,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function rt(o,l){l=l.checked,l!=null&&P(o,"checked",l,!1)}function Ve(o,l){rt(o,l);var h=ce(l.value),g=l.type;if(h!=null)g==="number"?(h===0&&o.value===""||o.value!=h)&&(o.value=""+h):o.value!==""+h&&(o.value=""+h);else if(g==="submit"||g==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?Je(o,l.type,h):l.hasOwnProperty("defaultValue")&&Je(o,l.type,ce(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function Oe(o,l,h){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,h||l===o.value||(o.value=l),o.defaultValue=l}h=o.name,h!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,h!==""&&(o.name=h)}function Je(o,l,h){(l!=="number"||Fe(o.ownerDocument)!==o)&&(h==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+h&&(o.defaultValue=""+h))}var kt=Array.isArray;function vt(o,l,h,g){if(o=o.options,l){l={};for(var b=0;b<h.length;b++)l["$"+h[b]]=!0;for(h=0;h<o.length;h++)b=l.hasOwnProperty("$"+o[h].value),o[h].selected!==b&&(o[h].selected=b),b&&g&&(o[h].defaultSelected=!0)}else{for(h=""+ce(h),l=null,b=0;b<o.length;b++){if(o[b].value===h){o[b].selected=!0,g&&(o[b].defaultSelected=!0);return}l!==null||o[b].disabled||(l=o[b])}l!==null&&(l.selected=!0)}}function xe(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return z({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function sn(o,l){var h=l.value;if(h==null){if(h=l.children,l=l.defaultValue,h!=null){if(l!=null)throw Error(n(92));if(kt(h)){if(1<h.length)throw Error(n(93));h=h[0]}l=h}l==null&&(l=""),h=l}o._wrapperState={initialValue:ce(h)}}function Ot(o,l){var h=ce(l.value),g=ce(l.defaultValue);h!=null&&(h=""+h,h!==o.value&&(o.value=h),l.defaultValue==null&&o.defaultValue!==h&&(o.defaultValue=h)),g!=null&&(o.defaultValue=""+g)}function Kr(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function Pa(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 on(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?Pa(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var wn,Ta=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,h,g,b){MSApp.execUnsafeLocalFunction(function(){return o(l,h,g,b)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(wn=wn||document.createElement("div"),wn.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=wn.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function fr(o,l){if(l){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=l;return}}o.textContent=l}var an={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},Eo=["Webkit","ms","Moz","O"];Object.keys(an).forEach(function(o){Eo.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),an[l]=an[o]})});function Un(o,l,h){return l==null||typeof l=="boolean"||l===""?"":h||typeof l!="number"||l===0||an.hasOwnProperty(o)&&an[o]?(""+l).trim():l+"px"}function ti(o,l){o=o.style;for(var h in l)if(l.hasOwnProperty(h)){var g=h.indexOf("--")===0,b=Un(h,l[h],g);h==="float"&&(h="cssFloat"),g?o.setProperty(h,b):o[h]=b}}var hs=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 ps(o,l){if(l){if(hs[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 ko(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 er=null;function On(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Os=null,bn=null,Cr=null;function Ni(o){if(o=Qc(o)){if(typeof Os!="function")throw Error(n(280));var l=o.stateNode;l&&(l=xh(l),Os(o.stateNode,o.type,l))}}function ni(o){bn?Cr?Cr.push(o):Cr=[o]:bn=o}function ms(){if(bn){var o=bn,l=Cr;if(Cr=bn=null,Ni(o),l)for(o=0;o<l.length;o++)Ni(l[o])}}function Ze(o,l){return o(l)}function Dt(){}var Kt=!1;function mn(o,l,h){if(Kt)return o(l,h);Kt=!0;try{return Ze(o,l,h)}finally{Kt=!1,(bn!==null||Cr!==null)&&(Dt(),ms())}}function hr(o,l){var h=o.stateNode;if(h===null)return null;var g=xh(h);if(g===null)return null;h=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(h&&typeof h!="function")throw Error(n(231,l,typeof h));return h}var Ft=!1;if(u)try{var ln={};Object.defineProperty(ln,"passive",{get:function(){Ft=!0}}),window.addEventListener("test",ln,ln),window.removeEventListener("test",ln,ln)}catch{Ft=!1}function Pr(o,l,h,g,b,k,M,$,B){var re=Array.prototype.slice.call(arguments,3);try{l.apply(h,re)}catch(ve){this.onError(ve)}}var Tr=!1,Bn=null,ri=!1,Pc=null,Tc={onError:function(o){Tr=!0,Bn=o}};function Ic(o,l,h,g,b,k,M,$,B){Tr=!1,Bn=null,Pr.apply(Tc,arguments)}function Xf(o,l,h,g,b,k,M,$,B){if(Ic.apply(this,arguments),Tr){if(Tr){var re=Bn;Tr=!1,Bn=null}else throw Error(n(198));ri||(ri=!0,Pc=re)}}function ji(o){var l=o,h=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(h=l.return),o=l.return;while(o)}return l.tag===3?h:null}function Qf(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 Rc(o){if(ji(o)!==o)throw Error(n(188))}function Q0(o){var l=o.alternate;if(!l){if(l=ji(o),l===null)throw Error(n(188));return l!==o?null:o}for(var h=o,g=l;;){var b=h.return;if(b===null)break;var k=b.alternate;if(k===null){if(g=b.return,g!==null){h=g;continue}break}if(b.child===k.child){for(k=b.child;k;){if(k===h)return Rc(b),o;if(k===g)return Rc(b),l;k=k.sibling}throw Error(n(188))}if(h.return!==g.return)h=b,g=k;else{for(var M=!1,$=b.child;$;){if($===h){M=!0,h=b,g=k;break}if($===g){M=!0,g=b,h=k;break}$=$.sibling}if(!M){for($=k.child;$;){if($===h){M=!0,h=k,g=b;break}if($===g){M=!0,g=k,h=b;break}$=$.sibling}if(!M)throw Error(n(189))}}if(h.alternate!==g)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?o:l}function Jf(o){return o=Q0(o),o!==null?jl(o):null}function jl(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=jl(o);if(l!==null)return l;o=o.sibling}return null}var eh=e.unstable_scheduleCallback,th=e.unstable_cancelCallback,J0=e.unstable_shouldYield,ev=e.unstable_requestPaint,Yt=e.unstable_now,Ac=e.unstable_getCurrentPriorityLevel,Mc=e.unstable_ImmediatePriority,nh=e.unstable_UserBlockingPriority,Fl=e.unstable_NormalPriority,Lc=e.unstable_LowPriority,Vl=e.unstable_IdlePriority,Ia=null,vs=null;function Kw(o){if(vs&&typeof vs.onCommitFiberRoot=="function")try{vs.onCommitFiberRoot(Ia,o,void 0,(o.current.flags&128)===128)}catch{}}var Dn=Math.clz32?Math.clz32:tv,rh=Math.log,Oc=Math.LN2;function tv(o){return o>>>=0,o===0?32:31-(rh(o)/Oc|0)|0}var $l=64,Ra=4194304;function si(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 Co(o,l){var h=o.pendingLanes;if(h===0)return 0;var g=0,b=o.suspendedLanes,k=o.pingedLanes,M=h&268435455;if(M!==0){var $=M&~b;$!==0?g=si($):(k&=M,k!==0&&(g=si(k)))}else M=h&~b,M!==0?g=si(M):k!==0&&(g=si(k));if(g===0)return 0;if(l!==0&&l!==g&&(l&b)===0&&(b=g&-g,k=l&-l,b>=k||b===16&&(k&4194240)!==0))return l;if((g&4)!==0&&(g|=h&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=g;0<l;)h=31-Dn(l),b=1<<h,g|=o[h],l&=~b;return g}function sh(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 ih(o,l){for(var h=o.suspendedLanes,g=o.pingedLanes,b=o.expirationTimes,k=o.pendingLanes;0<k;){var M=31-Dn(k),$=1<<M,B=b[M];B===-1?(($&h)===0||($&g)!==0)&&(b[M]=sh($,l)):B<=l&&(o.expiredLanes|=$),k&=~$}}function Hl(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Dc(){var o=$l;return $l<<=1,($l&4194240)===0&&($l=64),o}function V(o){for(var l=[],h=0;31>h;h++)l.push(o);return l}function ie(o,l,h){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-Dn(l),o[l]=h}function ke(o,l){var h=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<h;){var b=31-Dn(h),k=1<<b;l[b]=0,g[b]=-1,o[b]=-1,h&=~k}}function he(o,l){var h=o.entangledLanes|=l;for(o=o.entanglements;h;){var g=31-Dn(h),b=1<<g;b&l|o[g]&l&&(o[g]|=l),h&=~b}}var le=0;function ye(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var qe,De,Xt,Sn,Ir,gs=!1,pr=[],Ye=null,Ct=null,Rr=null,Nc=new Map,jc=new Map,Po=[],FM="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 Yw(o,l){switch(o){case"focusin":case"focusout":Ye=null;break;case"dragenter":case"dragleave":Ct=null;break;case"mouseover":case"mouseout":Rr=null;break;case"pointerover":case"pointerout":Nc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":jc.delete(l.pointerId)}}function Fc(o,l,h,g,b,k){return o===null||o.nativeEvent!==k?(o={blockedOn:l,domEventName:h,eventSystemFlags:g,nativeEvent:k,targetContainers:[b]},l!==null&&(l=Qc(l),l!==null&&De(l)),o):(o.eventSystemFlags|=g,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function VM(o,l,h,g,b){switch(l){case"focusin":return Ye=Fc(Ye,o,l,h,g,b),!0;case"dragenter":return Ct=Fc(Ct,o,l,h,g,b),!0;case"mouseover":return Rr=Fc(Rr,o,l,h,g,b),!0;case"pointerover":var k=b.pointerId;return Nc.set(k,Fc(Nc.get(k)||null,o,l,h,g,b)),!0;case"gotpointercapture":return k=b.pointerId,jc.set(k,Fc(jc.get(k)||null,o,l,h,g,b)),!0}return!1}function Xw(o){var l=Aa(o.target);if(l!==null){var h=ji(l);if(h!==null){if(l=h.tag,l===13){if(l=Qf(h),l!==null){o.blockedOn=l,Ir(o.priority,function(){Xt(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function oh(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var h=rv(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(h===null){h=o.nativeEvent;var g=new h.constructor(h.type,h);er=g,h.target.dispatchEvent(g),er=null}else return l=Qc(h),l!==null&&De(l),o.blockedOn=h,!1;l.shift()}return!0}function Qw(o,l,h){oh(o)&&h.delete(l)}function $M(){gs=!1,Ye!==null&&oh(Ye)&&(Ye=null),Ct!==null&&oh(Ct)&&(Ct=null),Rr!==null&&oh(Rr)&&(Rr=null),Nc.forEach(Qw),jc.forEach(Qw)}function Vc(o,l){o.blockedOn===l&&(o.blockedOn=null,gs||(gs=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,$M)))}function $c(o){function l(b){return Vc(b,o)}if(0<pr.length){Vc(pr[0],o);for(var h=1;h<pr.length;h++){var g=pr[h];g.blockedOn===o&&(g.blockedOn=null)}}for(Ye!==null&&Vc(Ye,o),Ct!==null&&Vc(Ct,o),Rr!==null&&Vc(Rr,o),Nc.forEach(l),jc.forEach(l),h=0;h<Po.length;h++)g=Po[h],g.blockedOn===o&&(g.blockedOn=null);for(;0<Po.length&&(h=Po[0],h.blockedOn===null);)Xw(h),h.blockedOn===null&&Po.shift()}var zl=T.ReactCurrentBatchConfig,ah=!0;function HM(o,l,h,g){var b=le,k=zl.transition;zl.transition=null;try{le=1,nv(o,l,h,g)}finally{le=b,zl.transition=k}}function zM(o,l,h,g){var b=le,k=zl.transition;zl.transition=null;try{le=4,nv(o,l,h,g)}finally{le=b,zl.transition=k}}function nv(o,l,h,g){if(ah){var b=rv(o,l,h,g);if(b===null)xv(o,l,g,lh,h),Yw(o,g);else if(VM(b,o,l,h,g))g.stopPropagation();else if(Yw(o,g),l&4&&-1<FM.indexOf(o)){for(;b!==null;){var k=Qc(b);if(k!==null&&qe(k),k=rv(o,l,h,g),k===null&&xv(o,l,g,lh,h),k===b)break;b=k}b!==null&&g.stopPropagation()}else xv(o,l,g,null,h)}}var lh=null;function rv(o,l,h,g){if(lh=null,o=On(g),o=Aa(o),o!==null)if(l=ji(o),l===null)o=null;else if(h=l.tag,h===13){if(o=Qf(l),o!==null)return o;o=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return lh=o,null}function Jw(o){switch(o){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ac()){case Mc:return 1;case nh:return 4;case Fl:case Lc:return 16;case Vl:return 536870912;default:return 16}default:return 16}}var To=null,sv=null,uh=null;function eb(){if(uh)return uh;var o,l=sv,h=l.length,g,b="value"in To?To.value:To.textContent,k=b.length;for(o=0;o<h&&l[o]===b[o];o++);var M=h-o;for(g=1;g<=M&&l[h-g]===b[k-g];g++);return uh=b.slice(o,1<g?1-g:void 0)}function ch(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 dh(){return!0}function tb(){return!1}function Yr(o){function l(h,g,b,k,M){this._reactName=h,this._targetInst=b,this.type=g,this.nativeEvent=k,this.target=M,this.currentTarget=null;for(var $ in o)o.hasOwnProperty($)&&(h=o[$],this[$]=h?h(k):k[$]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?dh:tb,this.isPropagationStopped=tb,this}return z(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=dh)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=dh)},persist:function(){},isPersistent:dh}),l}var Ul={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},iv=Yr(Ul),Hc=z({},Ul,{view:0,detail:0}),UM=Yr(Hc),ov,av,zc,fh=z({},Hc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uv,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!==zc&&(zc&&o.type==="mousemove"?(ov=o.screenX-zc.screenX,av=o.screenY-zc.screenY):av=ov=0,zc=o),ov)},movementY:function(o){return"movementY"in o?o.movementY:av}}),nb=Yr(fh),BM=z({},fh,{dataTransfer:0}),WM=Yr(BM),qM=z({},Hc,{relatedTarget:0}),lv=Yr(qM),ZM=z({},Ul,{animationName:0,elapsedTime:0,pseudoElement:0}),GM=Yr(ZM),KM=z({},Ul,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),YM=Yr(KM),XM=z({},Ul,{data:0}),rb=Yr(XM),QM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JM={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"},eL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tL(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=eL[o])?!!l[o]:!1}function uv(){return tL}var nL=z({},Hc,{key:function(o){if(o.key){var l=QM[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=ch(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?JM[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uv,charCode:function(o){return o.type==="keypress"?ch(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?ch(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),rL=Yr(nL),sL=z({},fh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sb=Yr(sL),iL=z({},Hc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uv}),oL=Yr(iL),aL=z({},Ul,{propertyName:0,elapsedTime:0,pseudoElement:0}),lL=Yr(aL),uL=z({},fh,{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}),cL=Yr(uL),dL=[9,13,27,32],cv=u&&"CompositionEvent"in window,Uc=null;u&&"documentMode"in document&&(Uc=document.documentMode);var fL=u&&"TextEvent"in window&&!Uc,ib=u&&(!cv||Uc&&8<Uc&&11>=Uc),ob=" ",ab=!1;function lb(o,l){switch(o){case"keyup":return dL.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ub(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Bl=!1;function hL(o,l){switch(o){case"compositionend":return ub(l);case"keypress":return l.which!==32?null:(ab=!0,ob);case"textInput":return o=l.data,o===ob&&ab?null:o;default:return null}}function pL(o,l){if(Bl)return o==="compositionend"||!cv&&lb(o,l)?(o=eb(),uh=sv=To=null,Bl=!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 ib&&l.locale!=="ko"?null:l.data;default:return null}}var mL={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 cb(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!mL[o.type]:l==="textarea"}function db(o,l,h,g){ni(g),l=gh(l,"onChange"),0<l.length&&(h=new iv("onChange","change",null,h,g),o.push({event:h,listeners:l}))}var Bc=null,Wc=null;function vL(o){Ib(o,0)}function hh(o){var l=Kl(o);if(He(l))return o}function gL(o,l){if(o==="change")return l}var fb=!1;if(u){var dv;if(u){var fv="oninput"in document;if(!fv){var hb=document.createElement("div");hb.setAttribute("oninput","return;"),fv=typeof hb.oninput=="function"}dv=fv}else dv=!1;fb=dv&&(!document.documentMode||9<document.documentMode)}function pb(){Bc&&(Bc.detachEvent("onpropertychange",mb),Wc=Bc=null)}function mb(o){if(o.propertyName==="value"&&hh(Wc)){var l=[];db(l,Wc,o,On(o)),mn(vL,l)}}function yL(o,l,h){o==="focusin"?(pb(),Bc=l,Wc=h,Bc.attachEvent("onpropertychange",mb)):o==="focusout"&&pb()}function _L(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return hh(Wc)}function xL(o,l){if(o==="click")return hh(l)}function wL(o,l){if(o==="input"||o==="change")return hh(l)}function bL(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ds=typeof Object.is=="function"?Object.is:bL;function qc(o,l){if(Ds(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var h=Object.keys(o),g=Object.keys(l);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var b=h[g];if(!c.call(l,b)||!Ds(o[b],l[b]))return!1}return!0}function vb(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function gb(o,l){var h=vb(o);o=0;for(var g;h;){if(h.nodeType===3){if(g=o+h.textContent.length,o<=l&&g>=l)return{node:h,offset:l-o};o=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=vb(h)}}function yb(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?yb(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function _b(){for(var o=window,l=Fe();l instanceof o.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)o=l.contentWindow;else break;l=Fe(o.document)}return l}function hv(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 SL(o){var l=_b(),h=o.focusedElem,g=o.selectionRange;if(l!==h&&h&&h.ownerDocument&&yb(h.ownerDocument.documentElement,h)){if(g!==null&&hv(h)){if(l=g.start,o=g.end,o===void 0&&(o=l),"selectionStart"in h)h.selectionStart=l,h.selectionEnd=Math.min(o,h.value.length);else if(o=(l=h.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var b=h.textContent.length,k=Math.min(g.start,b);g=g.end===void 0?k:Math.min(g.end,b),!o.extend&&k>g&&(b=g,g=k,k=b),b=gb(h,k);var M=gb(h,g);b&&M&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==M.node||o.focusOffset!==M.offset)&&(l=l.createRange(),l.setStart(b.node,b.offset),o.removeAllRanges(),k>g?(o.addRange(l),o.extend(M.node,M.offset)):(l.setEnd(M.node,M.offset),o.addRange(l)))}}for(l=[],o=h;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<l.length;h++)o=l[h],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var EL=u&&"documentMode"in document&&11>=document.documentMode,Wl=null,pv=null,Zc=null,mv=!1;function xb(o,l,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;mv||Wl==null||Wl!==Fe(g)||(g=Wl,"selectionStart"in g&&hv(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}),Zc&&qc(Zc,g)||(Zc=g,g=gh(pv,"onSelect"),0<g.length&&(l=new iv("onSelect","select",null,l,h),o.push({event:l,listeners:g}),l.target=Wl)))}function ph(o,l){var h={};return h[o.toLowerCase()]=l.toLowerCase(),h["Webkit"+o]="webkit"+l,h["Moz"+o]="moz"+l,h}var ql={animationend:ph("Animation","AnimationEnd"),animationiteration:ph("Animation","AnimationIteration"),animationstart:ph("Animation","AnimationStart"),transitionend:ph("Transition","TransitionEnd")},vv={},wb={};u&&(wb=document.createElement("div").style,"AnimationEvent"in window||(delete ql.animationend.animation,delete ql.animationiteration.animation,delete ql.animationstart.animation),"TransitionEvent"in window||delete ql.transitionend.transition);function mh(o){if(vv[o])return vv[o];if(!ql[o])return o;var l=ql[o],h;for(h in l)if(l.hasOwnProperty(h)&&h in wb)return vv[o]=l[h];return o}var bb=mh("animationend"),Sb=mh("animationiteration"),Eb=mh("animationstart"),kb=mh("transitionend"),Cb=new Map,Pb="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 Io(o,l){Cb.set(o,l),i(l,[o])}for(var gv=0;gv<Pb.length;gv++){var yv=Pb[gv],kL=yv.toLowerCase(),CL=yv[0].toUpperCase()+yv.slice(1);Io(kL,"on"+CL)}Io(bb,"onAnimationEnd"),Io(Sb,"onAnimationIteration"),Io(Eb,"onAnimationStart"),Io("dblclick","onDoubleClick"),Io("focusin","onFocus"),Io("focusout","onBlur"),Io(kb,"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 Gc="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(" "),PL=new Set("cancel close invalid load scroll toggle".split(" ").concat(Gc));function Tb(o,l,h){var g=o.type||"unknown-event";o.currentTarget=h,Xf(g,l,void 0,o),o.currentTarget=null}function Ib(o,l){l=(l&4)!==0;for(var h=0;h<o.length;h++){var g=o[h],b=g.event;g=g.listeners;e:{var k=void 0;if(l)for(var M=g.length-1;0<=M;M--){var $=g[M],B=$.instance,re=$.currentTarget;if($=$.listener,B!==k&&b.isPropagationStopped())break e;Tb(b,$,re),k=B}else for(M=0;M<g.length;M++){if($=g[M],B=$.instance,re=$.currentTarget,$=$.listener,B!==k&&b.isPropagationStopped())break e;Tb(b,$,re),k=B}}}if(ri)throw o=Pc,ri=!1,Pc=null,o}function Vt(o,l){var h=l[Cv];h===void 0&&(h=l[Cv]=new Set);var g=o+"__bubble";h.has(g)||(Rb(l,o,2,!1),h.add(g))}function _v(o,l,h){var g=0;l&&(g|=4),Rb(h,o,g,l)}var vh="_reactListening"+Math.random().toString(36).slice(2);function Kc(o){if(!o[vh]){o[vh]=!0,r.forEach(function(h){h!=="selectionchange"&&(PL.has(h)||_v(h,!1,o),_v(h,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[vh]||(l[vh]=!0,_v("selectionchange",!1,l))}}function Rb(o,l,h,g){switch(Jw(l)){case 1:var b=HM;break;case 4:b=zM;break;default:b=nv}h=b.bind(null,l,h,o),b=void 0,!Ft||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),g?b!==void 0?o.addEventListener(l,h,{capture:!0,passive:b}):o.addEventListener(l,h,!0):b!==void 0?o.addEventListener(l,h,{passive:b}):o.addEventListener(l,h,!1)}function xv(o,l,h,g,b){var k=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var M=g.tag;if(M===3||M===4){var $=g.stateNode.containerInfo;if($===b||$.nodeType===8&&$.parentNode===b)break;if(M===4)for(M=g.return;M!==null;){var B=M.tag;if((B===3||B===4)&&(B=M.stateNode.containerInfo,B===b||B.nodeType===8&&B.parentNode===b))return;M=M.return}for(;$!==null;){if(M=Aa($),M===null)return;if(B=M.tag,B===5||B===6){g=k=M;continue e}$=$.parentNode}}g=g.return}mn(function(){var re=k,ve=On(h),_e=[];e:{var me=Cb.get(o);if(me!==void 0){var Pe=iv,Ae=o;switch(o){case"keypress":if(ch(h)===0)break e;case"keydown":case"keyup":Pe=rL;break;case"focusin":Ae="focus",Pe=lv;break;case"focusout":Ae="blur",Pe=lv;break;case"beforeblur":case"afterblur":Pe=lv;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=nb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=WM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=oL;break;case bb:case Sb:case Eb:Pe=GM;break;case kb:Pe=lL;break;case"scroll":Pe=UM;break;case"wheel":Pe=cL;break;case"copy":case"cut":case"paste":Pe=YM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=sb}var Le=(l&4)!==0,vn=!Le&&o==="scroll",ee=Le?me!==null?me+"Capture":null:me;Le=[];for(var G=re,te;G!==null;){te=G;var be=te.stateNode;if(te.tag===5&&be!==null&&(te=be,ee!==null&&(be=hr(G,ee),be!=null&&Le.push(Yc(G,be,te)))),vn)break;G=G.return}0<Le.length&&(me=new Pe(me,Ae,null,h,ve),_e.push({event:me,listeners:Le}))}}if((l&7)===0){e:{if(me=o==="mouseover"||o==="pointerover",Pe=o==="mouseout"||o==="pointerout",me&&h!==er&&(Ae=h.relatedTarget||h.fromElement)&&(Aa(Ae)||Ae[Fi]))break e;if((Pe||me)&&(me=ve.window===ve?ve:(me=ve.ownerDocument)?me.defaultView||me.parentWindow:window,Pe?(Ae=h.relatedTarget||h.toElement,Pe=re,Ae=Ae?Aa(Ae):null,Ae!==null&&(vn=ji(Ae),Ae!==vn||Ae.tag!==5&&Ae.tag!==6)&&(Ae=null)):(Pe=null,Ae=re),Pe!==Ae)){if(Le=nb,be="onMouseLeave",ee="onMouseEnter",G="mouse",(o==="pointerout"||o==="pointerover")&&(Le=sb,be="onPointerLeave",ee="onPointerEnter",G="pointer"),vn=Pe==null?me:Kl(Pe),te=Ae==null?me:Kl(Ae),me=new Le(be,G+"leave",Pe,h,ve),me.target=vn,me.relatedTarget=te,be=null,Aa(ve)===re&&(Le=new Le(ee,G+"enter",Ae,h,ve),Le.target=te,Le.relatedTarget=vn,be=Le),vn=be,Pe&&Ae)t:{for(Le=Pe,ee=Ae,G=0,te=Le;te;te=Zl(te))G++;for(te=0,be=ee;be;be=Zl(be))te++;for(;0<G-te;)Le=Zl(Le),G--;for(;0<te-G;)ee=Zl(ee),te--;for(;G--;){if(Le===ee||ee!==null&&Le===ee.alternate)break t;Le=Zl(Le),ee=Zl(ee)}Le=null}else Le=null;Pe!==null&&Ab(_e,me,Pe,Le,!1),Ae!==null&&vn!==null&&Ab(_e,vn,Ae,Le,!0)}}e:{if(me=re?Kl(re):window,Pe=me.nodeName&&me.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&me.type==="file")var Ne=gL;else if(cb(me))if(fb)Ne=wL;else{Ne=_L;var ze=yL}else(Pe=me.nodeName)&&Pe.toLowerCase()==="input"&&(me.type==="checkbox"||me.type==="radio")&&(Ne=xL);if(Ne&&(Ne=Ne(o,re))){db(_e,Ne,h,ve);break e}ze&&ze(o,me,re),o==="focusout"&&(ze=me._wrapperState)&&ze.controlled&&me.type==="number"&&Je(me,"number",me.value)}switch(ze=re?Kl(re):window,o){case"focusin":(cb(ze)||ze.contentEditable==="true")&&(Wl=ze,pv=re,Zc=null);break;case"focusout":Zc=pv=Wl=null;break;case"mousedown":mv=!0;break;case"contextmenu":case"mouseup":case"dragend":mv=!1,xb(_e,h,ve);break;case"selectionchange":if(EL)break;case"keydown":case"keyup":xb(_e,h,ve)}var Ue;if(cv)e:{switch(o){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else Bl?lb(o,h)&&(Xe="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(Xe="onCompositionStart");Xe&&(ib&&h.locale!=="ko"&&(Bl||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&Bl&&(Ue=eb()):(To=ve,sv="value"in To?To.value:To.textContent,Bl=!0)),ze=gh(re,Xe),0<ze.length&&(Xe=new rb(Xe,o,null,h,ve),_e.push({event:Xe,listeners:ze}),Ue?Xe.data=Ue:(Ue=ub(h),Ue!==null&&(Xe.data=Ue)))),(Ue=fL?hL(o,h):pL(o,h))&&(re=gh(re,"onBeforeInput"),0<re.length&&(ve=new rb("onBeforeInput","beforeinput",null,h,ve),_e.push({event:ve,listeners:re}),ve.data=Ue))}Ib(_e,l)})}function Yc(o,l,h){return{instance:o,listener:l,currentTarget:h}}function gh(o,l){for(var h=l+"Capture",g=[];o!==null;){var b=o,k=b.stateNode;b.tag===5&&k!==null&&(b=k,k=hr(o,h),k!=null&&g.unshift(Yc(o,k,b)),k=hr(o,l),k!=null&&g.push(Yc(o,k,b))),o=o.return}return g}function Zl(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function Ab(o,l,h,g,b){for(var k=l._reactName,M=[];h!==null&&h!==g;){var $=h,B=$.alternate,re=$.stateNode;if(B!==null&&B===g)break;$.tag===5&&re!==null&&($=re,b?(B=hr(h,k),B!=null&&M.unshift(Yc(h,B,$))):b||(B=hr(h,k),B!=null&&M.push(Yc(h,B,$)))),h=h.return}M.length!==0&&o.push({event:l,listeners:M})}var TL=/\r\n?/g,IL=/\u0000|\uFFFD/g;function Mb(o){return(typeof o=="string"?o:""+o).replace(TL,`
40
+ `).replace(IL,"")}function yh(o,l,h){if(l=Mb(l),Mb(o)!==l&&h)throw Error(n(425))}function _h(){}var wv=null,bv=null;function Sv(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 Ev=typeof setTimeout=="function"?setTimeout:void 0,RL=typeof clearTimeout=="function"?clearTimeout:void 0,Lb=typeof Promise=="function"?Promise:void 0,AL=typeof queueMicrotask=="function"?queueMicrotask:typeof Lb<"u"?function(o){return Lb.resolve(null).then(o).catch(ML)}:Ev;function ML(o){setTimeout(function(){throw o})}function kv(o,l){var h=l,g=0;do{var b=h.nextSibling;if(o.removeChild(h),b&&b.nodeType===8)if(h=b.data,h==="/$"){if(g===0){o.removeChild(b),$c(l);return}g--}else h!=="$"&&h!=="$?"&&h!=="$!"||g++;h=b}while(h);$c(l)}function Ro(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 Ob(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"){if(l===0)return o;l--}else h==="/$"&&l++}o=o.previousSibling}return null}var Gl=Math.random().toString(36).slice(2),ii="__reactFiber$"+Gl,Xc="__reactProps$"+Gl,Fi="__reactContainer$"+Gl,Cv="__reactEvents$"+Gl,LL="__reactListeners$"+Gl,OL="__reactHandles$"+Gl;function Aa(o){var l=o[ii];if(l)return l;for(var h=o.parentNode;h;){if(l=h[Fi]||h[ii]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(o=Ob(o);o!==null;){if(h=o[ii])return h;o=Ob(o)}return l}o=h,h=o.parentNode}return null}function Qc(o){return o=o[ii]||o[Fi],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Kl(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function xh(o){return o[Xc]||null}var Pv=[],Yl=-1;function Ao(o){return{current:o}}function $t(o){0>Yl||(o.current=Pv[Yl],Pv[Yl]=null,Yl--)}function Nt(o,l){Yl++,Pv[Yl]=o.current,o.current=l}var Mo={},tr=Ao(Mo),Ar=Ao(!1),Ma=Mo;function Xl(o,l){var h=o.type.contextTypes;if(!h)return Mo;var g=o.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===l)return g.__reactInternalMemoizedMaskedChildContext;var b={},k;for(k in h)b[k]=l[k];return g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=b),b}function Mr(o){return o=o.childContextTypes,o!=null}function wh(){$t(Ar),$t(tr)}function Db(o,l,h){if(tr.current!==Mo)throw Error(n(168));Nt(tr,l),Nt(Ar,h)}function Nb(o,l,h){var g=o.stateNode;if(l=l.childContextTypes,typeof g.getChildContext!="function")return h;g=g.getChildContext();for(var b in g)if(!(b in l))throw Error(n(108,Se(o)||"Unknown",b));return z({},h,g)}function bh(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Mo,Ma=tr.current,Nt(tr,o),Nt(Ar,Ar.current),!0}function jb(o,l,h){var g=o.stateNode;if(!g)throw Error(n(169));h?(o=Nb(o,l,Ma),g.__reactInternalMemoizedMergedChildContext=o,$t(Ar),$t(tr),Nt(tr,o)):$t(Ar),Nt(Ar,h)}var Vi=null,Sh=!1,Tv=!1;function Fb(o){Vi===null?Vi=[o]:Vi.push(o)}function DL(o){Sh=!0,Fb(o)}function Lo(){if(!Tv&&Vi!==null){Tv=!0;var o=0,l=le;try{var h=Vi;for(le=1;o<h.length;o++){var g=h[o];do g=g(!0);while(g!==null)}Vi=null,Sh=!1}catch(b){throw Vi!==null&&(Vi=Vi.slice(o+1)),eh(Mc,Lo),b}finally{le=l,Tv=!1}}return null}var Ql=[],Jl=0,Eh=null,kh=0,ys=[],_s=0,La=null,$i=1,Hi="";function Oa(o,l){Ql[Jl++]=kh,Ql[Jl++]=Eh,Eh=o,kh=l}function Vb(o,l,h){ys[_s++]=$i,ys[_s++]=Hi,ys[_s++]=La,La=o;var g=$i;o=Hi;var b=32-Dn(g)-1;g&=~(1<<b),h+=1;var k=32-Dn(l)+b;if(30<k){var M=b-b%5;k=(g&(1<<M)-1).toString(32),g>>=M,b-=M,$i=1<<32-Dn(l)+b|h<<b|g,Hi=k+o}else $i=1<<k|h<<b|g,Hi=o}function Iv(o){o.return!==null&&(Oa(o,1),Vb(o,1,0))}function Rv(o){for(;o===Eh;)Eh=Ql[--Jl],Ql[Jl]=null,kh=Ql[--Jl],Ql[Jl]=null;for(;o===La;)La=ys[--_s],ys[_s]=null,Hi=ys[--_s],ys[_s]=null,$i=ys[--_s],ys[_s]=null}var Xr=null,Qr=null,Wt=!1,Ns=null;function $b(o,l){var h=Ss(5,null,null,0);h.elementType="DELETED",h.stateNode=l,h.return=o,l=o.deletions,l===null?(o.deletions=[h],o.flags|=16):l.push(h)}function Hb(o,l){switch(o.tag){case 5:var h=o.type;return l=l.nodeType!==1||h.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,Xr=o,Qr=Ro(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,Xr=o,Qr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(h=La!==null?{id:$i,overflow:Hi}:null,o.memoizedState={dehydrated:l,treeContext:h,retryLane:1073741824},h=Ss(18,null,null,0),h.stateNode=l,h.return=o,o.child=h,Xr=o,Qr=null,!0):!1;default:return!1}}function Av(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Mv(o){if(Wt){var l=Qr;if(l){var h=l;if(!Hb(o,l)){if(Av(o))throw Error(n(418));l=Ro(h.nextSibling);var g=Xr;l&&Hb(o,l)?$b(g,h):(o.flags=o.flags&-4097|2,Wt=!1,Xr=o)}}else{if(Av(o))throw Error(n(418));o.flags=o.flags&-4097|2,Wt=!1,Xr=o}}}function zb(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Xr=o}function Ch(o){if(o!==Xr)return!1;if(!Wt)return zb(o),Wt=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!Sv(o.type,o.memoizedProps)),l&&(l=Qr)){if(Av(o))throw Ub(),Error(n(418));for(;l;)$b(o,l),l=Ro(l.nextSibling)}if(zb(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 h=o.data;if(h==="/$"){if(l===0){Qr=Ro(o.nextSibling);break e}l--}else h!=="$"&&h!=="$!"&&h!=="$?"||l++}o=o.nextSibling}Qr=null}}else Qr=Xr?Ro(o.stateNode.nextSibling):null;return!0}function Ub(){for(var o=Qr;o;)o=Ro(o.nextSibling)}function eu(){Qr=Xr=null,Wt=!1}function Lv(o){Ns===null?Ns=[o]:Ns.push(o)}var NL=T.ReactCurrentBatchConfig;function Jc(o,l,h){if(o=h.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var g=h.stateNode}if(!g)throw Error(n(147,o));var b=g,k=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===k?l.ref:(l=function(M){var $=b.refs;M===null?delete $[k]:$[k]=M},l._stringRef=k,l)}if(typeof o!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,o))}return o}function Ph(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Bb(o){var l=o._init;return l(o._payload)}function Wb(o){function l(ee,G){if(o){var te=ee.deletions;te===null?(ee.deletions=[G],ee.flags|=16):te.push(G)}}function h(ee,G){if(!o)return null;for(;G!==null;)l(ee,G),G=G.sibling;return null}function g(ee,G){for(ee=new Map;G!==null;)G.key!==null?ee.set(G.key,G):ee.set(G.index,G),G=G.sibling;return ee}function b(ee,G){return ee=Ho(ee,G),ee.index=0,ee.sibling=null,ee}function k(ee,G,te){return ee.index=te,o?(te=ee.alternate,te!==null?(te=te.index,te<G?(ee.flags|=2,G):te):(ee.flags|=2,G)):(ee.flags|=1048576,G)}function M(ee){return o&&ee.alternate===null&&(ee.flags|=2),ee}function $(ee,G,te,be){return G===null||G.tag!==6?(G=Eg(te,ee.mode,be),G.return=ee,G):(G=b(G,te),G.return=ee,G)}function B(ee,G,te,be){var Ne=te.type;return Ne===O?ve(ee,G,te.props.children,be,te.key):G!==null&&(G.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===q&&Bb(Ne)===G.type)?(be=b(G,te.props),be.ref=Jc(ee,G,te),be.return=ee,be):(be=Xh(te.type,te.key,te.props,null,ee.mode,be),be.ref=Jc(ee,G,te),be.return=ee,be)}function re(ee,G,te,be){return G===null||G.tag!==4||G.stateNode.containerInfo!==te.containerInfo||G.stateNode.implementation!==te.implementation?(G=kg(te,ee.mode,be),G.return=ee,G):(G=b(G,te.children||[]),G.return=ee,G)}function ve(ee,G,te,be,Ne){return G===null||G.tag!==7?(G=za(te,ee.mode,be,Ne),G.return=ee,G):(G=b(G,te),G.return=ee,G)}function _e(ee,G,te){if(typeof G=="string"&&G!==""||typeof G=="number")return G=Eg(""+G,ee.mode,te),G.return=ee,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case I:return te=Xh(G.type,G.key,G.props,null,ee.mode,te),te.ref=Jc(ee,null,G),te.return=ee,te;case A:return G=kg(G,ee.mode,te),G.return=ee,G;case q:var be=G._init;return _e(ee,be(G._payload),te)}if(kt(G)||X(G))return G=za(G,ee.mode,te,null),G.return=ee,G;Ph(ee,G)}return null}function me(ee,G,te,be){var Ne=G!==null?G.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return Ne!==null?null:$(ee,G,""+te,be);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case I:return te.key===Ne?B(ee,G,te,be):null;case A:return te.key===Ne?re(ee,G,te,be):null;case q:return Ne=te._init,me(ee,G,Ne(te._payload),be)}if(kt(te)||X(te))return Ne!==null?null:ve(ee,G,te,be,null);Ph(ee,te)}return null}function Pe(ee,G,te,be,Ne){if(typeof be=="string"&&be!==""||typeof be=="number")return ee=ee.get(te)||null,$(G,ee,""+be,Ne);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case I:return ee=ee.get(be.key===null?te:be.key)||null,B(G,ee,be,Ne);case A:return ee=ee.get(be.key===null?te:be.key)||null,re(G,ee,be,Ne);case q:var ze=be._init;return Pe(ee,G,te,ze(be._payload),Ne)}if(kt(be)||X(be))return ee=ee.get(te)||null,ve(G,ee,be,Ne,null);Ph(G,be)}return null}function Ae(ee,G,te,be){for(var Ne=null,ze=null,Ue=G,Xe=G=0,Fn=null;Ue!==null&&Xe<te.length;Xe++){Ue.index>Xe?(Fn=Ue,Ue=null):Fn=Ue.sibling;var gt=me(ee,Ue,te[Xe],be);if(gt===null){Ue===null&&(Ue=Fn);break}o&&Ue&&gt.alternate===null&&l(ee,Ue),G=k(gt,G,Xe),ze===null?Ne=gt:ze.sibling=gt,ze=gt,Ue=Fn}if(Xe===te.length)return h(ee,Ue),Wt&&Oa(ee,Xe),Ne;if(Ue===null){for(;Xe<te.length;Xe++)Ue=_e(ee,te[Xe],be),Ue!==null&&(G=k(Ue,G,Xe),ze===null?Ne=Ue:ze.sibling=Ue,ze=Ue);return Wt&&Oa(ee,Xe),Ne}for(Ue=g(ee,Ue);Xe<te.length;Xe++)Fn=Pe(Ue,ee,Xe,te[Xe],be),Fn!==null&&(o&&Fn.alternate!==null&&Ue.delete(Fn.key===null?Xe:Fn.key),G=k(Fn,G,Xe),ze===null?Ne=Fn:ze.sibling=Fn,ze=Fn);return o&&Ue.forEach(function(zo){return l(ee,zo)}),Wt&&Oa(ee,Xe),Ne}function Le(ee,G,te,be){var Ne=X(te);if(typeof Ne!="function")throw Error(n(150));if(te=Ne.call(te),te==null)throw Error(n(151));for(var ze=Ne=null,Ue=G,Xe=G=0,Fn=null,gt=te.next();Ue!==null&&!gt.done;Xe++,gt=te.next()){Ue.index>Xe?(Fn=Ue,Ue=null):Fn=Ue.sibling;var zo=me(ee,Ue,gt.value,be);if(zo===null){Ue===null&&(Ue=Fn);break}o&&Ue&&zo.alternate===null&&l(ee,Ue),G=k(zo,G,Xe),ze===null?Ne=zo:ze.sibling=zo,ze=zo,Ue=Fn}if(gt.done)return h(ee,Ue),Wt&&Oa(ee,Xe),Ne;if(Ue===null){for(;!gt.done;Xe++,gt=te.next())gt=_e(ee,gt.value,be),gt!==null&&(G=k(gt,G,Xe),ze===null?Ne=gt:ze.sibling=gt,ze=gt);return Wt&&Oa(ee,Xe),Ne}for(Ue=g(ee,Ue);!gt.done;Xe++,gt=te.next())gt=Pe(Ue,ee,Xe,gt.value,be),gt!==null&&(o&&gt.alternate!==null&&Ue.delete(gt.key===null?Xe:gt.key),G=k(gt,G,Xe),ze===null?Ne=gt:ze.sibling=gt,ze=gt);return o&&Ue.forEach(function(mO){return l(ee,mO)}),Wt&&Oa(ee,Xe),Ne}function vn(ee,G,te,be){if(typeof te=="object"&&te!==null&&te.type===O&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case I:e:{for(var Ne=te.key,ze=G;ze!==null;){if(ze.key===Ne){if(Ne=te.type,Ne===O){if(ze.tag===7){h(ee,ze.sibling),G=b(ze,te.props.children),G.return=ee,ee=G;break e}}else if(ze.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===q&&Bb(Ne)===ze.type){h(ee,ze.sibling),G=b(ze,te.props),G.ref=Jc(ee,ze,te),G.return=ee,ee=G;break e}h(ee,ze);break}else l(ee,ze);ze=ze.sibling}te.type===O?(G=za(te.props.children,ee.mode,be,te.key),G.return=ee,ee=G):(be=Xh(te.type,te.key,te.props,null,ee.mode,be),be.ref=Jc(ee,G,te),be.return=ee,ee=be)}return M(ee);case A:e:{for(ze=te.key;G!==null;){if(G.key===ze)if(G.tag===4&&G.stateNode.containerInfo===te.containerInfo&&G.stateNode.implementation===te.implementation){h(ee,G.sibling),G=b(G,te.children||[]),G.return=ee,ee=G;break e}else{h(ee,G);break}else l(ee,G);G=G.sibling}G=kg(te,ee.mode,be),G.return=ee,ee=G}return M(ee);case q:return ze=te._init,vn(ee,G,ze(te._payload),be)}if(kt(te))return Ae(ee,G,te,be);if(X(te))return Le(ee,G,te,be);Ph(ee,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,G!==null&&G.tag===6?(h(ee,G.sibling),G=b(G,te),G.return=ee,ee=G):(h(ee,G),G=Eg(te,ee.mode,be),G.return=ee,ee=G),M(ee)):h(ee,G)}return vn}var tu=Wb(!0),qb=Wb(!1),Th=Ao(null),Ih=null,nu=null,Ov=null;function Dv(){Ov=nu=Ih=null}function Nv(o){var l=Th.current;$t(Th),o._currentValue=l}function jv(o,l,h){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===h)break;o=o.return}}function ru(o,l){Ih=o,Ov=nu=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(Lr=!0),o.firstContext=null)}function xs(o){var l=o._currentValue;if(Ov!==o)if(o={context:o,memoizedValue:l,next:null},nu===null){if(Ih===null)throw Error(n(308));nu=o,Ih.dependencies={lanes:0,firstContext:o}}else nu=nu.next=o;return l}var Da=null;function Fv(o){Da===null?Da=[o]:Da.push(o)}function Zb(o,l,h,g){var b=l.interleaved;return b===null?(h.next=h,Fv(l)):(h.next=b.next,b.next=h),l.interleaved=h,zi(o,g)}function zi(o,l){o.lanes|=l;var h=o.alternate;for(h!==null&&(h.lanes|=l),h=o,o=o.return;o!==null;)o.childLanes|=l,h=o.alternate,h!==null&&(h.childLanes|=l),h=o,o=o.return;return h.tag===3?h.stateNode:null}var Oo=!1;function Vv(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gb(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 Ui(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Do(o,l,h){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(ht&2)!==0){var b=g.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),g.pending=l,zi(o,h)}return b=g.interleaved,b===null?(l.next=l,Fv(g)):(l.next=b.next,b.next=l),g.interleaved=l,zi(o,h)}function Rh(o,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194240)!==0)){var g=l.lanes;g&=o.pendingLanes,h|=g,l.lanes=h,he(o,h)}}function Kb(o,l){var h=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var b=null,k=null;if(h=h.firstBaseUpdate,h!==null){do{var M={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};k===null?b=k=M:k=k.next=M,h=h.next}while(h!==null);k===null?b=k=l:k=k.next=l}else b=k=l;h={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:k,shared:g.shared,effects:g.effects},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=l:o.next=l,h.lastBaseUpdate=l}function Ah(o,l,h,g){var b=o.updateQueue;Oo=!1;var k=b.firstBaseUpdate,M=b.lastBaseUpdate,$=b.shared.pending;if($!==null){b.shared.pending=null;var B=$,re=B.next;B.next=null,M===null?k=re:M.next=re,M=B;var ve=o.alternate;ve!==null&&(ve=ve.updateQueue,$=ve.lastBaseUpdate,$!==M&&($===null?ve.firstBaseUpdate=re:$.next=re,ve.lastBaseUpdate=B))}if(k!==null){var _e=b.baseState;M=0,ve=re=B=null,$=k;do{var me=$.lane,Pe=$.eventTime;if((g&me)===me){ve!==null&&(ve=ve.next={eventTime:Pe,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var Ae=o,Le=$;switch(me=l,Pe=h,Le.tag){case 1:if(Ae=Le.payload,typeof Ae=="function"){_e=Ae.call(Pe,_e,me);break e}_e=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Le.payload,me=typeof Ae=="function"?Ae.call(Pe,_e,me):Ae,me==null)break e;_e=z({},_e,me);break e;case 2:Oo=!0}}$.callback!==null&&$.lane!==0&&(o.flags|=64,me=b.effects,me===null?b.effects=[$]:me.push($))}else Pe={eventTime:Pe,lane:me,tag:$.tag,payload:$.payload,callback:$.callback,next:null},ve===null?(re=ve=Pe,B=_e):ve=ve.next=Pe,M|=me;if($=$.next,$===null){if($=b.shared.pending,$===null)break;me=$,$=me.next,me.next=null,b.lastBaseUpdate=me,b.shared.pending=null}}while(!0);if(ve===null&&(B=_e),b.baseState=B,b.firstBaseUpdate=re,b.lastBaseUpdate=ve,l=b.shared.interleaved,l!==null){b=l;do M|=b.lane,b=b.next;while(b!==l)}else k===null&&(b.shared.lanes=0);Fa|=M,o.lanes=M,o.memoizedState=_e}}function Yb(o,l,h){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=h,typeof b!="function")throw Error(n(191,b));b.call(g)}}}var ed={},oi=Ao(ed),td=Ao(ed),nd=Ao(ed);function Na(o){if(o===ed)throw Error(n(174));return o}function $v(o,l){switch(Nt(nd,l),Nt(td,o),Nt(oi,ed),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:on(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=on(l,o)}$t(oi),Nt(oi,l)}function su(){$t(oi),$t(td),$t(nd)}function Xb(o){Na(nd.current);var l=Na(oi.current),h=on(l,o.type);l!==h&&(Nt(td,o),Nt(oi,h))}function Hv(o){td.current===o&&($t(oi),$t(td))}var Qt=Ao(0);function Mh(o){for(var l=o;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.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 zv=[];function Uv(){for(var o=0;o<zv.length;o++)zv[o]._workInProgressVersionPrimary=null;zv.length=0}var Lh=T.ReactCurrentDispatcher,Bv=T.ReactCurrentBatchConfig,ja=0,Jt=null,Tn=null,Nn=null,Oh=!1,rd=!1,sd=0,jL=0;function nr(){throw Error(n(321))}function Wv(o,l){if(l===null)return!1;for(var h=0;h<l.length&&h<o.length;h++)if(!Ds(o[h],l[h]))return!1;return!0}function qv(o,l,h,g,b,k){if(ja=k,Jt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Lh.current=o===null||o.memoizedState===null?HL:zL,o=h(g,b),rd){k=0;do{if(rd=!1,sd=0,25<=k)throw Error(n(301));k+=1,Nn=Tn=null,l.updateQueue=null,Lh.current=UL,o=h(g,b)}while(rd)}if(Lh.current=jh,l=Tn!==null&&Tn.next!==null,ja=0,Nn=Tn=Jt=null,Oh=!1,l)throw Error(n(300));return o}function Zv(){var o=sd!==0;return sd=0,o}function ai(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?Jt.memoizedState=Nn=o:Nn=Nn.next=o,Nn}function ws(){if(Tn===null){var o=Jt.alternate;o=o!==null?o.memoizedState:null}else o=Tn.next;var l=Nn===null?Jt.memoizedState:Nn.next;if(l!==null)Nn=l,Tn=o;else{if(o===null)throw Error(n(310));Tn=o,o={memoizedState:Tn.memoizedState,baseState:Tn.baseState,baseQueue:Tn.baseQueue,queue:Tn.queue,next:null},Nn===null?Jt.memoizedState=Nn=o:Nn=Nn.next=o}return Nn}function id(o,l){return typeof l=="function"?l(o):l}function Gv(o){var l=ws(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=o;var g=Tn,b=g.baseQueue,k=h.pending;if(k!==null){if(b!==null){var M=b.next;b.next=k.next,k.next=M}g.baseQueue=b=k,h.pending=null}if(b!==null){k=b.next,g=g.baseState;var $=M=null,B=null,re=k;do{var ve=re.lane;if((ja&ve)===ve)B!==null&&(B=B.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),g=re.hasEagerState?re.eagerState:o(g,re.action);else{var _e={lane:ve,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};B===null?($=B=_e,M=g):B=B.next=_e,Jt.lanes|=ve,Fa|=ve}re=re.next}while(re!==null&&re!==k);B===null?M=g:B.next=$,Ds(g,l.memoizedState)||(Lr=!0),l.memoizedState=g,l.baseState=M,l.baseQueue=B,h.lastRenderedState=g}if(o=h.interleaved,o!==null){b=o;do k=b.lane,Jt.lanes|=k,Fa|=k,b=b.next;while(b!==o)}else b===null&&(h.lanes=0);return[l.memoizedState,h.dispatch]}function Kv(o){var l=ws(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=o;var g=h.dispatch,b=h.pending,k=l.memoizedState;if(b!==null){h.pending=null;var M=b=b.next;do k=o(k,M.action),M=M.next;while(M!==b);Ds(k,l.memoizedState)||(Lr=!0),l.memoizedState=k,l.baseQueue===null&&(l.baseState=k),h.lastRenderedState=k}return[k,g]}function Qb(){}function Jb(o,l){var h=Jt,g=ws(),b=l(),k=!Ds(g.memoizedState,b);if(k&&(g.memoizedState=b,Lr=!0),g=g.queue,Yv(nS.bind(null,h,g,o),[o]),g.getSnapshot!==l||k||Nn!==null&&Nn.memoizedState.tag&1){if(h.flags|=2048,od(9,tS.bind(null,h,g,b,l),void 0,null),jn===null)throw Error(n(349));(ja&30)!==0||eS(h,l,b)}return b}function eS(o,l,h){o.flags|=16384,o={getSnapshot:l,value:h},l=Jt.updateQueue,l===null?(l={lastEffect:null,stores:null},Jt.updateQueue=l,l.stores=[o]):(h=l.stores,h===null?l.stores=[o]:h.push(o))}function tS(o,l,h,g){l.value=h,l.getSnapshot=g,rS(l)&&sS(o)}function nS(o,l,h){return h(function(){rS(l)&&sS(o)})}function rS(o){var l=o.getSnapshot;o=o.value;try{var h=l();return!Ds(o,h)}catch{return!0}}function sS(o){var l=zi(o,1);l!==null&&$s(l,o,1,-1)}function iS(o){var l=ai();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:id,lastRenderedState:o},l.queue=o,o=o.dispatch=$L.bind(null,Jt,o),[l.memoizedState,o]}function od(o,l,h,g){return o={tag:o,create:l,destroy:h,deps:g,next:null},l=Jt.updateQueue,l===null?(l={lastEffect:null,stores:null},Jt.updateQueue=l,l.lastEffect=o.next=o):(h=l.lastEffect,h===null?l.lastEffect=o.next=o:(g=h.next,h.next=o,o.next=g,l.lastEffect=o)),o}function oS(){return ws().memoizedState}function Dh(o,l,h,g){var b=ai();Jt.flags|=o,b.memoizedState=od(1|l,h,void 0,g===void 0?null:g)}function Nh(o,l,h,g){var b=ws();g=g===void 0?null:g;var k=void 0;if(Tn!==null){var M=Tn.memoizedState;if(k=M.destroy,g!==null&&Wv(g,M.deps)){b.memoizedState=od(l,h,k,g);return}}Jt.flags|=o,b.memoizedState=od(1|l,h,k,g)}function aS(o,l){return Dh(8390656,8,o,l)}function Yv(o,l){return Nh(2048,8,o,l)}function lS(o,l){return Nh(4,2,o,l)}function uS(o,l){return Nh(4,4,o,l)}function cS(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 dS(o,l,h){return h=h!=null?h.concat([o]):null,Nh(4,4,cS.bind(null,l,o),h)}function Xv(){}function fS(o,l){var h=ws();l=l===void 0?null:l;var g=h.memoizedState;return g!==null&&l!==null&&Wv(l,g[1])?g[0]:(h.memoizedState=[o,l],o)}function hS(o,l){var h=ws();l=l===void 0?null:l;var g=h.memoizedState;return g!==null&&l!==null&&Wv(l,g[1])?g[0]:(o=o(),h.memoizedState=[o,l],o)}function pS(o,l,h){return(ja&21)===0?(o.baseState&&(o.baseState=!1,Lr=!0),o.memoizedState=h):(Ds(h,l)||(h=Dc(),Jt.lanes|=h,Fa|=h,o.baseState=!0),l)}function FL(o,l){var h=le;le=h!==0&&4>h?h:4,o(!0);var g=Bv.transition;Bv.transition={};try{o(!1),l()}finally{le=h,Bv.transition=g}}function mS(){return ws().memoizedState}function VL(o,l,h){var g=Vo(o);if(h={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null},vS(o))gS(l,h);else if(h=Zb(o,l,h,g),h!==null){var b=vr();$s(h,o,g,b),yS(h,l,g)}}function $L(o,l,h){var g=Vo(o),b={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null};if(vS(o))gS(l,b);else{var k=o.alternate;if(o.lanes===0&&(k===null||k.lanes===0)&&(k=l.lastRenderedReducer,k!==null))try{var M=l.lastRenderedState,$=k(M,h);if(b.hasEagerState=!0,b.eagerState=$,Ds($,M)){var B=l.interleaved;B===null?(b.next=b,Fv(l)):(b.next=B.next,B.next=b),l.interleaved=b;return}}catch{}finally{}h=Zb(o,l,b,g),h!==null&&(b=vr(),$s(h,o,g,b),yS(h,l,g))}}function vS(o){var l=o.alternate;return o===Jt||l!==null&&l===Jt}function gS(o,l){rd=Oh=!0;var h=o.pending;h===null?l.next=l:(l.next=h.next,h.next=l),o.pending=l}function yS(o,l,h){if((h&4194240)!==0){var g=l.lanes;g&=o.pendingLanes,h|=g,l.lanes=h,he(o,h)}}var jh={readContext:xs,useCallback:nr,useContext:nr,useEffect:nr,useImperativeHandle:nr,useInsertionEffect:nr,useLayoutEffect:nr,useMemo:nr,useReducer:nr,useRef:nr,useState:nr,useDebugValue:nr,useDeferredValue:nr,useTransition:nr,useMutableSource:nr,useSyncExternalStore:nr,useId:nr,unstable_isNewReconciler:!1},HL={readContext:xs,useCallback:function(o,l){return ai().memoizedState=[o,l===void 0?null:l],o},useContext:xs,useEffect:aS,useImperativeHandle:function(o,l,h){return h=h!=null?h.concat([o]):null,Dh(4194308,4,cS.bind(null,l,o),h)},useLayoutEffect:function(o,l){return Dh(4194308,4,o,l)},useInsertionEffect:function(o,l){return Dh(4,2,o,l)},useMemo:function(o,l){var h=ai();return l=l===void 0?null:l,o=o(),h.memoizedState=[o,l],o},useReducer:function(o,l,h){var g=ai();return l=h!==void 0?h(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=VL.bind(null,Jt,o),[g.memoizedState,o]},useRef:function(o){var l=ai();return o={current:o},l.memoizedState=o},useState:iS,useDebugValue:Xv,useDeferredValue:function(o){return ai().memoizedState=o},useTransition:function(){var o=iS(!1),l=o[0];return o=FL.bind(null,o[1]),ai().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,h){var g=Jt,b=ai();if(Wt){if(h===void 0)throw Error(n(407));h=h()}else{if(h=l(),jn===null)throw Error(n(349));(ja&30)!==0||eS(g,l,h)}b.memoizedState=h;var k={value:h,getSnapshot:l};return b.queue=k,aS(nS.bind(null,g,k,o),[o]),g.flags|=2048,od(9,tS.bind(null,g,k,h,l),void 0,null),h},useId:function(){var o=ai(),l=jn.identifierPrefix;if(Wt){var h=Hi,g=$i;h=(g&~(1<<32-Dn(g)-1)).toString(32)+h,l=":"+l+"R"+h,h=sd++,0<h&&(l+="H"+h.toString(32)),l+=":"}else h=jL++,l=":"+l+"r"+h.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},zL={readContext:xs,useCallback:fS,useContext:xs,useEffect:Yv,useImperativeHandle:dS,useInsertionEffect:lS,useLayoutEffect:uS,useMemo:hS,useReducer:Gv,useRef:oS,useState:function(){return Gv(id)},useDebugValue:Xv,useDeferredValue:function(o){var l=ws();return pS(l,Tn.memoizedState,o)},useTransition:function(){var o=Gv(id)[0],l=ws().memoizedState;return[o,l]},useMutableSource:Qb,useSyncExternalStore:Jb,useId:mS,unstable_isNewReconciler:!1},UL={readContext:xs,useCallback:fS,useContext:xs,useEffect:Yv,useImperativeHandle:dS,useInsertionEffect:lS,useLayoutEffect:uS,useMemo:hS,useReducer:Kv,useRef:oS,useState:function(){return Kv(id)},useDebugValue:Xv,useDeferredValue:function(o){var l=ws();return Tn===null?l.memoizedState=o:pS(l,Tn.memoizedState,o)},useTransition:function(){var o=Kv(id)[0],l=ws().memoizedState;return[o,l]},useMutableSource:Qb,useSyncExternalStore:Jb,useId:mS,unstable_isNewReconciler:!1};function js(o,l){if(o&&o.defaultProps){l=z({},l),o=o.defaultProps;for(var h in o)l[h]===void 0&&(l[h]=o[h]);return l}return l}function Qv(o,l,h,g){l=o.memoizedState,h=h(g,l),h=h==null?l:z({},l,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var Fh={isMounted:function(o){return(o=o._reactInternals)?ji(o)===o:!1},enqueueSetState:function(o,l,h){o=o._reactInternals;var g=vr(),b=Vo(o),k=Ui(g,b);k.payload=l,h!=null&&(k.callback=h),l=Do(o,k,b),l!==null&&($s(l,o,b,g),Rh(l,o,b))},enqueueReplaceState:function(o,l,h){o=o._reactInternals;var g=vr(),b=Vo(o),k=Ui(g,b);k.tag=1,k.payload=l,h!=null&&(k.callback=h),l=Do(o,k,b),l!==null&&($s(l,o,b,g),Rh(l,o,b))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var h=vr(),g=Vo(o),b=Ui(h,g);b.tag=2,l!=null&&(b.callback=l),l=Do(o,b,g),l!==null&&($s(l,o,g,h),Rh(l,o,g))}};function _S(o,l,h,g,b,k,M){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,k,M):l.prototype&&l.prototype.isPureReactComponent?!qc(h,g)||!qc(b,k):!0}function xS(o,l,h){var g=!1,b=Mo,k=l.contextType;return typeof k=="object"&&k!==null?k=xs(k):(b=Mr(l)?Ma:tr.current,g=l.contextTypes,k=(g=g!=null)?Xl(o,b):Mo),l=new l(h,k),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Fh,o.stateNode=l,l._reactInternals=o,g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=k),l}function wS(o,l,h,g){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,g),l.state!==o&&Fh.enqueueReplaceState(l,l.state,null)}function Jv(o,l,h,g){var b=o.stateNode;b.props=h,b.state=o.memoizedState,b.refs={},Vv(o);var k=l.contextType;typeof k=="object"&&k!==null?b.context=xs(k):(k=Mr(l)?Ma:tr.current,b.context=Xl(o,k)),b.state=o.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(Qv(o,l,k,h),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&&Fh.enqueueReplaceState(b,b.state,null),Ah(o,h,b,g),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function iu(o,l){try{var h="",g=l;do h+=se(g),g=g.return;while(g);var b=h}catch(k){b=`
41
+ Error generating stack: `+k.message+`
42
+ `+k.stack}return{value:o,source:l,stack:b,digest:null}}function eg(o,l,h){return{value:o,source:null,stack:h??null,digest:l??null}}function tg(o,l){try{console.error(l.value)}catch(h){setTimeout(function(){throw h})}}var BL=typeof WeakMap=="function"?WeakMap:Map;function bS(o,l,h){h=Ui(-1,h),h.tag=3,h.payload={element:null};var g=l.value;return h.callback=function(){Wh||(Wh=!0,vg=g),tg(o,l)},h}function SS(o,l,h){h=Ui(-1,h),h.tag=3;var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var b=l.value;h.payload=function(){return g(b)},h.callback=function(){tg(o,l)}}var k=o.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(h.callback=function(){tg(o,l),typeof g!="function"&&(jo===null?jo=new Set([this]):jo.add(this));var M=l.stack;this.componentDidCatch(l.value,{componentStack:M!==null?M:""})}),h}function ES(o,l,h){var g=o.pingCache;if(g===null){g=o.pingCache=new BL;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(h)||(b.add(h),o=sO.bind(null,o,l,h),l.then(o,o))}function kS(o){do{var l;if((l=o.tag===13)&&(l=o.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return o;o=o.return}while(o!==null);return null}function CS(o,l,h,g,b){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(l=Ui(-1,1),l.tag=2,Do(h,l,1))),h.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var WL=T.ReactCurrentOwner,Lr=!1;function mr(o,l,h,g){l.child=o===null?qb(l,null,h,g):tu(l,o.child,h,g)}function PS(o,l,h,g,b){h=h.render;var k=l.ref;return ru(l,b),g=qv(o,l,h,g,k,b),h=Zv(),o!==null&&!Lr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Bi(o,l,b)):(Wt&&h&&Iv(l),l.flags|=1,mr(o,l,g,b),l.child)}function TS(o,l,h,g,b){if(o===null){var k=h.type;return typeof k=="function"&&!Sg(k)&&k.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(l.tag=15,l.type=k,IS(o,l,k,g,b)):(o=Xh(h.type,null,g,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(k=o.child,(o.lanes&b)===0){var M=k.memoizedProps;if(h=h.compare,h=h!==null?h:qc,h(M,g)&&o.ref===l.ref)return Bi(o,l,b)}return l.flags|=1,o=Ho(k,g),o.ref=l.ref,o.return=l,l.child=o}function IS(o,l,h,g,b){if(o!==null){var k=o.memoizedProps;if(qc(k,g)&&o.ref===l.ref)if(Lr=!1,l.pendingProps=g=k,(o.lanes&b)!==0)(o.flags&131072)!==0&&(Lr=!0);else return l.lanes=o.lanes,Bi(o,l,b)}return ng(o,l,h,g,b)}function RS(o,l,h){var g=l.pendingProps,b=g.children,k=o!==null?o.memoizedState:null;if(g.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(au,Jr),Jr|=h;else{if((h&1073741824)===0)return o=k!==null?k.baseLanes|h:h,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Nt(au,Jr),Jr|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=k!==null?k.baseLanes:h,Nt(au,Jr),Jr|=g}else k!==null?(g=k.baseLanes|h,l.memoizedState=null):g=h,Nt(au,Jr),Jr|=g;return mr(o,l,b,h),l.child}function AS(o,l){var h=l.ref;(o===null&&h!==null||o!==null&&o.ref!==h)&&(l.flags|=512,l.flags|=2097152)}function ng(o,l,h,g,b){var k=Mr(h)?Ma:tr.current;return k=Xl(l,k),ru(l,b),h=qv(o,l,h,g,k,b),g=Zv(),o!==null&&!Lr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Bi(o,l,b)):(Wt&&g&&Iv(l),l.flags|=1,mr(o,l,h,b),l.child)}function MS(o,l,h,g,b){if(Mr(h)){var k=!0;bh(l)}else k=!1;if(ru(l,b),l.stateNode===null)$h(o,l),xS(l,h,g),Jv(l,h,g,b),g=!0;else if(o===null){var M=l.stateNode,$=l.memoizedProps;M.props=$;var B=M.context,re=h.contextType;typeof re=="object"&&re!==null?re=xs(re):(re=Mr(h)?Ma:tr.current,re=Xl(l,re));var ve=h.getDerivedStateFromProps,_e=typeof ve=="function"||typeof M.getSnapshotBeforeUpdate=="function";_e||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||($!==g||B!==re)&&wS(l,M,g,re),Oo=!1;var me=l.memoizedState;M.state=me,Ah(l,g,M,b),B=l.memoizedState,$!==g||me!==B||Ar.current||Oo?(typeof ve=="function"&&(Qv(l,h,ve,g),B=l.memoizedState),($=Oo||_S(l,h,$,g,me,B,re))?(_e||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(l.flags|=4194308)):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=B),M.props=g,M.state=B,M.context=re,g=$):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{M=l.stateNode,Gb(o,l),$=l.memoizedProps,re=l.type===l.elementType?$:js(l.type,$),M.props=re,_e=l.pendingProps,me=M.context,B=h.contextType,typeof B=="object"&&B!==null?B=xs(B):(B=Mr(h)?Ma:tr.current,B=Xl(l,B));var Pe=h.getDerivedStateFromProps;(ve=typeof Pe=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||($!==_e||me!==B)&&wS(l,M,g,B),Oo=!1,me=l.memoizedState,M.state=me,Ah(l,g,M,b);var Ae=l.memoizedState;$!==_e||me!==Ae||Ar.current||Oo?(typeof Pe=="function"&&(Qv(l,h,Pe,g),Ae=l.memoizedState),(re=Oo||_S(l,h,re,g,me,Ae,B)||!1)?(ve||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(g,Ae,B),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(g,Ae,B)),typeof M.componentDidUpdate=="function"&&(l.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof M.componentDidUpdate!="function"||$===o.memoizedProps&&me===o.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||$===o.memoizedProps&&me===o.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=Ae),M.props=g,M.state=Ae,M.context=B,g=re):(typeof M.componentDidUpdate!="function"||$===o.memoizedProps&&me===o.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||$===o.memoizedProps&&me===o.memoizedState||(l.flags|=1024),g=!1)}return rg(o,l,h,g,k,b)}function rg(o,l,h,g,b,k){AS(o,l);var M=(l.flags&128)!==0;if(!g&&!M)return b&&jb(l,h,!1),Bi(o,l,k);g=l.stateNode,WL.current=l;var $=M&&typeof h.getDerivedStateFromError!="function"?null:g.render();return l.flags|=1,o!==null&&M?(l.child=tu(l,o.child,null,k),l.child=tu(l,null,$,k)):mr(o,l,$,k),l.memoizedState=g.state,b&&jb(l,h,!0),l.child}function LS(o){var l=o.stateNode;l.pendingContext?Db(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Db(o,l.context,!1),$v(o,l.containerInfo)}function OS(o,l,h,g,b){return eu(),Lv(b),l.flags|=256,mr(o,l,h,g),l.child}var sg={dehydrated:null,treeContext:null,retryLane:0};function ig(o){return{baseLanes:o,cachePool:null,transitions:null}}function DS(o,l,h){var g=l.pendingProps,b=Qt.current,k=!1,M=(l.flags&128)!==0,$;if(($=M)||($=o!==null&&o.memoizedState===null?!1:(b&2)!==0),$?(k=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),Nt(Qt,b&1),o===null)return Mv(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((l.mode&1)===0?l.lanes=1:o.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(M=g.children,o=g.fallback,k?(g=l.mode,k=l.child,M={mode:"hidden",children:M},(g&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=M):k=Qh(M,g,0,null),o=za(o,g,h,null),k.return=l,o.return=l,k.sibling=o,l.child=k,l.child.memoizedState=ig(h),l.memoizedState=sg,o):og(l,M));if(b=o.memoizedState,b!==null&&($=b.dehydrated,$!==null))return qL(o,l,M,g,$,b,h);if(k){k=g.fallback,M=l.mode,b=o.child,$=b.sibling;var B={mode:"hidden",children:g.children};return(M&1)===0&&l.child!==b?(g=l.child,g.childLanes=0,g.pendingProps=B,l.deletions=null):(g=Ho(b,B),g.subtreeFlags=b.subtreeFlags&14680064),$!==null?k=Ho($,k):(k=za(k,M,h,null),k.flags|=2),k.return=l,g.return=l,g.sibling=k,l.child=g,g=k,k=l.child,M=o.child.memoizedState,M=M===null?ig(h):{baseLanes:M.baseLanes|h,cachePool:null,transitions:M.transitions},k.memoizedState=M,k.childLanes=o.childLanes&~h,l.memoizedState=sg,g}return k=o.child,o=k.sibling,g=Ho(k,{mode:"visible",children:g.children}),(l.mode&1)===0&&(g.lanes=h),g.return=l,g.sibling=null,o!==null&&(h=l.deletions,h===null?(l.deletions=[o],l.flags|=16):h.push(o)),l.child=g,l.memoizedState=null,g}function og(o,l){return l=Qh({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function Vh(o,l,h,g){return g!==null&&Lv(g),tu(l,o.child,null,h),o=og(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function qL(o,l,h,g,b,k,M){if(h)return l.flags&256?(l.flags&=-257,g=eg(Error(n(422))),Vh(o,l,M,g)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(k=g.fallback,b=l.mode,g=Qh({mode:"visible",children:g.children},b,0,null),k=za(k,b,M,null),k.flags|=2,g.return=l,k.return=l,g.sibling=k,l.child=g,(l.mode&1)!==0&&tu(l,o.child,null,M),l.child.memoizedState=ig(M),l.memoizedState=sg,k);if((l.mode&1)===0)return Vh(o,l,M,null);if(b.data==="$!"){if(g=b.nextSibling&&b.nextSibling.dataset,g)var $=g.dgst;return g=$,k=Error(n(419)),g=eg(k,g,void 0),Vh(o,l,M,g)}if($=(M&o.childLanes)!==0,Lr||$){if(g=jn,g!==null){switch(M&-M){case 4:b=2;break;case 16:b=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(g.suspendedLanes|M))!==0?0:b,b!==0&&b!==k.retryLane&&(k.retryLane=b,zi(o,b),$s(g,o,b,-1))}return bg(),g=eg(Error(n(421))),Vh(o,l,M,g)}return b.data==="$?"?(l.flags|=128,l.child=o.child,l=iO.bind(null,o),b._reactRetry=l,null):(o=k.treeContext,Qr=Ro(b.nextSibling),Xr=l,Wt=!0,Ns=null,o!==null&&(ys[_s++]=$i,ys[_s++]=Hi,ys[_s++]=La,$i=o.id,Hi=o.overflow,La=l),l=og(l,g.children),l.flags|=4096,l)}function NS(o,l,h){o.lanes|=l;var g=o.alternate;g!==null&&(g.lanes|=l),jv(o.return,l,h)}function ag(o,l,h,g,b){var k=o.memoizedState;k===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:b}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=g,k.tail=h,k.tailMode=b)}function jS(o,l,h){var g=l.pendingProps,b=g.revealOrder,k=g.tail;if(mr(o,l,g.children,h),g=Qt.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&&NS(o,h,l);else if(o.tag===19)NS(o,h,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(Nt(Qt,g),(l.mode&1)===0)l.memoizedState=null;else switch(b){case"forwards":for(h=l.child,b=null;h!==null;)o=h.alternate,o!==null&&Mh(o)===null&&(b=h),h=h.sibling;h=b,h===null?(b=l.child,l.child=null):(b=h.sibling,h.sibling=null),ag(l,!1,b,h,k);break;case"backwards":for(h=null,b=l.child,l.child=null;b!==null;){if(o=b.alternate,o!==null&&Mh(o)===null){l.child=b;break}o=b.sibling,b.sibling=h,h=b,b=o}ag(l,!0,h,null,k);break;case"together":ag(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function $h(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function Bi(o,l,h){if(o!==null&&(l.dependencies=o.dependencies),Fa|=l.lanes,(h&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,h=Ho(o,o.pendingProps),l.child=h,h.return=l;o.sibling!==null;)o=o.sibling,h=h.sibling=Ho(o,o.pendingProps),h.return=l;h.sibling=null}return l.child}function ZL(o,l,h){switch(l.tag){case 3:LS(l),eu();break;case 5:Xb(l);break;case 1:Mr(l.type)&&bh(l);break;case 4:$v(l,l.stateNode.containerInfo);break;case 10:var g=l.type._context,b=l.memoizedProps.value;Nt(Th,g._currentValue),g._currentValue=b;break;case 13:if(g=l.memoizedState,g!==null)return g.dehydrated!==null?(Nt(Qt,Qt.current&1),l.flags|=128,null):(h&l.child.childLanes)!==0?DS(o,l,h):(Nt(Qt,Qt.current&1),o=Bi(o,l,h),o!==null?o.sibling:null);Nt(Qt,Qt.current&1);break;case 19:if(g=(h&l.childLanes)!==0,(o.flags&128)!==0){if(g)return jS(o,l,h);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Nt(Qt,Qt.current),g)break;return null;case 22:case 23:return l.lanes=0,RS(o,l,h)}return Bi(o,l,h)}var FS,lg,VS,$S;FS=function(o,l){for(var h=l.child;h!==null;){if(h.tag===5||h.tag===6)o.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},lg=function(){},VS=function(o,l,h,g){var b=o.memoizedProps;if(b!==g){o=l.stateNode,Na(oi.current);var k=null;switch(h){case"input":b=ct(o,b),g=ct(o,g),k=[];break;case"select":b=z({},b,{value:void 0}),g=z({},g,{value:void 0}),k=[];break;case"textarea":b=xe(o,b),g=xe(o,g),k=[];break;default:typeof b.onClick!="function"&&typeof g.onClick=="function"&&(o.onclick=_h)}ps(h,g);var M;h=null;for(re in b)if(!g.hasOwnProperty(re)&&b.hasOwnProperty(re)&&b[re]!=null)if(re==="style"){var $=b[re];for(M in $)$.hasOwnProperty(M)&&(h||(h={}),h[M]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(s.hasOwnProperty(re)?k||(k=[]):(k=k||[]).push(re,null));for(re in g){var B=g[re];if($=b!=null?b[re]:void 0,g.hasOwnProperty(re)&&B!==$&&(B!=null||$!=null))if(re==="style")if($){for(M in $)!$.hasOwnProperty(M)||B&&B.hasOwnProperty(M)||(h||(h={}),h[M]="");for(M in B)B.hasOwnProperty(M)&&$[M]!==B[M]&&(h||(h={}),h[M]=B[M])}else h||(k||(k=[]),k.push(re,h)),h=B;else re==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,$=$?$.__html:void 0,B!=null&&$!==B&&(k=k||[]).push(re,B)):re==="children"?typeof B!="string"&&typeof B!="number"||(k=k||[]).push(re,""+B):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(s.hasOwnProperty(re)?(B!=null&&re==="onScroll"&&Vt("scroll",o),k||$===B||(k=[])):(k=k||[]).push(re,B))}h&&(k=k||[]).push("style",h);var re=k;(l.updateQueue=re)&&(l.flags|=4)}},$S=function(o,l,h,g){h!==g&&(l.flags|=4)};function ad(o,l){if(!Wt)switch(o.tailMode){case"hidden":l=o.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function rr(o){var l=o.alternate!==null&&o.alternate.child===o.child,h=0,g=0;if(l)for(var b=o.child;b!==null;)h|=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;)h|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=g,o.childLanes=h,l}function GL(o,l,h){var g=l.pendingProps;switch(Rv(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rr(l),null;case 1:return Mr(l.type)&&wh(),rr(l),null;case 3:return g=l.stateNode,su(),$t(Ar),$t(tr),Uv(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(o===null||o.child===null)&&(Ch(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ns!==null&&(_g(Ns),Ns=null))),lg(o,l),rr(l),null;case 5:Hv(l);var b=Na(nd.current);if(h=l.type,o!==null&&l.stateNode!=null)VS(o,l,h,g,b),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!g){if(l.stateNode===null)throw Error(n(166));return rr(l),null}if(o=Na(oi.current),Ch(l)){g=l.stateNode,h=l.type;var k=l.memoizedProps;switch(g[ii]=l,g[Xc]=k,o=(l.mode&1)!==0,h){case"dialog":Vt("cancel",g),Vt("close",g);break;case"iframe":case"object":case"embed":Vt("load",g);break;case"video":case"audio":for(b=0;b<Gc.length;b++)Vt(Gc[b],g);break;case"source":Vt("error",g);break;case"img":case"image":case"link":Vt("error",g),Vt("load",g);break;case"details":Vt("toggle",g);break;case"input":Gt(g,k),Vt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!k.multiple},Vt("invalid",g);break;case"textarea":sn(g,k),Vt("invalid",g)}ps(h,k),b=null;for(var M in k)if(k.hasOwnProperty(M)){var $=k[M];M==="children"?typeof $=="string"?g.textContent!==$&&(k.suppressHydrationWarning!==!0&&yh(g.textContent,$,o),b=["children",$]):typeof $=="number"&&g.textContent!==""+$&&(k.suppressHydrationWarning!==!0&&yh(g.textContent,$,o),b=["children",""+$]):s.hasOwnProperty(M)&&$!=null&&M==="onScroll"&&Vt("scroll",g)}switch(h){case"input":We(g),Oe(g,k,!0);break;case"textarea":We(g),Kr(g);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(g.onclick=_h)}g=b,l.updateQueue=g,g!==null&&(l.flags|=4)}else{M=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=Pa(h)),o==="http://www.w3.org/1999/xhtml"?h==="script"?(o=M.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof g.is=="string"?o=M.createElement(h,{is:g.is}):(o=M.createElement(h),h==="select"&&(M=o,g.multiple?M.multiple=!0:g.size&&(M.size=g.size))):o=M.createElementNS(o,h),o[ii]=l,o[Xc]=g,FS(o,l,!1,!1),l.stateNode=o;e:{switch(M=ko(h,g),h){case"dialog":Vt("cancel",o),Vt("close",o),b=g;break;case"iframe":case"object":case"embed":Vt("load",o),b=g;break;case"video":case"audio":for(b=0;b<Gc.length;b++)Vt(Gc[b],o);b=g;break;case"source":Vt("error",o),b=g;break;case"img":case"image":case"link":Vt("error",o),Vt("load",o),b=g;break;case"details":Vt("toggle",o),b=g;break;case"input":Gt(o,g),b=ct(o,g),Vt("invalid",o);break;case"option":b=g;break;case"select":o._wrapperState={wasMultiple:!!g.multiple},b=z({},g,{value:void 0}),Vt("invalid",o);break;case"textarea":sn(o,g),b=xe(o,g),Vt("invalid",o);break;default:b=g}ps(h,b),$=b;for(k in $)if($.hasOwnProperty(k)){var B=$[k];k==="style"?ti(o,B):k==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,B!=null&&Ta(o,B)):k==="children"?typeof B=="string"?(h!=="textarea"||B!=="")&&fr(o,B):typeof B=="number"&&fr(o,""+B):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(s.hasOwnProperty(k)?B!=null&&k==="onScroll"&&Vt("scroll",o):B!=null&&P(o,k,B,M))}switch(h){case"input":We(o),Oe(o,g,!1);break;case"textarea":We(o),Kr(o);break;case"option":g.value!=null&&o.setAttribute("value",""+ce(g.value));break;case"select":o.multiple=!!g.multiple,k=g.value,k!=null?vt(o,!!g.multiple,k,!1):g.defaultValue!=null&&vt(o,!!g.multiple,g.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=_h)}switch(h){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 rr(l),null;case 6:if(o&&l.stateNode!=null)$S(o,l,o.memoizedProps,g);else{if(typeof g!="string"&&l.stateNode===null)throw Error(n(166));if(h=Na(nd.current),Na(oi.current),Ch(l)){if(g=l.stateNode,h=l.memoizedProps,g[ii]=l,(k=g.nodeValue!==h)&&(o=Xr,o!==null))switch(o.tag){case 3:yh(g.nodeValue,h,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&yh(g.nodeValue,h,(o.mode&1)!==0)}k&&(l.flags|=4)}else g=(h.nodeType===9?h:h.ownerDocument).createTextNode(g),g[ii]=l,l.stateNode=g}return rr(l),null;case 13:if($t(Qt),g=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Wt&&Qr!==null&&(l.mode&1)!==0&&(l.flags&128)===0)Ub(),eu(),l.flags|=98560,k=!1;else if(k=Ch(l),g!==null&&g.dehydrated!==null){if(o===null){if(!k)throw Error(n(318));if(k=l.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[ii]=l}else eu(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;rr(l),k=!1}else Ns!==null&&(_g(Ns),Ns=null),k=!0;if(!k)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=h,l):(g=g!==null,g!==(o!==null&&o.memoizedState!==null)&&g&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Qt.current&1)!==0?In===0&&(In=3):bg())),l.updateQueue!==null&&(l.flags|=4),rr(l),null);case 4:return su(),lg(o,l),o===null&&Kc(l.stateNode.containerInfo),rr(l),null;case 10:return Nv(l.type._context),rr(l),null;case 17:return Mr(l.type)&&wh(),rr(l),null;case 19:if($t(Qt),k=l.memoizedState,k===null)return rr(l),null;if(g=(l.flags&128)!==0,M=k.rendering,M===null)if(g)ad(k,!1);else{if(In!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(M=Mh(o),M!==null){for(l.flags|=128,ad(k,!1),g=M.updateQueue,g!==null&&(l.updateQueue=g,l.flags|=4),l.subtreeFlags=0,g=h,h=l.child;h!==null;)k=h,o=g,k.flags&=14680066,M=k.alternate,M===null?(k.childLanes=0,k.lanes=o,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=M.childLanes,k.lanes=M.lanes,k.child=M.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=M.memoizedProps,k.memoizedState=M.memoizedState,k.updateQueue=M.updateQueue,k.type=M.type,o=M.dependencies,k.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),h=h.sibling;return Nt(Qt,Qt.current&1|2),l.child}o=o.sibling}k.tail!==null&&Yt()>lu&&(l.flags|=128,g=!0,ad(k,!1),l.lanes=4194304)}else{if(!g)if(o=Mh(M),o!==null){if(l.flags|=128,g=!0,h=o.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),ad(k,!0),k.tail===null&&k.tailMode==="hidden"&&!M.alternate&&!Wt)return rr(l),null}else 2*Yt()-k.renderingStartTime>lu&&h!==1073741824&&(l.flags|=128,g=!0,ad(k,!1),l.lanes=4194304);k.isBackwards?(M.sibling=l.child,l.child=M):(h=k.last,h!==null?h.sibling=M:l.child=M,k.last=M)}return k.tail!==null?(l=k.tail,k.rendering=l,k.tail=l.sibling,k.renderingStartTime=Yt(),l.sibling=null,h=Qt.current,Nt(Qt,g?h&1|2:h&1),l):(rr(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?(Jr&1073741824)!==0&&(rr(l),l.subtreeFlags&6&&(l.flags|=8192)):rr(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function KL(o,l){switch(Rv(l),l.tag){case 1:return Mr(l.type)&&wh(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return su(),$t(Ar),$t(tr),Uv(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return Hv(l),null;case 13:if($t(Qt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));eu()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return $t(Qt),null;case 4:return su(),null;case 10:return Nv(l.type._context),null;case 22:case 23:return wg(),null;case 24:return null;default:return null}}var Hh=!1,sr=!1,YL=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function ou(o,l){var h=o.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(g){un(o,l,g)}else h.current=null}function ug(o,l,h){try{h()}catch(g){un(o,l,g)}}var HS=!1;function XL(o,l){if(wv=ah,o=_b(),hv(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var b=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{h.nodeType,k.nodeType}catch{h=null;break e}var M=0,$=-1,B=-1,re=0,ve=0,_e=o,me=null;t:for(;;){for(var Pe;_e!==h||b!==0&&_e.nodeType!==3||($=M+b),_e!==k||g!==0&&_e.nodeType!==3||(B=M+g),_e.nodeType===3&&(M+=_e.nodeValue.length),(Pe=_e.firstChild)!==null;)me=_e,_e=Pe;for(;;){if(_e===o)break t;if(me===h&&++re===b&&($=M),me===k&&++ve===g&&(B=M),(Pe=_e.nextSibling)!==null)break;_e=me,me=_e.parentNode}_e=Pe}h=$===-1||B===-1?null:{start:$,end:B}}else h=null}h=h||{start:0,end:0}}else h=null;for(bv={focusedElem:o,selectionRange:h},ah=!1,Ie=l;Ie!==null;)if(l=Ie,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Ie=o;else for(;Ie!==null;){l=Ie;try{var Ae=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Ae!==null){var Le=Ae.memoizedProps,vn=Ae.memoizedState,ee=l.stateNode,G=ee.getSnapshotBeforeUpdate(l.elementType===l.type?Le:js(l.type,Le),vn);ee.__reactInternalSnapshotBeforeUpdate=G}break;case 3:var te=l.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(be){un(l,l.return,be)}if(o=l.sibling,o!==null){o.return=l.return,Ie=o;break}Ie=l.return}return Ae=HS,HS=!1,Ae}function ld(o,l,h){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 k=b.destroy;b.destroy=void 0,k!==void 0&&ug(l,h,k)}b=b.next}while(b!==g)}}function zh(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&o)===o){var g=h.create;h.destroy=g()}h=h.next}while(h!==l)}}function cg(o){var l=o.ref;if(l!==null){var h=o.stateNode;switch(o.tag){case 5:o=h;break;default:o=h}typeof l=="function"?l(o):l.current=o}}function zS(o){var l=o.alternate;l!==null&&(o.alternate=null,zS(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[ii],delete l[Xc],delete l[Cv],delete l[LL],delete l[OL])),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 US(o){return o.tag===5||o.tag===3||o.tag===4}function BS(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||US(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 dg(o,l,h){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?h.nodeType===8?h.parentNode.insertBefore(o,l):h.insertBefore(o,l):(h.nodeType===8?(l=h.parentNode,l.insertBefore(o,h)):(l=h,l.appendChild(o)),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=_h));else if(g!==4&&(o=o.child,o!==null))for(dg(o,l,h),o=o.sibling;o!==null;)dg(o,l,h),o=o.sibling}function fg(o,l,h){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?h.insertBefore(o,l):h.appendChild(o);else if(g!==4&&(o=o.child,o!==null))for(fg(o,l,h),o=o.sibling;o!==null;)fg(o,l,h),o=o.sibling}var Wn=null,Fs=!1;function No(o,l,h){for(h=h.child;h!==null;)WS(o,l,h),h=h.sibling}function WS(o,l,h){if(vs&&typeof vs.onCommitFiberUnmount=="function")try{vs.onCommitFiberUnmount(Ia,h)}catch{}switch(h.tag){case 5:sr||ou(h,l);case 6:var g=Wn,b=Fs;Wn=null,No(o,l,h),Wn=g,Fs=b,Wn!==null&&(Fs?(o=Wn,h=h.stateNode,o.nodeType===8?o.parentNode.removeChild(h):o.removeChild(h)):Wn.removeChild(h.stateNode));break;case 18:Wn!==null&&(Fs?(o=Wn,h=h.stateNode,o.nodeType===8?kv(o.parentNode,h):o.nodeType===1&&kv(o,h),$c(o)):kv(Wn,h.stateNode));break;case 4:g=Wn,b=Fs,Wn=h.stateNode.containerInfo,Fs=!0,No(o,l,h),Wn=g,Fs=b;break;case 0:case 11:case 14:case 15:if(!sr&&(g=h.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){b=g=g.next;do{var k=b,M=k.destroy;k=k.tag,M!==void 0&&((k&2)!==0||(k&4)!==0)&&ug(h,l,M),b=b.next}while(b!==g)}No(o,l,h);break;case 1:if(!sr&&(ou(h,l),g=h.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=h.memoizedProps,g.state=h.memoizedState,g.componentWillUnmount()}catch($){un(h,l,$)}No(o,l,h);break;case 21:No(o,l,h);break;case 22:h.mode&1?(sr=(g=sr)||h.memoizedState!==null,No(o,l,h),sr=g):No(o,l,h);break;default:No(o,l,h)}}function qS(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var h=o.stateNode;h===null&&(h=o.stateNode=new YL),l.forEach(function(g){var b=oO.bind(null,o,g);h.has(g)||(h.add(g),g.then(b,b))})}}function Vs(o,l){var h=l.deletions;if(h!==null)for(var g=0;g<h.length;g++){var b=h[g];try{var k=o,M=l,$=M;e:for(;$!==null;){switch($.tag){case 5:Wn=$.stateNode,Fs=!1;break e;case 3:Wn=$.stateNode.containerInfo,Fs=!0;break e;case 4:Wn=$.stateNode.containerInfo,Fs=!0;break e}$=$.return}if(Wn===null)throw Error(n(160));WS(k,M,b),Wn=null,Fs=!1;var B=b.alternate;B!==null&&(B.return=null),b.return=null}catch(re){un(b,l,re)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)ZS(l,o),l=l.sibling}function ZS(o,l){var h=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Vs(l,o),li(o),g&4){try{ld(3,o,o.return),zh(3,o)}catch(Le){un(o,o.return,Le)}try{ld(5,o,o.return)}catch(Le){un(o,o.return,Le)}}break;case 1:Vs(l,o),li(o),g&512&&h!==null&&ou(h,h.return);break;case 5:if(Vs(l,o),li(o),g&512&&h!==null&&ou(h,h.return),o.flags&32){var b=o.stateNode;try{fr(b,"")}catch(Le){un(o,o.return,Le)}}if(g&4&&(b=o.stateNode,b!=null)){var k=o.memoizedProps,M=h!==null?h.memoizedProps:k,$=o.type,B=o.updateQueue;if(o.updateQueue=null,B!==null)try{$==="input"&&k.type==="radio"&&k.name!=null&&rt(b,k),ko($,M);var re=ko($,k);for(M=0;M<B.length;M+=2){var ve=B[M],_e=B[M+1];ve==="style"?ti(b,_e):ve==="dangerouslySetInnerHTML"?Ta(b,_e):ve==="children"?fr(b,_e):P(b,ve,_e,re)}switch($){case"input":Ve(b,k);break;case"textarea":Ot(b,k);break;case"select":var me=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!k.multiple;var Pe=k.value;Pe!=null?vt(b,!!k.multiple,Pe,!1):me!==!!k.multiple&&(k.defaultValue!=null?vt(b,!!k.multiple,k.defaultValue,!0):vt(b,!!k.multiple,k.multiple?[]:"",!1))}b[Xc]=k}catch(Le){un(o,o.return,Le)}}break;case 6:if(Vs(l,o),li(o),g&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,k=o.memoizedProps;try{b.nodeValue=k}catch(Le){un(o,o.return,Le)}}break;case 3:if(Vs(l,o),li(o),g&4&&h!==null&&h.memoizedState.isDehydrated)try{$c(l.containerInfo)}catch(Le){un(o,o.return,Le)}break;case 4:Vs(l,o),li(o);break;case 13:Vs(l,o),li(o),b=o.child,b.flags&8192&&(k=b.memoizedState!==null,b.stateNode.isHidden=k,!k||b.alternate!==null&&b.alternate.memoizedState!==null||(mg=Yt())),g&4&&qS(o);break;case 22:if(ve=h!==null&&h.memoizedState!==null,o.mode&1?(sr=(re=sr)||ve,Vs(l,o),sr=re):Vs(l,o),li(o),g&8192){if(re=o.memoizedState!==null,(o.stateNode.isHidden=re)&&!ve&&(o.mode&1)!==0)for(Ie=o,ve=o.child;ve!==null;){for(_e=Ie=ve;Ie!==null;){switch(me=Ie,Pe=me.child,me.tag){case 0:case 11:case 14:case 15:ld(4,me,me.return);break;case 1:ou(me,me.return);var Ae=me.stateNode;if(typeof Ae.componentWillUnmount=="function"){g=me,h=me.return;try{l=g,Ae.props=l.memoizedProps,Ae.state=l.memoizedState,Ae.componentWillUnmount()}catch(Le){un(g,h,Le)}}break;case 5:ou(me,me.return);break;case 22:if(me.memoizedState!==null){YS(_e);continue}}Pe!==null?(Pe.return=me,Ie=Pe):YS(_e)}ve=ve.sibling}e:for(ve=null,_e=o;;){if(_e.tag===5){if(ve===null){ve=_e;try{b=_e.stateNode,re?(k=b.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):($=_e.stateNode,B=_e.memoizedProps.style,M=B!=null&&B.hasOwnProperty("display")?B.display:null,$.style.display=Un("display",M))}catch(Le){un(o,o.return,Le)}}}else if(_e.tag===6){if(ve===null)try{_e.stateNode.nodeValue=re?"":_e.memoizedProps}catch(Le){un(o,o.return,Le)}}else if((_e.tag!==22&&_e.tag!==23||_e.memoizedState===null||_e===o)&&_e.child!==null){_e.child.return=_e,_e=_e.child;continue}if(_e===o)break e;for(;_e.sibling===null;){if(_e.return===null||_e.return===o)break e;ve===_e&&(ve=null),_e=_e.return}ve===_e&&(ve=null),_e.sibling.return=_e.return,_e=_e.sibling}}break;case 19:Vs(l,o),li(o),g&4&&qS(o);break;case 21:break;default:Vs(l,o),li(o)}}function li(o){var l=o.flags;if(l&2){try{e:{for(var h=o.return;h!==null;){if(US(h)){var g=h;break e}h=h.return}throw Error(n(160))}switch(g.tag){case 5:var b=g.stateNode;g.flags&32&&(fr(b,""),g.flags&=-33);var k=BS(o);fg(o,k,b);break;case 3:case 4:var M=g.stateNode.containerInfo,$=BS(o);dg(o,$,M);break;default:throw Error(n(161))}}catch(B){un(o,o.return,B)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function QL(o,l,h){Ie=o,GS(o)}function GS(o,l,h){for(var g=(o.mode&1)!==0;Ie!==null;){var b=Ie,k=b.child;if(b.tag===22&&g){var M=b.memoizedState!==null||Hh;if(!M){var $=b.alternate,B=$!==null&&$.memoizedState!==null||sr;$=Hh;var re=sr;if(Hh=M,(sr=B)&&!re)for(Ie=b;Ie!==null;)M=Ie,B=M.child,M.tag===22&&M.memoizedState!==null?XS(b):B!==null?(B.return=M,Ie=B):XS(b);for(;k!==null;)Ie=k,GS(k),k=k.sibling;Ie=b,Hh=$,sr=re}KS(o)}else(b.subtreeFlags&8772)!==0&&k!==null?(k.return=b,Ie=k):KS(o)}}function KS(o){for(;Ie!==null;){var l=Ie;if((l.flags&8772)!==0){var h=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:sr||zh(5,l);break;case 1:var g=l.stateNode;if(l.flags&4&&!sr)if(h===null)g.componentDidMount();else{var b=l.elementType===l.type?h.memoizedProps:js(l.type,h.memoizedProps);g.componentDidUpdate(b,h.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var k=l.updateQueue;k!==null&&Yb(l,k,g);break;case 3:var M=l.updateQueue;if(M!==null){if(h=null,l.child!==null)switch(l.child.tag){case 5:h=l.child.stateNode;break;case 1:h=l.child.stateNode}Yb(l,M,h)}break;case 5:var $=l.stateNode;if(h===null&&l.flags&4){h=$;var B=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":B.autoFocus&&h.focus();break;case"img":B.src&&(h.src=B.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var re=l.alternate;if(re!==null){var ve=re.memoizedState;if(ve!==null){var _e=ve.dehydrated;_e!==null&&$c(_e)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}sr||l.flags&512&&cg(l)}catch(me){un(l,l.return,me)}}if(l===o){Ie=null;break}if(h=l.sibling,h!==null){h.return=l.return,Ie=h;break}Ie=l.return}}function YS(o){for(;Ie!==null;){var l=Ie;if(l===o){Ie=null;break}var h=l.sibling;if(h!==null){h.return=l.return,Ie=h;break}Ie=l.return}}function XS(o){for(;Ie!==null;){var l=Ie;try{switch(l.tag){case 0:case 11:case 15:var h=l.return;try{zh(4,l)}catch(B){un(l,h,B)}break;case 1:var g=l.stateNode;if(typeof g.componentDidMount=="function"){var b=l.return;try{g.componentDidMount()}catch(B){un(l,b,B)}}var k=l.return;try{cg(l)}catch(B){un(l,k,B)}break;case 5:var M=l.return;try{cg(l)}catch(B){un(l,M,B)}}}catch(B){un(l,l.return,B)}if(l===o){Ie=null;break}var $=l.sibling;if($!==null){$.return=l.return,Ie=$;break}Ie=l.return}}var JL=Math.ceil,Uh=T.ReactCurrentDispatcher,hg=T.ReactCurrentOwner,bs=T.ReactCurrentBatchConfig,ht=0,jn=null,En=null,qn=0,Jr=0,au=Ao(0),In=0,ud=null,Fa=0,Bh=0,pg=0,cd=null,Or=null,mg=0,lu=1/0,Wi=null,Wh=!1,vg=null,jo=null,qh=!1,Fo=null,Zh=0,dd=0,gg=null,Gh=-1,Kh=0;function vr(){return(ht&6)!==0?Yt():Gh!==-1?Gh:Gh=Yt()}function Vo(o){return(o.mode&1)===0?1:(ht&2)!==0&&qn!==0?qn&-qn:NL.transition!==null?(Kh===0&&(Kh=Dc()),Kh):(o=le,o!==0||(o=window.event,o=o===void 0?16:Jw(o.type)),o)}function $s(o,l,h,g){if(50<dd)throw dd=0,gg=null,Error(n(185));ie(o,h,g),((ht&2)===0||o!==jn)&&(o===jn&&((ht&2)===0&&(Bh|=h),In===4&&$o(o,qn)),Dr(o,g),h===1&&ht===0&&(l.mode&1)===0&&(lu=Yt()+500,Sh&&Lo()))}function Dr(o,l){var h=o.callbackNode;ih(o,l);var g=Co(o,o===jn?qn:0);if(g===0)h!==null&&th(h),o.callbackNode=null,o.callbackPriority=0;else if(l=g&-g,o.callbackPriority!==l){if(h!=null&&th(h),l===1)o.tag===0?DL(JS.bind(null,o)):Fb(JS.bind(null,o)),AL(function(){(ht&6)===0&&Lo()}),h=null;else{switch(ye(g)){case 1:h=Mc;break;case 4:h=nh;break;case 16:h=Fl;break;case 536870912:h=Vl;break;default:h=Fl}h=a4(h,QS.bind(null,o))}o.callbackPriority=l,o.callbackNode=h}}function QS(o,l){if(Gh=-1,Kh=0,(ht&6)!==0)throw Error(n(327));var h=o.callbackNode;if(uu()&&o.callbackNode!==h)return null;var g=Co(o,o===jn?qn:0);if(g===0)return null;if((g&30)!==0||(g&o.expiredLanes)!==0||l)l=Yh(o,g);else{l=g;var b=ht;ht|=2;var k=t4();(jn!==o||qn!==l)&&(Wi=null,lu=Yt()+500,$a(o,l));do try{nO();break}catch($){e4(o,$)}while(!0);Dv(),Uh.current=k,ht=b,En!==null?l=0:(jn=null,qn=0,l=In)}if(l!==0){if(l===2&&(b=Hl(o),b!==0&&(g=b,l=yg(o,b))),l===1)throw h=ud,$a(o,0),$o(o,g),Dr(o,Yt()),h;if(l===6)$o(o,g);else{if(b=o.current.alternate,(g&30)===0&&!eO(b)&&(l=Yh(o,g),l===2&&(k=Hl(o),k!==0&&(g=k,l=yg(o,k))),l===1))throw h=ud,$a(o,0),$o(o,g),Dr(o,Yt()),h;switch(o.finishedWork=b,o.finishedLanes=g,l){case 0:case 1:throw Error(n(345));case 2:Ha(o,Or,Wi);break;case 3:if($o(o,g),(g&130023424)===g&&(l=mg+500-Yt(),10<l)){if(Co(o,0)!==0)break;if(b=o.suspendedLanes,(b&g)!==g){vr(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=Ev(Ha.bind(null,o,Or,Wi),l);break}Ha(o,Or,Wi);break;case 4:if($o(o,g),(g&4194240)===g)break;for(l=o.eventTimes,b=-1;0<g;){var M=31-Dn(g);k=1<<M,M=l[M],M>b&&(b=M),g&=~k}if(g=b,g=Yt()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*JL(g/1960))-g,10<g){o.timeoutHandle=Ev(Ha.bind(null,o,Or,Wi),g);break}Ha(o,Or,Wi);break;case 5:Ha(o,Or,Wi);break;default:throw Error(n(329))}}}return Dr(o,Yt()),o.callbackNode===h?QS.bind(null,o):null}function yg(o,l){var h=cd;return o.current.memoizedState.isDehydrated&&($a(o,l).flags|=256),o=Yh(o,l),o!==2&&(l=Or,Or=h,l!==null&&_g(l)),o}function _g(o){Or===null?Or=o:Or.push.apply(Or,o)}function eO(o){for(var l=o;;){if(l.flags&16384){var h=l.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var g=0;g<h.length;g++){var b=h[g],k=b.getSnapshot;b=b.value;try{if(!Ds(k(),b))return!1}catch{return!1}}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;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 $o(o,l){for(l&=~pg,l&=~Bh,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var h=31-Dn(l),g=1<<h;o[h]=-1,l&=~g}}function JS(o){if((ht&6)!==0)throw Error(n(327));uu();var l=Co(o,0);if((l&1)===0)return Dr(o,Yt()),null;var h=Yh(o,l);if(o.tag!==0&&h===2){var g=Hl(o);g!==0&&(l=g,h=yg(o,g))}if(h===1)throw h=ud,$a(o,0),$o(o,l),Dr(o,Yt()),h;if(h===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,Ha(o,Or,Wi),Dr(o,Yt()),null}function xg(o,l){var h=ht;ht|=1;try{return o(l)}finally{ht=h,ht===0&&(lu=Yt()+500,Sh&&Lo())}}function Va(o){Fo!==null&&Fo.tag===0&&(ht&6)===0&&uu();var l=ht;ht|=1;var h=bs.transition,g=le;try{if(bs.transition=null,le=1,o)return o()}finally{le=g,bs.transition=h,ht=l,(ht&6)===0&&Lo()}}function wg(){Jr=au.current,$t(au)}function $a(o,l){o.finishedWork=null,o.finishedLanes=0;var h=o.timeoutHandle;if(h!==-1&&(o.timeoutHandle=-1,RL(h)),En!==null)for(h=En.return;h!==null;){var g=h;switch(Rv(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&wh();break;case 3:su(),$t(Ar),$t(tr),Uv();break;case 5:Hv(g);break;case 4:su();break;case 13:$t(Qt);break;case 19:$t(Qt);break;case 10:Nv(g.type._context);break;case 22:case 23:wg()}h=h.return}if(jn=o,En=o=Ho(o.current,null),qn=Jr=l,In=0,ud=null,pg=Bh=Fa=0,Or=cd=null,Da!==null){for(l=0;l<Da.length;l++)if(h=Da[l],g=h.interleaved,g!==null){h.interleaved=null;var b=g.next,k=h.pending;if(k!==null){var M=k.next;k.next=b,g.next=M}h.pending=g}Da=null}return o}function e4(o,l){do{var h=En;try{if(Dv(),Lh.current=jh,Oh){for(var g=Jt.memoizedState;g!==null;){var b=g.queue;b!==null&&(b.pending=null),g=g.next}Oh=!1}if(ja=0,Nn=Tn=Jt=null,rd=!1,sd=0,hg.current=null,h===null||h.return===null){In=1,ud=l,En=null;break}e:{var k=o,M=h.return,$=h,B=l;if(l=qn,$.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var re=B,ve=$,_e=ve.tag;if((ve.mode&1)===0&&(_e===0||_e===11||_e===15)){var me=ve.alternate;me?(ve.updateQueue=me.updateQueue,ve.memoizedState=me.memoizedState,ve.lanes=me.lanes):(ve.updateQueue=null,ve.memoizedState=null)}var Pe=kS(M);if(Pe!==null){Pe.flags&=-257,CS(Pe,M,$,k,l),Pe.mode&1&&ES(k,re,l),l=Pe,B=re;var Ae=l.updateQueue;if(Ae===null){var Le=new Set;Le.add(B),l.updateQueue=Le}else Ae.add(B);break e}else{if((l&1)===0){ES(k,re,l),bg();break e}B=Error(n(426))}}else if(Wt&&$.mode&1){var vn=kS(M);if(vn!==null){(vn.flags&65536)===0&&(vn.flags|=256),CS(vn,M,$,k,l),Lv(iu(B,$));break e}}k=B=iu(B,$),In!==4&&(In=2),cd===null?cd=[k]:cd.push(k),k=M;do{switch(k.tag){case 3:k.flags|=65536,l&=-l,k.lanes|=l;var ee=bS(k,B,l);Kb(k,ee);break e;case 1:$=B;var G=k.type,te=k.stateNode;if((k.flags&128)===0&&(typeof G.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(jo===null||!jo.has(te)))){k.flags|=65536,l&=-l,k.lanes|=l;var be=SS(k,$,l);Kb(k,be);break e}}k=k.return}while(k!==null)}r4(h)}catch(Ne){l=Ne,En===h&&h!==null&&(En=h=h.return);continue}break}while(!0)}function t4(){var o=Uh.current;return Uh.current=jh,o===null?jh:o}function bg(){(In===0||In===3||In===2)&&(In=4),jn===null||(Fa&268435455)===0&&(Bh&268435455)===0||$o(jn,qn)}function Yh(o,l){var h=ht;ht|=2;var g=t4();(jn!==o||qn!==l)&&(Wi=null,$a(o,l));do try{tO();break}catch(b){e4(o,b)}while(!0);if(Dv(),ht=h,Uh.current=g,En!==null)throw Error(n(261));return jn=null,qn=0,In}function tO(){for(;En!==null;)n4(En)}function nO(){for(;En!==null&&!J0();)n4(En)}function n4(o){var l=o4(o.alternate,o,Jr);o.memoizedProps=o.pendingProps,l===null?r4(o):En=l,hg.current=null}function r4(o){var l=o;do{var h=l.alternate;if(o=l.return,(l.flags&32768)===0){if(h=GL(h,l,Jr),h!==null){En=h;return}}else{if(h=KL(h,l),h!==null){h.flags&=32767,En=h;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{In=6,En=null;return}}if(l=l.sibling,l!==null){En=l;return}En=l=o}while(l!==null);In===0&&(In=5)}function Ha(o,l,h){var g=le,b=bs.transition;try{bs.transition=null,le=1,rO(o,l,h,g)}finally{bs.transition=b,le=g}return null}function rO(o,l,h,g){do uu();while(Fo!==null);if((ht&6)!==0)throw Error(n(327));h=o.finishedWork;var b=o.finishedLanes;if(h===null)return null;if(o.finishedWork=null,o.finishedLanes=0,h===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var k=h.lanes|h.childLanes;if(ke(o,k),o===jn&&(En=jn=null,qn=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||qh||(qh=!0,a4(Fl,function(){return uu(),null})),k=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||k){k=bs.transition,bs.transition=null;var M=le;le=1;var $=ht;ht|=4,hg.current=null,XL(o,h),ZS(h,o),SL(bv),ah=!!wv,bv=wv=null,o.current=h,QL(h),ev(),ht=$,le=M,bs.transition=k}else o.current=h;if(qh&&(qh=!1,Fo=o,Zh=b),k=o.pendingLanes,k===0&&(jo=null),Kw(h.stateNode),Dr(o,Yt()),l!==null)for(g=o.onRecoverableError,h=0;h<l.length;h++)b=l[h],g(b.value,{componentStack:b.stack,digest:b.digest});if(Wh)throw Wh=!1,o=vg,vg=null,o;return(Zh&1)!==0&&o.tag!==0&&uu(),k=o.pendingLanes,(k&1)!==0?o===gg?dd++:(dd=0,gg=o):dd=0,Lo(),null}function uu(){if(Fo!==null){var o=ye(Zh),l=bs.transition,h=le;try{if(bs.transition=null,le=16>o?16:o,Fo===null)var g=!1;else{if(o=Fo,Fo=null,Zh=0,(ht&6)!==0)throw Error(n(331));var b=ht;for(ht|=4,Ie=o.current;Ie!==null;){var k=Ie,M=k.child;if((Ie.flags&16)!==0){var $=k.deletions;if($!==null){for(var B=0;B<$.length;B++){var re=$[B];for(Ie=re;Ie!==null;){var ve=Ie;switch(ve.tag){case 0:case 11:case 15:ld(8,ve,k)}var _e=ve.child;if(_e!==null)_e.return=ve,Ie=_e;else for(;Ie!==null;){ve=Ie;var me=ve.sibling,Pe=ve.return;if(zS(ve),ve===re){Ie=null;break}if(me!==null){me.return=Pe,Ie=me;break}Ie=Pe}}}var Ae=k.alternate;if(Ae!==null){var Le=Ae.child;if(Le!==null){Ae.child=null;do{var vn=Le.sibling;Le.sibling=null,Le=vn}while(Le!==null)}}Ie=k}}if((k.subtreeFlags&2064)!==0&&M!==null)M.return=k,Ie=M;else e:for(;Ie!==null;){if(k=Ie,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:ld(9,k,k.return)}var ee=k.sibling;if(ee!==null){ee.return=k.return,Ie=ee;break e}Ie=k.return}}var G=o.current;for(Ie=G;Ie!==null;){M=Ie;var te=M.child;if((M.subtreeFlags&2064)!==0&&te!==null)te.return=M,Ie=te;else e:for(M=G;Ie!==null;){if($=Ie,($.flags&2048)!==0)try{switch($.tag){case 0:case 11:case 15:zh(9,$)}}catch(Ne){un($,$.return,Ne)}if($===M){Ie=null;break e}var be=$.sibling;if(be!==null){be.return=$.return,Ie=be;break e}Ie=$.return}}if(ht=b,Lo(),vs&&typeof vs.onPostCommitFiberRoot=="function")try{vs.onPostCommitFiberRoot(Ia,o)}catch{}g=!0}return g}finally{le=h,bs.transition=l}}return!1}function s4(o,l,h){l=iu(h,l),l=bS(o,l,1),o=Do(o,l,1),l=vr(),o!==null&&(ie(o,1,l),Dr(o,l))}function un(o,l,h){if(o.tag===3)s4(o,o,h);else for(;l!==null;){if(l.tag===3){s4(l,o,h);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(jo===null||!jo.has(g))){o=iu(h,o),o=SS(l,o,1),l=Do(l,o,1),o=vr(),l!==null&&(ie(l,1,o),Dr(l,o));break}}l=l.return}}function sO(o,l,h){var g=o.pingCache;g!==null&&g.delete(l),l=vr(),o.pingedLanes|=o.suspendedLanes&h,jn===o&&(qn&h)===h&&(In===4||In===3&&(qn&130023424)===qn&&500>Yt()-mg?$a(o,0):pg|=h),Dr(o,l)}function i4(o,l){l===0&&((o.mode&1)===0?l=1:(l=Ra,Ra<<=1,(Ra&130023424)===0&&(Ra=4194304)));var h=vr();o=zi(o,l),o!==null&&(ie(o,l,h),Dr(o,h))}function iO(o){var l=o.memoizedState,h=0;l!==null&&(h=l.retryLane),i4(o,h)}function oO(o,l){var h=0;switch(o.tag){case 13:var g=o.stateNode,b=o.memoizedState;b!==null&&(h=b.retryLane);break;case 19:g=o.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(l),i4(o,h)}var o4;o4=function(o,l,h){if(o!==null)if(o.memoizedProps!==l.pendingProps||Ar.current)Lr=!0;else{if((o.lanes&h)===0&&(l.flags&128)===0)return Lr=!1,ZL(o,l,h);Lr=(o.flags&131072)!==0}else Lr=!1,Wt&&(l.flags&1048576)!==0&&Vb(l,kh,l.index);switch(l.lanes=0,l.tag){case 2:var g=l.type;$h(o,l),o=l.pendingProps;var b=Xl(l,tr.current);ru(l,h),b=qv(null,l,g,o,b,h);var k=Zv();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,Mr(g)?(k=!0,bh(l)):k=!1,l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Vv(l),b.updater=Fh,l.stateNode=b,b._reactInternals=l,Jv(l,g,o,h),l=rg(null,l,g,!0,k,h)):(l.tag=0,Wt&&k&&Iv(l),mr(null,l,b,h),l=l.child),l;case 16:g=l.elementType;e:{switch($h(o,l),o=l.pendingProps,b=g._init,g=b(g._payload),l.type=g,b=l.tag=lO(g),o=js(g,o),b){case 0:l=ng(null,l,g,o,h);break e;case 1:l=MS(null,l,g,o,h);break e;case 11:l=PS(null,l,g,o,h);break e;case 14:l=TS(null,l,g,js(g.type,o),h);break e}throw Error(n(306,g,""))}return l;case 0:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:js(g,b),ng(o,l,g,b,h);case 1:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:js(g,b),MS(o,l,g,b,h);case 3:e:{if(LS(l),o===null)throw Error(n(387));g=l.pendingProps,k=l.memoizedState,b=k.element,Gb(o,l),Ah(l,g,null,h);var M=l.memoizedState;if(g=M.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},l.updateQueue.baseState=k,l.memoizedState=k,l.flags&256){b=iu(Error(n(423)),l),l=OS(o,l,g,h,b);break e}else if(g!==b){b=iu(Error(n(424)),l),l=OS(o,l,g,h,b);break e}else for(Qr=Ro(l.stateNode.containerInfo.firstChild),Xr=l,Wt=!0,Ns=null,h=qb(l,null,g,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(eu(),g===b){l=Bi(o,l,h);break e}mr(o,l,g,h)}l=l.child}return l;case 5:return Xb(l),o===null&&Mv(l),g=l.type,b=l.pendingProps,k=o!==null?o.memoizedProps:null,M=b.children,Sv(g,b)?M=null:k!==null&&Sv(g,k)&&(l.flags|=32),AS(o,l),mr(o,l,M,h),l.child;case 6:return o===null&&Mv(l),null;case 13:return DS(o,l,h);case 4:return $v(l,l.stateNode.containerInfo),g=l.pendingProps,o===null?l.child=tu(l,null,g,h):mr(o,l,g,h),l.child;case 11:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:js(g,b),PS(o,l,g,b,h);case 7:return mr(o,l,l.pendingProps,h),l.child;case 8:return mr(o,l,l.pendingProps.children,h),l.child;case 12:return mr(o,l,l.pendingProps.children,h),l.child;case 10:e:{if(g=l.type._context,b=l.pendingProps,k=l.memoizedProps,M=b.value,Nt(Th,g._currentValue),g._currentValue=M,k!==null)if(Ds(k.value,M)){if(k.children===b.children&&!Ar.current){l=Bi(o,l,h);break e}}else for(k=l.child,k!==null&&(k.return=l);k!==null;){var $=k.dependencies;if($!==null){M=k.child;for(var B=$.firstContext;B!==null;){if(B.context===g){if(k.tag===1){B=Ui(-1,h&-h),B.tag=2;var re=k.updateQueue;if(re!==null){re=re.shared;var ve=re.pending;ve===null?B.next=B:(B.next=ve.next,ve.next=B),re.pending=B}}k.lanes|=h,B=k.alternate,B!==null&&(B.lanes|=h),jv(k.return,h,l),$.lanes|=h;break}B=B.next}}else if(k.tag===10)M=k.type===l.type?null:k.child;else if(k.tag===18){if(M=k.return,M===null)throw Error(n(341));M.lanes|=h,$=M.alternate,$!==null&&($.lanes|=h),jv(M,h,l),M=k.sibling}else M=k.child;if(M!==null)M.return=k;else for(M=k;M!==null;){if(M===l){M=null;break}if(k=M.sibling,k!==null){k.return=M.return,M=k;break}M=M.return}k=M}mr(o,l,b.children,h),l=l.child}return l;case 9:return b=l.type,g=l.pendingProps.children,ru(l,h),b=xs(b),g=g(b),l.flags|=1,mr(o,l,g,h),l.child;case 14:return g=l.type,b=js(g,l.pendingProps),b=js(g.type,b),TS(o,l,g,b,h);case 15:return IS(o,l,l.type,l.pendingProps,h);case 17:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:js(g,b),$h(o,l),l.tag=1,Mr(g)?(o=!0,bh(l)):o=!1,ru(l,h),xS(l,g,b),Jv(l,g,b,h),rg(null,l,g,!0,o,h);case 19:return jS(o,l,h);case 22:return RS(o,l,h)}throw Error(n(156,l.tag))};function a4(o,l){return eh(o,l)}function aO(o,l,h,g){this.tag=o,this.key=h,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 Ss(o,l,h,g){return new aO(o,l,h,g)}function Sg(o){return o=o.prototype,!(!o||!o.isReactComponent)}function lO(o){if(typeof o=="function")return Sg(o)?1:0;if(o!=null){if(o=o.$$typeof,o===F)return 11;if(o===K)return 14}return 2}function Ho(o,l){var h=o.alternate;return h===null?(h=Ss(o.tag,l,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=l,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&14680064,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,l=o.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h}function Xh(o,l,h,g,b,k){var M=2;if(g=o,typeof o=="function")Sg(o)&&(M=1);else if(typeof o=="string")M=5;else e:switch(o){case O:return za(h.children,b,k,l);case R:M=8,b|=8;break;case L:return o=Ss(12,h,l,b|2),o.elementType=L,o.lanes=k,o;case Z:return o=Ss(13,h,l,b),o.elementType=Z,o.lanes=k,o;case Q:return o=Ss(19,h,l,b),o.elementType=Q,o.lanes=k,o;case W:return Qh(h,b,k,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case D:M=10;break e;case j:M=9;break e;case F:M=11;break e;case K:M=14;break e;case q:M=16,g=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=Ss(M,h,l,b),l.elementType=o,l.type=g,l.lanes=k,l}function za(o,l,h,g){return o=Ss(7,o,g,l),o.lanes=h,o}function Qh(o,l,h,g){return o=Ss(22,o,g,l),o.elementType=W,o.lanes=h,o.stateNode={isHidden:!1},o}function Eg(o,l,h){return o=Ss(6,o,null,l),o.lanes=h,o}function kg(o,l,h){return l=Ss(4,o.children!==null?o.children:[],o.key,l),l.lanes=h,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function uO(o,l,h,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=V(0),this.expirationTimes=V(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=V(0),this.identifierPrefix=g,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function Cg(o,l,h,g,b,k,M,$,B){return o=new uO(o,l,h,$,B),l===1?(l=1,k===!0&&(l|=8)):l=0,k=Ss(3,null,null,l),o.current=k,k.stateNode=o,k.memoizedState={element:g,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vv(k),o}function cO(o,l,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:g==null?null:""+g,children:o,containerInfo:l,implementation:h}}function l4(o){if(!o)return Mo;o=o._reactInternals;e:{if(ji(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(Mr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var h=o.type;if(Mr(h))return Nb(o,h,l)}return l}function u4(o,l,h,g,b,k,M,$,B){return o=Cg(h,g,!0,o,b,k,M,$,B),o.context=l4(null),h=o.current,g=vr(),b=Vo(h),k=Ui(g,b),k.callback=l??null,Do(h,k,b),o.current.lanes=b,ie(o,b,g),Dr(o,g),o}function Jh(o,l,h,g){var b=l.current,k=vr(),M=Vo(b);return h=l4(h),l.context===null?l.context=h:l.pendingContext=h,l=Ui(k,M),l.payload={element:o},g=g===void 0?null:g,g!==null&&(l.callback=g),o=Do(b,l,M),o!==null&&($s(o,b,M,k),Rh(o,b,M)),M}function ep(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 c4(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<l?h:l}}function Pg(o,l){c4(o,l),(o=o.alternate)&&c4(o,l)}function dO(){return null}var d4=typeof reportError=="function"?reportError:function(o){console.error(o)};function Tg(o){this._internalRoot=o}tp.prototype.render=Tg.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));Jh(o,l,null,null)},tp.prototype.unmount=Tg.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Va(function(){Jh(null,o,null,null)}),l[Fi]=null}};function tp(o){this._internalRoot=o}tp.prototype.unstable_scheduleHydration=function(o){if(o){var l=Sn();o={blockedOn:null,target:o,priority:l};for(var h=0;h<Po.length&&l!==0&&l<Po[h].priority;h++);Po.splice(h,0,o),h===0&&Xw(o)}};function Ig(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function np(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function f4(){}function fO(o,l,h,g,b){if(b){if(typeof g=="function"){var k=g;g=function(){var re=ep(M);k.call(re)}}var M=u4(l,g,o,0,null,!1,!1,"",f4);return o._reactRootContainer=M,o[Fi]=M.current,Kc(o.nodeType===8?o.parentNode:o),Va(),M}for(;b=o.lastChild;)o.removeChild(b);if(typeof g=="function"){var $=g;g=function(){var re=ep(B);$.call(re)}}var B=Cg(o,0,!1,null,null,!1,!1,"",f4);return o._reactRootContainer=B,o[Fi]=B.current,Kc(o.nodeType===8?o.parentNode:o),Va(function(){Jh(l,B,h,g)}),B}function rp(o,l,h,g,b){var k=h._reactRootContainer;if(k){var M=k;if(typeof b=="function"){var $=b;b=function(){var B=ep(M);$.call(B)}}Jh(l,M,o,b)}else M=fO(h,l,o,b,g);return ep(M)}qe=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var h=si(l.pendingLanes);h!==0&&(he(l,h|1),Dr(l,Yt()),(ht&6)===0&&(lu=Yt()+500,Lo()))}break;case 13:Va(function(){var g=zi(o,1);if(g!==null){var b=vr();$s(g,o,1,b)}}),Pg(o,1)}},De=function(o){if(o.tag===13){var l=zi(o,134217728);if(l!==null){var h=vr();$s(l,o,134217728,h)}Pg(o,134217728)}},Xt=function(o){if(o.tag===13){var l=Vo(o),h=zi(o,l);if(h!==null){var g=vr();$s(h,o,l,g)}Pg(o,l)}},Sn=function(){return le},Ir=function(o,l){var h=le;try{return le=o,l()}finally{le=h}},Os=function(o,l,h){switch(l){case"input":if(Ve(o,h),l=h.name,h.type==="radio"&&l!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<h.length;l++){var g=h[l];if(g!==o&&g.form===o.form){var b=xh(g);if(!b)throw Error(n(90));He(g),Ve(g,b)}}}break;case"textarea":Ot(o,h);break;case"select":l=h.value,l!=null&&vt(o,!!h.multiple,l,!1)}},Ze=xg,Dt=Va;var hO={usingClientEntryPoint:!1,Events:[Qc,Kl,xh,ni,ms,xg]},fd={findFiberByHostInstance:Aa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},pO={bundleType:fd.bundleType,version:fd.version,rendererPackageName:fd.rendererPackageName,rendererConfig:fd.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=Jf(o),o===null?null:o.stateNode},findFiberByHostInstance:fd.findFiberByHostInstance||dO,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 sp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sp.isDisabled&&sp.supportsFiber)try{Ia=sp.inject(pO),vs=sp}catch{}}return Nr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hO,Nr.createPortal=function(o,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ig(l))throw Error(n(200));return cO(o,l,null,h)},Nr.createRoot=function(o,l){if(!Ig(o))throw Error(n(299));var h=!1,g="",b=d4;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),l=Cg(o,1,!1,null,null,h,!1,g,b),o[Fi]=l.current,Kc(o.nodeType===8?o.parentNode:o),new Tg(l)},Nr.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=Jf(l),o=o===null?null:o.stateNode,o},Nr.flushSync=function(o){return Va(o)},Nr.hydrate=function(o,l,h){if(!np(l))throw Error(n(200));return rp(null,o,l,!0,h)},Nr.hydrateRoot=function(o,l,h){if(!Ig(o))throw Error(n(405));var g=h!=null&&h.hydratedSources||null,b=!1,k="",M=d4;if(h!=null&&(h.unstable_strictMode===!0&&(b=!0),h.identifierPrefix!==void 0&&(k=h.identifierPrefix),h.onRecoverableError!==void 0&&(M=h.onRecoverableError)),l=u4(l,null,o,1,h??null,b,!1,k,M),o[Fi]=l.current,Kc(o),g)for(o=0;o<g.length;o++)h=g[o],b=h._getVersion,b=b(h._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[h,b]:l.mutableSourceEagerHydrationData.push(h,b);return new tp(l)},Nr.render=function(o,l,h){if(!np(l))throw Error(n(200));return rp(null,o,l,!1,h)},Nr.unmountComponentAtNode=function(o){if(!np(o))throw Error(n(40));return o._reactRootContainer?(Va(function(){rp(null,null,o,!1,function(){o._reactRootContainer=null,o[Fi]=null})}),!0):!1},Nr.unstable_batchedUpdates=xg,Nr.unstable_renderSubtreeIntoContainer=function(o,l,h,g){if(!np(h))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return rp(o,l,h,!1,g)},Nr.version="18.3.1-next-f1338f8080-20240426",Nr}var ZE;function x3(){if(ZE)return f1.exports;ZE=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(),f1.exports=sj(),f1.exports}var GE;function ij(){if(GE)return _p;GE=1;var t=x3();return _p.createRoot=t.createRoot,_p.hydrateRoot=t.hydrateRoot,_p}var oj=ij();const aj=x0(oj),co={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function w3(t){return"init"in t}function f_(t){return typeof t.write=="function"}function lj(t){return!!t.onMount}function KE(t){return"v"in t||"e"in t}function Bm(t){if("e"in t)throw t.e;if((co?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Wm(t){return typeof(t==null?void 0:t.then)=="function"}function uj(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 b3(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function S3(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 cj(t){return!!t.INTERNAL_onInit}const dj=(t,e,n,...r)=>n.read(...r),fj=(t,e,n,...r)=>n.write(...r),hj=(t,e,n)=>n.INTERNAL_onInit(e),pj=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},mj=(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),cj(n)&&u(t,e,n)}return i},vj=(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=[],f=p=>{try{p()}catch(m){d.push(m)}};do{u.f&&f(u.f);const p=new Set;for(const m of s){const _=(n=r.get(m))==null?void 0:n.l;if(_)for(const x of _)p.add(x)}s.clear();for(const m of a)p.add(m);a.clear();for(const m of i)p.add(m);i.clear();for(const m of p)f(m);s.size&&c(t,e)}while(s.size||a.size||i.size);if(d.length)throw new AggregateError(d)},gj=(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=[],f=new WeakSet,p=new WeakSet,m=[],_=[];for(const x of s)m.push(x),_.push(i(t,e,x));for(;m.length;){const x=m.length-1,y=m[x],w=_[x];if(p.has(y)){m.pop(),_.pop();continue}if(f.has(y)){if(r.get(y)===w.n)c.push(y),d.push(w);else if((co?"production":void 0)!=="production"&&r.has(y))throw new Error("[Bug] invalidated atom exists");p.add(y),m.pop(),_.pop();continue}f.add(y);for(const S of S3(y,w,n))f.has(S)||(m.push(S),_.push(i(t,e,S)))}for(let x=c.length-1;x>=0;--x){const y=c[x],w=d[x];let S=!1;for(const C of w.d.keys())if(C!==y&&s.has(C)){S=!0;break}S&&(r.set(y,w.n),a(t,e,y),u(t,e,y)),r.delete(y)}},h_=new WeakSet,yj=(t,e,n)=>{var r,s;const i=t[1],a=t[2],u=t[3],c=t[6],d=t[7],f=t[11],p=t[12],m=t[13],_=t[14],x=t[16],y=t[17],w=t[20],S=t[26],C=t[28],P=f(t,e,n),T=C[0];if(KE(P)){if(i.has(n)&&a.get(n)!==P.n||P.m===T)return P.m=T,P;let K=!1;for(const[q,W]of P.d)if(_(t,e,q).n!==W){K=!0;break}if(!K)return P.m=T,P}let I=!0;const A=new Set(P.d.keys()),O=()=>{for(const K of A)P.d.delete(K)},R=()=>{if(i.has(n)){const K=!u.size;y(t,e,n),K&&(m(t,e),p(t,e))}},L=K=>{var q;if(K===n){const H=f(t,e,K);if(!KE(H))if(w3(K))w(t,e,K,K.init);else throw new Error("no atom init");return Bm(H)}const W=_(t,e,K);try{return Bm(W)}finally{A.delete(K),P.d.set(K,W.n),Wm(P.v)&&b3(n,P.v,W),i.has(n)&&((q=i.get(K))==null||q.t.add(n)),I||R()}};let D,j;const F={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(co?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(co?"production":void 0)!=="production"&&!f_(n)&&console.warn("setSelf function cannot be used with read-only atom"),!j&&f_(n)&&(j=(...K)=>{if((co?"production":void 0)!=="production"&&I&&console.warn("setSelf function cannot be called in sync"),!I)try{return x(t,e,n,K)}finally{m(t,e),p(t,e)}}),j}},Z=P.n,Q=a.get(n)===Z;try{(co?"production":void 0)!=="production"&&h_.delete(e);const K=d(t,e,n,L,F);if((co?"production":void 0)!=="production"&&h_.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),w(t,e,n,K),Wm(K)){S(t,e,K,()=>D==null?void 0:D.abort());const q=()=>{O(),R()};K.then(q,q)}else O();return(r=c.r)==null||r.call(c,n),P.m=T,P}catch(K){if(uj(K))throw K;return delete P.v,P.e=K,++P.n,P.m=T,P}finally{I=!1,P.n!==Z&&Q&&(a.set(n,P.n),u.add(n),(s=c.c)==null||s.call(c,n))}},_j=(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 S3(u,c,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),a.push(d))}}},xj=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],u=t[11],c=t[12],d=t[13],f=t[14],p=t[15],m=t[16],_=t[17],x=t[20],y=t[28];let w=!0;const S=P=>Bm(f(t,e,P)),C=(P,...T)=>{var I;const A=u(t,e,P);try{if(P===n){if(!w3(P))throw new Error("atom not writable");(co?"production":void 0)!=="production"&&h_.add(e);const O=A.n,R=T[0];x(t,e,P,R),_(t,e,P),O!==A.n&&(++y[0],s.add(P),p(t,e,P),(I=i.c)==null||I.call(i,P));return}else return m(t,e,P,T)}finally{w||(d(t,e),c(t,e))}};try{return a(t,e,n,S,C,...r)}finally{w=!1}},wj=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],u=t[11],c=t[15],d=t[18],f=t[19],p=u(t,e,n),m=s.get(n);if(m&&p.d.size>0){for(const[_,x]of p.d)if(!m.d.has(_)){const y=u(t,e,_);d(t,e,_).t.add(n),m.d.add(_),x!==y.n&&(i.add(_),c(t,e,_),(r=a.c)==null||r.call(a,_))}for(const _ of m.d)if(!p.d.has(_)){m.d.delete(_);const x=f(t,e,_);x==null||x.t.delete(n)}}},bj=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],u=t[10],c=t[11],d=t[12],f=t[13],p=t[14],m=t[16],_=t[18],x=c(t,e,n);let y=s.get(n);if(!y){p(t,e,n);for(const w of x.d.keys())_(t,e,w).t.add(n);if(y={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,y),f_(n)&&lj(n)){const w=()=>{let S=!0;const C=(...P)=>{try{return m(t,e,n,P)}finally{S||(f(t,e),d(t,e))}};try{const P=u(t,e,n,C);P&&(y.u=()=>{S=!0;try{P()}finally{S=!1}})}finally{S=!1}};i.add(w)}(r=a.m)==null||r.call(a,n)}return y},Sj=(t,e,n)=>{var r,s;const i=t[1],a=t[5],u=t[6],c=t[11],d=t[19],f=c(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const _ of p.t)if((r=i.get(_))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const _ of f.d.keys()){const x=d(t,e,_);x==null||x.t.delete(n)}(s=u.u)==null||s.call(u,n);return}return p},Ej=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),u="v"in a,c=a.v;if(Wm(r))for(const d of a.d.keys())b3(n,r,s(t,e,d));a.v=r,delete a.e,(!u||!Object.is(c,a.v))&&(++a.n,Wm(c)&&i(t,e,c))},kj=(t,e,n)=>{const r=t[14];return Bm(r(t,e,n))},Cj=(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))}},Pj=(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)}},Tj=(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)},Ij=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},E3=new WeakMap;function Rj(t){const e=E3.get(t);if((co?"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 Aj(...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,{},dj,fj,hj,pj,mj,vj,gj,yj,_j,xj,wj,bj,Sj,Ej,kj,Cj,Pj,void 0,new WeakMap,Tj,Ij,[0]].map((a,u)=>t[u]||a);E3.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const k3={};let Mj=0;function st(t,e){const n=`atom${++Mj}`,r={toString(){return(k3?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=Lj,r.write=Oj),e&&(r.write=e),r}function Lj(t){return t(this)}function Oj(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function Dj(){return Aj()}let Sd;function Nj(){return Sd||(Sd=Dj(),(k3?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Sd),globalThis.__JOTAI_DEFAULT_STORE__!==Sd&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Sd}const jj={},Fj=v.createContext(void 0);function sx(t){return v.useContext(Fj)||Nj()}const p_=t=>typeof(t==null?void 0:t.then)=="function",m_=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},Vj=we.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(m_(t),t)}),m1=new WeakMap,YE=(t,e,n)=>{const r=Rj(t),s=r[26];let i=m1.get(e);return i||(i=new Promise((a,u)=>{let c=e;const d=m=>_=>{c===m&&a(_)},f=m=>_=>{c===m&&u(_)},p=()=>{try{const m=n();p_(m)?(m1.set(m,i),c=m,m.then(d(m),f(m)),s(r,t,m,p)):a(m)}catch(m){u(m)}};e.then(d(e),f(e)),s(r,t,e,p)}),m1.set(e,i)),i};function tt(t,e){const{delay:n,unstable_promiseStatus:r=!we.use}={},s=sx(),[[i,a,u],c]=v.useReducer(f=>{const p=s.get(t);return Object.is(f[0],p)&&f[1]===s&&f[2]===t?f:[p,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((a!==s||u!==t)&&(c(),d=s.get(t)),v.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const p=s.get(t);p_(p)&&m_(YE(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
43
+
44
+ Migration guide:
45
+
46
+ Create a custom hook like the following.
47
+
48
+ function useAtomValueWithDelay<Value>(
49
+ atom: Atom<Value>,
50
+ options: { delay: number },
51
+ ): Value {
52
+ const { delay } = options
53
+ const store = useStore(options)
54
+ const [value, setValue] = useState(() => store.get(atom))
55
+ useEffect(() => {
56
+ const unsub = store.sub(atom, () => {
57
+ setTimeout(() => setValue(store.get(atom)), delay)
58
+ })
59
+ return unsub
60
+ }, [store, atom, delay])
61
+ return value
62
+ }
63
+ `),setTimeout(c,n);return}c()});return c(),f},[s,t,n,r]),v.useDebugValue(d),p_(d)){const f=YE(s,d,()=>s.get(t));return r&&m_(f),Vj(f)}return d}function at(t,e){const n=sx();return v.useCallback((...s)=>{if((jj?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function C3(t,e){return[tt(t),at(t)]}const ix=v.createContext({});function ox(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const $j=typeof window<"u",ax=$j?v.useLayoutEffect:v.useEffect,k0=v.createContext(null);function lx(t,e){t.indexOf(e)===-1&&t.push(e)}function qm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Ri=(t,e,n)=>n>e?e:n<t?t:n;let C0=()=>{};const fa={},P3=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),T3=t=>typeof t=="object"&&t!==null,I3=t=>/^0[^.\s]+$/u.test(t);function R3(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ms=t=>t,Vf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),of=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class ux{constructor(){this.subscriptions=[]}add(e){return lx(this.subscriptions,e),()=>qm(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 ls=t=>t*1e3,Ts=t=>t/1e3,A3=(t,e)=>e?t*(1e3/e):0,M3=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Hj=1e-7,zj=12;function Uj(t,e,n,r,s){let i,a,u=0;do a=e+(n-e)/2,i=M3(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>Hj&&++u<zj);return a}function $f(t,e,n,r){if(t===e&&n===r)return Ms;const s=i=>Uj(i,0,1,t,n);return i=>i===0||i===1?i:M3(s(i),e,r)}const L3=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,O3=t=>e=>1-t(1-e),D3=$f(.33,1.53,.69,.99),cx=O3(D3),N3=L3(cx),j3=t=>t>=1?1:(t*=2)<1?.5*cx(t):.5*(2-Math.pow(2,-10*(t-1))),dx=t=>1-Math.sin(Math.acos(t)),F3=O3(dx),V3=L3(dx),Bj=$f(.42,0,1,1),Wj=$f(0,0,.58,1),$3=$f(.42,0,.58,1),qj=t=>Array.isArray(t)&&typeof t[0]!="number",H3=t=>Array.isArray(t)&&typeof t[0]=="number",Zj={linear:Ms,easeIn:Bj,easeInOut:$3,easeOut:Wj,circIn:dx,circInOut:V3,circOut:F3,backIn:cx,backInOut:N3,backOut:D3,anticipate:j3},Gj=t=>typeof t=="string",XE=t=>{if(H3(t)){C0(t.length===4);const[e,n,r,s]=t;return $f(e,n,r,s)}else if(Gj(t))return Zj[t];return t},xp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Kj(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,f=!1,p=!1)=>{const _=p&&r?e:n;return f&&i.add(d),_.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(a=d,r){s=!0;return}r=!0;const f=e;e=n,n=f,e.forEach(u),e.clear(),r=!1,s&&(s=!1,c.process(d))}};return c}const Yj=40;function z3(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=xp.reduce((P,T)=>(P[T]=Kj(i),P),{}),{setup:u,read:c,resolveKeyframes:d,preUpdate:f,update:p,preRender:m,render:_,postRender:x}=a,y=()=>{const P=fa.useManualTiming,T=P?s.timestamp:performance.now();n=!1,P||(s.delta=r?1e3/60:Math.max(Math.min(T-s.timestamp,Yj),1)),s.timestamp=T,s.isProcessing=!0,u.process(s),c.process(s),d.process(s),f.process(s),p.process(s),m.process(s),_.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(y))},w=()=>{n=!0,r=!0,s.isProcessing||t(y)};return{schedule:xp.reduce((P,T)=>{const I=a[T];return P[T]=(A,O=!1,R=!1)=>(n||w(),I.schedule(A,O,R)),P},{}),cancel:P=>{for(let T=0;T<xp.length;T++)a[xp[T]].cancel(P)},state:s,steps:a}}const{schedule:Lt,cancel:ha,state:Gn,steps:v1}=z3(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ms,!0);let Yp;function Xj(){Yp=void 0}const Sr={now:()=>(Yp===void 0&&Sr.set(Gn.isProcessing||fa.useManualTiming?Gn.timestamp:performance.now()),Yp),set:t=>{Yp=t,queueMicrotask(Xj)}},U3=t=>e=>typeof e=="string"&&e.startsWith(t),B3=U3("--"),Qj=U3("var(--"),fx=t=>Qj(t)?Jj.test(t.split("/*")[0].trim()):!1,Jj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function QE(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const xc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},af={...xc,transform:t=>Ri(0,1,t)},wp={...xc,default:1},Hd=t=>Math.round(t*1e5)/1e5,hx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function e7(t){return t==null}const t7=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,px=(t,e)=>n=>!!(typeof n=="string"&&t7.test(n)&&n.startsWith(t)||e&&!e7(n)&&Object.prototype.hasOwnProperty.call(n,e)),W3=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,u]=r.match(hx);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}},n7=t=>Ri(0,255,t),g1={...xc,transform:t=>Math.round(n7(t))},dl={test:px("rgb","red"),parse:W3("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+g1.transform(t)+", "+g1.transform(e)+", "+g1.transform(n)+", "+Hd(af.transform(r))+")"};function r7(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 v_={test:px("#"),parse:r7,transform:dl.transform},Hf=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ji=Hf("deg"),Ii=Hf("%"),Me=Hf("px"),s7=Hf("vh"),i7=Hf("vw"),JE={...Ii,parse:t=>Ii.parse(t)/100,transform:t=>Ii.transform(t*100)},Tu={test:px("hsl","hue"),parse:W3("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Ii.transform(Hd(e))+", "+Ii.transform(Hd(n))+", "+Hd(af.transform(r))+")"},Cn={test:t=>dl.test(t)||v_.test(t)||Tu.test(t),parse:t=>dl.test(t)?dl.parse(t):Tu.test(t)?Tu.parse(t):v_.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?dl.transform(t):Tu.transform(t),getAnimatableNone:t=>{const e=Cn.parse(t);return e.alpha=0,Cn.transform(e)}},o7=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function a7(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(hx))==null?void 0:e.length)||0)+(((n=t.match(o7))==null?void 0:n.length)||0)>0}const q3="number",Z3="color",l7="var",u7="var(",ek="${}",c7=/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 hc(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const u=e.replace(c7,c=>(Cn.test(c)?(r.color.push(i),s.push(Z3),n.push(Cn.parse(c))):c.startsWith(u7)?(r.var.push(i),s.push(l7),n.push(c)):(r.number.push(i),s.push(q3),n.push(parseFloat(c))),++i,ek)).split(ek);return{values:n,split:u,indexes:r,types:s}}function d7(t){return hc(t).values}function G3({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===q3?s+=Hd(r[i]):a===Z3?s+=Cn.transform(r[i]):s+=r[i]}return s}}function f7(t){return G3(hc(t))}const h7=t=>typeof t=="number"?0:Cn.test(t)?Cn.getAnimatableNone(t):t,p7=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:h7(t);function m7(t){const e=hc(t);return G3(e)(e.values.map((r,s)=>p7(r,e.split[s])))}const Xs={test:a7,parse:d7,createTransformer:f7,getAnimatableNone:m7};function y1(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 v7({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=y1(c,u,t+1/3),i=y1(c,u,t),a=y1(c,u,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Zm(t,e){return n=>n>0?e:t}const Mt=(t,e,n)=>t+(e-t)*n,_1=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},g7=[v_,dl,Tu],y7=t=>g7.find(e=>e.test(t));function tk(t){const e=y7(t);if(!e)return!1;let n=e.parse(t);return e===Tu&&(n=v7(n)),n}const nk=(t,e)=>{const n=tk(t),r=tk(e);if(!n||!r)return Zm(t,e);const s={...n};return i=>(s.red=_1(n.red,r.red,i),s.green=_1(n.green,r.green,i),s.blue=_1(n.blue,r.blue,i),s.alpha=Mt(n.alpha,r.alpha,i),dl.transform(s))},g_=new Set(["none","hidden"]);function _7(t,e){return g_.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function x7(t,e){return n=>Mt(t,e,n)}function mx(t){return typeof t=="number"?x7:typeof t=="string"?fx(t)?Zm:Cn.test(t)?nk:S7:Array.isArray(t)?K3:typeof t=="object"?Cn.test(t)?nk:w7:Zm}function K3(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>mx(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function w7(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=mx(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function b7(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 S7=(t,e)=>{const n=Xs.createTransformer(e),r=hc(t),s=hc(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?g_.has(t)&&!s.values.length||g_.has(e)&&!r.values.length?_7(t,e):Vf(K3(b7(r,s),s.values),n):Zm(t,e)};function Y3(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Mt(t,e,n):mx(t)(t,e)}const E7=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Lt.update(e,n),stop:()=>ha(e),now:()=>Gn.isProcessing?Gn.timestamp:Sr.now()}},X3=(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)})`},Gm=2e4;function vx(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Gm;)e+=n,r=t.next(e);return e>=Gm?1/0:e}function k7(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(vx(r),Gm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Ts(s)}}const fn={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 y_(t,e){return t*Math.sqrt(1-e*e)}const C7=12;function P7(t,e,n){let r=n;for(let s=1;s<C7;s++)r=r-t(r)/e(r);return r}const x1=.001;function T7({duration:t=fn.duration,bounce:e=fn.bounce,velocity:n=fn.velocity,mass:r=fn.mass}){let s,i,a=1-e;a=Ri(fn.minDamping,fn.maxDamping,a),t=Ri(fn.minDuration,fn.maxDuration,Ts(t)),a<1?(s=d=>{const f=d*a,p=f*t,m=f-n,_=y_(d,a),x=Math.exp(-p);return x1-m/_*x},i=d=>{const p=d*a*t,m=p*n+n,_=Math.pow(a,2)*Math.pow(d,2)*t,x=Math.exp(-p),y=y_(Math.pow(d,2),a);return(-s(d)+x1>0?-1:1)*((m-_)*x)/y}):(s=d=>{const f=Math.exp(-d*t),p=(d-n)*t+1;return-x1+f*p},i=d=>{const f=Math.exp(-d*t),p=(n-d)*(t*t);return f*p});const u=5/t,c=P7(s,i,u);if(t=ls(t),isNaN(c))return{stiffness:fn.stiffness,damping:fn.damping,duration:t};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:a*2*Math.sqrt(r*d),duration:t}}}const I7=["duration","bounce"],R7=["stiffness","damping","mass"];function rk(t,e){return e.some(n=>t[n]!==void 0)}function A7(t){let e={velocity:fn.velocity,stiffness:fn.stiffness,damping:fn.damping,mass:fn.mass,isResolvedFromDuration:!1,...t};if(!rk(t,R7)&&rk(t,I7))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ri(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:fn.mass,stiffness:s,damping:i}}else{const n=T7({...t,velocity:0});e={...e,...n,mass:fn.mass},e.isResolvedFromDuration=!0}return e}function Km(t=fn.visualDuration,e=fn.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:f,duration:p,velocity:m,isResolvedFromDuration:_}=A7({...n,velocity:-Ts(n.velocity||0)}),x=m||0,y=d/(2*Math.sqrt(c*f)),w=a-i,S=Ts(Math.sqrt(c/f)),C=Math.abs(w)<5;r||(r=C?fn.restSpeed.granular:fn.restSpeed.default),s||(s=C?fn.restDelta.granular:fn.restDelta.default);let P,T,I,A,O,R;if(y<1)I=y_(S,y),A=(x+y*S*w)/I,P=D=>{const j=Math.exp(-y*S*D);return a-j*(A*Math.sin(I*D)+w*Math.cos(I*D))},O=y*S*A+w*I,R=y*S*w-A*I,T=D=>Math.exp(-y*S*D)*(O*Math.sin(I*D)+R*Math.cos(I*D));else if(y===1){P=j=>a-Math.exp(-S*j)*(w+(x+S*w)*j);const D=x+S*w;T=j=>Math.exp(-S*j)*(S*D*j-x)}else{const D=S*Math.sqrt(y*y-1);P=Q=>{const K=Math.exp(-y*S*Q),q=Math.min(D*Q,300);return a-K*((x+y*S*w)*Math.sinh(q)+D*w*Math.cosh(q))/D};const j=(x+y*S*w)/D,F=y*S*j-w*D,Z=y*S*w-j*D;T=Q=>{const K=Math.exp(-y*S*Q),q=Math.min(D*Q,300);return K*(F*Math.sinh(q)+Z*Math.cosh(q))}}const L={calculatedDuration:_&&p||null,velocity:D=>ls(T(D)),next:D=>{if(!_&&y<1){const F=Math.exp(-y*S*D),Z=Math.sin(I*D),Q=Math.cos(I*D),K=a-F*(A*Z+w*Q),q=ls(F*(O*Z+R*Q));return u.done=Math.abs(q)<=r&&Math.abs(a-K)<=s,u.value=u.done?a:K,u}const j=P(D);if(_)u.done=D>=p;else{const F=ls(T(D));u.done=Math.abs(F)<=r&&Math.abs(a-j)<=s}return u.value=u.done?a:j,u},toString:()=>{const D=Math.min(vx(L),Gm),j=X3(F=>L.next(D*F).value,D,30);return D+"ms "+j},toTransition:()=>{}};return L}Km.applyToOptions=t=>{const e=k7(t,100,Km);return t.ease=e.ease,t.duration=ls(e.duration),t.type="keyframes",t};const M7=5;function Q3(t,e,n){const r=Math.max(e-M7,0);return A3(n-t(r),e-r)}function __({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:f}){const p=t[0],m={done:!1,value:p},_=R=>u!==void 0&&R<u||c!==void 0&&R>c,x=R=>u===void 0?c:c===void 0||Math.abs(u-R)<Math.abs(c-R)?u:c;let y=n*e;const w=p+y,S=a===void 0?w:a(w);S!==w&&(y=S-p);const C=R=>-y*Math.exp(-R/r),P=R=>S+C(R),T=R=>{const L=C(R),D=P(R);m.done=Math.abs(L)<=d,m.value=m.done?S:D};let I,A;const O=R=>{_(m.value)&&(I=R,A=Km({keyframes:[m.value,x(m.value)],velocity:Q3(P,R,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return O(0),{calculatedDuration:null,next:R=>{let L=!1;return!A&&I===void 0&&(L=!0,T(R),O(R)),I!==void 0&&R>=I?A.next(R-I):(!L&&T(R),m)}}}function L7(t,e,n){const r=[],s=n||fa.mix||Y3,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]||Ms:e;u=Vf(c,u)}r.push(u)}return r}function O7(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(C0(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=L7(e,r,s),c=u.length,d=f=>{if(a&&f<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(f<t[p+1]);p++);const m=of(t[p],t[p+1],f);return u[p](m)};return n?f=>d(Ri(t[0],t[i-1],f)):d}function D7(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=of(0,e,r);t.push(Mt(n,1,s))}}function N7(t){const e=[0];return D7(e,t.length-1),e}function j7(t,e){return t.map(n=>n*e)}function F7(t,e){return t.map(()=>e||$3).splice(0,t.length-1)}function zd({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=qj(r)?r.map(XE):XE(r),i={done:!1,value:e[0]},a=j7(n&&n.length===e.length?n:N7(e),t),u=O7(a,e,{ease:Array.isArray(s)?s:F7(e,s)});return{calculatedDuration:t,next:c=>(i.value=u(c),i.done=c>=t,i)}}const V7=t=>t!==null;function P0(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(V7),u=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!u||r===void 0?i[u]:r}const $7={decay:__,inertia:__,tween:zd,keyframes:zd,spring:Km};function J3(t){typeof t.type=="string"&&(t.type=$7[t.type])}class gx{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 H7=t=>t/100;class Ym extends gx{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!==Sr.now()&&this.tick(Sr.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;J3(e);const{type:n=zd,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:u}=e;const c=n||zd;c!==zd&&typeof u[0]!="number"&&(this.mixKeyframes=Vf(H7,Y3(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=vx(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:u,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:p,repeatType:m,repeatDelay:_,type:x,onUpdate:y,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const S=this.currentTime-d*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,T=r;if(p){const R=Math.min(this.currentTime,s)/u;let L=Math.floor(R),D=R%1;!D&&R>=1&&(D=1),D===1&&L--,L=Math.min(L,p+1),!!(L%2)&&(m==="reverse"?(D=1-D,_&&(D-=_/u)):m==="mirror"&&(T=a)),P=Ri(0,1,D)*u}let I;C?(this.delayState.value=f[0],I=this.delayState):I=T.next(P),i&&!C&&(I.value=i(I.value));let{done:A}=I;!C&&c!==null&&(A=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return O&&x!==__&&(I.value=P0(f,this.options,w,this.speed)),y&&y(I.value),O&&this.finish(),I}then(e,n){return this.finished.then(e,n)}get duration(){return Ts(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ts(e)}get time(){return Ts(this.currentTime)}set time(e){e=ls(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 Q3(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(Sr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Ts(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=E7,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(Sr.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 z7(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const fl=t=>t*180/Math.PI,x_=t=>{const e=fl(Math.atan2(t[1],t[0]));return w_(e)},U7={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:x_,rotateZ:x_,skewX:t=>fl(Math.atan(t[1])),skewY:t=>fl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},w_=t=>(t=t%360,t<0&&(t+=360),t),sk=x_,ik=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ok=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),B7={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ik,scaleY:ok,scale:t=>(ik(t)+ok(t))/2,rotateX:t=>w_(fl(Math.atan2(t[6],t[5]))),rotateY:t=>w_(fl(Math.atan2(-t[2],t[0]))),rotateZ:sk,rotate:sk,skewX:t=>fl(Math.atan(t[4])),skewY:t=>fl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function b_(t){return t.includes("scale")?1:0}function S_(t,e){if(!t||t==="none")return b_(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=B7,s=n;else{const u=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=U7,s=u}if(!s)return b_(e);const i=r[e],a=s[1].split(",").map(q7);return typeof i=="function"?i(a):a[i]}const W7=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return S_(n,e)};function q7(t){return parseFloat(t.trim())}const wc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bc=new Set([...wc,"pathRotation"]),ak=t=>t===xc||t===Me,Z7=new Set(["x","y","z"]),G7=wc.filter(t=>!Z7.has(t));function K7(t){const e=[];return G7.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const na={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})=>S_(e,"x"),y:(t,{transform:e})=>S_(e,"y")};na.translateX=na.x;na.translateY=na.y;const kl=new Set;let E_=!1,k_=!1,C_=!1;function eT(){if(k_){const t=Array.from(kl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=K7(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)})}k_=!1,E_=!1,kl.forEach(t=>t.complete(C_)),kl.clear()}function tT(){kl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(k_=!0)})}function Y7(){C_=!0,tT(),eT(),C_=!1}class yx{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?(kl.add(this),E_||(E_=!0,Lt.read(tT),Lt.resolveKeyframes(eT))):(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])}z7(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),kl.delete(this)}cancel(){this.state==="scheduled"&&(kl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const X7=t=>t.startsWith("--");function nT(t,e,n){X7(e)?t.style.setProperty(e,n):t.style[e]=n}const Q7={};function rT(t,e){const n=R3(t);return()=>Q7[e]??n()}const J7=rT(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),sT=rT(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ld=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,lk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ld([0,.65,.55,1]),circOut:Ld([.55,0,1,.45]),backIn:Ld([.31,.01,.66,-.59]),backOut:Ld([.33,1.53,.69,.99])};function iT(t,e){if(t)return typeof t=="function"?sT()?X3(t,e):"ease-out":H3(t)?Ld(t):Array.isArray(t)?t.map(n=>iT(n,e)||lk.easeOut):lk[t]}function eF(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:u="easeOut",times:c}={},d=void 0){const f={[e]:n};c&&(f.offset=c);const p=iT(u,s);Array.isArray(p)&&(f.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(f,m)}function oT(t){return typeof t=="function"&&"applyToOptions"in t}function tF({type:t,...e}){return oT(t)&&sT()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class aT extends gx{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,C0(typeof e.type!="string");const d=tF(e);this.animation=eF(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=P0(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(f),nT(n,r,f),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 Ts(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ts(e)}get time(){return Ts(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ls(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&J7()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Ms):s(this)}}const lT={anticipate:j3,backInOut:N3,circInOut:V3};function nF(t){return t in lT}function rF(t){typeof t.ease=="string"&&nF(t.ease)&&(t.ease=lT[t.ease])}const w1=10;class sF extends aT{constructor(e){rF(e),J3(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 Ym({...a,autoplay:!1}),c=Math.max(w1,Sr.now()-this.startTime),d=Ri(0,w1,c-w1),f=u.sample(c).value,{name:p}=this.options;i&&p&&nT(i,p,f),n.setWithVelocity(u.sample(Math.max(0,c-d)).value,f,d),u.stop()}}const uk=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Xs.test(t)||t==="0")&&!t.startsWith("url("));function iF(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 oF(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=uk(s,e),u=uk(i,e);return!a||!u?!1:iF(t)||(n==="spring"||oT(n))&&r}function P_(t){t.duration=0,t.type="keyframes"}const uT=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),aF=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function lF(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&aF.test(t[e]))return!0;return!1}const uF=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),cF=R3(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function dF(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:u}=t,c=(p=e==null?void 0:e.owner)==null?void 0:p.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return cF()&&n&&(uT.has(n)||uF.has(n)&&lF(u))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const fF=40;class hF extends gx{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:f,...p}){var x;super(),this.stop=()=>{var y,w;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=Sr.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:c,motionValue:d,element:f,...p},_=(f==null?void 0:f.KeyframeResolver)||yx;this.keyframeResolver=new _(u,(y,w,S)=>this.onKeyframesResolved(y,w,m,!S),c,d,f),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,n,r,s){var S,C;this.keyframeResolver=void 0;const{name:i,type:a,velocity:u,delay:c,isHandoff:d,onUpdate:f}=r;this.resolvedAt=Sr.now();let p=!0;oF(e,i,a,u)||(p=!1,(fa.instantAnimations||!c)&&(f==null||f(P0(e,r,n))),e[0]=e[e.length-1],P_(r),r.repeat=0);const _={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>fF?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=p&&!d&&dF(_),y=(C=(S=_.motionValue)==null?void 0:S.owner)==null?void 0:C.current;let w;if(x)try{w=new sF({..._,element:y})}catch{w=new Ym(_)}else w=new Ym(_);w.finished.then(()=>{this.notifyFinished()}).catch(Ms),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Y7()),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 cT(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,f)=>d.sortNodePosition(f)).indexOf(e),a=t.size,u=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:u-i*r}const ck=30,pF=t=>!isNaN(parseFloat(t));class mF{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Sr.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=Sr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=pF(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 ux);const r=this.events[e].add(n);return e==="change"?()=>{r(),Lt.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=Sr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ck)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ck);return A3(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 pc(t,e){return new mF(t,e)}function dT(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function _x(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?dT(n,t):n}const vF={type:"spring",stiffness:500,damping:25,restSpeed:10},gF=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),yF={type:"keyframes",duration:.8},_F={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},xF=(t,{keyframes:e})=>e.length>2?yF:bc.has(t)?t.startsWith("scale")?gF(e[1]):vF:_F,wF=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function bF(t){for(const e in t)if(!wF.has(e))return!0;return!1}const xx=(t,e,n,r={},s,i)=>a=>{const u=_x(r,t)||{},c=u.delay||r.delay||0;let{elapsed:d=0}=r;d=d-ls(c);const f={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};bF(u)||Object.assign(f,xF(t,f)),f.duration&&(f.duration=ls(f.duration)),f.repeatDelay&&(f.repeatDelay=ls(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let p=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(P_(f),f.delay===0&&(p=!0)),(fa.instantAnimations||fa.skipAnimations||s!=null&&s.shouldSkipAnimations||u.skipAnimations)&&(p=!0,P_(f),f.delay=0),f.allowFlatten=!u.type&&!u.ease,p&&!i&&e.get()!==void 0){const m=P0(f.keyframes,u);if(m!==void 0){Lt.update(()=>{f.onUpdate(m),f.onComplete()});return}}return u.isSync?new Ym(f):new hF(f)},SF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function EF(t){const e=SF.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function fT(t,e,n=1){const[r,s]=EF(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return P3(a)?parseFloat(a):a}return fx(s)?fT(s,e,n+1):s}function dk(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function wx(t,e,n,r){if(typeof e=="function"){const[s,i]=dk(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=dk(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function Cl(t,e,n){const r=t.getProps();return wx(r,e,n!==void 0?n:r.custom,t)}const hT=new Set(["width","height","top","left","right","bottom",...wc]),T_=t=>Array.isArray(t);function kF(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,pc(n))}function CF(t){return T_(t)?t[t.length-1]||0:t}function PF(t,e){const n=Cl(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const u=CF(i[a]);kF(t,a,u)}}const Qn=t=>!!(t&&t.getVelocity);function TF(t){return!!(Qn(t)&&t.add)}function I_(t,e){const n=t.getValue("willChange");if(TF(n))return n.add(e);if(!n&&fa.WillChange){const r=new fa.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function bx(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const IF="framerAppearId",pT="data-"+bx(IF);function mT(t){return t.props[pT]}function RF({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function vT(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...u}=e;const c=t.getDefaultTransition();i=i?dT(i,c):c;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],m=s&&t.animationState&&t.animationState.getState()[s],_=i==null?void 0:i.path;_&&_.animateVisualElement(t,u,i,n,p);for(const x in u){const y=t.getValue(x,t.latestValues[x]??null),w=u[x];if(w===void 0||m&&RF(m,x))continue;const S={delay:n,..._x(i||{},x)};f&&(S.skipAnimations=!0);const C=y.get();if(C!==void 0&&!y.isAnimating()&&!Array.isArray(w)&&w===C&&!S.velocity){Lt.update(()=>y.set(w));continue}let P=!1;if(window.MotionHandoffAnimation){const A=mT(t);if(A){const O=window.MotionHandoffAnimation(A,x,Lt);O!==null&&(S.startTime=O,P=!0)}}I_(t,x);const T=d??t.shouldReduceMotion;y.start(xx(x,y,w,T&&hT.has(x)?{type:!1}:S,t,P));const I=y.animation;I&&p.push(I)}if(a){const x=()=>Lt.update(()=>{a&&PF(t,a)});p.length?Promise.all(p).then(x):x()}return p}function R_(t,e,n={}){var c;const r=Cl(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(vT(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:m}=s;return AF(t,e,d,f,p,m,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[d,f]=u==="beforeChildren"?[i,a]:[a,i];return d().then(()=>f())}else return Promise.all([i(),a(n.delay)])}function AF(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(R_(c,e,{...a,delay:n+(typeof r=="function"?0:r)+cT(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(u)}function MF(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>R_(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=R_(t,e,n);else{const s=typeof e=="function"?Cl(t,e,n.custom):e;r=Promise.all(vT(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const LF={test:t=>t==="auto",parse:t=>t},gT=t=>e=>e.test(t),yT=[xc,Me,Ii,Ji,i7,s7,LF],fk=t=>yT.find(gT(t));function OF(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||I3(t):!0}const DF=new Set(["brightness","contrast","saturate","opacity"]);function NF(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(hx)||[];if(!r)return t;const s=n.replace(r,"");let i=DF.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const jF=/\b([a-z-]*)\(.*?\)/gu,A_={...Xs,getAnimatableNone:t=>{const e=t.match(jF);return e?e.map(NF).join(" "):t}},M_={...Xs,getAnimatableNone:t=>{const e=Xs.parse(t);return Xs.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},hk={...xc,transform:Math.round},FF={rotate:Ji,pathRotation:Ji,rotateX:Ji,rotateY:Ji,rotateZ:Ji,scale:wp,scaleX:wp,scaleY:wp,scaleZ:wp,skew:Ji,skewX:Ji,skewY:Ji,distance:Me,translateX:Me,translateY:Me,translateZ:Me,x:Me,y:Me,z:Me,perspective:Me,transformPerspective:Me,opacity:af,originX:JE,originY:JE,originZ:Me},Xm={borderWidth:Me,borderTopWidth:Me,borderRightWidth:Me,borderBottomWidth:Me,borderLeftWidth:Me,borderRadius:Me,borderTopLeftRadius:Me,borderTopRightRadius:Me,borderBottomRightRadius:Me,borderBottomLeftRadius:Me,width:Me,maxWidth:Me,height:Me,maxHeight:Me,top:Me,right:Me,bottom:Me,left:Me,inset:Me,insetBlock:Me,insetBlockStart:Me,insetBlockEnd:Me,insetInline:Me,insetInlineStart:Me,insetInlineEnd:Me,padding:Me,paddingTop:Me,paddingRight:Me,paddingBottom:Me,paddingLeft:Me,paddingBlock:Me,paddingBlockStart:Me,paddingBlockEnd:Me,paddingInline:Me,paddingInlineStart:Me,paddingInlineEnd:Me,margin:Me,marginTop:Me,marginRight:Me,marginBottom:Me,marginLeft:Me,marginBlock:Me,marginBlockStart:Me,marginBlockEnd:Me,marginInline:Me,marginInlineStart:Me,marginInlineEnd:Me,fontSize:Me,backgroundPositionX:Me,backgroundPositionY:Me,...FF,zIndex:hk,fillOpacity:af,strokeOpacity:af,numOctaves:hk},VF={...Xm,color:Cn,backgroundColor:Cn,outlineColor:Cn,fill:Cn,stroke:Cn,borderColor:Cn,borderTopColor:Cn,borderRightColor:Cn,borderBottomColor:Cn,borderLeftColor:Cn,filter:A_,WebkitFilter:A_,mask:M_,WebkitMask:M_},_T=t=>VF[t],$F=new Set([A_,M_]);function xT(t,e){let n=_T(t);return $F.has(n)||(n=Xs),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const HF=new Set(["auto","none","0"]);function zF(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!HF.has(i)&&hc(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=xT(n,s)}class UF extends yx{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f<e.length;f++){let p=e[f];if(typeof p=="string"&&(p=p.trim(),fx(p))){const m=fT(p,n.current);m!==void 0&&(e[f]=m),f===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!hT.has(r)||e.length!==2)return;const[s,i]=e,a=fk(s),u=fk(i),c=QE(s),d=QE(i);if(c!==d&&na[r]){this.needsMeasurement=!0;return}if(a!==u)if(ak(a)&&ak(u))for(let f=0;f<e.length;f++){const p=e[f];typeof p=="string"&&(e[f]=parseFloat(p))}else na[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||OF(e[s]))&&r.push(s);r.length&&zF(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=na[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]=na[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 Sx=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function wT(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 L_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Xp(t){return T3(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Ex}=z3(queueMicrotask,!1),Bs={x:!1,y:!1};function bT(){return Bs.x||Bs.y}function BF(t){return t==="x"||t==="y"?Bs[t]?null:(Bs[t]=!0,()=>{Bs[t]=!1}):Bs.x||Bs.y?null:(Bs.x=Bs.y=!0,()=>{Bs.x=Bs.y=!1})}function ST(t,e){const n=wT(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function WF(t){return!(t.pointerType==="touch"||bT())}function qF(t,e,n={}){const[r,s,i]=ST(t,n);return r.forEach(a=>{let u=!1,c=!1,d;const f=()=>{a.removeEventListener("pointerleave",x)},p=w=>{d&&(d(w),d=void 0),f()},m=w=>{u=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,p(w))},_=()=>{u=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},x=w=>{if(w.pointerType!=="touch"){if(u){c=!0;return}p(w)}},y=w=>{if(!WF(w))return;c=!1;const S=e(a,w);typeof S=="function"&&(d=S,a.addEventListener("pointerleave",x,s))};a.addEventListener("pointerenter",y,s),a.addEventListener("pointerdown",_,s)}),i}const ET=(t,e)=>e?t===e?!0:ET(t,e.parentElement):!1,kx=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,ZF=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function GF(t){return ZF.has(t.tagName)||t.isContentEditable===!0}const KF=new Set(["INPUT","SELECT","TEXTAREA"]);function YF(t){return KF.has(t.tagName)||t.isContentEditable===!0}const Qp=new WeakSet;function pk(t){return e=>{e.key==="Enter"&&t(e)}}function b1(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const XF=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=pk(()=>{if(Qp.has(n))return;b1(n,"down");const s=pk(()=>{b1(n,"up")}),i=()=>b1(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 mk(t){return kx(t)&&!bT()}const vk=new WeakSet;function QF(t,e,n={}){const[r,s,i]=ST(t,n),a=u=>{const c=u.currentTarget;if(!mk(u)||vk.has(u))return;Qp.add(c),n.stopPropagation&&vk.add(u);const d=e(c,u),f={...s,capture:!0},p=(x,y)=>{window.removeEventListener("pointerup",m,f),window.removeEventListener("pointercancel",_,f),Qp.has(c)&&Qp.delete(c),mk(x)&&typeof d=="function"&&d(x,{success:y})},m=x=>{p(x,c===window||c===document||n.useGlobalTarget||ET(c,x.target))},_=x=>{p(x,!1)};window.addEventListener("pointerup",m,f),window.addEventListener("pointercancel",_,f)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",a,s),Xp(u)&&(u.addEventListener("focus",d=>XF(d,s)),!GF(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),i}function Cx(t){return T3(t)&&"ownerSVGElement"in t}const Jp=new WeakMap;let Go;const kT=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:Cx(r)&&"getBBox"in r?r.getBBox()[e]:r[n],JF=kT("inline","width","offsetWidth"),eV=kT("block","height","offsetHeight");function tV({target:t,borderBoxSize:e}){var n;(n=Jp.get(t))==null||n.forEach(r=>{r(t,{get width(){return JF(t,e)},get height(){return eV(t,e)}})})}function nV(t){t.forEach(tV)}function rV(){typeof ResizeObserver>"u"||(Go=new ResizeObserver(nV))}function sV(t,e){Go||rV();const n=wT(t);return n.forEach(r=>{let s=Jp.get(r);s||(s=new Set,Jp.set(r,s)),s.add(e),Go==null||Go.observe(r)}),()=>{n.forEach(r=>{const s=Jp.get(r);s==null||s.delete(e),s!=null&&s.size||Go==null||Go.unobserve(r)})}}const em=new Set;let Iu;function iV(){Iu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};em.forEach(e=>e(t))},window.addEventListener("resize",Iu)}function oV(t){return em.add(t),Iu||iV(),()=>{em.delete(t),!em.size&&typeof Iu=="function"&&(window.removeEventListener("resize",Iu),Iu=void 0)}}function gk(t,e){return typeof t=="function"?oV(t):sV(t,e)}function aV(t){return Cx(t)&&t.tagName==="svg"}const lV=[...yT,Cn,Xs],uV=t=>lV.find(gT(t)),yk=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ru=()=>({x:yk(),y:yk()}),_k=()=>({min:0,max:0}),Mn=()=>({x:_k(),y:_k()}),cV=new WeakMap;function T0(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function lf(t){return typeof t=="string"||Array.isArray(t)}const Px=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Tx=["initial",...Px];function I0(t){return T0(t.animate)||Tx.some(e=>lf(t[e]))}function CT(t){return!!(I0(t)||t.variants)}function dV(t,e,n){for(const r in e){const s=e[r],i=n[r];if(Qn(s))t.addValue(r,s);else if(Qn(i))t.addValue(r,pc(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,pc(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Qm={current:null},Ix={current:!1},fV=typeof window<"u";function PT(){if(Ix.current=!0,!!fV)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Qm.current=t.matches;t.addEventListener("change",e),e()}else Qm.current=!1}const xk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Jm={};function TT(t){Jm=t}function hV(){return Jm}class pV{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=yx,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 _=Sr.now();this.renderScheduledAt<_&&(this.renderScheduledAt=_,Lt.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!a,this.isControllingVariants=I0(n),this.isVariantNode=CT(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const _ in m){const x=m[_];d[_]!==void 0&&Qn(x)&&x.set(d[_])}}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,cV.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:(Ix.current||PT(),this.shouldReduceMotion=Qm.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),ha(this.notifyUpdate),ha(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&uT.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:u,times:c,ease:d,duration:f}=n.accelerate,p=new aT({element:this.current,name:e,keyframes:u,times:c,ease:d,duration:ls(f)}),m=a(p);this.valueSubscriptions.set(e,()=>{m(),p.cancel()});return}const r=bc.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Lt.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 Jm){const n=Jm[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):Mn()}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<xk.length;r++){const s=xk[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=dV(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=pc(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"&&(P3(r)||I3(r))?r=parseFloat(r):!uV(r)&&Xs.test(n)&&(r=xT(e,n)),this.setBaseTarget(e,Qn(r)?r.get():r)),Qn(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=wx(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&&!Qn(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 ux),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Ex.render(this.render)}}class IT extends pV{constructor(){super(...arguments),this.KeyframeResolver=UF}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;Qn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class xa{constructor(e){this.isMounted=!1,this.node=e}update(){}}function RT({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function mV({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function vV(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 S1(t){return t===void 0||t===1}function O_({scale:t,scaleX:e,scaleY:n}){return!S1(t)||!S1(e)||!S1(n)}function il(t){return O_(t)||AT(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function AT(t){return wk(t.x)||wk(t.y)}function wk(t){return t&&t!=="0%"}function e0(t,e,n){const r=t-n,s=e*r;return n+s}function bk(t,e,n,r,s){return s!==void 0&&(t=e0(t,s,r)),e0(t,n,r)+e}function D_(t,e=0,n=1,r,s){t.min=bk(t.min,e,n,r,s),t.max=bk(t.max,e,n,r,s)}function MT(t,{x:e,y:n}){D_(t.x,e.translate,e.scale,e.originPoint),D_(t.y,n.translate,n.scale,n.originPoint)}const Sk=.999999999999,Ek=1.0000000000001;function gV(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&&(Si(t.x,-i.scroll.offset.x),Si(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,MT(t,a)),r&&il(i.latestValues)&&tm(t,i.latestValues,(u=i.layout)==null?void 0:u.layoutBox))}e.x<Ek&&e.x>Sk&&(e.x=1),e.y<Ek&&e.y>Sk&&(e.y=1)}function Si(t,e){t.min+=e,t.max+=e}function kk(t,e,n,r,s=.5){const i=Mt(t.min,t.max,s);D_(t,e,n,i,r)}function Ck(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function tm(t,e,n){const r=n??t;kk(t.x,Ck(e.x,r.x),e.scaleX,e.scale,e.originX),kk(t.y,Ck(e.y,r.y),e.scaleY,e.scale,e.originY)}function LT(t,e){return RT(vV(t.getBoundingClientRect(),e))}function yV(t,e,n){const r=LT(t,n),{scroll:s}=e;return s&&(Si(r.x,s.offset.x),Si(r.y,s.offset.y)),r}const _V={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xV=wc.length;function wV(t,e,n){let r="",s=!0;for(let a=0;a<xV;a++){const u=wc[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 f=parseFloat(c);d=u.startsWith("scale")?f===1:f===0}if(!d||n){const f=L_(c,Xm[u]);if(!d){s=!1;const p=_V[u]||u;r+=`${p}(${f}) `}n&&(e[u]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${L_(i,Xm.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function Rx(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(bc.has(c)){a=!0;continue}else if(B3(c)){s[c]=d;continue}else{const f=L_(d,Xm[c]);c.startsWith("origin")?(u=!0,i[c]=f):r[c]=f}}if(e.transform||(a||n?r.transform=wV(e,t.transform,n):r.transform&&(r.transform="none")),u){const{originX:c="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${c} ${d} ${f}`}}function OT(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 Pk(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ed={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Me.test(t))t=parseFloat(t);else return t;const n=Pk(t,e.target.x),r=Pk(t,e.target.y);return`${n}% ${r}%`}},bV={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Xs.parse(t);if(s.length>5)return r;const i=Xs.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=Mt(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:{...Ed,applyTo:[...Sx]},borderTopLeftRadius:Ed,borderTopRightRadius:Ed,borderBottomLeftRadius:Ed,borderBottomRightRadius:Ed,boxShadow:bV};function DT(t,{layout:e,layoutId:n}){return bc.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!N_[t]||t==="opacity")}function Ax(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)(Qn(r[u])||s&&Qn(s[u])||DT(u,t)||((a=n==null?void 0:n.getValue(u))==null?void 0:a.liveStyle)!==void 0)&&(i[u]=r[u]);return i}function SV(t){return window.getComputedStyle(t)}class EV extends IT{constructor(){super(...arguments),this.type="html",this.renderInstance=OT}mount(e){C0(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(bc.has(n))return(r=this.projection)!=null&&r.isProjecting?b_(n):W7(e,n);{const s=SV(e),i=(B3(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return LT(e,n)}build(e,n,r){Rx(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Ax(e,n,r)}}const kV={offset:"stroke-dashoffset",array:"stroke-dasharray"},CV={offset:"strokeDashoffset",array:"strokeDasharray"};function PV(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?kV:CV;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const TV=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function NT(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...u},c,d,f){if(Rx(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=(f==null?void 0:f.transformBox)??"fill-box",delete p.transformBox);for(const _ of TV)p[_]!==void 0&&(m[_]=p[_],delete p[_]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&PV(p,s,i,a,!1)}const jT=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"]),FT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function IV(t,e,n,r){OT(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(jT.has(s)?s:bx(s),e.attrs[s])}function VT(t,e,n){const r=Ax(t,e,n);for(const s in t)if(Qn(t[s])||Qn(e[s])){const i=wc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class RV extends IT{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Mn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(bc.has(n)){const r=_T(n);return r&&r.default||0}return n=jT.has(n)?n:bx(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return VT(e,n,r)}build(e,n,r){NT(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){IV(e,n,r,s)}mount(e){this.isSVGTag=FT(e.tagName),super.mount(e)}}const AV=Tx.length;function $T(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?$T(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<AV;n++){const r=Tx[n],s=t.props[r];(lf(s)||s===!1)&&(e[r]=s)}return e}function HT(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 MV=[...Px].reverse(),LV=Px.length;function OV(t){return e=>Promise.all(e.map(({animation:n,options:r})=>MF(t,n,r)))}function DV(t){let e=OV(t),n=Tk(),r=!0,s=!1;const i=d=>(f,p)=>{var _;const m=Cl(t,p,d==="exit"?(_=t.presenceContext)==null?void 0:_.custom:void 0);if(m){const{transition:x,transitionEnd:y,...w}=m;f={...f,...w,...y}}return f};function a(d){e=d(t)}function u(d){const{props:f}=t,p=$T(t.parent)||{},m=[],_=new Set;let x={},y=1/0;for(let S=0;S<LV;S++){const C=MV[S],P=n[C],T=f[C]!==void 0?f[C]:p[C],I=lf(T),A=C===d?P.isActive:null;A===!1&&(y=S);let O=T===p[C]&&T!==f[C]&&I;if(O&&(r||s)&&t.manuallyAnimateOnMount&&(O=!1),P.protectedKeys={...x},!P.isActive&&A===null||!T&&!P.prevProp||T0(T)||typeof T=="boolean")continue;if(C==="exit"&&P.isActive&&A!==!0){P.prevResolvedValues&&(x={...x,...P.prevResolvedValues});continue}const R=NV(P.prevProp,T);let L=R||C===d&&P.isActive&&!O&&I||S>y&&I,D=!1;const j=Array.isArray(T)?T:[T];let F=j.reduce(i(C),{});A===!1&&(F={});const{prevResolvedValues:Z={}}=P,Q={...Z,...F},K=H=>{L=!0,_.has(H)&&(D=!0,_.delete(H)),P.needsAnimating[H]=!0;const X=t.getValue(H);X&&(X.liveStyle=!1)};for(const H in Q){const X=F[H],z=Z[H];if(x.hasOwnProperty(H))continue;let N=!1;T_(X)&&T_(z)?N=!HT(X,z)||R:N=X!==z,N?X!=null?K(H):_.add(H):X!==void 0&&_.has(H)?K(H):P.protectedKeys[H]=!0}P.prevProp=T,P.prevResolvedValues=F,P.isActive&&(x={...x,...F}),(r||s)&&t.blockInitialAnimation&&(L=!1);const q=O&&R;L&&(!q||D)&&m.push(...j.map(H=>{const X={type:C};if(typeof H=="string"&&(r||s)&&!q&&t.manuallyAnimateOnMount&&t.parent){const{parent:z}=t,N=Cl(z,H);if(z.enteringChildren&&N){const{delayChildren:Y}=N.transition||{};X.delay=cT(z.enteringChildren,t,Y)}}return{animation:H,options:X}}))}if(_.size){const S={};if(typeof f.initial!="boolean"){const C=Cl(t,Array.isArray(f.initial)?f.initial[0]:f.initial);C&&C.transition&&(S.transition=C.transition)}_.forEach(C=>{const P=t.getBaseTarget(C),T=t.getValue(C);T&&(T.liveStyle=!0),S[C]=P??null}),m.push({animation:S})}let w=!!m.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?e(m):Promise.resolve()}function c(d,f){var m;if(n[d].isActive===f)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(_=>{var x;return(x=_.animationState)==null?void 0:x.setActive(d,f)}),n[d].isActive=f;const p=u(d);for(const _ in n)n[_].protectedKeys={};return p}return{animateChanges:u,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Tk(),s=!0}}}function NV(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!HT(e,t):!1}function Za(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Tk(){return{animate:Za(!0),whileInView:Za(),whileHover:Za(),whileTap:Za(),whileDrag:Za(),whileFocus:Za(),exit:Za()}}function j_(t,e){t.min=e.min,t.max=e.max}function zs(t,e){j_(t.x,e.x),j_(t.y,e.y)}function Ik(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const zT=1e-4,jV=1-zT,FV=1+zT,UT=.01,VV=0-UT,$V=0+UT;function Er(t){return t.max-t.min}function HV(t,e,n){return Math.abs(t-e)<=n}function Rk(t,e,n,r=.5){t.origin=r,t.originPoint=Mt(e.min,e.max,t.origin),t.scale=Er(n)/Er(e),t.translate=Mt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=jV&&t.scale<=FV||isNaN(t.scale))&&(t.scale=1),(t.translate>=VV&&t.translate<=$V||isNaN(t.translate))&&(t.translate=0)}function Ud(t,e,n,r){Rk(t.x,e.x,n.x,r?r.originX:void 0),Rk(t.y,e.y,n.y,r?r.originY:void 0)}function Ak(t,e,n,r=0){const s=r?Mt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Er(e)}function zV(t,e,n,r){Ak(t.x,e.x,n.x,r==null?void 0:r.x),Ak(t.y,e.y,n.y,r==null?void 0:r.y)}function Mk(t,e,n,r=0){const s=r?Mt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Er(e)}function t0(t,e,n,r){Mk(t.x,e.x,n.x,r==null?void 0:r.x),Mk(t.y,e.y,n.y,r==null?void 0:r.y)}function Lk(t,e,n,r,s){return t-=e,t=e0(t,1/n,r),s!==void 0&&(t=e0(t,1/s,r)),t}function UV(t,e=0,n=1,r=.5,s,i=t,a=t){if(Ii.test(e)&&(e=parseFloat(e),e=Mt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let u=Mt(i.min,i.max,r);t===i&&(u-=e),t.min=Lk(t.min,e,n,u,s),t.max=Lk(t.max,e,n,u,s)}function Ok(t,e,[n,r,s],i,a){UV(t,e[n],e[r],e[s],e.scale,i,a)}const BV=["x","scaleX","originX"],WV=["y","scaleY","originY"];function Dk(t,e,n,r){Ok(t.x,e,BV,n?n.x:void 0,r?r.x:void 0),Ok(t.y,e,WV,n?n.y:void 0,r?r.y:void 0)}function Nk(t){return t.translate===0&&t.scale===1}function BT(t){return Nk(t.x)&&Nk(t.y)}function jk(t,e){return t.min===e.min&&t.max===e.max}function qV(t,e){return jk(t.x,e.x)&&jk(t.y,e.y)}function Fk(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function WT(t,e){return Fk(t.x,e.x)&&Fk(t.y,e.y)}function Vk(t){return Er(t.x)/Er(t.y)}function $k(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function vi(t){return[t("x"),t("y")]}function ZV(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:f,pathRotation:p,rotateX:m,rotateY:_,skewX:x,skewY:y}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),_&&(r+=`rotateY(${_}deg) `),x&&(r+=`skewX(${x}deg) `),y&&(r+=`skewY(${y}deg) `)}const u=t.x.scale*e.x,c=t.y.scale*e.y;return(u!==1||c!==1)&&(r+=`scale(${u}, ${c})`),r||"none"}const GV=Sx.length,Hk=t=>typeof t=="string"?parseFloat(t):t,zk=t=>typeof t=="number"||Me.test(t);function KV(t,e,n,r,s,i){s?(t.opacity=Mt(0,n.opacity??1,YV(r)),t.opacityExit=Mt(e.opacity??1,0,XV(r))):i&&(t.opacity=Mt(e.opacity??1,n.opacity??1,r));for(let a=0;a<GV;a++){const u=Sx[a];let c=Uk(e,u),d=Uk(n,u);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||zk(c)===zk(d)?(t[u]=Math.max(Mt(Hk(c),Hk(d),r),0),(Ii.test(d)||Ii.test(c))&&(t[u]+="%")):t[u]=d}(e.rotate||n.rotate)&&(t.rotate=Mt(e.rotate||0,n.rotate||0,r))}function Uk(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const YV=qT(0,.5,F3),XV=qT(.5,.95,Ms);function qT(t,e,n){return r=>r<t?0:r>e?1:n(of(t,e,r))}function QV(t,e,n){const r=Qn(t)?t:pc(t);return r.start(xx("",r,e,n)),r.animation}function uf(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const JV=(t,e)=>t.depth-e.depth;class e${constructor(){this.children=[],this.isDirty=!1}add(e){lx(this.children,e),this.isDirty=!0}remove(e){qm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(JV),this.isDirty=!1,this.children.forEach(e)}}function t$(t,e){const n=Sr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(ha(r),t(i-e))};return Lt.setup(r,!0),()=>ha(r)}function nm(t){return Qn(t)?t.get():t}class n${constructor(){this.members=[]}add(e){lx(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&&(qm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(qm(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 rm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},E1=["","X","Y","Z"],r$=1e3;let s$=0;function k1(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function ZT(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=mT(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Lt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&ZT(r)}function GT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},u=e==null?void 0:e()){this.id=s$++,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(a$),this.nodes.forEach(h$),this.nodes.forEach(p$),this.nodes.forEach(l$)},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 e$)}addEventListener(a,u){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new ux),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=Cx(a)&&!aV(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 f,p=0;const m=()=>this.root.updateBlockedByResize=!1;Lt.read(()=>{p=window.innerWidth}),t(a,()=>{const _=window.innerWidth;_!==p&&(p=_,this.root.updateBlockedByResize=!0,f&&f(),f=t$(m,250),rm.hasAnimatedSinceResize&&(rm.hasAnimatedSinceResize=!1,this.nodes.forEach(qk)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&d&&(u||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||_$,{onLayoutAnimationStart:y,onLayoutAnimationComplete:w}=d.getProps(),S=!this.targetLayout||!WT(this.targetLayout,_),C=!p&&m;if(this.options.layoutRoot||this.resumeFrom||C||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={..._x(x,"layout"),onPlay:y,onComplete:w};(d.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(f,C,P.path)}else p||qk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ha(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(m$),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&&ZT(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const p=this.path[f];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId: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(c$),this.nodes.forEach(Bk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Wk);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(d$),this.nodes.forEach(f$),this.nodes.forEach(i$),this.nodes.forEach(o$)):this.nodes.forEach(Wk),this.clearAllSnapshots();const u=Sr.now();Gn.delta=Ri(0,1e3/60,u-Gn.timestamp),Gn.timestamp=u,Gn.isProcessing=!0,v1.update.process(Gn),v1.preRender.process(Gn),v1.render.process(Gn),Gn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ex.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(u$),this.sharedNodes.forEach(v$)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Lt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Er(this.snapshot.measuredBox.x)&&!Er(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=Mn()),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&&!BT(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;a&&this.instance&&(u||il(this.latestValues)||f)&&(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)),x$(c),{animationId:this.root.animationId,measuredBox:u,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:a}=this.options;if(!a)return Mn();const u=a.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(w$))){const{scroll:f}=this.root;f&&(Si(u.x,f.offset.x),Si(u.y,f.offset.y))}return u}removeElementScroll(a){var c;const u=Mn();if(zs(u,a),(c=this.scroll)!=null&&c.wasRoot)return u;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:p,options:m}=f;f!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&zs(u,a),Si(u.x,p.offset.x),Si(u.y,p.offset.y))}return u}applyTransform(a,u=!1,c){var f,p;const d=c||Mn();zs(d,a);for(let m=0;m<this.path.length;m++){const _=this.path[m];!u&&_.options.layoutScroll&&_.scroll&&_!==_.root&&(Si(d.x,-_.scroll.offset.x),Si(d.y,-_.scroll.offset.y)),il(_.latestValues)&&tm(d,_.latestValues,(f=_.layout)==null?void 0:f.layoutBox)}return il(this.latestValues)&&tm(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(a){var c;const u=Mn();zs(u,a);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!il(f.latestValues))continue;let p;f.instance&&(O_(f.latestValues)&&f.updateSnapshot(),p=Mn(),zs(p,f.measurePageBox())),Dk(u,f.latestValues,(c=f.snapshot)==null?void 0:c.layoutBox,p)}return il(this.latestValues)&&Dk(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!==Gn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var _;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||(_=this.parent)!=null&&_.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:p}=this.options;if(!this.layout||!(f||p))return;this.resolvedRelativeTargetAt=Gn.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=Mn(),this.targetWithTransforms=Mn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zV(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):zs(this.target,this.layout.layoutBox),MT(this.target,this.targetDelta)):zs(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||O_(this.parent.latestValues)||AT(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=Mn(),this.relativeTargetOrigin=Mn(),t0(this.relativeTargetOrigin,u,c,this.options.layoutAnchor||void 0),zs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const a=this.getLead(),u=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(c=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Gn.timestamp&&(c=!1),c)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;zs(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;gV(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=Mn());const{target:_}=a;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ik(this.prevProjectionDelta.x,this.projectionDelta.x),Ik(this.prevProjectionDelta.y,this.projectionDelta.y)),Ud(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!$k(this.projectionDelta.x,this.prevProjectionDelta.x)||!$k(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var 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=Ru(),this.projectionDelta=Ru(),this.projectionDeltaWithTransform=Ru()}setAnimationOrigin(a,u=!1,c){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},m=Ru();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const _=Mn(),x=d?d.source:void 0,y=this.layout?this.layout.source:void 0,w=x!==y,S=this.getStack(),C=!S||S.members.length<=1,P=!!(w&&!C&&this.options.crossfade===!0&&!this.path.some(y$));this.animationProgress=0;let T;const I=c==null?void 0:c.interpolateProjection(a);this.mixTargetDelta=A=>{const O=A/1e3,R=I==null?void 0:I(O);R?(m.x.translate=R.x,m.x.scale=Mt(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=Mt(a.y.scale,1,O),m.y.origin=a.y.origin,m.y.originPoint=a.y.originPoint):(Zk(m.x,a.x,O),Zk(m.y,a.y,O)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(t0(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),g$(this.relativeTarget,this.relativeTargetOrigin,_,O),T&&qV(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Mn()),zs(T,this.relativeTarget)),w&&(this.animationValues=p,KV(p,f,this.latestValues,O,P,C)),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&&(ha(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Lt.update(()=>{rm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=pc(0)),this.motionValue.jump(0,!1),this.currentAnimation=QV(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),a.onUpdate&&a.onUpdate(f)},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(r$),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:u,target:c,layout:d,latestValues:f}=a;if(!(!u||!c||!d)){if(this!==a&&this.layout&&d&&KT(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Mn();const p=Er(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+p;const m=Er(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+m}zs(u,c),tm(u,f),Ud(this.projectionDeltaWithTransform,this.layoutCorrected,u,f)}}registerSharedNode(a,u){this.sharedNodes.has(a)||this.sharedNodes.set(a,new n$),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&&k1("z",a,d,this.animationValues);for(let f=0;f<E1.length;f++)k1(`rotate${E1[f]}`,a,d,this.animationValues),k1(`skew${E1[f]}`,a,d,this.animationValues);a.render();for(const f in d)a.setStaticValue(f,d[f]),this.animationValues&&(this.animationValues[f]=d[f]);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=nm(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=nm(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!il(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=ZV(this.projectionDeltaWithTransform,this.treeScale,f);c&&(p=c(f,p)),a.transform=p;const{x:m,y:_}=this.projectionDelta;a.transformOrigin=`${m.origin*100}% ${_.origin*100}% 0`,d.animationValues?a.opacity=d===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:a.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const x in N_){if(f[x]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:S}=N_[x],C=p==="none"?f[x]:y(f[x],d);if(w){const P=w.length;for(let T=0;T<P;T++)a[w[T]]=C}else S?this.options.visualElement.renderState.vars[x]=C:a[x]=C}this.options.layoutId&&(a.pointerEvents=d===this?nm(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(Bk),this.root.sharedNodes.clear()}}}function i$(t){t.updateLayout()}function o$(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")vi(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],_=Er(m);m.min=r[p].min,m.max=m.min+_});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";j_(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else KT(i,e.layoutBox,r)&&vi(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],_=Er(r[p]);m.max=m.min+_,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+_)});const u=Ru();Ud(u,r,e.layoutBox);const c=Ru();a?Ud(c,t.applyTransform(s,!0),e.measuredBox):Ud(c,r,e.layoutBox);const d=!BT(u);let f=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:_}=p;if(m&&_){const x=t.options.layoutAnchor||void 0,y=Mn();t0(y,e.layoutBox,m.layoutBox,x);const w=Mn();t0(w,r,_.layoutBox,x),WT(y,w)||(f=!0),p.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=y,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function a$(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 l$(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function u$(t){t.clearSnapshot()}function Bk(t){t.clearMeasurements()}function c$(t){t.isLayoutDirty=!0,t.updateLayout()}function Wk(t){t.isLayoutDirty=!1}function d$(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function f$(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function qk(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function h$(t){t.resolveTargetDelta()}function p$(t){t.calcProjection()}function m$(t){t.resetSkewAndRotation()}function v$(t){t.removeLeadSnapshot()}function Zk(t,e,n){t.translate=Mt(e.translate,0,n),t.scale=Mt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Gk(t,e,n,r){t.min=Mt(e.min,n.min,r),t.max=Mt(e.max,n.max,r)}function g$(t,e,n,r){Gk(t.x,e.x,n.x,r),Gk(t.y,e.y,n.y,r)}function y$(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const _$={duration:.45,ease:[.4,0,.1,1]},Kk=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Yk=Kk("applewebkit/")&&!Kk("chrome/")?Math.round:Ms;function Xk(t){t.min=Yk(t.min),t.max=Yk(t.max)}function x$(t){Xk(t.x),Xk(t.y)}function KT(t,e,n){return t==="position"||t==="preserve-aspect"&&!HV(Vk(e),Vk(n),.2)}function w$(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const b$=GT({attachResizeListener:(t,e)=>uf(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}),C1={current:void 0},YT=GT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!C1.current){const t=new b$({});t.mount(window),t.setOptions({layoutScroll:!0}),C1.current=t}return C1.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Mx=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Qk(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function S$(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Qk(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():Qk(t[s],null)}}}}function E$(...t){return v.useCallback(S$(...t),t)}class k$ extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Xp(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Xp(r)&&r.offsetWidth||0,i=Xp(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 C$({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(Mx),f=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,p=E$(u,f);return v.useInsertionEffect(()=>{const{width:_,height:x,top:y,left:w,right:S,bottom:C,direction:P}=c.current;if(e||i===!1||!u.current||!_||!x)return;const T=P==="rtl",I=n==="left"?T?`right: ${S}`:`left: ${w}`:T?`left: ${w}`:`right: ${S}`,A=r==="bottom"?`bottom: ${C}`:`top: ${y}`;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(`
64
+ [data-motion-pop-id="${a}"] {
65
+ position: absolute !important;
66
+ width: ${_}px !important;
67
+ height: ${x}px !important;
68
+ ${I}px !important;
69
+ ${A}px !important;
70
+ }
71
+ `),()=>{var L;(L=u.current)==null||L.removeAttribute("data-motion-pop-id"),R.contains(O)&&R.removeChild(O)}},[e]),E.jsx(k$,{isPresent:e,childRef:u,sizeRef:c,pop:i,children:i===!1?t:v.cloneElement(t,{ref:p})})}const P$=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:u,anchorY:c,root:d})=>{const f=ox(T$),p=v.useId(),m=v.useRef(n),_=v.useRef(r);ax(()=>{m.current=n,_.current=r});let x=!0,y=v.useMemo(()=>(x=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:w=>{f.set(w,!0);for(const S of f.values())if(!S)return;r&&r()},register:w=>(f.set(w,!1),()=>{var S;f.delete(w),!m.current&&!f.size&&((S=_.current)==null||S.call(_))})}),[n,f,r]);return i&&x&&(y={...y}),v.useMemo(()=>{f.forEach((w,S)=>f.set(S,!1))},[n]),v.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=E.jsx(C$,{pop:a==="popLayout",isPresent:n,anchorX:u,anchorY:c,root:d,children:t}),E.jsx(k0.Provider,{value:y,children:t})};function T$(){return new Map}function XT(t=!0){const e=v.useContext(k0);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 bp=t=>t.key||"";function Jk(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const Qs=({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[f,p]=XT(a),m=v.useMemo(()=>Jk(t),[t]),_=a&&!f?[]:m.map(bp),x=v.useRef(!0),y=v.useRef(m),w=ox(()=>new Map),S=v.useRef(new Set),[C,P]=v.useState(m),[T,I]=v.useState(m);ax(()=>{x.current=!1,y.current=m;for(let R=0;R<T.length;R++){const L=bp(T[R]);_.includes(L)?(w.delete(L),S.current.delete(L)):w.get(L)!==!0&&w.set(L,!1)}},[T,_.length,_.join("-")]);const A=[];if(m!==C){let R=[...m];for(let L=0;L<T.length;L++){const D=T[L],j=bp(D);_.includes(j)||(R.splice(L,0,D),A.push(D))}return i==="wait"&&A.length&&(R=A),I(Jk(R)),P(m),null}const{forceRender:O}=v.useContext(ix);return E.jsx(E.Fragment,{children:T.map(R=>{const L=bp(R),D=a&&!f?!1:m===T||_.includes(L),j=()=>{if(S.current.has(L))return;if(w.has(L))S.current.add(L),w.set(L,!0);else return;let F=!0;w.forEach(Z=>{Z||(F=!1)}),F&&(O==null||O(),I(y.current),a&&(p==null||p()),r&&r())};return E.jsx(P$,{isPresent:D,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:D?void 0:j,anchorX:u,anchorY:c,children:R},L)})})},QT=v.createContext({strict:!1}),eC={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 tC=!1;function I$(){if(tC)return;const t={};for(const e in eC)t[e]={isEnabled:n=>eC[e].some(r=>!!n[r])};TT(t),tC=!0}function JT(){return I$(),hV()}function R$(t){const e=JT();for(const n in t)e[n]={...e[n],...t[n]};TT(e)}const A$=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 n0(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||A$.has(t)}let e5=t=>!n0(t);function M$(t){typeof t=="function"&&(e5=e=>e.startsWith("on")?!n0(e):t(e))}try{M$(require("@emotion/is-prop-valid").default)}catch{}function L$(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||Qn(t[s])||(e5(s)||n===!0&&n0(s)||!e&&!n0(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const R0=v.createContext({});function O$(t,e){if(I0(t)){const{initial:n,animate:r}=t;return{initial:n===!1||lf(n)?n:void 0,animate:lf(r)?r:void 0}}return t.inherit!==!1?e:{}}function D$(t){const{initial:e,animate:n}=O$(t,v.useContext(R0));return v.useMemo(()=>({initial:e,animate:n}),[nC(e),nC(n)])}function nC(t){return Array.isArray(t)?t.join(" "):t}const Lx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function t5(t,e,n){for(const r in e)!Qn(e[r])&&!DT(r,n)&&(t[r]=e[r])}function N$({transformTemplate:t},e){return v.useMemo(()=>{const n=Lx();return Rx(n,e,t),Object.assign({},n.vars,n.style)},[e])}function j$(t,e){const n=t.style||{},r={};return t5(r,n,t),Object.assign(r,N$(t,e)),r}function F$(t,e){const n={},r=j$(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 n5=()=>({...Lx(),attrs:{}});function V$(t,e,n,r){const s=v.useMemo(()=>{const i=n5();return NT(i,e,FT(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};t5(i,t.style,t),s.style={...i,...s.style}}return s}const $$=["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 Ox(t){return typeof t!="string"||t.includes("-")?!1:!!($$.indexOf(t)>-1||/[A-Z]/u.test(t))}function H$(t,e,n,{latestValues:r},s,i=!1,a){const c=(a??Ox(t)?V$:F$)(e,r,s,t),d=L$(e,typeof t=="string",i),f=t!==v.Fragment?{...d,...c,ref:n}:{},{children:p}=e,m=v.useMemo(()=>Qn(p)?p.get():p,[p]);return v.createElement(t,{...f,children:m})}function z$({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:U$(n,r,s,t),renderState:e()}}function U$(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=nm(i[m]);let{initial:a,animate:u}=t;const c=I0(t),d=CT(t);e&&d&&!c&&t.inherit!==!1&&(a===void 0&&(a=e.initial),u===void 0&&(u=e.animate));let f=n?n.initial===!1:!1;f=f||a===!1;const p=f?u:a;if(p&&typeof p!="boolean"&&!T0(p)){const m=Array.isArray(p)?p:[p];for(let _=0;_<m.length;_++){const x=wx(t,m[_]);if(x){const{transitionEnd:y,transition:w,...S}=x;for(const C in S){let P=S[C];if(Array.isArray(P)){const T=f?P.length-1:0;P=P[T]}P!==null&&(s[C]=P)}for(const C in y)s[C]=y[C]}}}return s}const r5=t=>(e,n)=>{const r=v.useContext(R0),s=v.useContext(k0),i=()=>z$(t,e,r,s);return n?i():ox(i)},B$=r5({scrapeMotionValuesFromProps:Ax,createRenderState:Lx}),W$=r5({scrapeMotionValuesFromProps:VT,createRenderState:n5}),q$=Symbol.for("motionComponentSymbol");function Z$(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 s5=v.createContext({});function Su(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function G$(t,e,n,r,s,i){var P,T;const{visualElement:a}=v.useContext(R0),u=v.useContext(QT),c=v.useContext(k0),d=v.useContext(Mx),f=d.reducedMotion,p=d.skipAnimations,m=v.useRef(null),_=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:f,skipAnimations:p,isSVG:i}),_.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,y=v.useContext(s5);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&K$(m.current,n,s,y);const w=v.useRef(!1);v.useInsertionEffect(()=>{x&&w.current&&x.update(n,c)});const S=n[pT],C=v.useRef(!!S&&typeof window<"u"&&!((P=window.MotionHandoffIsComplete)!=null&&P.call(window,S))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,S)));return ax(()=>{_.current=!0,x&&(w.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),C.current&&x.animationState&&x.animationState.animateChanges())}),v.useEffect(()=>{x&&(!C.current&&x.animationState&&x.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{var I;(I=window.MotionHandoffMarkAsComplete)==null||I.call(window,S)}),C.current=!1),x.enteringChildren=void 0)}),x}function K$(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:u,layoutScroll:c,layoutRoot:d,layoutAnchor:f,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:i5(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||u&&Su(u),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:d,layoutAnchor:f})}function i5(t){if(t)return t.options.allowProjection!==!1?t.projection:i5(t.parent)}function P1(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&R$(r);const i=n?n==="svg":Ox(t),a=i?W$:B$;function u(d,f){let p;const m={...v.useContext(Mx),...d,layoutId:Y$(d)},{isStatic:_}=m,x=D$(d),y=a(d,_);if(!_&&typeof window<"u"){X$();const w=Q$(m);p=w.MeasureLayout,x.visualElement=G$(t,y,m,s,w.ProjectionNode,i)}return E.jsxs(R0.Provider,{value:x,children:[p&&x.visualElement?E.jsx(p,{visualElement:x.visualElement,...m}):null,H$(t,d,Z$(y,x.visualElement,f),y,_,e,i)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=v.forwardRef(u);return c[q$]=t,c}function Y$({layoutId:t}){const e=v.useContext(ix).id;return e&&t!==void 0?e+"-"+t:t}function X$(t,e){v.useContext(QT).strict}function Q$(t){const e=JT(),{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 J$(t,e){if(typeof Proxy>"u")return P1;const n=new Map,r=(i,a)=>P1(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,P1(a,void 0,t,e)),n.get(a))})}const eH=(t,e)=>e.isSVG??Ox(t)?new RV(e):new EV(e,{allowProjection:t!==v.Fragment});class tH extends xa{constructor(e){super(e),e.animationState||(e.animationState=DV(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();T0(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 nH=0;class rH extends xa{constructor(){super(...arguments),this.id=nH++,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=Cl(this.node,a,u);if(c){const{transition:d,transitionEnd:f,...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 sH={animation:{Feature:tH},exit:{Feature:rH}};function zf(t){return{point:{x:t.pageX,y:t.pageY}}}const iH=t=>e=>kx(e)&&t(e,zf(e));function Bd(t,e,n,r){return uf(t,e,iH(n),r)}const o5=({current:t})=>t?t.ownerDocument.defaultView:null,rC=(t,e)=>Math.abs(t-e);function oH(t,e){const n=rC(t.x,e.x),r=rC(t.y,e.y);return Math.sqrt(n**2+r**2)}const sC=new Set(["auto","scroll"]);class a5{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=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Sp(this.lastRawMoveEventInfo,this.transformPagePoint));const x=T1(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,w=oH(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!w)return;const{point:S}=x,{timestamp:C}=Gn;this.history.push({...S,timestamp:C});const{onStart:P,onMove:T}=this.handlers;y||(P&&P(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=Sp(y,this.transformPagePoint),Lt.update(this.updatePoint,!0)},this.handlePointerUp=(x,y)=>{this.end();const{onEnd:w,onSessionEnd:S,resumeAnimation:C}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=T1(x.type==="pointercancel"?this.lastMoveEventInfo:Sp(y,this.transformPagePoint),this.history);this.startEvent&&w&&w(x,P),S&&S(x,P)},!kx(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const c=zf(e),d=Sp(c,this.transformPagePoint),{point:f}=d,{timestamp:p}=Gn;this.history=[{...f,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,T1(d,this.history));const _={passive:!0,capture:!0};this.removeListeners=Vf(Bd(this.contextWindow,"pointermove",this.handlePointerMove,_),Bd(this.contextWindow,"pointerup",this.handlePointerUp,_),Bd(this.contextWindow,"pointercancel",this.handlePointerUp,_)),u&&this.startScrollTracking(u)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(sC.has(r.overflowX)||sC.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),Lt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ha(this.updatePoint)}}function Sp(t,e){return e?{point:e(t.point)}:t}function iC(t,e){return{x:t.x-e.x,y:t.y-e.y}}function T1({point:t},e){return{point:t,delta:iC(t,l5(e)),offset:iC(t,aH(e)),velocity:lH(e,.1)}}function aH(t){return t[0]}function l5(t){return t[t.length-1]}function lH(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=l5(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>ls(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>ls(e)*2&&(r=t[1]);const i=Ts(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 uH(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Mt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Mt(n,t,r.max):Math.min(t,n)),t}function oC(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 cH(t,{top:e,left:n,bottom:r,right:s}){return{x:oC(t.x,n,s),y:oC(t.y,e,r)}}function aC(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 dH(t,e){return{x:aC(t.x,e.x),y:aC(t.y,e.y)}}function fH(t,e){let n=.5;const r=Er(t),s=Er(e);return s>r?n=of(e.min,e.max-r,t.min):r>s&&(n=of(t.min,t.max-s,e.min)),Ri(0,1,n)}function hH(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 F_=.35;function pH(t=F_){return t===!1?t=0:t===!0&&(t=F_),{x:lC(t,"left","right"),y:lC(t,"top","bottom")}}function lC(t,e,n){return{min:uC(t,e),max:uC(t,n)}}function uC(t,e){return typeof t=="number"?t:t[e]||0}const mH=new WeakMap;class vH{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=Mn(),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(zf(p).point),this.stopAnimation()},a=(p,m)=>{const{drag:_,dragPropagation:x,onDragStart:y}=this.getProps();if(_&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=BF(_),!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),vi(S=>{let C=this.getAxisMotionValue(S).get()||0;if(Ii.test(C)){const{projection:P}=this.visualElement;if(P&&P.layout){const T=P.layout.layoutBox[S];T&&(C=Er(T)*(parseFloat(C)/100))}}this.originPoint[S]=C}),y&&Lt.update(()=>y(p,m),!1,!0),I_(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:_,dragDirectionLock:x,onDirectionLock:y,onDrag:w}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:S}=m;if(x&&this.currentDirection===null){this.currentDirection=yH(S),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",m.point,S),this.updateAxis("y",m.point,S),this.visualElement.render(),w&&Lt.update(()=>w(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:f}=this.getProps();this.panSession=new a5(e,{onSessionStart:i,onStart:a,onMove:u,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:o5(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&&Lt.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||!Ep(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=uH(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&&Su(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=cH(r.layoutBox,e):this.constraints=!1,this.elastic=pH(n),s!==this.constraints&&!Su(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&vi(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=hH(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Su(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=yV(r,s.root,this.visualElement.getTransformPagePoint());let a=dH(s.layout.layoutBox,i);if(n){const u=n(mV(a));this.hasMutatedConstraints=!!u,u&&(a=RT(u))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:u}=this.getProps(),c=this.constraints||{},d=vi(f=>{if(!Ep(f,n,this.currentDirection))return;let p=c&&c[f]||{};(a===!0||a===f)&&(p={min:0,max:0});const m=s?200:1e6,_=s?40:1e7,x={type:"inertia",velocity:r?e[f]:0,bounceStiffness:m,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(f,x)});return Promise.all(d).then(u)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return I_(this.visualElement,e),r.start(xx(e,r,0,n,this.visualElement,!1))}stopAnimation(){vi(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){vi(n=>{const{drag:r}=this.getProps();if(!Ep(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]-Mt(a,u,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Su(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};vi(a=>{const u=this.getAxisMotionValue(a);if(u&&this.constraints!==!1){const c=u.get();s[a]=fH({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(),vi(a=>{if(!Ep(a,e,null))return;const u=this.getAxisMotionValue(a),{min:c,max:d}=this.constraints[a];u.set(Mt(c,d,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;mH.set(this.visualElement,this);const e=this.visualElement.current,n=Bd(e,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps(),m=d.target,_=m!==e&&YF(m);f&&p&&!_&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();Su(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=gH(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Lt.read(s);const u=uf(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(vi(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=F_,dragMomentum:u=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:u}}}function cC(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function gH(t,e,n){const r=gk(t,cC(n)),s=gk(e,cC(n));return()=>{r(),s()}}function Ep(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function yH(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class _H extends xa{constructor(e){super(e),this.removeGroupControls=Ms,this.removeListeners=Ms,this.controls=new vH(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ms}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 I1=t=>(e,n)=>{t&&Lt.update(()=>t(e,n),!1,!0)};class xH extends xa{constructor(){super(...arguments),this.removePointerDownListener=Ms}onPointerDown(e){this.session=new a5(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:o5(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:I1(e),onStart:I1(n),onMove:I1(r),onEnd:(i,a)=>{delete this.session,s&&Lt.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Bd(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 R1=!1;class wH 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),R1&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),rm.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}),R1=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Lt.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(),Ex.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;R1=!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 u5(t){const[e,n]=XT(),r=v.useContext(ix);return E.jsx(wH,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(s5),isPresent:e,safeToRemove:n})}const bH={pan:{Feature:xH},drag:{Feature:_H,ProjectionNode:YT,MeasureLayout:u5}};function dC(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&&Lt.postRender(()=>i(e,zf(e)))}class SH extends xa{mount(){const{current:e}=this.node;e&&(this.unmount=qF(e,(n,r)=>(dC(this.node,r,"Start"),s=>dC(this.node,s,"End"))))}unmount(){}}class EH extends xa{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=Vf(uf(this.node.current,"focus",()=>this.onFocus()),uf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function fC(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&&Lt.postRender(()=>i(e,zf(e)))}class kH extends xa{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=QF(e,(s,i)=>(fC(this.node,i,"Start"),(a,{success:u})=>fC(this.node,a,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const V_=new WeakMap,A1=new WeakMap,CH=t=>{const e=V_.get(t.target);e&&e(t)},PH=t=>{t.forEach(CH)};function TH({root:t,...e}){const n=t||document;A1.has(n)||A1.set(n,{});const r=A1.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(PH,{root:t,...e})),r[s]}function IH(t,e,n){const r=TH(e);return V_.set(t,n),r.observe(t),()=>{V_.delete(t),r.unobserve(t)}}const RH={some:0,all:1};class AH extends xa{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:RH[s]},u=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),_=f?p:m;_&&_(d)};this.stopObserver=IH(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(MH(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function MH({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const LH={inView:{Feature:AH},tap:{Feature:kH},focus:{Feature:EH},hover:{Feature:SH}},OH={layout:{ProjectionNode:YT,MeasureLayout:u5}},DH={...sH,...LH,...bH,...OH},ho=J$(DH,eH);function NH(){!Ix.current&&PT();const[t]=v.useState(Qm.current);return t}const po=ho;var A0=x3();const jH=x0(A0);function FH(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 VH=t=>{switch(t){case"success":return zH;case"info":return BH;case"warning":return UH;case"error":return WH;default:return null}},$H=Array(12).fill(0),HH=({visible:t,className:e})=>we.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},we.createElement("div",{className:"sonner-spinner"},$H.map((n,r)=>we.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),zH=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),UH=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),BH=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),WH=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),qH=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},we.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),we.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ZH=()=>{const[t,e]=we.useState(document.hidden);return we.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let GH=1;const KH=100,hC=t=>{var e;return typeof(t==null?void 0:t.id)=="number"||(t==null||(e=t.id)==null?void 0:e.length)>0?t.id:GH++};class YH{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(n=>e(n)),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-KH;e<=0||(this.toasts=this.toasts.filter(n=>e>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),e--,!1):!0))},this.create=e=>{const{message:n,...r}=e,s=hC(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),u=e.dismissible===void 0?!0:e.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(a?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:u,title:n}):d):this.addToast({title:n,...r,dismissible:u,id:s}),s},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(r=>r({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,a;const u=s.then(async d=>{if(a=["resolve",d],we.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(QH(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,x=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}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,x=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,x=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,...x})}}).catch(async d=>{if(a=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,_=typeof f=="object"&&!we.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,..._})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,f)=>u.then(()=>a[0]==="reject"?f(a[1]):d(a[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=hC(n);return this.create({...n,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Fr=new YH,XH=(t,e)=>Fr.message(t,e),QH=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",JH=XH,ez=()=>Fr.toasts,tz=()=>Fr.getActiveToasts(),mt=Object.assign(JH,{success:Fr.success,info:Fr.info,warning:Fr.warning,error:Fr.error,custom:Fr.custom,message:Fr.message,promise:Fr.promise,dismiss:Fr.dismiss,loading:Fr.loading},{getHistory:ez,getToasts:tz});FH("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function kp(t){return t.label!==void 0}const nz=3,rz="24px",sz="16px",pC=4e3,iz=356,oz=14,az=45,lz=200;function ci(...t){return t.filter(Boolean).join(" ")}function uz(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const cz=t=>{var e,n,r,s,i,a,u,c,d;const{invert:f,toast:p,unstyled:m,interacting:_,setHeights:x,visibleToasts:y,heights:w,index:S,toasts:C,expanded:P,removeToast:T,defaultRichColors:I,closeButton:A,style:O,cancelButtonStyle:R,actionButtonStyle:L,className:D="",descriptionClassName:j="",duration:F,position:Z,gap:Q,expandByDefault:K,classNames:q,icons:W,closeButtonAriaLabel:H="Close toast"}=t,[X,z]=we.useState(null),[N,Y]=we.useState(null),[oe,J]=we.useState(!1),[se,pe]=we.useState(!1),[Se,ce]=we.useState(!1),[ae,$e]=we.useState(!1),[We,He]=we.useState(!1),[Fe,ct]=we.useState(0),[Gt,rt]=we.useState(0),Ve=we.useRef(p.duration||F||pC),Oe=we.useRef(null),Je=we.useRef(null),kt=S===0,vt=S+1<=y,xe=p.type,sn=xe??"default",Ot=p.dismissible!==!1,Kr=p.className||"",Pa=p.descriptionClassName||"",on=we.useMemo(()=>w.findIndex(Ze=>Ze.toastId===p.id)||0,[w,p.id]),wn=we.useMemo(()=>{var Ze;return(Ze=p.closeButton)!=null?Ze:A},[p.closeButton,A]),Ta=we.useMemo(()=>p.duration||F||pC,[p.duration,F]),fr=we.useRef(0),an=we.useRef(0),Eo=we.useRef(0),Un=we.useRef(null),[ti,hs]=Z.split("-"),ps=we.useMemo(()=>w.reduce((Ze,Dt,Kt)=>Kt>=on?Ze:Ze+Dt.height,0),[w,on]),ko=ZH(),er=we.useMemo(()=>{var Ze;return(Ze=t.swipeDirections)!=null?Ze:uz(Z)},[t.swipeDirections,Z]),On=p.invert||f,Os=xe==="loading";an.current=we.useMemo(()=>on*Q+ps,[on,ps]),we.useEffect(()=>{Ve.current=Ta},[Ta]),we.useEffect(()=>{J(!0)},[]),we.useEffect(()=>{const Ze=Je.current;if(Ze){const Dt=Ze.getBoundingClientRect().height;return rt(Dt),x(Kt=>[{toastId:p.id,height:Dt,position:p.position},...Kt]),()=>x(Kt=>Kt.filter(mn=>mn.toastId!==p.id))}},[x,p.id]),we.useLayoutEffect(()=>{if(!oe)return;const Ze=Je.current,Dt=Ze.style.height;Ze.style.height="auto";const Kt=Ze.getBoundingClientRect().height;Ze.style.height=Dt,rt(Kt),x(mn=>mn.find(Ft=>Ft.toastId===p.id)?mn.map(Ft=>Ft.toastId===p.id?{...Ft,height:Kt}:Ft):[{toastId:p.id,height:Kt,position:p.position},...mn])},[oe,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const bn=we.useCallback(()=>{pe(!0),ct(an.current),x(Ze=>Ze.filter(Dt=>Dt.toastId!==p.id)),setTimeout(()=>{T(p)},lz)},[p,T,x,an]);we.useEffect(()=>{if(p.promise&&xe==="loading"||p.duration===1/0||p.type==="loading")return;let Ze;return P||_||ko?(()=>{if(Eo.current<fr.current){const mn=new Date().getTime()-fr.current;Ve.current=Ve.current-mn}Eo.current=new Date().getTime()})():(()=>{Ve.current!==1/0&&(fr.current=new Date().getTime(),Ze=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),bn()},Ve.current))})(),()=>clearTimeout(Ze)},[P,_,p,xe,ko,bn]),we.useEffect(()=>{p.delete&&(bn(),p.onDismiss==null||p.onDismiss.call(p,p))},[bn,p.delete]);function Cr(){var Ze;if(W!=null&&W.loading){var Dt;return we.createElement("div",{className:ci(q==null?void 0:q.loader,p==null||(Dt=p.classNames)==null?void 0:Dt.loader,"sonner-loader"),"data-visible":xe==="loading"},W.loading)}return we.createElement(HH,{className:ci(q==null?void 0:q.loader,p==null||(Ze=p.classNames)==null?void 0:Ze.loader),visible:xe==="loading"})}const Ni=p.icon||(W==null?void 0:W[xe])||VH(xe);var ni,ms;return we.createElement("li",{tabIndex:0,ref:Je,className:ci(D,Kr,q==null?void 0:q.toast,p==null||(e=p.classNames)==null?void 0:e.toast,q==null?void 0:q[sn],p==null||(n=p.classNames)==null?void 0:n[sn]),"data-sonner-toast":"","data-rich-colors":(ni=p.richColors)!=null?ni:I,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":oe,"data-promise":!!p.promise,"data-swiped":We,"data-removed":se,"data-visible":vt,"data-y-position":ti,"data-x-position":hs,"data-index":S,"data-front":kt,"data-swiping":Se,"data-dismissible":Ot,"data-type":xe,"data-invert":On,"data-swipe-out":ae,"data-swipe-direction":N,"data-expanded":!!(P||K&&oe),"data-testid":p.testId,style:{"--index":S,"--toasts-before":S,"--z-index":C.length-S,"--offset":`${se?Fe:an.current}px`,"--initial-height":K?"auto":`${Gt}px`,...O,...p.style},onDragEnd:()=>{ce(!1),z(null),Un.current=null},onPointerDown:Ze=>{Ze.button!==2&&(Os||!Ot||(Oe.current=new Date,ct(an.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(ce(!0),Un.current={x:Ze.clientX,y:Ze.clientY})))},onPointerUp:()=>{var Ze,Dt,Kt;if(ae||!Ot)return;Un.current=null;const mn=Number(((Ze=Je.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),hr=Number(((Dt=Je.current)==null?void 0:Dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ft=new Date().getTime()-((Kt=Oe.current)==null?void 0:Kt.getTime()),ln=X==="x"?mn:hr,Pr=Math.abs(ln)/Ft;if((X==="x"?er.includes(mn>0?"right":"left"):er.includes(hr>0?"bottom":"top"))&&(Math.abs(ln)>=az||Pr>.11)){ct(an.current),p.onDismiss==null||p.onDismiss.call(p,p),Y(X==="x"?mn>0?"right":"left":hr>0?"down":"up"),bn(),$e(!0);return}else{var Bn,ri;(Bn=Je.current)==null||Bn.style.setProperty("--swipe-amount-x","0px"),(ri=Je.current)==null||ri.style.setProperty("--swipe-amount-y","0px")}He(!1),ce(!1),z(null)},onPointerMove:Ze=>{var Dt,Kt,mn;if(!Un.current||!Ot||((Dt=window.getSelection())==null?void 0:Dt.toString().length)>0)return;const Ft=Ze.clientY-Un.current.y,ln=Ze.clientX-Un.current.x;!X&&(Math.abs(ln)>1||Math.abs(Ft)>1)&&z(Math.abs(ln)>Math.abs(Ft)?"x":"y");let Pr={x:0,y:0};const Tr=Bn=>1/(1.5+Math.abs(Bn)/20);if(X==="y"){if(er.includes("top")||er.includes("bottom"))if(er.includes("top")&&Ft<0||er.includes("bottom")&&Ft>0)Pr.y=Ft;else{const Bn=Ft*Tr(Ft);Pr.y=Math.abs(Bn)<Math.abs(Ft)?Bn:Ft}}else if(X==="x"&&(er.includes("left")||er.includes("right")))if(er.includes("left")&&ln<0||er.includes("right")&&ln>0)Pr.x=ln;else{const Bn=ln*Tr(ln);Pr.x=Math.abs(Bn)<Math.abs(ln)?Bn:ln}(Math.abs(Pr.x)>0||Math.abs(Pr.y)>0)&&He(!0),(Kt=Je.current)==null||Kt.style.setProperty("--swipe-amount-x",`${Pr.x}px`),(mn=Je.current)==null||mn.style.setProperty("--swipe-amount-y",`${Pr.y}px`)}},wn&&!p.jsx&&xe!=="loading"?we.createElement("button",{"aria-label":H,"data-disabled":Os,"data-close-button":!0,onClick:Os||!Ot?()=>{}:()=>{bn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ci(q==null?void 0:q.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(ms=W==null?void 0:W.close)!=null?ms:qH):null,(xe||p.icon||p.promise)&&p.icon!==null&&((W==null?void 0:W[xe])!==null||p.icon)?we.createElement("div",{"data-icon":"",className:ci(q==null?void 0:q.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},xe==="loading"?p.icon||Cr():p.promise?Cr():null,xe!=="loading"?Ni:null):null,we.createElement("div",{"data-content":"",className:ci(q==null?void 0:q.content,p==null||(i=p.classNames)==null?void 0:i.content)},we.createElement("div",{"data-title":"",className:ci(q==null?void 0:q.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?we.createElement("div",{"data-description":"",className:ci(j,Pa,q==null?void 0:q.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),we.isValidElement(p.cancel)?p.cancel:p.cancel&&kp(p.cancel)?we.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:Ze=>{kp(p.cancel)&&Ot&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ze),bn())},className:ci(q==null?void 0:q.cancelButton,p==null||(c=p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,we.isValidElement(p.action)?p.action:p.action&&kp(p.action)?we.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:Ze=>{kp(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ze),!Ze.defaultPrevented&&bn())},className:ci(q==null?void 0:q.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function mC(){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 dz(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",u=i?sz:rz;function c(d){["top","right","bottom","left"].forEach(f=>{n[`${a}-${f}`]=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 fz=we.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:c,className:d,offset:f,mobileOffset:p,theme:m="light",richColors:_,duration:x,style:y,visibleToasts:w=nz,toastOptions:S,dir:C=mC(),gap:P=oz,icons:T,customAriaLabel:I,containerAriaLabel:A="Notifications"}=e,[O,R]=we.useState([]),L=we.useMemo(()=>r?O.filter(J=>J.toasterId===r):O.filter(J=>!J.toasterId),[O,r]),D=we.useMemo(()=>Array.from(new Set([i].concat(L.filter(J=>J.position).map(J=>J.position)))),[L,i]),[j,F]=we.useState([]),[Z,Q]=we.useState(!1),[K,q]=we.useState(!1),[W,H]=we.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=we.useRef(null),z=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=we.useRef(null),Y=we.useRef(!1),oe=we.useCallback(J=>{R(se=>{var pe;return(pe=se.find(Se=>Se.id===J.id))!=null&&pe.delete||Fr.dismiss(J.id),se.filter(({id:Se})=>Se!==J.id)})},[]);return we.useEffect(()=>Fr.subscribe(J=>{if(J.dismiss){requestAnimationFrame(()=>{R(se=>se.map(pe=>pe.id===J.id?{...pe,delete:!0}:pe))});return}setTimeout(()=>{jH.flushSync(()=>{R(se=>{const pe=se.findIndex(Se=>Se.id===J.id);return pe!==-1?[...se.slice(0,pe),{...se[pe],...J},...se.slice(pe+1)]:[J,...se]})})})}),[]),we.useEffect(()=>{if(m!=="system"){H(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const J=window.matchMedia("(prefers-color-scheme: dark)");try{J.addEventListener("change",({matches:se})=>{H(se?"dark":"light")})}catch{J.addListener(({matches:pe})=>{try{H(pe?"dark":"light")}catch(Se){console.error(Se)}})}},[m]),we.useEffect(()=>{O.length<=1&&Q(!1)},[O]),we.useEffect(()=>{const J=se=>{var pe;if(a.length>0&&a.every(ae=>se[ae]||se.code===ae)){var ce;Q(!0),(ce=X.current)==null||ce.focus()}se.code==="Escape"&&(document.activeElement===X.current||(pe=X.current)!=null&&pe.contains(document.activeElement))&&Q(!1)};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[a]),we.useEffect(()=>{if(X.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,Y.current=!1)}},[X.current]),we.createElement("section",{ref:n,"aria-label":I??`${A} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((J,se)=>{var pe;const[Se,ce]=J.split("-");return L.length?we.createElement("ol",{key:J,dir:C==="auto"?mC():C,tabIndex:-1,ref:X,className:d,"data-sonner-toaster":!0,"data-sonner-theme":W,"data-y-position":Se,"data-x-position":ce,style:{"--front-toast-height":`${((pe=j[0])==null?void 0:pe.height)||0}px`,"--width":`${iz}px`,"--gap":`${P}px`,...y,...dz(f,p)},onBlur:ae=>{Y.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(Y.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,N.current=ae.relatedTarget)},onMouseEnter:()=>Q(!0),onMouseMove:()=>Q(!0),onMouseLeave:()=>{K||Q(!1)},onDragEnd:()=>Q(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},L.filter(ae=>!ae.position&&se===0||ae.position===J).map((ae,$e)=>{var We,He;return we.createElement(cz,{key:ae.id,icons:T,index:$e,toast:ae,defaultRichColors:_,duration:(We=S==null?void 0:S.duration)!=null?We:x,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:s,visibleToasts:w,closeButton:(He=S==null?void 0:S.closeButton)!=null?He:c,interacting:K,position:J,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:oe,toasts:L.filter(Fe=>Fe.position==ae.position),heights:j.filter(Fe=>Fe.position==ae.position),setHeights:F,expandByDefault:u,gap:P,expanded:Z,swipeDirections:e.swipeDirections})})):null}))});var hz=Object.defineProperty,Sc=(t,e)=>hz(t,"name",{value:e,configurable:!0}),c5=!!(typeof window<"u"&&window.document&&window.document.createElement);function zt(t,e,{checkForDefaultPrevented:n=!0}={}){return Sc(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}Sc(zt,"composeEventHandlers");function pz(t){var e;if(!c5)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}Sc(pz,"getOwnerWindow");function $_(t){if(!c5)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Sc($_,"getOwnerDocument");function d5(t,e=!1){const{activeElement:n}=$_(t);if(!(n!=null&&n.nodeName))return null;if(f5(n)&&n.contentDocument)return d5(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=$_(n).getElementById(r);if(s)return s}}return n}Sc(d5,"getActiveElement");function f5(t){return t.tagName==="IFRAME"}Sc(f5,"isFrame");var mz=Object.defineProperty,Dx=(t,e)=>mz(t,"name",{value:e,configurable:!0});function H_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Dx(H_,"setRef");function h5(...t){return e=>{let n=!1;const r=t.map(s=>{const i=H_(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():H_(t[s],null)}}}}Dx(h5,"composeRefs");function Bt(...t){return v.useCallback(h5(...t),t)}Dx(Bt,"useComposedRefs");var vz=Object.defineProperty,Ps=(t,e)=>vz(t,"name",{value:e,configurable:!0});function gz(t,e){const n=v.createContext(e);n.displayName=t+"Context";const r=Ps(i=>{const{children:a,...u}=i,c=v.useMemo(()=>u,Object.values(u));return E.jsx(n.Provider,{value:c,children:a})},"Provider");r.displayName=t+"Provider";function s(i,a={}){const{optional:u=!1}=a,c=v.useContext(n);if(c)return c;if(e!==void 0)return e;if(!u)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Ps(s,"useContext"),[r,s]}Ps(gz,"createContext");function Oi(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=Ps(p=>{var S;const{scope:m,children:_,...x}=p,y=((S=m==null?void 0:m[t])==null?void 0:S[c])||u,w=v.useMemo(()=>x,Object.values(x));return E.jsx(y.Provider,{value:w,children:_})},"Provider");d.displayName=i+"Provider";function f(p,m,_={}){var S;const{optional:x=!1}=_,y=((S=m==null?void 0:m[t])==null?void 0:S[c])||u,w=v.useContext(y);if(w)return w;if(a!==void 0)return a;if(!x)throw new Error(`\`${p}\` must be used within \`${i}\``)}return Ps(f,"useContext"),[d,f]}Ps(r,"createContext");const s=Ps(()=>{const i=n.map(a=>v.createContext(a));return Ps(function(u){const c=(u==null?void 0:u[t])||i;return v.useMemo(()=>({[`__scope${t}`]:{...u,[t]:c}}),[u,c])},"useScope")},"createScope");return s.scopeName=t,[r,p5(s,...e)]}Ps(Oi,"createContextScope");function p5(...t){const e=t[0];if(t.length===1)return e;const n=Ps(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Ps(function(i){const a=r.reduce((u,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...u,...p}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Ps(p5,"composeContextScopes");var zr=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},yz=Object.defineProperty,_z=(t,e)=>yz(t,"name",{value:e,configurable:!0}),xz=Df[" useId ".trim().toString()]||(()=>{}),wz=0;function oa(t){const[e,n]=v.useState(xz());return zr(()=>{t||n(r=>r??String(wz++))},[t]),t||(e?`radix-${e}`:"")}_z(oa,"useId");var bz=Object.defineProperty,Sz=(t,e)=>bz(t,"name",{value:e,configurable:!0}),vC=Df[" useEffectEvent ".trim().toString()],gC=Df[" useInsertionEffect ".trim().toString()];function m5(t){if(typeof vC=="function")return vC(t);const e=v.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof gC=="function"?gC(()=>{e.current=t}):zr(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}Sz(m5,"useEffectEvent");var Ez=Object.defineProperty,Uf=(t,e)=>Ez(t,"name",{value:e,configurable:!0}),kz=Df[" useInsertionEffect ".trim().toString()]||zr;function wa({prop:t,defaultProp:e,onChange:n=Uf(()=>{},"onChange"),caller:r}){const[s,i,a]=v5({defaultProp:e,onChange:n}),u=t!==void 0,c=u?t:s,d=v.useCallback(f=>{var p;if(u){const m=g5(f)?f(t):f;m!==t&&((p=a.current)==null||p.call(a,m))}else i(f)},[u,t,i,a]);return[c,d]}Uf(wa,"useControllableState");function v5({defaultProp:t,onChange:e}){const[n,r]=v.useState(t),s=v.useRef(n),i=v.useRef(e);return kz(()=>{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]}Uf(v5,"useUncontrolledState");function g5(t){return typeof t=="function"}Uf(g5,"isFunction");var yC=Symbol("RADIX:SYNC_STATE");function Cz(t,e,n,r){const{prop:s,defaultProp:i,onChange:a,caller:u}=e,c=s!==void 0,d=m5(a),f=[{...n,state:i}];r&&f.push(r);const[p,m]=v.useReducer((w,S)=>{if(S.type===yC)return{...w,state:S.state};const C=t(w,S);return c&&!Object.is(C.state,w.state)&&d(C.state),C},...f),_=p.state,x=v.useRef(_);v.useEffect(()=>{x.current!==_&&(x.current=_,c||d(_))},[_,x,c]);const y=v.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return v.useEffect(()=>{c&&!Object.is(s,p.state)&&m({type:yC,state:s})},[s,p.state,c]),[y,m]}Uf(Cz,"useControllableStateReducer");var Pz=Object.defineProperty,Js=(t,e)=>Pz(t,"name",{value:e,configurable:!0});function pa(t){const e=v.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,u=!1;const c=[];z_(s)&&typeof Cp=="function"&&(s=Cp(s._payload)),v.Children.forEach(s,m=>{var _;if(b5(m)){u=!0;const x=m;let y="child"in x.props?x.props.child:x.props.children;z_(y)&&typeof Cp=="function"&&(y=Cp(y._payload)),a=Tz(x,y),c.push((_=a==null?void 0:a.props)==null?void 0:_.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?w5(a):void 0,f=Bt(r,d);if(!a){if(s||s===0)throw new Error(u?Az(t):Rz(t));return s}const p=x5(i,a.props??{});return a.type!==v.Fragment&&(p.ref=r?f:d),v.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}Js(pa,"createSlot");var y5=Symbol.for("radix.slottable");function _5(t){const e=Js(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=y5,e}Js(_5,"createSlottable");var Tz=Js((t,e)=>{if("child"in t.props){const n=t.props.child;return v.isValidElement(n)?v.cloneElement(n,void 0,t.props.children(n.props.children)):null}return v.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function x5(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}}Js(x5,"mergeProps");function w5(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)}Js(w5,"getElementRef");function b5(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===y5}Js(b5,"isSlottable");var Iz=Symbol.for("react.lazy");function z_(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Iz&&"_payload"in t&&S5(t._payload)}Js(z_,"isLazyComponent");function S5(t){return typeof t=="object"&&t!==null&&"then"in t}Js(S5,"isPromiseLike");var Rz=Js(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Az=Js(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Cp=Df[" use ".trim().toString()],Mz=Object.defineProperty,Lz=(t,e)=>Mz(t,"name",{value:e,configurable:!0}),Oz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xn=Oz.reduce((t,e)=>{const n=pa(`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),E.jsx(c,{...u,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function E5(t,e){t&&A0.flushSync(()=>t.dispatchEvent(e))}Lz(E5,"dispatchDiscreteCustomEvent");var Dz=Object.defineProperty,Nz=(t,e)=>Dz(t,"name",{value:e,configurable:!0});function Ml(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)}),[])}Nz(Ml,"useCallbackRef");var jz=Object.defineProperty,Vn=(t,e)=>jz(t,"name",{value:e,configurable:!0}),U_="dismissableLayer.update",Fz="dismissableLayer.pointerDownOutside",Vz="dismissableLayer.focusOutside",_C,k5=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Nx=v.forwardRef(Vn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:u,onInteractOutside:c,onDismiss:d,...f}=e,p=v.useContext(k5),[m,_]=v.useState(null),x=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=v.useState({}),w=Bt(n,_),S=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),P=C?S.indexOf(C):-1,T=m?S.indexOf(m):-1,I=p.layersWithOutsidePointerEventsDisabled.size>0,A=T>=P,O=v.useRef(!1),R=P5(F=>{a==null||a(F),c==null||c(F),F.defaultPrevented||d==null||d()},{ownerDocument:x,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(F=>{if(!(F instanceof Node))return!1;const Z=[...p.branches].some(Q=>Q.contains(F));return A&&!Z},[p.branches,A])}),L=T5(F=>{if(s&&O.current)return;const Z=F.target;[...p.branches].some(K=>K.contains(Z))||(u==null||u(F),c==null||c(F),F.defaultPrevented||d==null||d())},x),D=m?T===S.length-1:!1,j=Ml(F=>{F.key==="Escape"&&(i==null||i(F),!F.defaultPrevented&&d&&(F.preventDefault(),d()))});return v.useEffect(()=>{if(D)return x.addEventListener("keydown",j,{capture:!0}),()=>x.removeEventListener("keydown",j,{capture:!0})},[x,D,j]),v.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(_C=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),B_(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=_C))}},[m,x,r,p]),v.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),B_())},[m,p]),v.useEffect(()=>{const F=Vn(()=>y({}),"handleUpdate");return document.addEventListener(U_,F),()=>document.removeEventListener(U_,F)},[]),E.jsx(xn.div,{...f,ref:w,style:{pointerEvents:I?A?"auto":"none":void 0,...e.style},onFocusCapture:zt(e.onFocusCapture,L.onFocusCapture),onBlurCapture:zt(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:zt(e.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function C5(){const t=v.useContext(k5),[e,n]=v.useState(null);return v.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Vn(C5,"useDismissableLayerSurface");var $z=Vn(()=>!0,"IS_TRUE");function P5(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=$z}=e,u=Ml(t),c=v.useRef(!1),d=v.useRef(!1),f=v.useRef(new Map),p=v.useRef(()=>{});return v.useEffect(()=>{function m(){d.current=!1,s.current=!1,f.current.clear()}Vn(m,"resetOutsideInteraction");function _(){return Array.from(f.current.values()).some(Boolean)}Vn(_,"isOutsideInteractionIntercepted");function x(P){if(!d.current)return;const T=P.target;T instanceof Node&&[...i].some(A=>A.contains(T))||f.current.set(P.type,!0),P.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}Vn(x,"handleInteractionCapture");function y(P){d.current&&f.current.set(P.type,!1)}Vn(y,"handleInteractionBubble");const w=Vn(P=>{if(P.target&&!c.current){let T=function(){n.removeEventListener("click",p.current);const A=_();m(),A||jx(Fz,u,I,{discrete:!0})};if(Vn(T,"handleAndDispatchPointerDownOutsideEvent"),!a(P.target)){n.removeEventListener("click",p.current),m(),c.current=!1;return}const I={originalEvent:P};d.current=!0,s.current=r&&P.button===0,f.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"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const P of S)n.addEventListener(P,x,!0),n.addEventListener(P,y);const C=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(C),n.removeEventListener("pointerdown",w),n.removeEventListener("click",p.current);for(const P of S)n.removeEventListener(P,x,!0),n.removeEventListener(P,y)}},[n,u,r,s,i,a]),{onPointerDownCapture:Vn(()=>c.current=!0,"onPointerDownCapture")}}Vn(P5,"usePointerDownOutside");function T5(t,e=globalThis==null?void 0:globalThis.document){const n=Ml(t),r=v.useRef(!1);return v.useEffect(()=>{const s=Vn(i=>{i.target&&!r.current&&jx(Vz,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:Vn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Vn(()=>r.current=!1,"onBlurCapture")}}Vn(T5,"useFocusOutside");function B_(){const t=new CustomEvent(U_);document.dispatchEvent(t)}Vn(B_,"dispatchUpdate");function jx(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?E5(s,i):s.dispatchEvent(i)}Vn(jx,"handleAndDispatchCustomEvent");var Hz=Object.defineProperty,kr=(t,e)=>Hz(t,"name",{value:e,configurable:!0}),M1="focusScope.autoFocusOnMount",L1="focusScope.autoFocusOnUnmount",xC={bubbles:!1,cancelable:!0},I5=v.forwardRef(kr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...u}=e,[c,d]=v.useState(null),f=Ml(i),p=Ml(a),m=v.useRef(null),_=Bt(n,d),x=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(s){let w=function(T){if(x.paused||!c)return;const I=T.target;c.contains(I)?m.current=I:to(m.current,{select:!0})},S=function(T){if(x.paused||!c)return;const I=T.relatedTarget;I!==null&&(c.contains(I)||to(m.current,{select:!0}))},C=function(T){if(document.activeElement===document.body)for(const A of T)A.removedNodes.length>0&&to(c)};kr(w,"handleFocusIn"),kr(S,"handleFocusOut"),kr(C,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",S);const P=new MutationObserver(C);return c&&P.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),P.disconnect()}}},[s,c,x.paused]),v.useEffect(()=>{if(c){wC.add(x);const w=document.activeElement;if(!c.contains(w)){const C=new CustomEvent(M1,xC);c.addEventListener(M1,f),c.dispatchEvent(C),C.defaultPrevented||(R5(D5(Fx(c)),{select:!0}),document.activeElement===w&&to(c))}return()=>{c.removeEventListener(M1,f),setTimeout(()=>{const C=new CustomEvent(L1,xC);c.addEventListener(L1,p),c.dispatchEvent(C),C.defaultPrevented||to(w??document.body,{select:!0}),c.removeEventListener(L1,p),wC.remove(x)},0)}}},[c,f,p,x]);const y=v.useCallback(w=>{if(!r&&!s||x.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,C=document.activeElement;if(S&&C){const P=w.currentTarget,[T,I]=A5(P);T&&I?!w.shiftKey&&C===I?(w.preventDefault(),r&&to(T,{select:!0})):w.shiftKey&&C===T&&(w.preventDefault(),r&&to(I,{select:!0})):C===P&&w.preventDefault()}},[r,s,x.paused]);return E.jsx(xn.div,{tabIndex:-1,...u,ref:_,onKeyDown:y})},"FocusScope"));function R5(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(to(r,{select:e}),document.activeElement!==n)return}kr(R5,"focusFirst");function A5(t){const e=Fx(t),n=W_(e,t),r=W_(e.reverse(),t);return[n,r]}kr(A5,"getTabbableEdges");function Fx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:kr(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}kr(Fx,"getTabbableCandidates");function W_(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):M5(r,{upTo:e})))return r}kr(W_,"findVisible");function M5(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}kr(M5,"isHidden");function L5(t){return t instanceof HTMLInputElement&&"select"in t}kr(L5,"isSelectableInput");function to(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&L5(t)&&e&&t.select()}}kr(to,"focus");var wC=O5();function O5(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=q_(t,e),t.unshift(e)},remove(e){var n;t=q_(t,e),(n=t[0])==null||n.resume()}}}kr(O5,"createFocusScopesStack");function q_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}kr(q_,"arrayRemove");function D5(t){return t.filter(e=>e.tagName!=="A")}kr(D5,"removeLinks");var zz=Object.defineProperty,Uz=(t,e)=>zz(t,"name",{value:e,configurable:!0}),Vx=v.forwardRef(Uz(function(e,n){var c;const{container:r,...s}=e,[i,a]=v.useState(!1);zr(()=>a(!0),[]);const u=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?A0.createPortal(E.jsx(xn.div,{...s,ref:n}),u):null},"Portal")),Bz=Object.defineProperty,go=(t,e)=>Bz(t,"name",{value:e,configurable:!0});function N5(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}go(N5,"useStateMachine");var ba=go(t=>{const{present:e,children:n}=t,r=j5(e),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=F5(r.ref,V5(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:i}):null},"Presence");function j5(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]=N5(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??Eu(r.current),a.current=void 0):i.current="none"},[c]),zr(()=>{const f=r.current,p=s.current;if(p!==t){const _=i.current,x=Eu(f);t?(a.current=x,d("MOUNT")):x==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&_!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),zr(()=>{if(e){let f;const p=e.ownerDocument.defaultView??window,m=go(x=>{const w=Eu(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&w&&(d("ANIMATION_END"),!s.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",f=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},"handleAnimationEnd"),_=go(x=>{x.target===e&&(i.current=Eu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",_),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(f),e.removeEventListener("animationstart",_),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(f=>{if(f){const p=getComputedStyle(f);r.current=p,a.current=Eu(p)}else r.current=null;n(f)},[])}}go(j5,"usePresence");function Z_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}go(Z_,"setRef");function F5(...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=Z_(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():Z_(r[a],null)}}},[])}go(F5,"useStableComposedRefs");function Eu(t){return(t==null?void 0:t.animationName)||"none"}go(Eu,"getAnimationName");function V5(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)}go(V5,"getElementRef");var Wz=Object.defineProperty,$x=(t,e)=>Wz(t,"name",{value:e,configurable:!0}),Pp=0,di=null;function qz(t){return M0(),t.children}$x(qz,"FocusGuards");function M0(){v.useEffect(()=>{di||(di={start:G_(),end:G_()});const{start:t,end:e}=di;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Pp++,()=>{Pp===1&&(di==null||di.start.remove(),di==null||di.end.remove(),di=null),Pp=Math.max(0,Pp-1)}},[])}$x(M0,"useFocusGuards");function G_(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}$x(G_,"createFocusGuard");var Ei=function(){return Ei=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},Ei.apply(this,arguments)};function $5(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 Zz(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 sm="right-scroll-bar-position",im="width-before-scroll-bar",Gz="with-scroll-bars-hidden",Kz="--removed-body-scroll-bar-size";function O1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Yz(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 Xz=typeof window<"u"?v.useLayoutEffect:v.useEffect,bC=new WeakMap;function Qz(t,e){var n=Yz(null,function(r){return t.forEach(function(s){return O1(s,r)})});return Xz(function(){var r=bC.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(u){i.has(u)||O1(u,null)}),i.forEach(function(u){s.has(u)||O1(u,a)})}bC.set(n,t)},[t]),n}function Jz(t){return t}function eU(t,e){e===void 0&&(e=Jz);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 f=a;a=[],f.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){a.push(f),d()},filter:function(f){return a=a.filter(f),n}}}};return s}function tU(t){t===void 0&&(t={});var e=eU(null);return e.options=Ei({async:!0,ssr:!1},t),e}var H5=function(t){var e=t.sideCar,n=$5(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,Ei({},n))};H5.isSideCarExport=!0;function nU(t,e){return t.useMedium(e),H5}var z5=tU(),D1=function(){},L0=v.forwardRef(function(t,e){var n=v.useRef(null),r=v.useState({onScrollCapture:D1,onWheelCapture:D1,onTouchMoveCapture:D1}),s=r[0],i=r[1],a=t.forwardProps,u=t.children,c=t.className,d=t.removeScrollBar,f=t.enabled,p=t.shards,m=t.sideCar,_=t.noRelative,x=t.noIsolation,y=t.inert,w=t.allowPinchZoom,S=t.as,C=S===void 0?"div":S,P=t.gapMode,T=$5(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=m,A=Qz([n,e]),O=Ei(Ei({},T),s);return v.createElement(v.Fragment,null,f&&v.createElement(I,{sideCar:z5,removeScrollBar:d,shards:p,noRelative:_,noIsolation:x,inert:y,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:P}),a?v.cloneElement(v.Children.only(u),Ei(Ei({},O),{ref:A})):v.createElement(C,Ei({},O,{className:c,ref:A}),u))});L0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};L0.classNames={fullWidth:im,zeroRight:sm};var rU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sU(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=rU();return e&&t.setAttribute("nonce",e),t}function iU(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function oU(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var aU=function(){var t=0,e=null;return{add:function(n){t==0&&(e=sU())&&(iU(e,n),oU(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},lU=function(){var t=aU();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},U5=function(){var t=lU(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},uU={left:0,top:0,right:0,gap:0},N1=function(t){return parseInt(t||"",10)||0},cU=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[N1(n),N1(r),N1(s)]},dU=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return uU;var e=cU(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])}},fU=U5(),Fu="data-scroll-locked",hU=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,u=t.gap;return n===void 0&&(n="margin"),`
72
+ .`.concat(Gz,` {
73
+ overflow: hidden `).concat(r,`;
74
+ padding-right: `).concat(u,"px ").concat(r,`;
75
+ }
76
+ body[`).concat(Fu,`] {
77
+ overflow: hidden `).concat(r,`;
78
+ overscroll-behavior: contain;
79
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
80
+ padding-left: `.concat(s,`px;
81
+ padding-top: `).concat(i,`px;
82
+ padding-right: `).concat(a,`px;
83
+ margin-left:0;
84
+ margin-top:0;
85
+ margin-right: `).concat(u,"px ").concat(r,`;
86
+ `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
87
+ }
88
+
89
+ .`).concat(sm,` {
90
+ right: `).concat(u,"px ").concat(r,`;
91
+ }
92
+
93
+ .`).concat(im,` {
94
+ margin-right: `).concat(u,"px ").concat(r,`;
95
+ }
96
+
97
+ .`).concat(sm," .").concat(sm,` {
98
+ right: 0 `).concat(r,`;
99
+ }
100
+
101
+ .`).concat(im," .").concat(im,` {
102
+ margin-right: 0 `).concat(r,`;
103
+ }
104
+
105
+ body[`).concat(Fu,`] {
106
+ `).concat(Kz,": ").concat(u,`px;
107
+ }
108
+ `)},SC=function(){var t=parseInt(document.body.getAttribute(Fu)||"0",10);return isFinite(t)?t:0},pU=function(){v.useEffect(function(){return document.body.setAttribute(Fu,(SC()+1).toString()),function(){var t=SC()-1;t<=0?document.body.removeAttribute(Fu):document.body.setAttribute(Fu,t.toString())}},[])},mU=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;pU();var i=v.useMemo(function(){return dU(s)},[s]);return v.createElement(fU,{styles:hU(i,!e,s,n?"":"!important")})},K_=!1;if(typeof window<"u")try{var Tp=Object.defineProperty({},"passive",{get:function(){return K_=!0,!0}});window.addEventListener("test",Tp,Tp),window.removeEventListener("test",Tp,Tp)}catch{K_=!1}var mu=K_?{passive:!1}:!1,vU=function(t){return t.tagName==="TEXTAREA"},B5=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!vU(t)&&n[e]==="visible")},gU=function(t){return B5(t,"overflowY")},yU=function(t){return B5(t,"overflowX")},EC=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=W5(t,r);if(s){var i=q5(t,r),a=i[1],u=i[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},_U=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},xU=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},W5=function(t,e){return t==="v"?gU(e):yU(e)},q5=function(t,e){return t==="v"?_U(e):xU(e)},wU=function(t,e){return t==="h"&&e==="rtl"?-1:1},bU=function(t,e,n,r,s){var i=wU(t,window.getComputedStyle(e).direction),a=i*r,u=n.target,c=e.contains(u),d=!1,f=a>0,p=0,m=0;do{if(!u)break;var _=q5(t,u),x=_[0],y=_[1],w=_[2],S=y-w-i*x;(x||S)&&W5(t,u)&&(p+=S,m+=x);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!c&&u!==document.body||c&&(e.contains(u)||e===u));return(f&&Math.abs(p)<1||!f&&Math.abs(m)<1)&&(d=!0),d},Ip=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},kC=function(t){return[t.deltaX,t.deltaY]},CC=function(t){return t&&"current"in t?t.current:t},SU=function(t,e){return t[0]===e[0]&&t[1]===e[1]},EU=function(t){return`
109
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
110
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
111
+ `)},kU=0,vu=[];function CU(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(kU++)[0],i=v.useState(U5)[0],a=v.useRef(t);v.useEffect(function(){a.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var y=Zz([t.lockRef.current],(t.shards||[]).map(CC),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var u=v.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var S=Ip(y),C=n.current,P="deltaX"in y?y.deltaX:C[0]-S[0],T="deltaY"in y?y.deltaY:C[1]-S[1],I,A=y.target,O=Math.abs(P)>Math.abs(T)?"h":"v";if("touches"in y&&O==="h"&&A.type==="range")return!1;var R=window.getSelection(),L=R&&R.anchorNode,D=L?L===A||L.contains(A):!1;if(D)return!1;var j=EC(O,A);if(!j)return!0;if(j?I=O:(I=O==="v"?"h":"v",j=EC(O,A)),!j)return!1;if(!r.current&&"changedTouches"in y&&(P||T)&&(r.current=I),!I)return!0;var F=r.current||I;return bU(F,w,y,F==="h"?P:T)},[]),c=v.useCallback(function(y){var w=y;if(!(!vu.length||vu[vu.length-1]!==i)){var S="deltaY"in w?kC(w):Ip(w),C=e.current.filter(function(I){return I.name===w.type&&(I.target===w.target||w.target===I.shadowParent)&&SU(I.delta,S)})[0];if(C&&C.should){w.cancelable&&w.preventDefault();return}if(!C){var P=(a.current.shards||[]).map(CC).filter(Boolean).filter(function(I){return I.contains(w.target)}),T=P.length>0?u(w,P[0]):!a.current.noIsolation;T&&w.cancelable&&w.preventDefault()}}},[]),d=v.useCallback(function(y,w,S,C){var P={name:y,delta:w,target:S,should:C,shadowParent:PU(S)};e.current.push(P),setTimeout(function(){e.current=e.current.filter(function(T){return T!==P})},1)},[]),f=v.useCallback(function(y){n.current=Ip(y),r.current=void 0},[]),p=v.useCallback(function(y){d(y.type,kC(y),y.target,u(y,t.lockRef.current))},[]),m=v.useCallback(function(y){d(y.type,Ip(y),y.target,u(y,t.lockRef.current))},[]);v.useEffect(function(){return vu.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,mu),document.addEventListener("touchmove",c,mu),document.addEventListener("touchstart",f,mu),function(){vu=vu.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,mu),document.removeEventListener("touchmove",c,mu),document.removeEventListener("touchstart",f,mu)}},[]);var _=t.removeScrollBar,x=t.inert;return v.createElement(v.Fragment,null,x?v.createElement(i,{styles:EU(s)}):null,_?v.createElement(mU,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function PU(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const TU=nU(z5,CU);var Hx=v.forwardRef(function(t,e){return v.createElement(L0,Ei({},t,{ref:e,sideCar:TU}))});Hx.classNames=L0.classNames;var IU=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},gu=new WeakMap,Rp=new WeakMap,Ap={},j1=0,Z5=function(t){return t&&(t.host||Z5(t.parentNode))},RU=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Z5(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})},AU=function(t,e,n,r){var s=RU(e,Array.isArray(t)?t:[t]);Ap[n]||(Ap[n]=new WeakMap);var i=Ap[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 f=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))f(m);else try{var _=m.getAttribute(r),x=_!==null&&_!=="false",y=(gu.get(m)||0)+1,w=(i.get(m)||0)+1;gu.set(m,y),i.set(m,w),a.push(m),y===1&&x&&Rp.set(m,!0),w===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return f(e),u.clear(),j1++,function(){a.forEach(function(p){var m=gu.get(p)-1,_=i.get(p)-1;gu.set(p,m),i.set(p,_),m||(Rp.has(p)||p.removeAttribute(r),Rp.delete(p)),_||p.removeAttribute(n)}),j1--,j1||(gu=new WeakMap,gu=new WeakMap,Rp=new WeakMap,Ap={})}},G5=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=IU(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),AU(r,s,n,"aria-hidden")):function(){return null}},MU=Object.defineProperty,ei=(t,e)=>MU(t,"name",{value:e,configurable:!0}),zx="Dialog",[K5,ste]=Oi(zx),[LU,bo]=K5(zx),Ux=ei(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,f]=wa({prop:r,defaultProp:s??!1,onChange:i,caller:zx}),[p,m]=v.useState(0),[_,x]=v.useState(0);return E.jsx(LU,{scope:e,triggerRef:u,contentRef:c,contentId:oa(),titleId:oa(),descriptionId:oa(),titlePresent:p>0,descriptionPresent:_>0,setTitleCount:m,setDescriptionCount:x,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(y=>!y),[f]),modal:a,children:n})},"Dialog"),Y5="DialogPortal",[OU,X5]=K5(Y5,{forceMount:void 0}),Bx=ei(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=bo(Y5,e);return E.jsx(OU,{scope:e,forceMount:n,children:v.Children.map(r,a=>E.jsx(ba,{present:n||i.open,children:E.jsx(Vx,{asChild:!0,container:s,children:a})}))})},"DialogPortal"),Y_="DialogOverlay",Wx=v.forwardRef(ei(function(e,n){const r=X5(Y_,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=bo(Y_,e.__scopeDialog);return a.modal?E.jsx(ba,{present:s||a.open,children:E.jsx(NU,{...i,ref:n})}):null},"DialogOverlay")),DU=pa("DialogOverlay.RemoveScroll"),NU=v.forwardRef(ei(function(e,n){const{__scopeDialog:r,...s}=e,i=bo(Y_,r),a=C5(),u=Bt(n,a);return E.jsx(Hx,{as:DU,allowPinchZoom:!0,shards:[i.contentRef],children:E.jsx(xn.div,{"data-state":Kx(i.open),...s,ref:u,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),cf="DialogContent",qx=v.forwardRef(ei(function(e,n){const r=X5(cf,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=bo(cf,e.__scopeDialog);return E.jsx(ba,{present:s||a.open,children:a.modal?E.jsx(jU,{...i,ref:n}):E.jsx(FU,{...i,ref:n})})},"DialogContent")),jU=v.forwardRef(ei(function(e,n){const r=bo(cf,e.__scopeDialog),s=v.useRef(null),i=Bt(n,r.contentRef,s);return v.useEffect(()=>{const a=s.current;if(a)return G5(a)},[]),E.jsx(Q5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:zt(e.onCloseAutoFocus,a=>{var u;a.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:zt(e.onPointerDownOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0;(u.button===2||c)&&a.preventDefault()}),onFocusOutside:zt(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),FU=v.forwardRef(ei(function(e,n){const r=bo(cf,e.__scopeDialog),s=v.useRef(!1),i=v.useRef(!1);return E.jsx(Q5,{...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,f;(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;((f=r.triggerRef.current)==null?void 0:f.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"DialogContentNonModal")),Q5=v.forwardRef(ei(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,...u}=e,c=bo(cf,r);return M0(),E.jsx(E.Fragment,{children:E.jsx(I5,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(Nx,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Kx(c.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),VU="DialogTitle",Zx=v.forwardRef(ei(function(e,n){const{__scopeDialog:r,...s}=e,i=bo(VU,r),{setTitleCount:a}=i;return zr(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),E.jsx(xn.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),$U="DialogDescription",Gx=v.forwardRef(ei(function(e,n){const{__scopeDialog:r,...s}=e,i=bo($U,r),{setDescriptionCount:a}=i;return zr(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),E.jsx(xn.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function Kx(t){return t?"open":"closed"}ei(Kx,"getState");const HU=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"}))]]),zU=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"}))]]),UU=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"}))]]),BU=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"}))]]),WU=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"}))]]),qU=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"}))]]),ZU=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"}))]]),GU=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"}))]]),KU=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M248.23,112.31A20,20,0,0,0,232,104H220V88a20,20,0,0,0-20-20H132L105.34,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V208a12,12,0,0,0,12,12H211.1a12,12,0,0,0,11.33-8l28.49-81.47.06-.17A20,20,0,0,0,248.23,112.31ZM92,68l28.8,21.6A12,12,0,0,0,128,92h68v12H69.77a20,20,0,0,0-18.94,13.58L44,137.15V68ZM202.59,196H48.89l23.72-68H226.37Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208,88v24H69.77a8,8,0,0,0-7.59,5.47L32,208V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h72A8,8,0,0,1,208,88Z",opacity:"0.2"}),v.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M243.36,111.81A14,14,0,0,0,232,106H214V88a14,14,0,0,0-14-14H130L101.74,52.8a14.06,14.06,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V208a6,6,0,0,0,6,6H211.1a6,6,0,0,0,5.69-4.1l28.49-85.47A14,14,0,0,0,243.36,111.81ZM40,62H93.34a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h72a2,2,0,0,1,2,2v18H69.77a14,14,0,0,0-13.28,9.57L38,171V64A2,2,0,0,1,40,62Zm193.9,58.63L206.78,202H40.33l27.54-82.63a2,2,0,0,1,1.9-1.37H232a2,2,0,0,1,1.9,2.63Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M241.72,113a11.88,11.88,0,0,0-9.73-5H212V88a12,12,0,0,0-12-12H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V208a4,4,0,0,0,4,4H211.09a4,4,0,0,0,3.79-2.74l28.49-85.47A11.86,11.86,0,0,0,241.72,113ZM40,60H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h72a4,4,0,0,1,4,4v20H69.76a12,12,0,0,0-11.38,8.21L36,183.35V64A4,4,0,0,1,40,60Zm195.78,61.26L208.2,204H37.55L66,118.74A4,4,0,0,1,69.76,116H232a4,4,0,0,1,3.79,5.26Z"}))]]),YU=new Map([["bold",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),v.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",v.createElement(v.Fragment,null,v.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),XU=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"}))]]),QU=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"}))]]),JU=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"}))]]),eB=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"}))]]),tB=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"}))]]),nB=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"}))]]),rB=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"}))]]),sB=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"}))]]),iB=v.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Ln=v.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:u,weights:c,...d}=t,{color:f="currentColor",size:p,weight:m="regular",mirrored:_=!1,...x}=v.useContext(iB);return v.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??f,viewBox:"0 0 256 256",transform:a||_?"scale(-1, 1)":void 0,...x,...d},!!n&&v.createElement("title",null,n),u,c.get(i??m))});Ln.displayName="IconBase";const J5=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:HU}));J5.displayName="ArrowLeftIcon";const oB=J5,eI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:zU}));eI.displayName="ArrowSquareOutIcon";const aB=eI,tI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:UU}));tI.displayName="ArrowUpIcon";const lB=tI,nI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:BU}));nI.displayName="CaretDownIcon";const uB=nI,rI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:WU}));rI.displayName="ChatCircleIcon";const cB=rI,sI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:qU}));sI.displayName="CheckIcon";const iI=sI,oI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:ZU}));oI.displayName="CircleNotchIcon";const O0=oI,aI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:GU}));aI.displayName="CopyIcon";const df=aI,lI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:KU}));lI.displayName="FolderOpenIcon";const dB=lI,uI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:YU}));uI.displayName="FolderSimpleIcon";const fB=uI,cI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:XU}));cI.displayName="MagnifyingGlassIcon";const hB=cI,dI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:QU}));dI.displayName="PencilSimpleIcon";const fI=dI,hI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:JU}));hI.displayName="SidebarSimpleIcon";const pB=hI,pI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:eB}));pI.displayName="SignOutIcon";const mB=pI,mI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:tB}));mI.displayName="SparkleIcon";const F1=mI,vI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:nB}));vI.displayName="SwatchesIcon";const gI=vI,yI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:rB}));yI.displayName="TrashIcon";const _I=yI,xI=v.forwardRef((t,e)=>v.createElement(Ln,{ref:e,...t,weights:sB}));xI.displayName="XIcon";const wI=xI;function bI(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=bI(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function vB(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=bI(t))&&(r&&(r+=" "),r+=e);return r}const gB=(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},yB=(t,e)=>({classGroupId:t,validator:e}),SI=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),r0="-",PC=[],_B="arbitrary..",xB=t=>{const e=bB(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return wB(a);const u=a.split(r0),c=u[0]===""&&u.length>1?1:0;return EI(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],d=n[a];return c?d?gB(d,c):c:d||PC}return n[a]||PC}}},EI=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=EI(t,e+1,i);if(d)return d}const a=n.validators;if(a===null)return;const u=e===0?t.join(r0):t.slice(e).join(r0),c=a.length;for(let d=0;d<c;d++){const f=a[d];if(f.validator(u))return f.classGroupId}},wB=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?_B+r:void 0})(),bB=t=>{const{theme:e,classGroups:n}=t;return SB(n,e)},SB=(t,e)=>{const n=SI();for(const r in t){const s=t[r];Yx(s,n,r,e)}return n},Yx=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];EB(a,e,n,r)}},EB=(t,e,n,r)=>{if(typeof t=="string"){kB(t,e,n);return}if(typeof t=="function"){CB(t,e,n,r);return}PB(t,e,n,r)},kB=(t,e,n)=>{const r=t===""?e:kI(e,t);r.classGroupId=n},CB=(t,e,n,r)=>{if(TB(t)){Yx(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(yB(n,t))},PB=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[u,c]=s[a];Yx(c,kI(e,u),n,r)}},kI=(t,e)=>{let n=t;const r=e.split(r0),s=r.length;for(let i=0;i<s;i++){const a=r[i];let u=n.nextPart.get(a);u||(u=SI(),n.nextPart.set(a,u)),n=u}return n},TB=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,IB=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)}}},X_="!",TC=":",RB=[],IC=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),AB=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,u=0,c=0,d;const f=s.length;for(let y=0;y<f;y++){const w=s[y];if(a===0&&u===0){if(w===TC){i.push(s.slice(c,y)),c=y+1;continue}if(w==="/"){d=y;continue}}w==="["?a++:w==="]"?a--:w==="("?u++:w===")"&&u--}const p=i.length===0?s:s.slice(c);let m=p,_=!1;p.endsWith(X_)?(m=p.slice(0,-1),_=!0):p.startsWith(X_)&&(m=p.slice(1),_=!0);const x=d&&d>c?d-c:void 0;return IC(i,_,m,x)};if(e){const s=e+TC,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):IC(RB,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},MB=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}},LB=t=>({cache:IB(t.cacheSize),parseClassName:AB(t),sortModifiers:MB(t),postfixLookupClassGroupIds:OB(t),...xB(t)}),OB=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},DB=/\s+/,NB=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,u=[],c=t.trim().split(DB);let d="";for(let f=c.length-1;f>=0;f-=1){const p=c[f],{isExternal:m,modifiers:_,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:w}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let S=!!w,C;if(S){const O=y.substring(0,w);C=r(O);const R=C&&a[C]?r(y):void 0;R&&R!==C&&(C=R,S=!1)}else C=r(y);if(!C){if(!S){d=p+(d.length>0?" "+d:d);continue}if(C=r(y),!C){d=p+(d.length>0?" "+d:d);continue}S=!1}const P=_.length===0?"":_.length===1?_[0]:i(_).join(":"),T=x?P+X_:P,I=T+C;if(u.indexOf(I)>-1)continue;u.push(I);const A=s(C,S);for(let O=0;O<A.length;++O){const R=A[O];u.push(T+R)}d=p+(d.length>0?" "+d:d)}return d},jB=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=CI(n))&&(s&&(s+=" "),s+=r);return s},CI=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=CI(t[r]))&&(n&&(n+=" "),n+=e);return n},FB=(t,...e)=>{let n,r,s,i;const a=c=>{const d=e.reduce((f,p)=>p(f),t());return n=LB(d),r=n.cache.get,s=n.cache.set,i=u,u(c)},u=c=>{const d=r(c);if(d)return d;const f=NB(c,n);return s(c,f),f};return i=a,(...c)=>i(jB(...c))},VB=[],Rn=t=>{const e=n=>n[t]||VB;return e.isThemeGetter=!0,e},PI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,TI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$B=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,HB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zB=/\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$/,UB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,BB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,WB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qo=t=>$B.test(t),it=t=>!!t&&!Number.isNaN(Number(t)),fi=t=>!!t&&Number.isInteger(Number(t)),V1=t=>t.endsWith("%")&&it(t.slice(0,-1)),Gi=t=>HB.test(t),II=()=>!0,qB=t=>zB.test(t)&&!UB.test(t),Xx=()=>!1,ZB=t=>BB.test(t),GB=t=>WB.test(t),KB=t=>!Te(t)&&!Re(t),YB=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)),XB=t=>Sa(t,MI,Xx),Te=t=>PI.test(t),Ga=t=>Sa(t,LI,qB),RC=t=>Sa(t,iW,it),QB=t=>Sa(t,DI,II),JB=t=>Sa(t,OI,Xx),AC=t=>Sa(t,RI,Xx),eW=t=>Sa(t,AI,GB),Mp=t=>Sa(t,NI,ZB),Re=t=>TI.test(t),kd=t=>Dl(t,LI),tW=t=>Dl(t,OI),MC=t=>Dl(t,RI),nW=t=>Dl(t,MI),rW=t=>Dl(t,AI),Lp=t=>Dl(t,NI,!0),sW=t=>Dl(t,DI,!0),Sa=(t,e,n)=>{const r=PI.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Dl=(t,e,n=!1)=>{const r=TI.exec(t);return r?r[1]?e(r[1]):n:!1},RI=t=>t==="position"||t==="percentage",AI=t=>t==="image"||t==="url",MI=t=>t==="length"||t==="size"||t==="bg-size",LI=t=>t==="length",iW=t=>t==="number",OI=t=>t==="family-name",DI=t=>t==="number"||t==="weight",NI=t=>t==="shadow",oW=()=>{const t=Rn("color"),e=Rn("font"),n=Rn("text"),r=Rn("font-weight"),s=Rn("tracking"),i=Rn("leading"),a=Rn("breakpoint"),u=Rn("container"),c=Rn("spacing"),d=Rn("radius"),f=Rn("shadow"),p=Rn("inset-shadow"),m=Rn("text-shadow"),_=Rn("drop-shadow"),x=Rn("blur"),y=Rn("perspective"),w=Rn("aspect"),S=Rn("ease"),C=Rn("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"],I=()=>[...T(),Re,Te],A=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],R=()=>[Re,Te,c],L=()=>[qo,"full","auto",...R()],D=()=>[fi,"none","subgrid",Re,Te],j=()=>["auto",{span:["full",fi,Re,Te]},fi,Re,Te],F=()=>[fi,"auto",Re,Te],Z=()=>["auto","min","max","fr",Re,Te],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...R()],W=()=>[qo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],H=()=>[qo,"screen","full","dvw","lvw","svw","min","max","fit",...R()],X=()=>[qo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],z=()=>[t,Re,Te],N=()=>[...T(),MC,AC,{position:[Re,Te]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",nW,XB,{size:[Re,Te]}],J=()=>[V1,kd,Ga],se=()=>["","none","full",d,Re,Te],pe=()=>["",it,kd,Ga],Se=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[it,V1,MC,AC],$e=()=>["","none",x,Re,Te],We=()=>["none",it,Re,Te],He=()=>["none",it,Re,Te],Fe=()=>[it,Re,Te],ct=()=>[qo,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gi],breakpoint:[Gi],color:[II],container:[Gi],"drop-shadow":[Gi],ease:["in","out","in-out"],font:[KB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gi],shadow:[Gi],spacing:["px",it],text:[Gi],"text-shadow":[Gi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qo,Te,Re,w]}],container:["container"],"container-type":[{"@container":["","normal","size",Re,Te]}],"container-named":[YB],columns:[{columns:[it,Te,Re,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:I()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[fi,"auto",Re,Te]}],basis:[{basis:[qo,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[it,qo,"auto","initial","none",Te]}],grow:[{grow:["",it,Re,Te]}],shrink:[{shrink:["",it,Re,Te]}],order:[{order:[fi,"first","last","none",Re,Te]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":D()}],"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":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],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:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...X()]}],"min-block-size":[{"min-block":["auto",...X()]}],"max-block-size":[{"max-block":["none",...X()]}],w:[{w:[u,"screen",...W()]}],"min-w":[{"min-w":[u,"screen","none",...W()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,kd,Ga]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,sW,QB]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",V1,Te]}],"font-family":[{font:[tW,JB,e]}],"font-features":[{"font-features":[Te]}],"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,Re,Te]}],"line-clamp":[{"line-clamp":[it,"none",Re,RC]}],leading:[{leading:[i,...R()]}],"list-image":[{"list-image":["none",Re,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Re,Te]}],"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:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[it,"from-font","auto",Re,Ga]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[it,"auto",Re,Te]}],"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:[fi,Re,Te]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re,Te]}],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",Re,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},fi,Re,Te],radial:["",Re,Te],conic:[fi,Re,Te]},rW,eW]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"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:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[it,Re,Te]}],"outline-w":[{outline:["",it,kd,Ga]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",f,Lp,Mp]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",p,Lp,Mp]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[it,Ga]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",m,Lp,Mp]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[it,Re,Te]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":[it]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Re,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":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":[it]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":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:N()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Re,Te]}],filter:[{filter:["","none",Re,Te]}],blur:[{blur:$e()}],brightness:[{brightness:[it,Re,Te]}],contrast:[{contrast:[it,Re,Te]}],"drop-shadow":[{"drop-shadow":["","none",_,Lp,Mp]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",it,Re,Te]}],"hue-rotate":[{"hue-rotate":[it,Re,Te]}],invert:[{invert:["",it,Re,Te]}],saturate:[{saturate:[it,Re,Te]}],sepia:[{sepia:["",it,Re,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",Re,Te]}],"backdrop-blur":[{"backdrop-blur":$e()}],"backdrop-brightness":[{"backdrop-brightness":[it,Re,Te]}],"backdrop-contrast":[{"backdrop-contrast":[it,Re,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",it,Re,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[it,Re,Te]}],"backdrop-invert":[{"backdrop-invert":["",it,Re,Te]}],"backdrop-opacity":[{"backdrop-opacity":[it,Re,Te]}],"backdrop-saturate":[{"backdrop-saturate":[it,Re,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",it,Re,Te]}],"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",Re,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[it,"initial",Re,Te]}],ease:[{ease:["linear","initial",S,Re,Te]}],delay:[{delay:[it,Re,Te]}],animate:[{animate:["none",C,Re,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Re,Te]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:We()}],"rotate-x":[{"rotate-x":We()}],"rotate-y":[{"rotate-y":We()}],"rotate-z":[{"rotate-z":We()}],scale:[{scale:He()}],"scale-x":[{"scale-x":He()}],"scale-y":[{"scale-y":He()}],"scale-z":[{"scale-z":He()}],"scale-3d":["scale-3d"],skew:[{skew:Fe()}],"skew-x":[{"skew-x":Fe()}],"skew-y":[{"skew-y":Fe()}],transform:[{transform:[Re,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ct()}],"translate-x":[{"translate-x":ct()}],"translate-y":[{"translate-y":ct()}],"translate-z":[{"translate-z":ct()}],"translate-none":["translate-none"],zoom:[{zoom:[fi,Re,Te]}],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",Re,Te]}],"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",Re,Te]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[it,kd,Ga,RC]}],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"]}},aW=FB(oW);function cr(...t){return aW(vB(t))}const ff={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}};function jI(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),f=v.useRef(null),p=v.useRef(null),m=v.useCallback(()=>{if(!t.current)return;const C=[];r.current.forEach((P,T)=>{C[T]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),c.current=C,u(C)},[t]),_=v.useCallback((S,C)=>{C?r.current.set(S,C):r.current.delete(S),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,m()})},[m]),x=v.useCallback(S=>{const C=S.clientX,P=S.clientY;f.current!==null&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame(()=>{f.current=null;const T=t.current;if(!T)return;const I=T.getBoundingClientRect(),A=n==="x"?C:P;let O=null,R=1/0,L=null;const D=c.current,j=n==="x"?T.scrollLeft:T.scrollTop,F=n==="x"?T.clientLeft:T.clientTop,Z=n==="x"?I.left:I.top,Q=n==="x"?T.offsetWidth:T.offsetHeight,K=n==="x"?I.width:I.height,q=Q>0?K/Q:1;for(let W=0;W<D.length;W++){const H=D[W];if(!H)continue;const X=n==="x"?H.left:H.top,z=Z+(F+X-j)*q,N=(n==="x"?H.width:H.height)*q,Y=z+N;A>=z&&A<=Y&&(L=W);const oe=z+N/2,J=Math.abs(A-oe);J<R&&(R=J,O=W)}i(L??O)})},[n,t]),y=v.useCallback(()=>{d.current+=1,m()},[m]),w=v.useCallback(()=>{f.current!==null&&(cancelAnimationFrame(f.current),f.current=null),i(null)},[]);return v.useEffect(()=>()=>{f.current!==null&&cancelAnimationFrame(f.current),p.current!==null&&cancelAnimationFrame(p.current)},[]),{activeIndex:s,setActiveIndex:i,itemRects:a,sessionRef:d,handlers:{onMouseMove:x,onMouseEnter:y,onMouseLeave:w},registerItem:_,measureItems:m}}function lW(t,e,n){v.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const FI=(t,e)=>`style:${t}:${e}`,VI=t=>`text:${t}`,$I=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"]},HI=t=>$I(t)[0],Op=(t,e)=>$I(t).includes(e),uW=t=>{const e=HI(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${FI(e,t.property)}${n}`:`${VI(e)}${n}`},Zn=[];for(let t=0;t<256;++t)Zn.push((t+256).toString(16).slice(1));function cW(t,e=0){return(Zn[t[e+0]]+Zn[t[e+1]]+Zn[t[e+2]]+Zn[t[e+3]]+"-"+Zn[t[e+4]]+Zn[t[e+5]]+"-"+Zn[t[e+6]]+Zn[t[e+7]]+"-"+Zn[t[e+8]]+Zn[t[e+9]]+"-"+Zn[t[e+10]]+Zn[t[e+11]]+Zn[t[e+12]]+Zn[t[e+13]]+Zn[t[e+14]]+Zn[t[e+15]]).toLowerCase()}const dW=new Uint8Array(16);function fW(){return crypto.getRandomValues(dW)}function LC(t,e,n){return crypto.randomUUID?crypto.randomUUID():hW(t)}function hW(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??fW();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,cW(r)}const pW=300;class mW{constructor(){Uo(this,"history",{current:new Map,past:[],future:[]});Uo(this,"pendingChanges",new Map);Uo(this,"currentBatchId",null);Uo(this,"debounceTimer",null);Uo(this,"onChangeCallbacks",[]);Uo(this,"stateBeforePending",null);Uo(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=LC(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=HI(e.elementId),r=e.type==="style"?FI(n,e.property):VI(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=uW(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},pW),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"&&Op(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"&&Op(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>Op(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>Op(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=LC(),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 s0={kind:"base"};function hf(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function vW(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const gW={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}},zI=Object.fromEntries(Object.entries(gW).map(([t,e])=>[t,{isEnabled:e.default}]));st("view");const UI=st(!0),BI=st(null),yW=st("chat"),WI=st(0),qI=st({name:null,email:null}),OC=st(s0);st(null);const pf=new Map,_W=t=>{const e=hf(t);let n=pf.get(e);return n||(n=new mW,pf.set(e,n)),n};st(t=>_W(t(OC)),(t,e,n)=>{pf.set(hf(t(OC)),n)});const xW=t=>{for(const e of[...pf.keys()])e==="base"||t.has(e)||pf.delete(e)},mf=st(new Map),DC=st(null);st(null);const Q_=st(0),i0=st(null),J_=st(!1),e2=st(null),ZI=st(!1),GI=st(!1),t2=st(null),n2=st(null),vf=st(null),Qx=st(null),yo=st(null),Bf=st({active:!1}),KI=st([]),NC=st(null),wW=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&vW(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},bW=st(null,(t,e,n)=>{const r=c=>{const d=c??s0;return d.kind==="variant"&&!n.has(hf(d))},s=t(mf);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(mf,c)}const a=t(DC);a&&r(a.target)&&(e(DC,null),e(CW,!1));const u=t(NC);u&&(i!=null&&i.has(u.commentId))&&e(NC,null),xW(n)}),r2=st(zI),SW=st(!1),YI=st(null),Wf=st(!0),XI=st(!1),QI=st(!1),JI=st(null),EW=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},D0=st(EW()),kW=st(null),CW=st(!1);st(0);st(0);var om={exports:{}},PW=om.exports,jC;function TW(){return jC||(jC=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(PW,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(y,w){var S=y[w];if(typeof S.bind=="function")return S.bind(y);try{return Function.prototype.bind.call(S,y)}catch{return function(){return Function.prototype.apply.apply(S,[y,arguments])}}}function 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(y){return y==="debug"&&(y="log"),typeof console===n?!1:y==="trace"&&r?c:console[y]!==void 0?u(console,y):console.log!==void 0?u(console,"log"):e}function f(){for(var y=this.getLevel(),w=0;w<s.length;w++){var S=s[w];this[S]=w<y?e:this.methodFactory(S,y,this.name)}if(this.log=this.debug,typeof console===n&&y<this.levels.SILENT)return"No console available for logging"}function p(y){return function(){typeof console!==n&&(f.call(this),this[y].apply(this,arguments))}}function m(y,w,S){return d(y)||p.apply(this,arguments)}function _(y,w){var S=this,C,P,T,I="loglevel";typeof y=="string"?I+=":"+y:typeof y=="symbol"&&(I=void 0);function A(j){var F=(s[j]||"silent").toUpperCase();if(!(typeof window===n||!I)){try{window.localStorage[I]=F;return}catch{}try{window.document.cookie=encodeURIComponent(I)+"="+F+";"}catch{}}}function O(){var j;if(!(typeof window===n||!I)){try{j=window.localStorage[I]}catch{}if(typeof j===n)try{var F=window.document.cookie,Z=encodeURIComponent(I),Q=F.indexOf(Z+"=");Q!==-1&&(j=/^([^;]+)/.exec(F.slice(Q+Z.length+1))[1])}catch{}return S.levels[j]===void 0&&(j=void 0),j}}function R(){if(!(typeof window===n||!I)){try{window.localStorage.removeItem(I)}catch{}try{window.document.cookie=encodeURIComponent(I)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function L(j){var F=j;if(typeof F=="string"&&S.levels[F.toUpperCase()]!==void 0&&(F=S.levels[F.toUpperCase()]),typeof F=="number"&&F>=0&&F<=S.levels.SILENT)return F;throw new TypeError("log.setLevel() called with invalid level: "+j)}S.name=y,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=w||m,S.getLevel=function(){return T??P??C},S.setLevel=function(j,F){return T=L(j),F!==!1&&A(T),f.call(S)},S.setDefaultLevel=function(j){P=L(j),O()||S.setLevel(j,!1)},S.resetLevel=function(){T=null,R(),f.call(S)},S.enableAll=function(j){S.setLevel(S.levels.TRACE,j)},S.disableAll=function(j){S.setLevel(S.levels.SILENT,j)},S.rebuild=function(){if(a!==S&&(C=L(a.getLevel())),f.call(S),a===S)for(var j in i)i[j].rebuild()},C=L(a?a.getLevel():"WARN");var D=O();D!=null&&(T=L(D)),f.call(S)}a=new _,a.getLogger=function(w){if(typeof w!="symbol"&&typeof w!="string"||w==="")throw new TypeError("You must supply a name when creating a logger.");var S=i[w];return S||(S=i[w]=new _(w,a.methodFactory)),S};var x=typeof window!==n?window.log:void 0;return a.noConflict=function(){return typeof window!==n&&window.log===a&&(window.log=x),a},a.getLoggers=function(){return i},a.default=a,a})})(om)),om.exports}var IW=TW();const qs=x0(IW),RW="INFO",AW=RW.toUpperCase();qs.setLevel(qs.levels[AW]||qs.levels.INFO);const Ls=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>qs.trace(`${e}${n}`,...r),debug:(n,...r)=>qs.debug(`${e}${n}`,...r),info:(n,...r)=>qs.info(`${e}${n}`,...r),warn:(n,...r)=>qs.warn(`${e}${n}`,...r),error:(n,...r)=>{qs.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}:{}};Ee.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>qs.info(`${e}API: ${n}`,...r),hook:(n,...r)=>qs.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>qs.debug(`${e}Mount: ${n}`,...r)}};let am=0;const MW=()=>{am+=1;let t=!1;return()=>{t||(t=!0,am=Math.max(0,am-1))}},LW=()=>am>0;function OW(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const DW=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Jx=({className:t,"data-testid":e}={})=>E.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:E.jsx("div",{className:"rivet-sparkle-strip",children:DW.map((n,r)=>E.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),NW=["top","right","bottom","left"],ma=Math.min,mo=Math.max,o0=Math.round,Dp=Math.floor,vo=t=>({x:t,y:t}),jW={left:"right",right:"left",bottom:"top",top:"bottom"};function eR(t,e,n){return mo(t,ma(e,n))}function _o(t,e){return typeof t=="function"?t(e):t}function va(t){return t.split("-")[0]}function Ec(t){return t.split("-")[1]}function ew(t){return t==="x"?"y":"x"}function tw(t){return t==="y"?"height":"width"}function Pi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function nw(t){return ew(Pi(t))}function FW(t,e,n){n===void 0&&(n=!1);const r=Ec(t),s=nw(t),i=tw(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=a0(a)),[a,a0(a)]}function VW(t){const e=a0(t);return[s2(t),e,s2(e)]}function s2(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const FC=["left","right"],VC=["right","left"],$W=["top","bottom"],HW=["bottom","top"];function zW(t,e,n){switch(t){case"top":case"bottom":return n?e?VC:FC:e?FC:VC;case"left":case"right":return e?$W:HW;default:return[]}}function UW(t,e,n,r){const s=Ec(t);let i=zW(va(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(s2)))),i}function a0(t){const e=va(t);return jW[e]+t.slice(e.length)}function BW(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 tR(t){return typeof t!="number"?BW(t):{top:t,right:t,bottom:t,left:t}}function l0(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 $C(t,e,n){let{reference:r,floating:s}=t;const i=Pi(e),a=nw(e),u=tw(a),c=va(e),d=i==="y",f=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 _;switch(c){case"top":_={x:f,y:r.y-s.height};break;case"bottom":_={x:f,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:p};break;case"left":_={x:r.x-s.width,y:p};break;default:_={x:r.x,y:r.y}}const x=Ec(e);return x&&(_[a]+=m*(x==="end"?1:-1)*(n&&d?-1:1)),_}async function WW(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:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:_=0}=_o(e,t),x=tR(_),w=u[m?p==="floating"?"reference":"floating":p],S=l0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:d,rootBoundary:f,strategy:c})),C=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},I=l0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:C,offsetParent:P,strategy:c}):C);return{top:(S.top-I.top+x.top)/T.y,bottom:(I.bottom-S.bottom+x.bottom)/T.y,left:(S.left-I.left+x.left)/T.x,right:(I.right-S.right+x.right)/T.x}}const qW=50,ZW=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:WW},c=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:p}=$C(d,r,c),m=r,_=0;const x={};for(let y=0;y<i.length;y++){const w=i[y];if(!w)continue;const{name:S,fn:C}=w,{x:P,y:T,data:I,reset:A}=await C({x:f,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:x,rects:d,platform:u,elements:{reference:t,floating:e}});f=P??f,p=T??p,x[S]={...x[S],...I},A&&_<qW&&(_++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(d=A.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):A.rects),{x:f,y:p}=$C(d,m,c)),y=-1)}return{x:f,y:p,placement:m,strategy:s,middlewareData:x}},GW=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:f=0}=_o(t,e)||{};if(d==null)return{};const p=tR(f),m={x:n,y:r},_=nw(s),x=tw(_),y=await a.getDimensions(d),w=_==="y",S=w?"top":"left",C=w?"bottom":"right",P=w?"clientHeight":"clientWidth",T=i.reference[x]+i.reference[_]-m[_]-i.floating[x],I=m[_]-i.reference[_],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let O=A?A[P]:0;(!O||!await(a.isElement==null?void 0:a.isElement(A)))&&(O=u.floating[P]||i.floating[x]);const R=T/2-I/2,L=O/2-y[x]/2-1,D=ma(p[S],L),j=ma(p[C],L),F=O-y[x]-j,Z=O/2-y[x]/2+R,Q=eR(D,Z,F),K=!c.arrow&&Ec(s)!=null&&Z!==Q&&i.reference[x]/2-(Z<D?D:j)-y[x]/2<0,q=K?Z<D?Z-D:Z-F:0;return{[_]:m[_]+q,data:{[_]:Q,centerOffset:Z-Q-q,...K&&{alignmentOffset:q}},reset:K}}}),KW=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:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...w}=_o(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=va(s),C=Pi(u),P=va(u)===u,T=await(c.isRTL==null?void 0:c.isRTL(d.floating)),I=m||(P||!y?[a0(u)]:VW(u)),A=x!=="none";!m&&A&&I.push(...UW(u,y,x,T));const O=[u,...I],R=await c.detectOverflow(e,w),L=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&L.push(R[S]),p){const Q=FW(s,a,T);L.push(R[Q[0]],R[Q[1]])}if(D=[...D,{placement:s,overflows:L}],!L.every(Q=>Q<=0)){var j,F;const Q=(((j=i.flip)==null?void 0:j.index)||0)+1,K=O[Q];if(K&&(!(p==="alignment"?C!==Pi(K):!1)||D.every(H=>Pi(H.placement)===C?H.overflows[0]>0:!0)))return{data:{index:Q,overflows:D},reset:{placement:K}};let q=(F=D.filter(W=>W.overflows[0]<=0).sort((W,H)=>W.overflows[1]-H.overflows[1])[0])==null?void 0:F.placement;if(!q)switch(_){case"bestFit":{var Z;const W=(Z=D.filter(H=>{if(A){const X=Pi(H.placement);return X===C||X==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(X=>X>0).reduce((X,z)=>X+z,0)]).sort((H,X)=>H[1]-X[1])[0])==null?void 0:Z[0];W&&(q=W);break}case"initialPlacement":q=u;break}if(s!==q)return{reset:{placement:q}}}return{}}}};function HC(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function zC(t){return NW.some(e=>t[e]>=0)}const YW=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=_o(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),u=HC(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:zC(u)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),u=HC(a,n.floating);return{data:{escapedOffsets:u,escaped:zC(u)}}}default:return{}}}}},nR=new Set(["left","top"]);async function XW(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=va(n),u=Ec(n),c=Pi(n)==="y",d=nR.has(a)?-1:1,f=i&&c?-1:1,p=_o(e,t);let{mainAxis:m,crossAxis:_,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof x=="number"&&(_=u==="end"?x*-1:x),c?{x:_*f,y:m*d}:{x:m*d,y:_*f}}const QW=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 XW(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}}}}},JW=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:C=>{let{x:P,y:T}=C;return{x:P,y:T}}},...d}=_o(t,e),f={x:n,y:r},p=await i.detectOverflow(e,d),m=Pi(s),_=ew(m);let x=f[_],y=f[m];const w=(C,P)=>eR(P+p[C==="y"?"top":"left"],P,P-p[C==="y"?"bottom":"right"]);a&&(x=w(_,x)),u&&(y=w(m,y));const S=c.fn({...e,[_]:x,[m]:y});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[_]:a,[m]:u}}}}}},eq=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:f=!0,crossAxis:p=!0}=_o(t,e),m={x:s,y:i},_=Pi(a),x=ew(_);let y=m[x],w=m[_];const S=_o(d,e),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(f){const I=x==="y"?"height":"width",A=u.reference[x]-u.floating[I]+C.mainAxis,O=u.reference[x]+u.reference[I]-C.mainAxis;y<A?y=A:y>O&&(y=O)}if(p){var P,T;const I=x==="y"?"width":"height",A=nR.has(va(a)),O=u.reference[_]-u.floating[I]+(A&&((P=c.offset)==null?void 0:P[_])||0)+(A?0:C.crossAxis),R=u.reference[_]+u.reference[I]+(A?0:((T=c.offset)==null?void 0:T[_])||0)-(A?C.crossAxis:0);w<O?w=O:w>R&&(w=R)}return{[x]:y,[_]:w}}}},tq=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}=_o(t,e),c=await s.detectOverflow(e,u),d=va(n),f=Ec(n),p=Pi(n)==="y",{width:m,height:_}=r.floating;let x,y;d==="top"||d==="bottom"?(x=d,y=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(y=d,x=f==="end"?"top":"bottom");const w=_-c.top-c.bottom,S=m-c.left-c.right,C=ma(_-c[x],w),P=ma(m-c[y],S),T=e.middlewareData.shift,I=!T;let A=C,O=P;T!=null&&T.enabled.x&&(O=S),T!=null&&T.enabled.y&&(A=w),I&&!f&&(p?O=m-2*mo(c.left,c.right):A=_-2*mo(c.top,c.bottom)),await a({...e,availableWidth:O,availableHeight:A});const R=await s.getDimensions(i.floating);return m!==R.width||_!==R.height?{reset:{rects:!0}}:{}}}};function N0(){return typeof window<"u"}function kc(t){return rR(t)?(t.nodeName||"").toLowerCase():"#document"}function Ur(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function So(t){var e;return(e=(rR(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function rR(t){return N0()?t instanceof Node||t instanceof Ur(t).Node:!1}function Ai(t){return N0()?t instanceof Element||t instanceof Ur(t).Element:!1}function Ea(t){return N0()?t instanceof HTMLElement||t instanceof Ur(t).HTMLElement:!1}function UC(t){return!N0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ur(t).ShadowRoot}function j0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Mi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function nq(t){return/^(table|td|th)$/.test(kc(t))}function F0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const rq=/transform|translate|scale|rotate|perspective|filter/,sq=/paint|layout|strict|content/,Ka=t=>!!t&&t!=="none";let $1;function rw(t){const e=Ai(t)?Mi(t):t;return Ka(e.transform)||Ka(e.translate)||Ka(e.scale)||Ka(e.rotate)||Ka(e.perspective)||!sw()&&(Ka(e.backdropFilter)||Ka(e.filter))||rq.test(e.willChange||"")||sq.test(e.contain||"")}function iq(t){let e=Ll(t);for(;Ea(e)&&!gf(e);){if(rw(e))return e;if(F0(e))return null;e=Ll(e)}return null}function sw(){return $1==null&&($1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$1}function gf(t){return/^(html|body|#document)$/.test(kc(t))}function Mi(t){return Ur(t).getComputedStyle(t)}function V0(t){return Ai(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ll(t){if(kc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||UC(t)&&t.host||So(t);return UC(e)?e.host:e}function sR(t){const e=Ll(t);return gf(e)?(t.ownerDocument||t).body:Ea(e)&&j0(e)?e:sR(e)}function yf(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=sR(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Ur(s);if(i){const u=i2(a);return e.concat(a,a.visualViewport||[],j0(s)?s:[],u&&n?yf(u):[])}else return e.concat(s,yf(s,[],n))}function i2(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function iR(t){const e=Mi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Ea(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,u=o0(n)!==i||o0(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function iw(t){return Ai(t)?t:t.contextElement}function Vu(t){const e=iw(t);if(!Ea(e))return vo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=iR(e);let a=(i?o0(n.width):n.width)/r,u=(i?o0(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const oq=vo(0);function oR(t){const e=Ur(t);return!sw()||!e.visualViewport?oq:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function aq(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Ur(t)}function Ol(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=iw(t);let a=vo(1);e&&(r?Ai(r)&&(a=Vu(r)):a=Vu(t));const u=aq(i,n,r)?oR(i):vo(0);let c=(s.left+u.x)/a.x,d=(s.top+u.y)/a.y,f=s.width/a.x,p=s.height/a.y;if(i&&r){const m=Ur(i),_=Ai(r)?Ur(r):r;let x=m,y=i2(x);for(;y&&_!==x;){const w=Vu(y),S=y.getBoundingClientRect(),C=Mi(y),P=S.left+(y.clientLeft+parseFloat(C.paddingLeft))*w.x,T=S.top+(y.clientTop+parseFloat(C.paddingTop))*w.y;c*=w.x,d*=w.y,f*=w.x,p*=w.y,c+=P,d+=T,x=Ur(y),y=i2(x)}}return l0({width:f,height:p,x:c,y:d})}function $0(t,e){const n=V0(t).scrollLeft;return e?e.left+n:Ol(So(t)).left+n}function aR(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-$0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function lq(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=So(r),u=e?F0(e.floating):!1;if(r===a||u&&i)return n;let c={scrollLeft:0,scrollTop:0},d=vo(1);const f=vo(0),p=Ea(r);if((p||!i)&&((kc(r)!=="body"||j0(a))&&(c=V0(r)),p)){const _=Ol(r);d=Vu(r),f.x=_.x+r.clientLeft,f.y=_.y+r.clientTop}const m=a&&!p&&!i?aR(a,c):vo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-c.scrollTop*d.y+f.y+m.y}}function uq(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function cq(t){const e=V0(t),n=t.ownerDocument.body,r=mo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=mo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+$0(t);const a=-e.scrollTop;return Mi(n).direction==="rtl"&&(i+=mo(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:a}}const dq=25;function fq(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Ur(t),i=So(t),a=s.visualViewport;let u=i.clientWidth,c=i.clientHeight,d=0,f=0;if(a){const m=!sw()||e==="fixed";r?m||(d=-a.offsetLeft,f=-a.offsetTop):(u=a.width,c=a.height,m&&(d=a.offsetLeft,f=a.offsetTop))}if($0(i)<=0){const m=i.ownerDocument,_=m.body,x=getComputedStyle(_),y=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(i.clientWidth-_.clientWidth-y),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;S<=dq&&(u-=S)}return{width:u,height:c,x:d,y:f}}function hq(t,e){const n=Ol(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Vu(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 BC(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=fq(t,n,e);else if(e==="document")r=cq(So(t));else if(Ai(e))r=hq(e,n);else{const s=oR(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return l0(r)}function pq(t,e){const n=e.get(t);if(n)return n;let r=yf(t,[],!1).filter(u=>Ai(u)&&kc(u)!=="body"),s=null;const i=Mi(t).position==="fixed";let a=i?Ll(t):t;for(;Ai(a)&&!gf(a);){const u=Mi(a),c=rw(a),d=s?s.position:i?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&u.position==="static")?r=r.filter(p=>p!==a):s=u,a=Ll(a)}return e.set(t,r),r}function mq(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?F0(e)?[]:pq(e,this._c):[].concat(n),r],u=BC(e,a[0],s);let c=u.top,d=u.right,f=u.bottom,p=u.left;for(let m=1;m<a.length;m++){const _=BC(e,a[m],s);c=mo(_.top,c),d=ma(_.right,d),f=ma(_.bottom,f),p=mo(_.left,p)}return{width:d-p,height:f-c,x:p,y:c}}function vq(t){const{width:e,height:n}=iR(t);return{width:e,height:n}}function gq(t,e,n){const r=Ea(e),s=So(e),i=n==="fixed",a=Ol(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const c=vo(0);if((r||!i)&&((kc(e)!=="body"||j0(s))&&(u=V0(e)),r)){const m=Ol(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&s&&(c.x=$0(s));const d=s&&!r&&!i?aR(s,u):vo(0),f=a.left+u.scrollLeft-c.x-d.x,p=a.top+u.scrollTop-c.y-d.y;return{x:f,y:p,width:a.width,height:a.height}}function H1(t){return Mi(t).position==="static"}function WC(t,e){if(!Ea(t)||Mi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return So(t)===n&&(n=n.ownerDocument.body),n}function lR(t,e){const n=Ur(t);if(F0(t))return n;if(!Ea(t)){let s=Ll(t);for(;s&&!gf(s);){if(Ai(s)&&!H1(s))return s;s=Ll(s)}return n}let r=WC(t,e);for(;r&&nq(r)&&H1(r);)r=WC(r,e);return r&&gf(r)&&H1(r)&&!rw(r)?n:r||iq(t)||n}const yq=async function(t){const e=this.getOffsetParent||lR,n=this.getDimensions,r=await n(t.floating);return{reference:gq(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _q(t){return Mi(t).direction==="rtl"}const xq={convertOffsetParentRelativeRectToViewportRelativeRect:lq,getDocumentElement:So,getClippingRect:mq,getOffsetParent:lR,getElementRects:yq,getClientRects:uq,getDimensions:vq,getScale:Vu,isElement:Ai,isRTL:_q};function uR(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function wq(t,e,n){let r=null,s;const i=So(t);function a(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function u(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),a();const m=t.getBoundingClientRect(),{left:_,top:x,width:y,height:w}=m;if(f||e(),!y||!w)return;const S=Dp(x),C=Dp(i.clientWidth-(_+y)),P=Dp(i.clientHeight-(x+w)),T=Dp(_),A={rootMargin:-S+"px "+-C+"px "+-P+"px "+-T+"px",threshold:mo(0,ma(1,p))||1};let O=!0;function R(L){const D=L[0].intersectionRatio;if(!uR(m,t.getBoundingClientRect()))return u();if(D!==p){if(!O)return u();D?u(!1,D):s=setTimeout(()=>{u(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(R,{...A,root:i.ownerDocument})}catch{r=new IntersectionObserver(R,A)}r.observe(t)}const c=Ur(t),d=()=>u(n);return c.addEventListener("resize",d),u(!0),()=>{c.removeEventListener("resize",d),a()}}function bq(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=iw(t),f=s||i?[...d?yf(d):[],...e?yf(e):[]]:[];f.forEach(S=>{s&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const p=d&&u?wq(d,n,i):null;let m=-1,_=null;a&&(_=new ResizeObserver(S=>{let[C]=S;C&&C.target===d&&_&&e&&(_.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var P;(P=_)==null||P.observe(e)})),n()}),d&&!c&&_.observe(d),e&&_.observe(e));let x,y=c?Ol(t):null;c&&w();function w(){const S=Ol(t);y&&!uR(y,S)&&n(),y=S,x=requestAnimationFrame(w)}return n(),()=>{var S;f.forEach(C=>{s&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),p==null||p(),(S=_)==null||S.disconnect(),_=null,c&&cancelAnimationFrame(x)}}const Sq=QW,Eq=JW,kq=KW,Cq=tq,Pq=YW,qC=GW,Tq=eq,Iq=(t,e,n)=>{const r=new Map,s=n??{},i={...xq,...s.platform,_c:r};return ZW(t,e,{...s,platform:i})};var Rq=typeof document<"u",Aq=function(){},lm=Rq?v.useLayoutEffect:Aq;function u0(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(!u0(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)&&!u0(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function cR(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ZC(t,e){const n=cR(t);return Math.round(e*n)/n}function z1(t){const e=v.useRef(t);return lm(()=>{e.current=t}),e}function Mq(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,[f,p]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,_]=v.useState(r);u0(m,r)||_(r);const[x,y]=v.useState(null),[w,S]=v.useState(null),C=v.useCallback(H=>{H!==A.current&&(A.current=H,y(H))},[]),P=v.useCallback(H=>{H!==O.current&&(O.current=H,S(H))},[]),T=i||x,I=a||w,A=v.useRef(null),O=v.useRef(null),R=v.useRef(f),L=c!=null,D=z1(c),j=z1(s),F=z1(d),Z=v.useCallback(()=>{if(!A.current||!O.current)return;const H={placement:e,strategy:n,middleware:m};j.current&&(H.platform=j.current),Iq(A.current,O.current,H).then(X=>{const z={...X,isPositioned:F.current!==!1};Q.current&&!u0(R.current,z)&&(R.current=z,A0.flushSync(()=>{p(z)}))})},[m,e,n,j,F]);lm(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[d]);const Q=v.useRef(!1);lm(()=>(Q.current=!0,()=>{Q.current=!1}),[]),lm(()=>{if(T&&(A.current=T),I&&(O.current=I),T&&I){if(D.current)return D.current(T,I,Z);Z()}},[T,I,Z,D,L]);const K=v.useMemo(()=>({reference:A,floating:O,setReference:C,setFloating:P}),[C,P]),q=v.useMemo(()=>({reference:T,floating:I}),[T,I]),W=v.useMemo(()=>{const H={position:n,left:0,top:0};if(!q.floating)return H;const X=ZC(q.floating,f.x),z=ZC(q.floating,f.y);return u?{...H,transform:"translate("+X+"px, "+z+"px)",...cR(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:z}},[n,u,q.floating,f.x,f.y]);return v.useMemo(()=>({...f,update:Z,refs:K,elements:q,floatingStyles:W}),[f,Z,K,q,W])}const Lq=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?qC({element:r.current,padding:s}).fn(n):{}:r?qC({element:r,padding:s}).fn(n):{}}}},Oq=(t,e)=>{const n=Sq(t);return{name:n.name,fn:n.fn,options:[t,e]}},Dq=(t,e)=>{const n=Eq(t);return{name:n.name,fn:n.fn,options:[t,e]}},Nq=(t,e)=>({fn:Tq(t).fn,options:[t,e]}),jq=(t,e)=>{const n=kq(t);return{name:n.name,fn:n.fn,options:[t,e]}},Fq=(t,e)=>{const n=Cq(t);return{name:n.name,fn:n.fn,options:[t,e]}},Vq=(t,e)=>{const n=Pq(t);return{name:n.name,fn:n.fn,options:[t,e]}},$q=(t,e)=>{const n=Lq(t);return{name:n.name,fn:n.fn,options:[t,e]}};var Hq=Object.defineProperty,zq=(t,e)=>Hq(t,"name",{value:e,configurable:!0});function ow(t){const[e,n]=v.useState(void 0);return zr(()=>{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}zq(ow,"useSize");var Uq=Object.defineProperty,aa=(t,e)=>Uq(t,"name",{value:e,configurable:!0}),dR="Popper",[fR,H0]=Oi(dR),[Bq,hR]=fR(dR),Wq=aa(t=>{const{__scopePopper:e,children:n}=t,[r,s]=v.useState(null),[i,a]=v.useState(void 0);return E.jsx(Bq,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})},"Popper"),qq="PopperAnchor",Zq=v.forwardRef(aa(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,a=hR(qq,r),u=v.useRef(null),c=a.onAnchorChange,d=v.useCallback(y=>{u.current=y,y&&c(y)},[c]),f=Bt(n,d),p=v.useRef(null);v.useEffect(()=>{if(!s)return;const y=p.current;p.current=s.current,y!==p.current&&c(p.current)});const m=a.placementState&&z0(a.placementState),_=m==null?void 0:m[0],x=m==null?void 0:m[1];return s?null:E.jsx(xn.div,{"data-radix-popper-side":_,"data-radix-popper-align":x,...i,ref:f})},"PopperAnchor")),pR="PopperContent",[Gq,ite]=fR(pR),Kq=v.forwardRef(aa(function(e,n){var ae,$e,We,He,Fe,ct,Gt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:u=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:x="optimized",onPlaced:y,...w}=e,S=hR(pR,r),[C,P]=v.useState(null),T=Bt(n,P),[I,A]=v.useState(null),O=ow(I),R=(O==null?void 0:O.width)??0,L=(O==null?void 0:O.height)??0,D=s+(a!=="center"?"-"+a:""),j=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},F=Array.isArray(f)?f:[f],Z=F.length>0,Q={padding:j,boundary:F.filter(mR),altBoundary:Z},{refs:K,floatingStyles:q,placement:W,isPositioned:H,middlewareData:X}=Mq({strategy:"fixed",placement:D,whileElementsMounted:aa((...rt)=>bq(...rt,{animationFrame:x==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[Oq({mainAxis:i+L,alignmentAxis:u}),d&&Dq({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?Nq():void 0,...Q}),d&&jq({...Q}),Fq({...Q,apply:aa(({elements:rt,rects:Ve,availableWidth:Oe,availableHeight:Je})=>{const{width:kt,height:vt}=Ve.reference,xe=rt.floating.style;xe.setProperty("--radix-popper-available-width",`${Oe}px`),xe.setProperty("--radix-popper-available-height",`${Je}px`),xe.setProperty("--radix-popper-anchor-width",`${kt}px`),xe.setProperty("--radix-popper-anchor-height",`${vt}px`)},"apply")}),I&&$q({element:I,padding:c}),Yq({arrowWidth:R,arrowHeight:L}),_&&Vq({strategy:"referenceHidden",...Q,boundary:Z?Q.boundary:void 0})]}),z=S.setPlacementState;zr(()=>(z(W),()=>{z(void 0)}),[W,z]);const[N,Y]=z0(W),oe=Ml(y);zr(()=>{H&&(oe==null||oe())},[H,oe]);const J=(ae=X.arrow)==null?void 0:ae.x,se=($e=X.arrow)==null?void 0:$e.y,pe=((We=X.arrow)==null?void 0:We.centerOffset)!==0,[Se,ce]=v.useState();return zr(()=>{C&&ce(window.getComputedStyle(C).zIndex)},[C]),E.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:H?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(He=X.transformOrigin)==null?void 0:He.x,(Fe=X.transformOrigin)==null?void 0:Fe.y].join(" "),...((ct=X.hide)==null?void 0:ct.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(Gq,{scope:r,placedSide:N,placedAlign:Y,onArrowChange:A,arrowX:J,arrowY:se,shouldHideArrow:pe,children:E.jsx(xn.div,{"data-side":N,"data-align":Y,...w,ref:T,style:{...w.style,animation:H?(Gt=w.style)==null?void 0:Gt.animation:"none"}})})})},"PopperContent"));function mR(t){return t!==null}aa(mR,"isNotNull");var Yq=aa(t=>({name:"transformOrigin",options:t,fn(e){var w,S,C;const{placement:n,rects:r,middlewareData:s}=e,a=((w=s.arrow)==null?void 0:w.centerOffset)!==0,u=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[d,f]=z0(n),p={start:"0%",center:"50%",end:"100%"}[f],m=(((S=s.arrow)==null?void 0:S.x)??0)+u/2,_=(((C=s.arrow)==null?void 0:C.y)??0)+c/2;let x="",y="";return d==="bottom"?(x=a?p:`${m}px`,y=`${-c}px`):d==="top"?(x=a?p:`${m}px`,y=`${r.floating.height+c}px`):d==="right"?(x=`${-c}px`,y=a?p:`${_}px`):d==="left"&&(x=`${r.floating.width+c}px`,y=a?p:`${_}px`),{data:{x,y}}}}),"transformOrigin");function z0(t){const[e,n="center"]=t.split("-");return[e,n]}aa(z0,"getSideAndAlignFromPlacement");var vR=Wq,gR=Zq,yR=Kq,Xq=Object.defineProperty,ka=(t,e)=>Xq(t,"name",{value:e,configurable:!0}),aw="Popover",[_R,ote]=Oi(aw,[H0]),lw=H0(),[Qq,Cc]=_R(aw),Jq=ka(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,u=lw(e),c=v.useRef(null),[d,f]=v.useState(!1),[p,m]=wa({prop:r,defaultProp:s??!1,onChange:i,caller:aw});return E.jsx(vR,{...u,children:E.jsx(Qq,{scope:e,contentId:oa(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:v.useCallback(()=>m(_=>!_),[m]),hasCustomAnchor:d,onCustomAnchorAdd:v.useCallback(()=>f(!0),[]),onCustomAnchorRemove:v.useCallback(()=>f(!1),[]),modal:a,children:n})})},"Popover"),eZ="PopoverTrigger",tZ=v.forwardRef(ka(function(e,n){const{__scopePopover:r,...s}=e,i=Cc(eZ,r),a=lw(r),u=Bt(n,i.triggerRef),c=E.jsx(xn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":uw(i.open),...s,ref:u,onClick:zt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:E.jsx(gR,{asChild:!0,...a,children:c})},"PopoverTrigger")),xR="PopoverPortal",[nZ,rZ]=_R(xR,{forceMount:void 0}),sZ=ka(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=Cc(xR,e);return E.jsx(nZ,{scope:e,forceMount:n,children:E.jsx(ba,{present:n||i.open,children:E.jsx(Vx,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),_f="PopoverContent",iZ=v.forwardRef(ka(function(e,n){const r=rZ(_f,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,a=Cc(_f,e.__scopePopover);return E.jsx(ba,{present:s||a.open,children:a.modal?E.jsx(aZ,{...i,ref:n}):E.jsx(lZ,{...i,ref:n})})},"PopoverContent")),oZ=pa("PopoverContent.RemoveScroll"),aZ=v.forwardRef(ka(function(e,n){const r=Cc(_f,e.__scopePopover),s=v.useRef(null),i=Bt(n,s),a=v.useRef(!1);return v.useEffect(()=>{const u=s.current;if(u)return G5(u)},[]),E.jsx(Hx,{as:oZ,allowPinchZoom:!0,children:E.jsx(wR,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zt(e.onCloseAutoFocus,u=>{var c;u.preventDefault(),a.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:zt(e.onPointerDownOutside,u=>{const c=u.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;a.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:zt(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),lZ=v.forwardRef(ka(function(e,n){const r=Cc(_f,e.__scopePopover),s=v.useRef(!1),i=v.useRef(!1);return E.jsx(wR,{...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,f;(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;((f=r.triggerRef.current)==null?void 0:f.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"PopoverContentNonModal")),wR=v.forwardRef(ka(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,...m}=e,_=Cc(_f,r),x=lw(r);return M0(),E.jsx(I5,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(Nx,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>_.onOpenChange(!1),deferPointerDownOutside:!0,children:E.jsx(yR,{"data-state":uw(_.open),role:"dialog",id:_.contentId,...x,...m,ref:n,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function uw(t){return t?"open":"closed"}ka(uw,"getState");var bR=Jq,SR=tZ,ER=sZ,kR=iZ;const CR=({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,f]=v.useState(!1),p=i?a??t:t,m=c.length>0;return E.jsxs("div",{className:"flex items-stretch",children:[E.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?E.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?E.jsxs(bR,{open:d,onOpenChange:f,children:[E.jsx(SR,{asChild:!0,children:E.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:E.jsx(uB,{className:"h-3.5 w-3.5",weight:"bold"})})}),E.jsx(ER,{children:E.jsx(kR,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(_=>{const x=_.icon;return E.jsxs("button",{onClick:()=>{_.isDisabled||(_.onClick(),f(!1))},disabled:_.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[x?E.jsx(x,{className:"h-3.5 w-3.5",weight:"bold"}):null,_.label]},_.label)})})})]}):null]})};var uZ=Object.defineProperty,cZ=(t,e)=>uZ(t,"name",{value:e,configurable:!0}),dZ=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"}),fZ=v.forwardRef(cZ(function(e,n){return E.jsx(xn.span,{...e,ref:n,style:{...dZ,...e.style}})},"VisuallyHidden")),hZ=fZ,pZ=Object.defineProperty,Hn=(t,e)=>pZ(t,"name",{value:e,configurable:!0}),[cw,ate]=Oi("Tooltip",[H0]),dw=H0(),mZ="TooltipProvider",vZ=700,o2="tooltip.open",[gZ,fw]=cw(mZ),yZ=Hn(t=>{const{__scopeTooltip:e,delayDuration:n=vZ,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)},[]),E.jsx(gZ,{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"),a2="Tooltip",[_Z,qf]=cw(a2),xZ=Hn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=t,c=fw(a2,t.__scopeTooltip),d=dw(e),[f,p]=v.useState(null),[m,_]=v.useState(void 0),x=oa(),y=v.useRef(0),w=a??c.disableHoverableContent,S=u??c.delayDuration,C=v.useRef(!1),[P,T]=wa({prop:r,defaultProp:s??!1,onChange:Hn(D=>{D?(c.onOpen(),document.dispatchEvent(new CustomEvent(o2))):c.onClose(),i==null||i(D)},"onChange"),caller:a2}),I=v.useMemo(()=>P?C.current?"delayed-open":"instant-open":"closed",[P]),A=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,T(!0)},[T]),O=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T(!1)},[T]),R=v.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,T(!0),y.current=0},S)},[S,T]);v.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const L=m??x;return E.jsx(vR,{...d,children:E.jsx(_Z,{scope:e,contentId:L,setContentId:_,open:P,stateAttribute:I,trigger:f,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?R():A()},[c.isOpenDelayedRef,R,A]),onTriggerLeave:v.useCallback(()=>{w?O():(window.clearTimeout(y.current),y.current=0)},[O,w]),onOpen:A,onClose:O,disableHoverableContent:w,children:n})})},"Tooltip"),GC="TooltipTrigger",wZ=v.forwardRef(Hn(function(e,n){const{__scopeTooltip:r,...s}=e,i=qf(GC,r),a=fw(GC,r),u=dw(r),c=v.useRef(null),d=Bt(n,c,i.onTriggerChange),f=v.useRef(!1),p=v.useRef(!1),m=v.useCallback(()=>f.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),E.jsx(gR,{asChild:!0,...u,children:E.jsx(xn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:zt(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:zt(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:zt(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:zt(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:zt(e.onBlur,i.onClose),onClick:zt(e.onClick,i.onClose)})})},"TooltipTrigger")),PR="TooltipPortal",[bZ,SZ]=cw(PR,{forceMount:void 0}),EZ=Hn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=qf(PR,e);return E.jsx(bZ,{scope:e,forceMount:n,children:E.jsx(ba,{present:n||i.open,children:E.jsx(Vx,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),xf="TooltipContent",kZ=v.forwardRef(Hn(function(e,n){const r=SZ(xf,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...a}=e,u=qf(xf,e.__scopeTooltip);return E.jsx(ba,{present:s||u.open,children:u.disableHoverableContent?E.jsx(TR,{side:i,...a,ref:n}):E.jsx(CZ,{side:i,...a,ref:n})})},"TooltipContent")),CZ=v.forwardRef(Hn(function(e,n){const r=qf(xf,e.__scopeTooltip),s=fw(xf,e.__scopeTooltip),i=v.useRef(null),a=Bt(n,i),[u,c]=v.useState(null),{trigger:d,onClose:f}=r,p=i.current,{onPointerInTransitChange:m}=s,_=v.useCallback(()=>{c(null),m(!1)},[m]),x=v.useCallback((y,w)=>{const S=y.currentTarget,C={x:y.clientX,y:y.clientY},P=IR(C,S.getBoundingClientRect()),T=RR(C,P),I=AR(w.getBoundingClientRect()),A=LR([...T,...I]);c(A),m(!0)},[m]);return v.useEffect(()=>()=>_(),[_]),v.useEffect(()=>{if(d&&p){const y=Hn(S=>x(S,p),"handleTriggerLeave"),w=Hn(S=>x(S,d),"handleContentLeave");return d.addEventListener("pointerleave",y),p.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",w)}}},[d,p,x,_]),v.useEffect(()=>{if(u){const y=Hn(w=>{const S=w.target,C={x:w.clientX,y:w.clientY},P=(d==null?void 0:d.contains(S))||(p==null?void 0:p.contains(S)),T=!MR(C,u);P?_():T&&(_(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[d,p,u,f,_]),E.jsx(TR,{...e,ref:a})},"TooltipContentHoverable")),PZ=_5("TooltipContent"),TR=v.forwardRef(Hn(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:a,onEscapeKeyDown:u,onPointerDownOutside:c,...d}=e,f=qf(xf,r),p=dw(r),{onClose:m}=f;v.useEffect(()=>(document.addEventListener(o2,m),()=>document.removeEventListener(o2,m)),[m]),v.useEffect(()=>{if(f.trigger){const x=Hn(y=>{y.target instanceof Node&&y.target.contains(f.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[f.trigger,m]);const{setContentId:_}=f;return zr(()=>(_(a),()=>{_(void 0)}),[a,_]),E.jsx(Nx,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:E.jsxs(yR,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...p,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[E.jsx(PZ,{children:s}),i?E.jsx(hZ,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function IR(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")}}Hn(IR,"getExitSideFromRect");function RR(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}Hn(RR,"getPaddedExitPoints");function AR(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}]}Hn(AR,"getPointsFromRect");function MR(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,f=u.y,p=c.x,m=c.y;f>r!=m>r&&n<(p-d)*(r-f)/(m-f)+d&&(s=!s)}return s}Hn(MR,"isPointInPolygon");function LR(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),OR(e)}Hn(LR,"getHull");function OR(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)}Hn(OR,"getHullPresorted");var TZ=yZ,IZ=xZ,RZ=wZ,AZ=EZ,MZ=kZ;const Wd={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},DR={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"}},NR=v.createContext(null);function U0(){const t=v.useContext(NR);return t?t.classes:DR.pill}function LZ(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function OZ({children:t,defaultShape:e="pill"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{LZ(()=>r(i))},[]);return E.jsx(NR.Provider,{value:{shape:n,setShape:s,classes:DR[n]},children:t})}const jR=v.createContext(null);function FR({value:t,children:e}){return E.jsx(jR.Provider,{value:t,children:e})}function DZ(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function hw({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),f=a!==void 0?a:c,[p,m]=v.useState(!1),_=U0(),x=v.useContext(jR);v.useEffect(()=>{f&&m(!0)},[f]);const y=()=>{f||m(!1)},w=DZ(n);return E.jsx(TZ,{delayDuration:s,children:E.jsxs(IZ,{open:f,onOpenChange:S=>{d(S),u==null||u(S)},children:[E.jsx(RZ,{asChild:!0,children:e}),p&&E.jsx(AZ,{forceMount:!0,container:x??void 0,children:E.jsx(MZ,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:E.jsx(ho.div,{className:cr("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",_.bg,i),style:{fontVariationSettings:Wd.medium},initial:{opacity:0,scale:.8,...w},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:y,children:t})})})]})})}const Ys=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:a})=>i?E.jsx(E.Fragment,{children:e}):E.jsx(hw,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),B0="/__rivet/preview",KC=`${B0}/variant/`,YC=`${B0}/history/`,VR=t=>t?t.startsWith("/")?t:`/${t}`:"/",NZ=t=>`${B0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${VR(t.routePath)}`,jZ=t=>`${B0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${VR(t.routePath)}`,FZ=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(KC)||e.pathname.startsWith(YC)}catch{return t.startsWith(KC)||t.startsWith(YC)}},XC=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")?NZ({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},QC="/rivet/",$R=t=>{if(!t.startsWith(QC))return null;const e=t.slice(QC.length);return!e||e==="/"?null:`/${e}`},wf=(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(()=>{})},VZ=(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),wf(r,e))}},c0=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},JC=6,HR="original",pw="Original",zR="The original state of your app before any variants were generated.",e8=200,$Z=[.33,1,.68,1],HZ=.22,gn=Ls("AgentVariantsPanel"),U1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},yu=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},zZ=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function B1(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const UZ=(t,e)=>{if(t.kind==="original")return null;const n=t.kind==="active"?t.variant.runLabel:t.entry.runLabel,r=n==null?void 0:n.trim();return r?t.kind==="active"?e?{label:r,run:t.variant.requestId?{sessionId:e,requestId:t.variant.requestId}:{sessionId:e,runLabel:r}}:null:{label:r,run:t.entry.requestId?{sessionId:t.entry.sessionId,requestId:t.entry.requestId}:{sessionId:t.entry.sessionId,runLabel:r}}:null},UR=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},BZ="original";function BR(t){return`rivet:collapsedRuns:${t}`}function Np(t){try{const e=window.localStorage.getItem(BR(t)),n=e?JSON.parse(e):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function W1(t,e){try{window.localStorage.setItem(BR(t),JSON.stringify([...e]))}catch{}}const t8=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=UZ(s,e);let a="";s.kind==="original"?a=BZ:i&&(a=UR(i.run));let u=r.get(a);u||(u={key:a,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(a,u),n.push(u)),u.rows.push(s)}return n};async function hi(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 WZ=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},qd=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")},WR=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},qZ=t=>t.status==="succeeded"&&!qd(t)&&(!t.previewUnavailable||WR(t)),q1=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"},n8=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},ZZ=t=>{var e;return WZ(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},r8=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),GZ=(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.requestId===s.requestId&&n.label===s.label&&n.brief===s.brief&&n.runLabel===s.runLabel&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((a=s.serve)==null?void 0:a.kind)&&n.hasTree===s.hasTree}),KZ=()=>{var sh,ih,Hl,Dc;const t=tt(Bf),e=tt(KI),n=tt(YI),r=tt(Wf),s=tt(r2),i=((sh=s.deployPrototype)==null?void 0:sh.isEnabled)??!1,a=((ih=s.canvasShare)==null?void 0:ih.isEnabled)??!1,u=((Hl=s.variantSend)==null?void 0:Hl.isEnabled)??!1,c=((Dc=s.designContextViewer)==null?void 0:Dc.isEnabled)??!1,d=tt(QI),f=tt(JI),p=at(Q_),m=at(i0),_=at(J_),x=at(e2),y=at(ZI),w=at(GI),S=at(vf),C=at(Qx),P=at(BI);v.useEffect(()=>(P("Directions"),()=>P(null)),[P]);const T=tt(yo),I=at(yo),A=v.useCallback((V=!1)=>{if(VZ(T),I(null),V&&T){const ie=c0("ended",T);Ee.capture(ie.event,ie.properties)}},[I,T]),O=tt(t2),R=at(t2),L=tt(n2),D=at(n2),j=L?`${L.sessionId}:${L.variantId}`:null,[F,Z]=v.useState(""),[Q,K]=v.useReducer(V=>V+1,0),q=v.useMemo(()=>n!==null?Np(n):new Set,[n,Q]),W=v.useCallback(V=>{if(n===null)return;const ie=new Set(Np(n));ie.delete(V)||ie.add(V),W1(n,ie),K()},[n]),[H,X]=v.useState(null),[z,N]=v.useState(null),[Y,oe]=v.useState(!1),[J,se]=v.useState({}),[pe,Se]=v.useState(null),[ce,ae]=v.useState({}),[$e,We]=v.useState(null),[He,Fe]=v.useState([]),ct=v.useRef([]);ct.current=He;const[Gt,rt]=v.useState(!1),Ve=v.useRef(!1);Ve.current=L!==null||O!==null||Gt;const Oe=v.useMemo(()=>t.active?t.variants:[],[t]),Je=v.useMemo(()=>Oe.filter(ZZ),[Oe]),kt=v.useMemo(()=>r8(Je,J),[Je,J]),vt=(pe==null?void 0:pe.key)===kt?pe.shareUrl:null,xe=t.active?t.sessionId:null,sn=v.useMemo(()=>{const V=new Set;for(const ie of Oe)ie.adoptedSource&&V.add(`${ie.adoptedSource.sessionId}:${ie.adoptedSource.variantId}`);return V},[Oe]),Ot=v.useMemo(()=>[...He.filter(ie=>ie.sessionId!==xe&&!sn.has(`${ie.sessionId}:${ie.variantId}`))].sort((ie,ke)=>{const he=new Date(ie.createdAt).getTime(),le=new Date(ke.createdAt).getTime();return(Number.isNaN(le)?0:le)-(Number.isNaN(he)?0:he)}),[sn,He,xe]),Kr=v.useMemo(()=>L?Oe.find(V=>{var ie,ke;return((ie=V.adoptedSource)==null?void 0:ie.sessionId)===L.sessionId&&((ke=V.adoptedSource)==null?void 0:ke.variantId)===L.variantId})??null:null,[L,Oe]),Pa=v.useMemo(()=>L?Ot.find(V=>V.sessionId===L.sessionId&&V.variantId===L.variantId)??null:null,[L,Ot]),on=t.active?t.projectContext:null,wn=(on==null?void 0:on.kind)==="fresh"?on.workspacePath:n,Ta=!t.active&&Ot.length>0&&Ot.every(V=>V.projectKind==="fresh"),fr=t.active?zZ(on):!!n&&!Ta,an=v.useMemo(()=>wn?`?projectPath=${encodeURIComponent(wn)}`:"",[wn]),Eo=v.useRef(null),Un=v.useRef(null),ti=typeof window>"u"?"/":$R(window.location.pathname)??"/",hs=v.useRef(null),ps=v.useRef(!1),ko=v.useCallback((V,ie)=>{ie.button!==0&&ie.pointerType==="mouse"||(ie.preventDefault(),U1(),hs.current={kind:"live",variantId:V,startX:ie.clientX,startY:ie.clientY,committed:!1})},[]),er=v.useCallback((V,ie)=>{ie.button!==0&&ie.pointerType==="mouse"||(ie.preventDefault(),U1(),hs.current={kind:"past",entry:V,startX:ie.clientX,startY:ie.clientY,committed:!1})},[]);v.useEffect(()=>{const V=he=>{const le=hs.current;if(!le)return;const ye=he.clientX-le.startX,qe=he.clientY-le.startY;if(!le.committed){if(ye*ye+qe*qe<JC*JC)return;if(U1(),le.kind==="live"){const De=Oe.find(Sn=>Sn.workItemId===le.variantId);if(!De||De.status!=="succeeded"){hs.current=null;return}const Xt=XC({sessionId:xe,variant:De,projectContext:on,routePath:ti});S({sessionId:xe??"",variantId:De.workItemId,label:De.label||"Direction",url:Xt,source:"live",runLabel:De.runLabel,description:De.description})}else{const{entry:De}=le,Xt=yu(De),Sn=Xt?jZ({sessionId:De.sessionId,variantId:De.variantId,routePath:ti}):`/api/variants/history/${encodeURIComponent(De.sessionId)}/${encodeURIComponent(De.variantId)}/preview${an}`;if(S({sessionId:De.sessionId,variantId:De.variantId,label:De.label||"Direction",url:Sn,source:Xt?"history-dev-server":"history-static",runLabel:De.runLabel,description:De.brief}),Xt){const Ir=n8(`/api/variants/history/${encodeURIComponent(De.sessionId)}/${encodeURIComponent(De.variantId)}/run${an}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Ir,{method:"POST"})).ok)return;const pr=n8(Sn,"replay",String(Date.now()));S(Ye=>!Ye||Ye.sessionId!==De.sessionId||Ye.variantId!==De.variantId||Ye.source!=="history-dev-server"?Ye:{...Ye,url:pr}),I(Ye=>{if(!Ye)return Ye;const Ct=Rr=>!Rr||Rr.sessionId!==De.sessionId||Rr.variantId!==De.variantId?Rr:{...Rr,url:pr};return{...Ye,left:Ct(Ye.left),right:Ct(Ye.right)}})}catch(gs){gn.warn("history replay drag boot failed",gs)}})()}}le.committed=!0}C({x:he.clientX,y:he.clientY})},ie=()=>{const he=hs.current;he!=null&&he.committed&&(ps.current=!0),hs.current=null,C(null)},ke=he=>{if(he.key!=="Escape")return;const le=hs.current;le!=null&&le.committed&&(le.kind==="past"&&yu(le.entry)&&wf({sessionId:le.entry.sessionId,variantId:le.entry.variantId,source:"history-dev-server"}),hs.current=null,S(null),C(null))};return window.addEventListener("pointermove",V),window.addEventListener("pointerup",ie),window.addEventListener("pointercancel",ie),window.addEventListener("keydown",ke),()=>{window.removeEventListener("pointermove",V),window.removeEventListener("pointerup",ie),window.removeEventListener("pointercancel",ie),window.removeEventListener("keydown",ke)}},[Oe,xe,on,ti,an,S,C,I]);const On=v.useMemo(()=>{var ie;if(Gt||j)return null;const V=O?Oe.find(ke=>ke.workItemId===O):null;return O&&!V?null:V?qd(V)?V.workItemId:null:t.active?((ie=Oe.find(ke=>{var he,le;return qd(ke)&&(((he=ke.preview)==null?void 0:he.kind)==="static_artifact"||((le=ke.preview)==null?void 0:le.kind)==="dev_server")}))==null?void 0:ie.workItemId)??null:null},[O,j,Gt,t,Oe]),Os=Gt||fr&&O===null&&j===null&&On===null,bn=v.useCallback(async V=>{var ke,he,le,ye;if(!xe)return;const ie=(V==null?void 0:V.workItemId)??null;X({kind:"switch",variantId:ie??void 0});try{if(((ke=V==null?void 0:V.preview)==null?void 0:ke.kind)==="static_artifact"){if(_(!1),x(null),((he=V.refinement)==null?void 0:he.status)==="succeeded"){const De=V.preview.url.includes("?")?"&":"?";m(`${V.preview.url}${De}refinement=${encodeURIComponent(V.refinement.workItemId)}`)}else m(V.preview.url);p(De=>De+1);return}if(ie&&xe&&t.active&&t.projectContext.kind==="fresh"&&((le=t.projectContext.executionPlan)==null?void 0:le.mode)!=="vite_app"&&((ye=V==null?void 0:V.preview)==null?void 0:ye.kind)!=="dev_server"){_(!1),x(null),m(`/api/variants/${xe}/static/${ie}`),p(De=>De+1);return}const qe=V&&ie?XC({sessionId:xe,variant:V,projectContext:t.active?t.projectContext:null,routePath:ti}):null;if(qe){_(!1),x(null),m(qe),p(De=>De+1);return}Ee.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:ie,previewKind:V?q1(V):"none",hasPreview:!!(V!=null&&V.preview),hasPort:typeof(V==null?void 0:V.port)=="number",errorMessage:"No addressable dev-server preview URL"}),_(!1),x(null)}catch(qe){gn.warn("preview display failed",qe),Ee.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:ie,previewKind:V?q1(V):"none",hasPreview:!!(V!=null&&V.preview),hasPort:typeof(V==null?void 0:V.port)=="number",errorMessage:qe instanceof Error?qe.message:String(qe)}),_(!1),x(null)}finally{X(null)}},[xe,t,ti,p,m,_,x]),Cr=v.useRef(!1),Ni=v.useRef(null),ni=v.useRef(0),ms=v.useCallback(()=>{if(ni.current++,y(!1),w(!1),!Cr.current)return;const V=Ni.current;Cr.current=!1,Ni.current=null;const ie=V?new URLSearchParams({sessionId:V.sessionId,variantId:V.variantId}):null,ke=ie?`/api/variants/history/replay/stop?${ie.toString()}`:"/api/variants/history/replay/stop";fetch(ke,{method:"POST"}).catch(he=>gn.warn("history replay stop failed",he))},[y,w]),Ze=v.useCallback(async V=>{if(xe){X({kind:"switch",variantId:V.workItemId});try{const ie=await fetch(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:V.workItemId})});if(!ie.ok){const ke=await hi(ie);throw new Error(ke.message??`Preview restoration failed (${ie.status})`)}}catch(ie){gn.warn("preview restoration failed",ie),Ee.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:V.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:ie instanceof Error?ie.message:String(ie)})}finally{X(null)}}},[xe]),Dt=v.useCallback(V=>{var ye,qe,De,Xt,Sn;if(ps.current){ps.current=!1;return}const ie=qd(V),ke=V.status==="pending"||V.status==="running"||qZ(V);ms();const he=q1(V),le=Oe.find(Ir=>Ir.workItemId===O);Ee.capture("variants_panel.preview_requested",{sessionId:xe,fromVariantId:le==null?void 0:le.workItemId,toVariantId:V.workItemId,variantStatus:V.status,isPreviewReady:ie,isArmed:ke,previewKind:he,hasPreview:!!V.preview,hasPort:typeof V.port=="number",viewEnabled:((qe=(ye=V.actions)==null?void 0:ye.view)==null?void 0:qe.enabled)??null,previewUnavailableReason:((De=V.previewUnavailable)==null?void 0:De.reason)??null}),R(V.workItemId),D(null),ie?(Un.current=V.workItemId,rt(!1),A(!0),bn(V)):(Un.current=null,rt(!1),m(null),_(!1),ke&&Ee.capture("variants_panel.preview_armed",{sessionId:xe,fromVariantId:le==null?void 0:le.workItemId,toVariantId:V.workItemId,variantStatus:V.status,previewKind:he,hasPreview:!!V.preview,hasPort:typeof V.port=="number",viewEnabled:((Sn=(Xt=V.actions)==null?void 0:Xt.view)==null?void 0:Sn.enabled)??null}),WR(V)&&Ze(V)),Ee.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:le==null?void 0:le.workItemId,toVariantId:V.workItemId,armed:ke})},[O,xe,A,R,D,ms,Ze,bn,Oe,m,_]),Kt=t.active?`${t.sessionId}:${t.stage}`:"inactive",mn=v.useRef(!1);v.useEffect(()=>{if(r)return;let V=!1;return(async()=>{try{const ie=await fetch(`/api/variants/history${an}`,{credentials:"same-origin"});if(!ie.ok)return;const ke=await ie.json();if(V)return;const he=(ke.variants??[]).filter(le=>{var ye,qe;return((ye=le.preview)==null?void 0:ye.kind)==="static"||((qe=le.serve)==null?void 0:qe.kind)==="static"||yu(le)});if(!mn.current&&!Ve.current&&Kt==="inactive"&&he.length>0&&he.every(le=>le.projectKind==="fresh")){const le=[...he].sort((ye,qe)=>new Date(qe.createdAt).getTime()-new Date(ye.createdAt).getTime()).find(ye=>!yu(ye));le&&(mn.current=!0,D({sessionId:le.sessionId,variantId:le.variantId,previewKind:"static"}),rt(!1),m(`/api/variants/history/${encodeURIComponent(le.sessionId)}/${encodeURIComponent(le.variantId)}/preview${an}`))}if(GZ(ct.current,he))return;ct.current=he,Fe(he)}catch(ie){gn.warn("Failed to load past variants",ie)}})(),()=>{V=!0}},[r,Kt,an]);const hr=v.useCallback(()=>{Cr.current=!1,Ni.current=null,y(!1),w(!1),D(null),R(null),rt(!0),_(!1),x(null),m(null),p(V=>V+1)},[R,y,w,p,m,x,D,_]),Ft=v.useCallback(V=>{if(ps.current){ps.current=!1;return}if(A(!0),D({sessionId:V.sessionId,variantId:V.variantId,previewKind:yu(V)?"dev_server":"static"}),R(null),rt(!1),yu(V)){const ie=++ni.current;Cr.current=!0,Ni.current={sessionId:V.sessionId,variantId:V.variantId},y(!0),w(!0),(async()=>{X({kind:"switch"}),Ee.capture("variants_panel.history_replay_started",{sessionId:V.sessionId,variantId:V.variantId});const ke=he=>Ee.capture("variants_panel.history_replay_failed",{sessionId:V.sessionId,variantId:V.variantId,...he});try{const he=await fetch(`/api/variants/history/${encodeURIComponent(V.sessionId)}/${encodeURIComponent(V.variantId)}/run${an}`,{method:"POST"});if(ie!==ni.current)return;if(!he.ok){const{errorCode:le}=await hi(he);gn.warn(`history replay failed: HTTP ${he.status} ${le??""}`),ke({httpStatus:he.status,errorCode:le}),hr();return}w(!1),_(!0),x(null),m(null),p(le=>le+1),Ee.capture("variants_panel.history_replay_ready",{sessionId:V.sessionId,variantId:V.variantId})}catch(he){if(ie!==ni.current)return;gn.warn("history replay failed",he),ke({errorMessage:he instanceof Error?he.message:String(he)}),hr()}finally{X(null)}})();return}ms(),_(!1),x(null),m(`/api/variants/history/${encodeURIComponent(V.sessionId)}/${encodeURIComponent(V.variantId)}/preview${an}`)},[hr,X,y,w,p,D,R,m,x,A,_,ms,an]),ln=v.useCallback(async()=>{ms();const V=()=>{A(!0),R(null),D(null),rt(!0),Un.current=null,_(!1),x(null),m(null),p(ie=>ie+1)};if(!xe){V();return}X({kind:"switch"});try{const ie=await fetch(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!ie.ok){gn.warn(`switch to original failed: HTTP ${ie.status}`);return}V(),_(!0),Ee.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:O,toVariantId:null,target:"original",armed:!1})}catch(ie){gn.warn("preview-port original switch failed",ie)}finally{X(null)}},[O,xe,R,D,p,m,x,A,_,ms]),Pr=v.useCallback(async V=>{var ke,he;const ie=((he=(ke=V.actions)==null?void 0:ke.commit)==null?void 0:he.enabled)??V.status==="succeeded";if(!(!xe||!ie)){Ee.capture("variants_panel.commit_clicked",{sessionId:xe,variantId:V.workItemId,variantLabel:V.label}),X({kind:"commit",variantId:V.workItemId});try{const le=await fetch(`/api/variants/${xe}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:V.workItemId})});if(!le.ok){const{message:qe,errorCode:De}=await hi(le);gn.warn(`commit failed: HTTP ${le.status} ${De??""} ${qe??""}`),Ee.capture("variants_panel.commit_failed",{sessionId:xe,variantId:V.workItemId,httpStatus:le.status,errorCode:De??null,errorMessage:qe??null}),mt.error("Couldn't send direction",{description:qe??`The server rejected the request (HTTP ${le.status}). Try again, or pick a different direction.`});return}const ye=await le.json().catch(()=>null);Ee.capture("variants_panel.commit_succeeded",{sessionId:xe,variantId:V.workItemId,payloadKind:(ye==null?void 0:ye.payloadKind)??null,duplicate:(ye==null?void 0:ye.duplicate)??!1}),mt.success(`Sent "${V.label}" to your project`,{description:(ye==null?void 0:ye.payloadKind)==="project-created"?`Project created at ${(ye==null?void 0:ye.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(ye==null?void 0:ye.payloadKind)!=="project-created"&&(m(null),_(!1),p(qe=>qe+1))}catch(le){gn.warn("commit failed",le),Ee.capture("variants_panel.commit_failed",{sessionId:xe,variantId:V.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:le instanceof Error?le.message:String(le)}),mt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{X(null)}}},[xe,p,m,_]),Tr=v.useCallback(async(V,ie,ke)=>{Ee.capture("variants_panel.deploy_clicked",{sessionId:V,variantId:ie,variantLabel:ke});try{const he=await fetch(`/api/variants/${V}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:ie,...n?{projectPath:n}:{}})});if(!he.ok){const{message:qe,errorCode:De}=await hi(he);return gn.warn(`deploy failed: HTTP ${he.status} ${De??""} ${qe??""}`),Ee.capture("variants_panel.deploy_failed",{sessionId:V,variantId:ie,httpStatus:he.status,errorCode:De??null,errorMessage:qe??null}),mt.error("Couldn't deploy this direction",{description:qe??`The server rejected the request (HTTP ${he.status}). Try again.`}),null}const le=await he.json().catch(()=>null),ye=le==null?void 0:le.shareUrl;return ye?(await navigator.clipboard.writeText(ye).catch(()=>{}),Ee.capture("variants_panel.deploy_succeeded",{sessionId:V,variantId:ie}),mt.success(`"${ke}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(ye,"_blank","noopener")}}),ye):(mt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(he){return gn.warn("deploy failed",he),Ee.capture("variants_panel.deploy_failed",{sessionId:V,variantId:ie,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),mt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),Bn=v.useCallback(async V=>{if(!xe)return;const ie=J[V.workItemId];if(ie){await navigator.clipboard.writeText(ie).catch(()=>{}),mt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ie,"_blank","noopener")}});return}X({kind:"deploy",variantId:V.workItemId});try{const ke=await Tr(xe,V.workItemId,V.label);ke&&se(he=>({...he,[V.workItemId]:ke}))}finally{X(null)}},[xe,J,Tr]),ri=v.useCallback(async()=>{if(!(!xe||Je.length===0)){if(vt){await navigator.clipboard.writeText(vt).catch(()=>{}),mt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(vt,"_blank","noopener")}});return}Ee.capture("variants_panel.deploy_clicked",{sessionId:xe,variantId:"canvas",variantLabel:"Canvas",variantCount:Je.length}),X({kind:"deploy-canvas"});try{const V=await fetch(`/api/variants/${xe}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Je.map(ye=>ye.workItemId),...n?{projectPath:n}:{}})});if(!V.ok){const{message:ye,errorCode:qe}=await hi(V);gn.warn(`canvas deploy failed: HTTP ${V.status} ${qe??""} ${ye??""}`),Ee.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:V.status,errorCode:qe??null,errorMessage:ye??null,variantCount:Je.length}),mt.error("Couldn't share this canvas",{description:ye??`The server rejected the request (HTTP ${V.status}). Try again.`});return}const ie=await V.json().catch(()=>null),ke=ie==null?void 0:ie.shareUrl;if(!ke){mt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const he=Object.fromEntries(((ie==null?void 0:ie.variants)??[]).filter(ye=>typeof ye.variantId=="string"&&typeof ye.shareUrl=="string").map(ye=>[ye.variantId,ye.shareUrl])),le=Object.keys(he).length>0?{...J,...he}:J;le!==J&&se(le),await navigator.clipboard.writeText(ke).catch(()=>{}),Se({key:r8(Je,le),shareUrl:ke}),Ee.capture("variants_panel.deploy_succeeded",{sessionId:xe,variantId:"canvas",variantCount:Je.length}),mt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}})}catch(V){gn.warn("canvas deploy failed",V),Ee.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:V instanceof Error?V.message:String(V),variantCount:Je.length}),mt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{X(null)}}},[vt,Je,J,n,xe]),Pc=v.useCallback(async V=>{const ie=`${V.sessionId}:${V.variantId}`,ke=ce[ie];if(ke){await navigator.clipboard.writeText(ke).catch(()=>{}),mt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}});return}We(ie);try{const he=await Tr(V.sessionId,V.variantId,V.label);he&&ae(le=>({...le,[ie]:he}))}finally{We(null)}},[ce,Tr]),Tc=v.useCallback(async V=>{if(xe){Ee.capture("variants_panel.remove_clicked",{sessionId:xe,variantId:V.workItemId,variantLabelLength:V.label.length}),X({kind:"remove",variantId:V.workItemId});try{const ie=await fetch(`/api/variants/${xe}/${V.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!ie.ok){const{message:ke}=await hi(ie);gn.warn(`remove failed: HTTP ${ie.status} ${ke??""}`),mt.error("Couldn't remove direction",{description:ke??`The server rejected the request (HTTP ${ie.status}). Try again.`});return}(V.workItemId===On||V.workItemId===O)&&(R(null),m(null),_(!1),p(ke=>ke+1))}catch(ie){gn.warn("remove failed",ie),mt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{X(null)}}},[xe,O,On,R,m,_,p]),Ic=v.useCallback(async V=>{if(!wn){mt.error("Couldn't remove direction",{description:"No project path available."});return}Ee.capture("variants_panel.remove_past_clicked",{sessionId:V.sessionId,variantId:V.variantId});const ie=`${V.sessionId}:${V.variantId}`,ke=he=>he.sessionId===V.sessionId&&he.variantId===V.variantId;X({kind:"remove",variantId:ie}),Fe(he=>he.filter(le=>!ke(le))),j===ie&&(D(null),m(null),_(!1),p(he=>he+1));try{const he=await fetch(`/api/variants/history/${encodeURIComponent(V.sessionId)}/${encodeURIComponent(V.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:wn})});if(!he.ok){const{message:le}=await hi(he);Fe(ye=>ye.some(ke)?ye:[...ye,V]),mt.error("Couldn't remove direction",{description:le??`The server rejected the request (HTTP ${he.status}). Try again.`})}}catch(he){gn.warn("remove past failed",he),Fe(le=>le.some(ke)?le:[...le,V]),mt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{X(null)}},[wn,j,D,m,_,p]),Xf=v.useCallback(V=>{N(V)},[]),ji=v.useCallback(V=>{if(!V.label||!V.run)return;const ie=V.rows.flatMap(he=>he.kind==="active"?[he.variant]:[]),ke=V.rows.flatMap(he=>he.kind==="past"?[he.entry]:[]);ie.length===0&&ke.length===0||N({kind:"run",label:V.label,variants:ie,entries:ke})},[]),Qf=v.useCallback(async()=>{if(!(!z||Y)){oe(!0);try{if(z.kind==="active")await Tc(z.variant);else if(z.kind==="past")await Ic(z.entry);else{for(const V of z.variants)await Tc(V);for(const V of z.entries)await Ic(V)}}finally{oe(!1),N(null)}}},[z,Y,Tc,Ic]),[Rc,Q0]=v.useState(null),[Jf,jl]=v.useState(null),eh=v.useCallback(V=>{jl(V)},[]),th=v.useCallback(()=>{jl(null)},[]),J0=v.useCallback(async V=>{const ie=V.trim();if(ie)try{await navigator.clipboard.writeText(ie),mt.success("Copied")}catch{mt.error("Couldn't copy")}},[]),ev=v.useCallback(async(V,ie)=>{jl(null);const ke=ie.trim();if(!ke||V.kind==="original")return;if(V.kind==="active"){if(!xe||ke===V.variant.label)return;Ee.capture("variants_panel.rename",{sessionId:xe,variantId:V.variant.workItemId,labelLength:ke.length,past:!1});try{const ye=await fetch(`/api/variants/${xe}/${V.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:ke})});if(!ye.ok){const{message:qe}=await hi(ye);mt.error("Couldn't rename direction",{description:qe??`The server rejected the request (HTTP ${ye.status}). Try again.`})}}catch(ye){gn.warn("rename failed",ye),mt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:he}=V;if(ke===he.label.trim())return;if(!wn){mt.error("Couldn't rename direction",{description:"No project path available."});return}Ee.capture("variants_panel.rename",{sessionId:he.sessionId,variantId:he.variantId,labelLength:ke.length,past:!0});const le=ye=>ye.sessionId===he.sessionId&&ye.variantId===he.variantId;Fe(ye=>ye.map(qe=>le(qe)?{...qe,label:ke}:qe));try{const ye=await fetch(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:ke,projectPath:wn})});if(!ye.ok){const{message:qe}=await hi(ye);Fe(De=>De.map(Xt=>le(Xt)?{...Xt,label:he.label}:Xt)),mt.error("Couldn't rename direction",{description:qe??`The server rejected the request (HTTP ${ye.status}). Try again.`})}}catch(ye){gn.warn("rename failed",ye),Fe(qe=>qe.map(De=>le(De)?{...De,label:he.label}:De)),mt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[xe,wn]),[Yt,Ac]=v.useState(null),Mc=v.useCallback(V=>{Ac(V)},[]),nh=v.useCallback(()=>{Ac(null)},[]),Fl=v.useCallback(async(V,ie)=>{if(Ac(null),!V.label||!V.run)return;const ke=V.label,he=ie.trim();if(!he||he===ke)return;Ee.capture("variants_panel.rename_run",{runLabelLength:he.length});const le="requestId"in V.run?V.run.requestId:void 0,ye=le?V.key:UR({sessionId:V.run.sessionId,runLabel:he}),qe=ye!==V.key;let De=!1,Xt=!1;if(n!==null&&qe){const Ye=Np(n);De=Ye.has(V.key),Xt=Ye.has(ye),De&&(Ye.add(ye),W1(n,Ye),K())}const Sn=Ye=>{if(n===null||!qe)return;const Ct=Np(n);Ye?Ct.delete(V.key):(De?Ct.add(V.key):Ct.delete(V.key),Xt?Ct.add(ye):Ct.delete(ye)),W1(n,Ct),K()},Ir=new Set(V.rows.flatMap(Ye=>Ye.kind==="past"?[`${Ye.entry.sessionId}:${Ye.entry.variantId}`]:[])),gs=Ye=>Ir.has(`${Ye.sessionId}:${Ye.variantId}`);Fe(Ye=>Ye.map(Ct=>gs(Ct)?{...Ct,runLabel:he}:Ct));const pr=()=>Fe(Ye=>Ye.map(Ct=>gs(Ct)?{...Ct,runLabel:ke}:Ct));try{const Ye=await fetch("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:V.run.sessionId,...le?{requestId:le}:{},runLabel:ke,label:he,...wn?{projectPath:wn}:{}})});if(Ye.ok)Sn(!0);else{const{message:Ct}=await hi(Ye);pr(),Sn(!1),mt.error("Couldn't rename run",{description:Ct??`The server rejected the request (HTTP ${Ye.status}). Try again.`})}}catch(Ye){gn.warn("run rename failed",Ye),pr(),Sn(!1),mt.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[wn,n,Fe]);v.useEffect(()=>{if(Eo.current!==xe){const ie=Eo.current===null;if(Eo.current=xe,Un.current=null,Se(null),m(null),_(!1),x(null),A(),R(null),D(null),rt(!1),mn.current=!1,!ie)return}if(j||Gt||!On||t.active!==!0||Un.current===On)return;const V=Oe.find(ie=>ie.workItemId===On);V&&(Un.current=On,A(),bn(V))},[xe,j,Gt,On,t,Oe,bn,A,R,D,m,x,_]),v.useEffect(()=>{!L||!Kr||(Un.current=null,D(null),R(Kr.workItemId),rt(!1))},[Kr,L,xe,R,D]),v.useEffect(()=>{!L||Kr||Pa||D(null)},[Kr,L,Pa,xe,D,Ot]),v.useEffect(()=>{const V=F.trim().toLowerCase(),ie=[...Oe.map(ye=>({kind:"active",variant:ye})),...Ot.map(ye=>({kind:"past",entry:ye})),...fr?[{kind:"original"}]:[]],ke=V?ie.filter(ye=>s8(ye,V)):ie,he=t8(ke,xe).flatMap(ye=>ye.key!==""&&q.has(ye.key)?[]:ye.rows);if(he.length===0)return;const le=ye=>{if(LW())return;if(ye.key==="Enter"){const pr=Oe.find(Ye=>Ye.workItemId===Rc);pr&&(ye.preventDefault(),Dt(pr));return}if(ye.key!=="ArrowUp"&&ye.key!=="ArrowDown")return;ye.preventDefault();const qe=O??On;let De=qe?`live:${qe}`:null;j?De=`past:${j}`:Os&&(De=HR);const Xt=De?he.findIndex(pr=>l2(pr)===De):-1;let Sn;if(Xt===-1?Sn=ye.key==="ArrowDown"?0:he.length-1:ye.key==="ArrowDown"?Sn=Math.min(Xt+1,he.length-1):Sn=Math.max(Xt-1,0),Sn===Xt)return;const Ir=he[Sn];Ir.kind==="active"?Dt(Ir.variant):Ir.kind==="past"?Ft(Ir.entry):ln();const gs=document.querySelector(`[data-variant-key="${l2(Ir)}"]`);gs instanceof HTMLElement&&gs.focus({preventScroll:!0})};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[Oe,Ot,F,fr,q,xe,O,j,Os,On,Rc,Dt,Ft,ln]);const Lc=Oe.find(V=>V.workItemId===On)??null,Vl=j?Ot.find(V=>`${V.sessionId}:${V.variantId}`===j)??null:null,Ia=!!Vl,vs=t.active?t.artifacts??[]:[],Dn=[...(t.active?Oe:[]).map(V=>({kind:"active",variant:V})),...Ot.map(V=>({kind:"past",entry:V})),...fr?[{kind:"original"}]:[]],rh=F.trim().toLowerCase(),Oc=rh?Dn.filter(V=>s8(V,rh)):Dn,tv=t8(Oc,xe),$l=new Set(Oe.map(V=>V.requestId).filter(Boolean)),Ra=e.filter(V=>!$l.has(V.requestId)),si=Ra.length>0,Co=r&&!si&&Dn.length===0;return E.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[Dn.length>0?E.jsx("div",{className:"px-3 pt-2 pb-1",children:E.jsxs("div",{className:"relative",children:[E.jsx(hB,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),E.jsx("input",{type:"text",value:F,onChange:V=>Z(V.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,E.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[si?E.jsx(dG,{groups:Ra}):null,Co?E.jsx(fG,{}):null,t.active&&Dn.length===0&&!si&&!Co?E.jsx(hG,{}):null,!t.active&&!si&&!Co&&Ot.length===0&&!fr?E.jsx(pG,{isMCPSession:d,mcpEditor:f}):null,Dn.length>0&&Oc.length===0?E.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",F.trim(),"”."]}):null,Oc.length>0?E.jsx(tG,{groups:tv,collapsedRuns:q,onToggleRun:W,activeVariantId:O??On,activePastKey:j,isOriginalSelected:Os,busy:H,editingKey:Jf,onSelectActive:Dt,onSelectPast:Ft,onSelectOriginal:ln,onActivePointerDown:ko,onPastPointerDown:er,onHover:Q0,onRemove:V=>Xf({kind:"active",variant:V}),onRemovePast:V=>Xf({kind:"past",entry:V}),onStartRename:eh,onCommitRename:ev,onCancelRename:th,editingRunKey:Yt,onStartRunRename:Mc,onCommitRunRename:Fl,onCancelRunRename:nh,onRemoveRun:ji,onCopyVariantContext:J0,activeSessionId:t.active?t.sessionId:null,projectPath:wn}):null,t.active&&c?E.jsx(aG,{artifacts:vs}):null]}),Ia&&Vl?E.jsx(sG,{entry:Vl,deploying:$e===j,deployedUrl:j?ce[j]??null:null,onDeploy:Pc,isDeployDisabled:!i}):null,!Ia&&t.active?E.jsx(cG,{selectedVariant:Lc,busy:H,onSend:Pr,onDeploy:Bn,onDeployCanvas:ri,canDeploy:i&&(on==null?void 0:on.kind)==="fresh",canDeployCanvas:i&&a&&(on==null?void 0:on.kind)==="fresh",canSendToAgent:u,canvasVariantCount:Je.length,canvasDeployedUrl:vt,deployedUrl:Lc?J[Lc.workItemId]??null:null}):null,E.jsx(XZ,{target:z,isConfirming:Y,onCancel:()=>N(null),onConfirm:Qf})]})},YZ=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",XZ=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=YZ(t),i=t.kind==="run",a=i?t.variants.length+t.entries.length:0,u=i?"Remove run":"Remove direction";return E.jsx(Ux,{open:!0,onOpenChange:c=>{!c&&!e&&n()},children:E.jsxs(Bx,{children:[E.jsx(Wx,{className:"z-max fixed inset-0 bg-black/40"}),E.jsx(qx,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:E.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[E.jsx(Zx,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),E.jsx(Gx,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${a} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),E.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[E.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),E.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":u})]})]})})]})})},l2=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:HR,s8=(t,e)=>t.kind==="active"?B1(e,t.variant.label,t.variant.runLabel):t.kind==="past"?B1(e,t.entry.label,t.entry.runLabel,t.entry.brief):B1(e,pw,zR),QZ=t=>t.length<=e8?t:`${t.slice(0,e8-1)}…`,JZ=(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(`
112
+ `);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(`
113
+ `);return e?`${e}
114
+
115
+ ${s}`:s},tG=({groups:t,collapsedRuns:e,onToggleRun:n,activeVariantId:r,activePastKey:s,isOriginalSelected:i,busy:a,editingKey:u,onSelectActive:c,onSelectPast:d,onSelectOriginal:f,onActivePointerDown:p,onPastPointerDown:m,onHover:_,onRemove:x,onRemovePast:y,onStartRename:w,onCommitRename:S,onCancelRename:C,editingRunKey:P,onStartRunRename:T,onCommitRunRename:I,onCancelRunRename:A,onRemoveRun:O,onCopyVariantContext:R,activeSessionId:L,projectPath:D})=>{const j=v.useRef(null),{activeIndex:F,itemRects:Z,sessionRef:Q,handlers:K,registerItem:q}=jI(j),W=F!==null?Z[F]:null,H=N=>N.kind==="active"?N.variant.workItemId===r:N.kind==="past"?`${N.entry.sessionId}:${N.entry.variantId}`===s:i,X=(N,Y)=>{const oe=l2(N);return E.jsx(rG,{rowKey:oe,row:N,index:Y,isSelected:H(N),isEditing:u===oe,busy:a,registerItem:q,onSelectActive:c,onSelectPast:d,onSelectOriginal:f,onActivePointerDown:p,onPastPointerDown:m,onHover:_,onRemove:x,onRemovePast:y,onStartRename:w,onCommitRename:S,onCancelRename:C,onCopyVariantContext:R,activeSessionId:L,projectPath:D},oe)};let z=0;return E.jsxs("div",{ref:j,className:"relative",onMouseEnter:K.onMouseEnter,onMouseMove:K.onMouseMove,onMouseLeave:K.onMouseLeave,children:[E.jsx(Qs,{children:W&&E.jsx(po.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:W.top,left:W.left,width:W.width,height:W.height},animate:{opacity:1,top:W.top,left:W.left,width:W.width,height:W.height},exit:{opacity:0,transition:{duration:.06}},transition:{...ff.fast,opacity:{duration:.08}}},Q.current)}),E.jsx("ul",{className:"relative flex flex-col gap-2",children:t.map(N=>{if(N.key==="")return N.rows.map(se=>X(se,z++));const Y=e.has(N.key),oe=Y?null:N.rows.map(se=>X(se,z++)),J=N.label;return E.jsx(nG,{label:J??pw,collapsed:Y,onToggle:()=>n(N.key),directionCount:N.rows.length,isEditing:J!==null&&P===N.key,onStartRename:J!==null?()=>T(N.key):void 0,onCommitRename:J!==null?se=>I(N,se):void 0,onCancelRename:A,onRemove:J!==null?()=>O(N):void 0,children:oe},N.key)})})]})},nG=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:a,onCancelRename:u,onRemove:c,children:d})=>{const f=Ff(),p=e?E.jsx(fB,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):E.jsx(dB,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&a&&u?E.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[E.jsxs("div",{className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[p,E.jsx("span",{className:"min-w-0 flex-1",children:E.jsx(qR,{initial:t,onCommit:a,onCancel:u})})]}),E.jsx(Qs,{initial:!1,children:!e&&E.jsx(po.ul,{className:"overflow-hidden",children:d},"body")})]}):E.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button",onClick:()=>{f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[p,E.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),(i||c)&&E.jsxs("div",{className:cr("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:[i&&E.jsx(Ys,{label:"Rename",children:E.jsx("button",{type:"button","aria-label":`Rename ${t} run`,onClick:m=>{m.stopPropagation(),i()},onPointerDown:m=>m.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:E.jsx(fI,{size:13,weight:"bold"})})}),c&&E.jsx(Ys,{label:"Remove",children:E.jsx("button",{type:"button","aria-label":`Remove ${t} run`,onClick:m=>{m.stopPropagation(),c()},onPointerDown:m=>m.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",children:E.jsx(_I,{size:13,weight:"bold"})})})]})]}),E.jsx(Qs,{initial:!1,children:!e&&E.jsx(po.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:HZ,ease:$Z},className:"overflow-hidden",children:d},"body")})]})},rG=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,busy:i,registerItem:a,onSelectActive:u,onSelectPast:c,onSelectOriginal:d,onActivePointerDown:f,onPastPointerDown:p,onHover:m,onRemove:_,onRemovePast:x,onStartRename:y,onCommitRename:w,onCancelRename:S,onCopyVariantContext:C,activeSessionId:P,projectPath:T})=>{var Y,oe;const I=v.useRef(null);lW(a,n,I);const A=e.kind==="active",O=e.kind==="original",R=e.kind==="active"?e.variant:null,L=e.kind==="past"?e.entry:null,D=A?R.status==="succeeded":!0,j=A?qd(R):!0,F=A&&(R.status==="pending"||R.status==="running"),Z=A&&R.status==="failed",Q=A&&R.status==="cancelled",K=A&&(i==null?void 0:i.kind)==="remove"&&i.variantId===R.workItemId,q=A&&(((Y=R.refinement)==null?void 0:Y.status)==="pending"||((oe=R.refinement)==null?void 0:oe.status)==="running");let W=pw;A?W=R.label||`Direction ${n+1}`:L&&(W=L.label.trim()||"Untitled direction");let H=zR;A?H=R.description:L&&(H=L.brief);const X=H?QZ(H):null,z=JZ(e,P),N=z?"Copy variant reference":"Copy description";return s?E.jsx("li",{ref:I,"data-proximity-index":n,className:"group relative z-10",children:E.jsx("div",{className:"bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3 pl-[33px]",children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsx(qR,{initial:W,onCommit:J=>w(e,J),onCancel:S}),X&&E.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:X})]})})}):E.jsxs("li",{ref:I,"data-proximity-index":n,className:"group relative z-10",children:[E.jsx("div",{role:"button",tabIndex:0,"data-variant-id":A?R.workItemId:void 0,"data-variant-key":t,onClick:()=>{const J=window.getSelection();J&&!J.isCollapsed||(e.kind==="active"?u(e.variant):e.kind==="past"?c(e.entry):d())},onKeyDown:J=>{(J.key==="Enter"||J.key===" ")&&(J.preventDefault(),J.stopPropagation(),e.kind==="active"?u(e.variant):e.kind==="past"?c(e.entry):d())},onPointerDown:J=>{e.kind==="active"?j&&f(e.variant.workItemId,J):e.kind==="past"&&p(e.entry,J)},"aria-pressed":r,"aria-disabled":A?!1:void 0,"aria-busy":F||q,onMouseEnter:A?()=>m(R.workItemId):void 0,onMouseLeave:A?()=>m(null):void 0,className:cr("flex w-full items-start gap-2 rounded-md py-2 pr-3 pl-[33px] text-left transition-colors focus:outline-none",r&&"bg-main-input",j&&"cursor-grab active:cursor-grabbing",!j&&"cursor-pointer"),style:j?{touchAction:"none"}:void 0,children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[(F||q)&&E.jsx(Jx,{className:"text-content-muted shrink-0 text-sm","data-testid":q&&!F?"variant-refining":void 0}),E.jsx(Ys,{label:"Double-click to rename",disabled:O,children:E.jsx("span",{onDoubleClick:J=>{J.stopPropagation(),O||y(t)},className:cr("min-w-0 flex-1 truncate text-sm font-medium select-text",O?"cursor-default":"cursor-text",D||r?"text-content":"text-content-muted"),children:W})}),Z&&E.jsx(Ys,{label:R.errorMessage??R.errorCode??"Failed",disabled:!R.errorMessage&&!R.errorCode,children:E.jsx("span",{className:"shrink-0",children:E.jsx(i8,{label:"Failed"})})}),Q&&E.jsx(i8,{label:"Cancelled"})]}),X&&E.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:X})]})}),E.jsxs("div",{className:cr("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:[H||z?E.jsx(Ys,{label:N,children:E.jsx("button",{type:"button","aria-label":N,onClick:J=>{J.stopPropagation(),C(eG({label:W,description:H,reference:z,projectPath:T}))},onPointerDown:J=>J.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:E.jsx(df,{size:13,weight:"bold"})})}):null,!O&&E.jsx(Ys,{label:"Rename",children:E.jsx("button",{type:"button","aria-label":"Rename direction",onClick:J=>{J.stopPropagation(),y(t)},onPointerDown:J=>J.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:E.jsx(fI,{size:13,weight:"bold"})})}),!O&&E.jsx(Ys,{label:"Remove",children:E.jsx("button",{type:"button","data-variant-remove-id":e.kind==="active"?e.variant.workItemId:void 0,"aria-label":"Remove direction",disabled:K,onClick:J=>{J.stopPropagation(),e.kind==="active"?_(e.variant):x(e.entry)},onPointerDown:J=>J.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 ml-1 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(_I,{size:13,weight:"bold"})})})]})]})},qR=({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 E.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"})},i8=({label:t})=>E.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),sG=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const a=e?"Deploying…":n?"Copy link":"Share";return E.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[E.jsxs("div",{className:"min-w-0",children:[E.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?E.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),E.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?E.jsx(df,{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 E.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[E.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:E.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),E.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>E.jsx(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?E.jsx("li",{className:"border-main-border rounded-md border",children:E.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[E.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),E.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?E.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),E.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{Ee.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:E.jsx(aB,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):E.jsxs("li",{className:"border-main-border rounded-md border",children:[E.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":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:[E.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),E.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?E.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),E.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?E.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:E.jsx(uG,{artifact:t})}):null]})},uG=({artifact:t})=>E.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?E.jsx("p",{children:t.summary}):null,t.path?E.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?E.jsx("p",{children:"No inline content available for this artifact."}):null]}),cG=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:u,canvasVariantCount:c,canvasDeployedUrl:d,deployedUrl:f})=>{var O,R,L,D;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,_=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),x=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),y=(e==null?void 0:e.kind)==="deploy-canvas",w=!i||!p||e!==null,S=a&&c>0,P=x?"Deploying…":f?"Copy link":"Share",I=y?"Sharing…":d?"Copy canvas link":"Share canvas",A=_?"Applying…":"Apply to project";return E.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[E.jsx("div",{className:"min-w-0",children:t?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),f?E.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),E.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[E.jsx(CR,{primaryLabel:P,primaryIcon:f&&!x?df:void 0,primaryAction:()=>{t&&r(t)},isDisabled:w,isDropdownDisabled:e!==null,isLoading:x,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:S?[{label:I,icon:d&&!y?df:void 0,onClick:s,isDisabled:e!==null}]:[]}),u?E.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!m,title:(D=(L=t==null?void 0:t.actions)==null?void 0:L.commit)==null?void 0:D.reason,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:A}):null]})]})},ZR=()=>E.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx(Jx,{className:"text-content-muted shrink-0 text-sm"}),E.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),E.jsx("span",{className:"mt-1.5 flex",children:E.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),dG=({groups:t})=>E.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>E.jsx(ZR,{},`${e.requestId}-${r}`)))}),fG=()=>E.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>E.jsx(ZR,{},e))}),hG=()=>E.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[E.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),E.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),o8="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=OW(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(o8).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return E.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[E.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),E.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),E.jsxs("div",{className:"w-full",children:[E.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),E.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[E.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",o8,"”"]}),E.jsx("button",{type:"button",onClick:a,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?E.jsx(iI,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):E.jsx(df,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},mG=({onClose:t})=>{const e=tt(BI);return t?E.jsxs("div",{className:"z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b border-main-border bg-main-light px-2.5 py-2.5",children:[e?E.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):E.jsx("span",{}),E.jsx(Ys,{label:"Close panel",side:"bottom",children:E.jsx("button",{onClick:t,className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 text-content-subtle transition-colors hover:bg-main-input hover:text-content",children:E.jsx(pB,{className:"h-4 w-4",weight:"bold"})})})]}):null},vG='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',gG=({itemSelector:t=vG,loop:e=!1}={})=>{const n=v.useRef(null),r=v.useRef(null),s=v.useCallback(a=>{var u;n.current=a,a?r.current=MW():((u=r.current)==null||u.call(r),r.current=null)},[]),i=v.useCallback(a=>{var x;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 f=d.indexOf(document.activeElement),p=d.length-1,m=y=>{if(f===-1)return y===1?0:p;const w=f+y;return e?(w+d.length)%d.length:Math.min(Math.max(w,0),p)};let _;u==="Home"?_=0:u==="End"?_=p:u==="ArrowDown"?_=m(1):_=m(-1),(x=d[_])==null||x.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},a8="/assets/arena-Db0j1set.png",yG=Ls("useIntegrations"),Z1=["integrations"],_G="rivet:connect-result",xG=t=>typeof t=="object"&&t!==null&&t.type===_G,wG=st(null),l8=async()=>{const t=await fetch("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},bG=()=>{const t=g6(),[e,n]=C3(wG),r=Cy({queryKey:Z1,queryFn:l8,staleTime:1e4}),s=v.useCallback(async()=>(await t.invalidateQueries({queryKey:Z1,refetchType:"none"}),t.fetchQuery({queryKey:Z1,queryFn:l8})),[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"}),f=await d.json().catch(()=>({}));if(!d.ok||!f.authUrl)throw c.close(),new Error(f.error||`Could not connect ${u}`);return c.location.href=f.authUrl,await new Promise(p=>{let m=!1,_=null;const x=async(w,S=!1)=>{if(!m){m=!0,window.removeEventListener("message",y),_&&clearInterval(_);try{const P=(await s()).some(T=>T.provider===u&&T.status==="connected");p(S&&P?"connected":w)}catch{p(w)}}},y=w=>{if(xG(w.data)&&w.data.provider===u){if(w.data.status==="error"){yG.warn(`Connect failed for ${u}:`,w.data.message),x("failed");return}x("connected")}};window.addEventListener("message",y),_=setInterval(()=>{c.closed&&x("closed",!0)},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}},$u=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:a="button","data-cy":u})=>{const c=E.jsx("button",{onClick:t,disabled:s,className:i,type:a,"data-cy":u,children:r});return e?E.jsx(hw,{content:E.jsxs("div",{className:"flex flex-row items-center gap-2",children:[E.jsx("span",{children:e}),n?E.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:c}):c},Ya=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),u8=Ls("ConnectorsModal"),SG=()=>E.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","aria-hidden":"true",children:E.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})}),EG=()=>E.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${a8})`,maskImage:`url(${a8})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),kG=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:E.jsx(SG,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:E.jsx(EG,{})}],CG=({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 E.jsxs("article",{className:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,children:[E.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),E.jsxs("div",{className:"mt-4 flex-1",children:[E.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,a?E.jsx(iI,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),E.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),a&&u?E.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:u}):null]}),a?E.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push bg-main-input text-content-muted mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):E.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},u2=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:u,connect:c,disconnect:d}=bG(),f=Ff(),[p,m]=v.useState(null),_=S=>s.find(C=>C.provider===S),x=v.useCallback(S=>{const C=Date.now(),P=Ya({action:"connect",outcome:"started",provider:S,entryPoint:n});f==null||f.capture(P.event,P.properties),c(S).then(T=>{const I=Date.now()-C;if(T==="connected"){const O=Ya({action:"connect",outcome:"completed",provider:S,entryPoint:n,durationMs:I});f==null||f.capture(O.event,O.properties);return}const A=Ya({action:"connect",outcome:"failed",provider:S,entryPoint:n,durationMs:I,failureReason:T==="closed"?"popup_closed":"provider_failed"});f==null||f.capture(A.event,A.properties)}).catch(T=>{const I=T instanceof Error?T.message:"Could not connect.",A=Ya({action:"connect",outcome:"failed",provider:S,entryPoint:n,durationMs:Date.now()-C,failureReason:I.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture(A.event,A.properties),u8.warn(`Connect error for ${S}:`,I),mt.error(I)})},[c,n,f]),y=v.useCallback(S=>{const C=Date.now(),P=Ya({action:"disconnect",outcome:"started",provider:S,entryPoint:n});f==null||f.capture(P.event,P.properties),d(S).then(()=>{const T=Ya({action:"disconnect",outcome:"completed",provider:S,entryPoint:n,durationMs:Date.now()-C});f==null||f.capture(T.event,T.properties)}).catch(T=>{const I=T instanceof Error?T.message:"Could not disconnect.",A=Ya({action:"disconnect",outcome:"failed",provider:S,entryPoint:n,durationMs:Date.now()-C,failureReason:"request_failed"});f==null||f.capture(A.event,A.properties),u8.warn(`Disconnect error for ${S}:`,I),mt.error(I)})},[n,d,f]),w=n==="onboarding";return E.jsx(Ux,{open:t,onOpenChange:S=>!S&&e(),children:E.jsxs(Bx,{children:[E.jsx(Wx,{className:"z-max fixed inset-0 bg-black/40"}),E.jsx(qx,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:E.jsxs(FR,{value:p,children:[E.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[E.jsx(Zx,{className:"text-content text-base font-medium",children:"Connect design references"}),E.jsx($u,{onClick:e,title:"Close",className:"text-content-subtle hover:bg-main-hover hover:text-content rounded p-1 transition-colors",children:E.jsx(wI,{className:"h-4 w-4",weight:"bold"})})]}),E.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[E.jsx(Gx,{className:"text-content-subtle text-sm",children:"Connect your design references to use them with Rivet’s MCP."}),a?E.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:a}):null,E.jsx("div",{className:"grid grid-cols-2 gap-4",children:kG.map(S=>E.jsx(CG,{meta:S,integration:_(S.provider),isPending:i||u===S.provider,isHighlighted:r===S.provider,onConnect:()=>x(S.provider),onDisconnect:()=>y(S.provider)},S.provider))}),w?E.jsxs("div",{className:"flex items-center justify-between gap-4",children:[E.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),E.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})})},c8=({className:t=""})=>E.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),PG=Ls("SupportTicketModal"),d8=5e3,G1="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},IG=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}`},RG=({isOpen:t,onClose:e,contactEmail:n})=>{const r=Ff(),[s,i]=v.useState(""),[a,u]=v.useState(!1),[c,d]=v.useState(null),f=v.useCallback(()=>{i("")},[]),p=v.useCallback(()=>{a||(f(),e())},[a,e,f]),m=v.useCallback(async()=>{const w=s.trim();if(!(!w||a)){u(!0);try{const S=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,C=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:G1,message:w,contactEmail:P||void 0,metadata:{posthogSessionId:S??void 0,posthogDistinctId:C??void 0,appVersion:"0.16.0",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!T.ok){const I=await IG(T);throw new Error(I)}r==null||r.capture("support_ticket_submitted",{ticket_type:G1,has_posthog_session_id:!!S}),mt.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(S){const C=S instanceof Error?S.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:G1,error:C}),PG.error("Failed to submit support ticket:",C),mt.error("Could not send feedback",{description:C})}finally{u(!1)}}},[n,a,s,e,r,f]),_=v.useCallback(w=>{w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())},[m]),x=d8-s.length,y=a||s.trim().length===0;return E.jsx(Ux,{open:t,onOpenChange:w=>!w&&p(),children:E.jsxs(Bx,{children:[E.jsx(Wx,{className:"fixed inset-0 z-max bg-black/40"}),E.jsx(qx,{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:E.jsxs(FR,{value:c,children:[E.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[E.jsx(Zx,{className:"text-base font-medium text-content",children:"Send feedback"}),E.jsx($u,{onClick:p,disabled:a,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(wI,{className:"h-4 w-4",weight:"bold"})})]}),E.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[E.jsx(Gx,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),E.jsxs("div",{className:"rounded-lg bg-main-input outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[E.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:w=>i(w.target.value),onKeyDown:_,maxLength:d8,rows:6,disabled:a,placeholder:"What happened?",className:"max-h-64 w-full resize-none overflow-y-auto bg-transparent pb-1 pl-3 pr-3 pt-3 text-sm text-content placeholder-content-subtle focus:outline-none disabled:opacity-50"}),E.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[E.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),E.jsxs("div",{className:"flex items-center gap-2",children:[x<=500&&E.jsx("span",{className:"text-xs text-content-subtle",children:x}),E.jsx($u,{onClick:m,disabled:y,title:"Send feedback",shortcut:"⌘↵",className:"flex items-center justify-center rounded bg-primary p-1 text-content transition-colors hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-80",children:a?E.jsx(O0,{className:"h-5 w-5 animate-spin",weight:"bold"}):E.jsx(lB,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},AG=Ls("ProfileAvatar"),GR=(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)=>GR(t,e).charAt(0).toUpperCase(),LG=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=tt(qI),i=tt(XI),[a,u]=v.useState(!1),[c,d]=v.useState(!1),[f,p]=v.useState(!1),[m,_]=v.useState(!1),{containerRef:x,onKeyDown:y}=gG(),w=tt(Wf),S=MG(r,s);if(!S)return w?E.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[E.jsx(c8,{className:"h-7 w-7 rounded-full"}),E.jsx(c8,{className:"h-3 w-16"})]}):null;const C=GR(r,s),P=(r==null?void 0:r.trim())||null,T=(s==null?void 0:s.trim())||null,I=async()=>{_(!0);try{const A=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!A.ok)throw new Error(`Logout failed: ${A.status}`)}catch(A){AG.warn("Logout request failed",A),mt.error("Could not log out. Please try again."),_(!1);return}window.location.reload()};return E.jsxs(E.Fragment,{children:[E.jsxs(bR,{open:a,onOpenChange:u,children:[E.jsx(SR,{asChild:!0,children:E.jsxs("button",{type:"button","aria-label":"Account",className:`text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[E.jsx("span",{className:"border-main-border bg-main-input flex h-7 w-7 items-center justify-center rounded-full border text-[11px] leading-none font-semibold",children:S}),C?E.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:C}):null]})}),E.jsx(ER,{children:E.jsxs(kR,{ref:x,onKeyDown:y,role:"menu",className:"bg-surface-2 z-[60] min-w-[180px] rounded-lg p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[P||T?E.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[P?E.jsx("div",{className:"text-content truncate text-xs font-medium",children:P}):null,T?E.jsx("div",{className:"text-content-muted truncate text-[11px]",children:T}):null]}):null,E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u(!1),d(!0)},disabled:!i,className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[E.jsx(gI,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u(!1),p(!0)},className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none",children:[E.jsx(cB,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:I,disabled:m,className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[E.jsx(mB,{className:"h-3.5 w-3.5",weight:"bold"}),m?"Logging out…":"Log out"]})]})})]}),E.jsx(u2,{isOpen:c,onClose:()=>d(!1)}),E.jsx(RG,{isOpen:f,onClose:()=>p(!1),contactEmail:s??void 0})]})},OG=({onClose:t})=>E.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[E.jsx(mG,{onClose:t}),E.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:E.jsx(KZ,{})}),E.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:E.jsx(LG,{side:"top",align:"start"})})]});async function DG(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(a){const u=n[i-1];if(u===void 0||r&&!r(a))throw a;s==null||s(a,i,u),await new Promise(c=>setTimeout(c,u))}}const f8=Ls("useServerConfig"),KR=[250,500,1e3,2e3,4e3],h8=KR.length+1,NG=async()=>{var n;const t=await fetch("/api/health");if(!t.ok)throw new Error(`Failed to fetch config: ${t.status}`);const e=await t.json();if(!e.framework)throw new Error("Server did not return framework information");return{userPort:((n=e.ports)==null?void 0:n.userDevServer)||3e3,framework:e.framework}},jG=()=>{const[t,e]=v.useState(null),[n,r]=v.useState(!0),[s,i]=v.useState(null),a=v.useCallback(async()=>{try{r(!0),i(null);const u=await DG(NG,{delaysMs:KR,onRetry:(c,d,f)=>{f8.warn(`Server config fetch failed (attempt ${d}); retrying in ${f}ms`,c)}});return e(u),u}catch(u){const c=u instanceof Error?u.message:"Failed to fetch server config";throw i(c),f8.warn("Error fetching server config:",u),u}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},FG="#1C1C20",Ki=[118,118,124],p8=.85,VG=3,$G=.15,jp=36,HG=4.4,zG=.7,UG=3.5,BG=.8,m8=9,WG=11,qG=[1.35,1.12,.95,.85],ZG=[0,1.1,2.3,3.1],GG=[0,.35,.16,.13],KG=[.9,.5,.4,.35],Xa=3,K1=[[{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},um=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Qa=(t,e)=>(Math.round(t/e-.5)+.5)*e,YG=Math.sin(Math.PI/3),v8=(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*YG;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()},XG=(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)-m8}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)-m8}return um(.5-r/(2*WG))},YR=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=at(WI),r=v.useRef(null),s=v.useCallback(i=>{var D;if((D=r.current)==null||D.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,f=0,p=jp,m=jp,_=null,x=null,y=0,w=-1;const S=new Array(33),C=j=>{const F=Math.round(j*32);let Z=S[F];if(!Z){const Q=F/32,K=Math.round(Ki[0]+(255-Ki[0])*Q),q=Math.round(Ki[1]+(255-Ki[1])*Q),W=Math.round(Ki[2]+(255-Ki[2])*Q);Z=`rgba(${K}, ${q}, ${W}, ${p8})`,S[F]=Z}return Z},P=j=>{const F=1-.35*j,Z=Math.round(Ki[0]*F),Q=Math.round(Ki[1]*F),K=Math.round(Ki[2]*F);return`rgba(${Z}, ${Q}, ${K}, ${p8})`},T=j=>{let F=Math.floor(Math.random()*K1.length);F===w&&(F=(F+1)%K1.length),w=F;const Z=[0,0,0,0],Q=K1[F].map((N,Y)=>{const oe=N.level,J=Z[oe]++,se=ZG[oe]+J*GG[oe],pe=KG[oe]+Fp(F*131+Y*17+5)*.2;if(N.hline){const ae=Qa((N.y??0)*f,m);return{hline:!0,x1:Qa(N.x1*d,p),x2:Qa(N.x2*d,p),y1:ae,y2:ae,level:oe,start:se,dur:pe}}const Se=Qa(N.x1*d,p),ce=Qa((N.y1??0)*f,m);return{hline:!1,x1:Se,y1:ce,x2:Math.max(Qa(N.x2*d,p),Se+p),y2:Math.max(Qa((N.y2??0)*f,m),ce+m),level:oe,start:se,dur:pe}}),K=Q.reduce((N,Y)=>Math.max(N,Y.start+Y.dur),0),q=c.length,W=new Float32Array(q*Xa),H=new Int16Array(q*Xa).fill(-1),X=new Uint8Array(q),z=Q[0];for(let N=0;N<q;N++){const Y=c[N];Y.x>z.x1&&Y.x<z.x2&&Y.y>z.y1&&Y.y<z.y2&&(X[N]=1);const oe=N*Xa;for(let J=0;J<Q.length;J++){const se=XG(Y.x,Y.y,Q[J]);if(se<=.02)continue;let pe=oe;for(let Se=oe;Se<oe+Xa;Se++){if(H[Se]===-1){pe=Se;break}W[Se]<W[pe]&&(pe=Se)}(H[pe]===-1||se>W[pe])&&(W[pe]=se,H[pe]=J)}}return{startT:j,buildEnd:K,els:Q,frame:z,cellQ:W,cellEl:H,inFrame:X}},I=()=>{const j=i.getBoundingClientRect();d=Math.max(1,j.width),f=Math.max(1,j.height);const F=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*F),i.height=Math.round(f*F),a.setTransform(F,0,0,F,0,0);const Z=Math.max(8,Math.round(d/jp)),Q=Math.max(6,Math.round(f/jp));p=d/Z,m=f/Q,c=[];for(let K=0;K<Q;K++){const q=Q>1?K/(Q-1):.5,W=HG*(1+zG*.4*(q*2-1));for(let H=0;H<Z;H++){const X=K*8191+H*131+1,z={x:(H+.5)*p,y:(K+.5)*m,size:W,seed:X,phase:Fp(X),kind:0};z.kind=Math.floor(Fp(X*97)*3),c.push(z)}}x=null,_=null},A=new Float32Array(32),O=j=>{a.fillStyle=FG,a.fillRect(0,0,d,f),_||(_=T(j+.2)),j>=_.startT+_.buildEnd+UG&&(x=_,y=j,_=T(j+.2));let F=0;x&&(F=1-um((j-y)/BG),F<=0&&(x=null));const Z=_;for(let z=0;z<Z.els.length;z++){const N=Z.els[z];A[z]=um(Math.min(1,Math.max(0,(j-Z.startT-N.start)/N.dur)))}const Q=A[0],K=P(0),q=P(Q),W=F>0?P(F):K,H=F>0?P(Math.max(Q,F)):q,X=c.length;for(let z=0;z<X;z++){const N=c[z];let Y=0,oe=0;const J=z*Xa;for(let We=J;We<J+Xa;We++){const He=Z.cellEl[We];if(He<0)break;const Fe=Z.cellQ[We]*A[He];Fe>Y&&(Y=Fe,oe=Z.els[He].level)}if(x)for(let We=J;We<J+Xa;We++){const He=x.cellEl[We];if(He<0)break;const Fe=x.cellQ[We]*F;Fe>Y&&(Y=Fe,oe=x.els[He].level)}const se=j/VG+N.phase,pe=Math.floor(se),Se=se-pe,ce=um(Math.min(Se,1-Se)/$G),ae=Math.floor(Fp(N.seed*97+pe*7919)*3);ae!==N.kind&&Y<.02&&ce<.05&&(N.kind=ae);const $e=Math.max(ce*(1-Y),Y);if(!($e<.01))if(Y<.02){const We=Z.inFrame[z]===1,He=x?x.inFrame[z]===1:!1;We?a.fillStyle=He?H:q:a.fillStyle=He?W:K;const Fe=Math.max(We?Q:0,He?F:0);v8(a,N.kind,N.x,N.y,N.size*$e*(1-.2*Fe))}else{a.fillStyle=C(Y);const We=1+(qG[oe]-1)*Y;v8(a,N.kind,N.x,N.y,N.size*$e*We)}}};I();let R=0;if(u)_=T(-100),O(0);else{const j=performance.now(),F=Z=>{O((Z-j)/1e3),R=requestAnimationFrame(F)};R=requestAnimationFrame(F)}const L=new ResizeObserver(()=>{I(),u&&(_=T(-100),O(0))});L.observe(i),r.current=()=>{cancelAnimationFrame(R),L.disconnect(),e&&n(j=>j-1)}},[e,n]);return E.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},QG=async(t=null)=>{if(t)return JG(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return Vp();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return Vp()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable",upstreamStatus:null}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable",upstreamStatus:null}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable",upstreamStatus:null}:Vp()},XR=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},JG=t=>XR(t),Vp=()=>XR("/"),Y1=Ls("usePreviewUpstreamHealth"),eK=500,tK=4e3,nK=15e3,rK=3,sK=(t,e={})=>{const n=v.useRef(null),r=v.useRef(null),s=e.probeMsWhileDown??eK,i=e.probeMsWhileUp??tK,a=e.firstUnreachableCaptureAfterMs??nK,u=e.rerunProbeImmediatelyOnVersion,c=e.probePath??null,d=e.skip??!1,f=v.useRef(e.onPersistentUpstreamServerErrors);f.current=e.onPersistentUpstreamServerErrors;const[p,m]=v.useState(t==="static"),[_,x]=v.useState(0),[y,w]=v.useState(null),[S,C]=v.useState(0),[P,T]=v.useState(!1),[I,A]=v.useState(!1),[O,R]=v.useState(t==="static"?null:"upstream_unreachable");return v.useEffect(()=>{if(t==="static"){m(!0),w(null),C(0),T(!1),A(!0),R(null);return}if(d){m(!1),w(null),C(0),T(!1),A(!0),R("upstream_unreachable"),n.current=null;return}let L=!0;const D=Date.now();w(D),C(0),T(!1),m(!1),A(!1),R("upstream_unreachable");const j={current:!1},F={current:!1},Z={current:!1},Q={current:null},K={current:!1},q={current:!1},W={current:0},H={current:!1},X={current:null};let z=null;const N=()=>{Z.current||(Z.current=!0,L&&A(!0))},Y=()=>{z!==null&&(clearTimeout(z),z=null)},oe=(se,pe)=>{Y(),z=setTimeout(pe,se)},J=async()=>{var Fe;if(!L)return;C(ct=>ct+1);const{isOk:se,unavailableReason:pe,upstreamStatus:Se}=await QG(c);if(!L)return;N(),X.current=Se;const ce=se&&Se!==null&&Se>=500;ce&&q.current?W.current+=1:se&&!ce&&(W.current=0);const ae=W.current>=rK;if(ae&&!H.current&&Se!==null&&(H.current=!0,Ee==null||Ee.capture("preview_upstream_error_responses",{framework:t,upstream_status:Se,consecutive_count:W.current}),Y1.warn(`Preview upstream is listening but has served ${W.current} consecutive ${Se} responses`),(Fe=f.current)==null||Fe.call(f,{upstreamStatus:Se,consecutiveCount:W.current})),se&&!ae){ce||(q.current=!0,H.current=!1);const ct=!K.current;K.current=!0,m(!0),R(null),Q.current=null,F.current=!1,T(!1),j.current?ct&&(Ee==null||Ee.capture("preview_upstream_restored",{framework:t})):(j.current=!0,Ee==null||Ee.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-D})),oe(i,J);return}const We=K.current;K.current=!1,m(!1),R(pe),Q.current===null&&(Q.current=Date.now(),F.current=!1,T(!1)),We&&(Ee==null||Ee.capture("preview_upstream_lost",{framework:t,upstream_status:Se}),x(ct=>ct+1),Y1.warn("Preview upstream became unavailable after it was ready"));const He=Date.now()-Q.current;He>=a&&!F.current&&(F.current=!0,T(!0),Ee==null||Ee.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:He,upstream_status:X.current}),Y1.warn("Dev server did not become ready within timeout window")),oe(s,J)};return n.current=()=>oe(0,J),oe(0,J),()=>{L=!1,n.current=null,Y()}},[t,s,i,a,c,d]),v.useEffect(()=>{var D;if(t==="static"||u===void 0)return;const L=r.current;r.current=u,L!==null&&L!==u&&((D=n.current)==null||D.call(n))},[t,u]),{isUpstreamReady:p,iframeRemountKey:_,probeStartedAt:y,probeAttemptCount:S,isFirstUnreachableWindowExceeded:P,initialProbeComplete:I,unavailableReason:O}};function iK(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const QR=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}`},JR=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${QR(t)}${e}`:e,oK="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",aK=t=>oK,lK=Ls("PreviewSurface"),g8=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",eA=({target:t,src:e,framework:n,remountKey:r})=>(tt(D0),E.jsx("div",{className:"relative h-full w-full",children:E.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:aK(),onLoad:()=>{Ee==null||Ee.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Ee==null||Ee.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:g8(e,t),framework:n}))},onError:()=>{Ee==null||Ee.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Ee==null||Ee.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:g8(e,t),framework:n})),lK.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),uK="modulepreload",cK=function(t){return"/"+t},y8={},dK=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const 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=cK(d),d in y8)return;y8[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":uK,f||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),f)return new Promise((_,x)=>{m.addEventListener("load",_),m.addEventListener("error",()=>x(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)})},fK=v.lazy(()=>dK(()=>Promise.resolve().then(()=>GY),void 0)),hK={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"},pK={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},mK={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"},Hu=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:u="md",children:c,state:d,role:f="status",busy:p=!1,className:m=""})=>{const _=v.useCallback(y=>{y&&d&&(Ee==null||Ee.capture("status_surface_shown",{state:d,tone:i,fill:a}))},[d,i,a]),x=!!(e||n||r||c||s!=null&&s.length);return E.jsxs("div",{ref:_,className:`${hK[a]} ${m}`.trim(),role:f,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[t?E.jsx("div",{className:"absolute inset-0",children:t}):null,x?E.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?E.jsx("h2",{className:pK[u],children:n}):null,r?E.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,s!=null&&s.length?E.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(y=>E.jsx("button",{type:"button",onClick:y.onClick,className:mK[y.variant??"neutral"],children:y.label},y.label))}):null]}):null]})},c2=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?E.jsx(Hu,{...r,size:n,busy:!0,backdrop:E.jsx(YR,{trackGlobalLoaderCount:e})}):t==="logo"?E.jsx(Hu,{...r,size:n,busy:!0,backdrop:E.jsx(v.Suspense,{fallback:null,children:E.jsx(fK,{className:"absolute inset-0"})})}):E.jsx(Hu,{...r,size:n,busy:!0,media:E.jsx(O0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),tA=({icon:t,...e})=>E.jsx(Hu,{...e,tone:"neutral",media:t?E.jsx("div",{className:"text-content-muted",children:t}):void 0}),mw=t=>E.jsx(Hu,{...t,tone:"error",role:"alert"}),_8="/static/",vK=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(_8)}catch{return t.endsWith(_8)}},gK=t=>t==="spawn_error"?"The direction is saved, but its preview process didn’t start.":t==="exited"?"The direction is saved, but its preview stopped before it was ready.":t==="timeout"?"The direction is saved, but its preview took too long to become ready.":t==="missing_dev_script"?"The direction is saved, but Rivet couldn’t find a dev script to preview it.":t==="missing_static_entry"?"The direction is saved, but Rivet couldn’t find an HTML entry to preview it.":"The direction is saved, but Rivet couldn’t prepare its preview.",yK=t=>t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE"?{state:"variant_verification_unavailable",title:"Rivet couldn’t verify this direction",description:"The worker completed, but Rivet couldn’t inspect its generated files.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED"?{state:"variant_output_integrity_failed",title:"This direction couldn’t be verified",description:"The worker completed, but Rivet found a structural problem in the generated files.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="failed"?{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="cancelled"?{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1}:t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"?{state:"preview_unavailable",title:"Rivet couldn’t preview this direction",description:gK(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,_K=({issue:t})=>E.jsx(Hu,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,children:t.detail?E.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:t.detail}):null}),xK=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{const r=tt(Q_),s=at(Q_),i=tt(i0),a=at(i0),u=tt(Bf),c=tt(D0),d=tt(J_),f=tt(e2),p=tt(ZI),m=tt(GI),_=at(e2),x=tt(yo),y=tt(n2),w=at(J_),S=u.active&&u.projectContext.kind==="fresh",C=tt(t2),P=u.active?u.variants.find(Ve=>Ve.workItemId===C&&(Ve.status==="pending"||Ve.status==="running"||Ve.status==="succeeded"&&!Ve.preview&&typeof Ve.port!="number"&&(!Ve.previewUnavailable||Ve.previewUnavailable.reason==="idle_timeout")))??null:null,T=u.active&&u.variants.some(Ve=>Ve.status==="pending"||Ve.status==="running"),I=S||T,A=u.active?u.variants.find(Ve=>Ve.workItemId===C)??null:null,O=A?yK(A):null,R=e==="static"&&i!==null&&vK(i);v.useEffect(()=>{u.active||w(!1)},[u.active,w]);const L=v.useRef(!1);v.useEffect(()=>{const Ve=!!(x!=null&&x.left||x!=null&&x.right),Oe=Ve&&!L.current;L.current=Ve;const Je=u.active?u.sessionId:null;!Je||!iK({enteringSplit:Oe,isExistingSession:u.active&&u.projectContext.kind==="existing",hasActiveVariantProxy:d&&f!==null})||(w(!1),_(null),s(kt=>kt+1),fetch(`/api/variants/${encodeURIComponent(Je)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[x,u,d,f,w,_,s]);const j=v.useMemo(()=>{var xe;if(d||i&&!R||!u.active)return null;const{stage:Ve,variants:Oe}=u,Je=Ve==="ready"||Ve==="degraded",kt=Oe.some(sn=>{var Ot,Kr;return((Ot=sn.refinement)==null?void 0:Ot.status)==="pending"||((Kr=sn.refinement)==null?void 0:Kr.status)==="running"});if(!Je&&!kt)return null;const vt=Oe.find(sn=>{var Ot;return sn.status==="succeeded"&&((Ot=sn.preview)==null?void 0:Ot.kind)==="static_artifact"});return((xe=vt==null?void 0:vt.preview)==null?void 0:xe.kind)==="static_artifact"?vt.preview.url:null},[R,i,d,u])??i,F=v.useMemo(()=>!u.active||!j?null:u.variants.find(Ve=>{var Oe;return((Oe=Ve.preview)==null?void 0:Oe.kind)==="static_artifact"&&j.startsWith(Ve.preview.url)})??null,[j,u]),Z=v.useMemo(()=>{if((y==null?void 0:y.previewKind)==="static")return{kind:"variant",sessionId:y.sessionId,variantId:y.variantId};if(!u.active)return s0;if(F)return{kind:"variant",sessionId:u.sessionId,variantId:F.workItemId};if(j){const Oe=j.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Je=Oe!=null&&Oe[1]?decodeURIComponent(Oe[1]):null,kt=Oe!=null&&Oe[2]?decodeURIComponent(Oe[2]):null;if(Je===u.sessionId&&kt&&u.variants.some(sn=>sn.workItemId===kt))return{kind:"variant",sessionId:u.sessionId,variantId:kt};const vt=j.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),xe=vt!=null&&vt[1]?decodeURIComponent(vt[1]):null;if(xe&&u.variants.some(sn=>sn.workItemId===xe))return{kind:"variant",sessionId:u.sessionId,variantId:xe}}const Ve=!!(x!=null&&x.left||x!=null&&x.right);return(!Ve||S)&&!j&&d&&f&&u.variants.some(Oe=>Oe.workItemId===f)?{kind:"variant",sessionId:u.sessionId,variantId:f}:(!Ve||S)&&!j&&C&&u.variants.some(Oe=>Oe.workItemId===C)?{kind:"variant",sessionId:u.sessionId,variantId:C}:s0},[y,F,u,d,f,j,x,S,C]),Q=v.useRef(null);v.useEffect(()=>{var kt,vt;if(!F||((kt=F.preview)==null?void 0:kt.kind)!=="static_artifact"||((vt=F.refinement)==null?void 0:vt.status)!=="succeeded")return;const Ve=`${F.workItemId}:${F.refinement.workItemId}`;if(Q.current===Ve)return;Q.current=Ve;const Oe=F.preview.url.includes("?")?"&":"?",Je=`${F.preview.url}${Oe}refinement=${encodeURIComponent(F.refinement.workItemId)}`;j!==Je&&(a(Je),s(xe=>xe+1))},[j,F,s,a,u]);const K=j!==null&&FZ(j),q=j!==null&&!K||S&&!d&&!K,{isUpstreamReady:W,iframeRemountKey:H,probeAttemptCount:X,initialProbeComplete:z}=sK(e,{rerunProbeImmediatelyOnVersion:r,probePath:K?j:null,skip:q}),[N,Y]=v.useState(()=>p&&W?r:null),oe=v.useRef(null);v.useEffect(()=>{if(!p){oe.current=null,Y(null);return}if(N===r){oe.current=null;return}const Ve=oe.current;if(!Ve||Ve.remountKey!==r){oe.current={remountKey:r,probeAttemptCount:X};return}W&&X>Ve.probeAttemptCount&&(oe.current=null,Y(r))},[N,r,p,X,W]);const se=j!==null&&!K||W,Se=m||p&&N!==r||p&&!se,ce=`${H}:${r}`,ae=$R(window.location.pathname),$e=e==="static"?`/static${ae??"/"}`:ae??"/",We=QR(c);let He=null;j&&(He=JR({agentApplyMode:c,url:j}));const ct=P||O||Se?"about:blank":(K&&!se?"about:blank":He)??(se?`${We}${$e}`:"about:blank"),Gt=!!P||!!O||!se&&z;let rt=null;return Se?rt=E.jsx(c2,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):P?rt=E.jsx(c2,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:E.jsx("span",{className:"sr-only",children:"Building your direction"})}):O?rt=E.jsx(_K,{issue:O}):Gt&&(rt=I?E.jsx(tA,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):E.jsx(mw,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),E.jsxs("div",{className:"relative h-full w-full",children:[rt,E.jsx(eA,{target:Z,src:ct,framework:e,remountKey:ce})]})};function x8({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var P;const u=tt(yo),c=at(yo),d=Ff(),f=tt(Bf),p=tt(D0),m=v.useRef(!1),_=v.useCallback(()=>{m.current||(m.current=!0,wf({source:i,sessionId:e,variantId:n}))},[i,e,n]),x=v.useCallback(()=>{if(a){c(null);const O=c0("ended",u);d==null||d.capture(O.event,O.properties);return}_();const T={...u};delete T[t];const I=T.left||T.right?T:null;c(I);const A=c0(I?"updated":"ended",I??u);d==null||d.capture(A.event,A.properties)},[a,d,c,t,u,_]),y=v.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),w=v.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(T=>T.workItemId===n)??null,[e,n,f]),S=v.useMemo(()=>{var I,A;let T=r;if(((I=w==null?void 0:w.preview)==null?void 0:I.kind)==="static_artifact"&&((A=w.refinement)==null?void 0:A.status)==="succeeded"){const O=w.preview.url.includes("?")?"&":"?";T=`${w.preview.url}${O}refinement=${encodeURIComponent(w.refinement.workItemId)}`}return JR({agentApplyMode:p,url:T})},[p,w,r]),C=((P=w==null?void 0:w.refinement)==null?void 0:P.status)==="succeeded"?`${n}:${w.refinement.workItemId}`:n;return E.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[E.jsxs("div",{className:"variant-split-secondary-toolbar",children:[E.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),E.jsx(Ys,{label:"Collapse",children:E.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:x,"aria-label":"Collapse split view",children:E.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:E.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),E.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:E.jsx(eA,{target:y,src:S,framework:"static",remountKey:C})})]})}const w8=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function wK(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=w8[Math.abs(e)%w8.length];return{color:n,backgroundColor:`${n}22`}}const b8=240;function bK(){const t=tt(vf),e=tt(Qx),n=v.useRef(null);return v.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-b8/2,s=e.y-22;n.current.style.transform=`translate3d(${r}px, ${s}px, 0)`},[t,e]),!t||!e?null:E.jsx("div",{ref:n,"aria-hidden":"true",className:"variant-drag-ghost",style:{width:b8},children:E.jsxs("div",{className:"variant-drag-ghost-body",children:[E.jsxs("div",{className:"variant-drag-ghost-row",children:[E.jsx("div",{className:"variant-drag-ghost-title",children:t.label}),t.runLabel?E.jsx("div",{className:"variant-drag-ghost-tag",style:wK(t.runLabel),children:t.runLabel}):null]}),t.description?E.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function SK(){const t=tt(vf),e=tt(Qx),n=tt(yo),r=at(vf),s=at(yo),i=Ff(),a=v.useRef(null),[u,c]=v.useState(null),[d,f]=v.useState("hidden");v.useEffect(()=>{if(!t){f("hidden"),c(null);return}const _=requestAnimationFrame(()=>f("visible"));return()=>cancelAnimationFrame(_)},[t]);const p=v.useCallback((_,x)=>{const y=a.current;if(!y)return null;const w=y.getBoundingClientRect();return _<w.left||_>w.right||x<w.top||x>w.bottom?null:_<(w.left+w.right)/2?"left":"right"},[]);if(v.useEffect(()=>{if(!t||!e)return;const _=p(e.x,e.y);c(x=>x===_?x:_)},[t,e,p]),v.useEffect(()=>{if(!t)return;const _=x=>{const y=p(x.clientX,x.clientY);if(y&&t.url){const w={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},S=n==null?void 0:n[y];S&&(S.sessionId!==w.sessionId||S.variantId!==w.variantId)&&wf(S);const C={...n??{},[y]:w};s(C);const P=c0(n?"updated":"started",C);i==null||i.capture(P.event,P.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else wf(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_)}},[t,p,i,r,s,n]),!t)return null;const m=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return E.jsxs("div",{ref:a,className:m,"aria-hidden":"true",children:[E.jsx(S8,{side:"left",hovered:u==="left",canDrop:!!t.url,label:t.label}),E.jsx(S8,{side:"right",hovered:u==="right",canDrop:!!t.url,label:t.label})]})}function S8({side:t,hovered:e,canDrop:n,label:r}){return E.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[E.jsxs("div",{className:"variant-drop-zone-inner",children:[E.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),E.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),E.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:E.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),E.jsx("div",{className:"variant-drop-zone-border"})]})}const nA=(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)}`},E8=(t,e)=>{if(!t)return;const n=nA(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},EK=()=>E.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:E.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:E.jsx(YR,{trackGlobalLoaderCount:!1})})}),kK=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=jG();return v.useEffect(()=>{r().catch(a=>{Ee==null||Ee.capture("preview_config_load_failed",{message:a instanceof Error?a.message:"unknown_error",attempts:h8})})},[r]),s?E.jsx(EK,{}):i||!n?E.jsx(mw,{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:()=>{Ee==null||Ee.capture("preview_config_retry_clicked"),r().catch(a=>{Ee==null||Ee.capture("preview_config_load_failed",{message:a instanceof Error?a.message:"unknown_error",attempts:h8})})}}]}):E.jsx(CK,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function CK(t){const e=tt(yo),n=tt(vf),r=tt(Bf),s=tt(i0),i=e==null?void 0:e.left,a=e==null?void 0:e.right,u=v.useMemo(()=>{var I,A;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const y=(I=i??a)==null?void 0:I.variantId,w=r.variants.filter(O=>{var R;return O.status==="succeeded"&&((R=O.preview)==null?void 0:R.kind)==="static_artifact"&&O.workItemId!==y}),S=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),P=w.find(O=>{var R;return((R=O.preview)==null?void 0:R.kind)==="static_artifact"&&O.preview.url===S})??w[0];if(((A=P==null?void 0:P.preview)==null?void 0:A.kind)!=="static_artifact")return;const T=nA(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=E8(i,r)??(a?u:void 0),d=E8(a,r)??(i?u:void 0),f=!i&&!!c,p=!a&&!!d,m=!!(c||d),_=E.jsx(xK,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return E.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:E.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[E.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&E.jsx(x8,{side:"left",sessionId:c.sessionId,variantId:c.variantId,url:c.url,label:c.label,source:c.source,isFallback:f},`left-${c.sessionId}:${c.variantId}:${c.url}`),!(c&&d)&&E.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:_}),d&&E.jsx(x8,{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}`)]}),E.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),E.jsx(SK,{}),E.jsx(bK,{})]})})}function no(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
116
+ * GSAP 3.15.0
117
+ * https://gsap.com
118
+ *
119
+ * @license Copyright 2008-2026, GreenSock. All rights reserved.
120
+ * Subject to the terms at https://gsap.com/standard-license
121
+ * @author: Jack Doyle, jack@greensock.com
122
+ */var us={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},bf={duration:.5,overwrite:!1,delay:0},vw,Jn,Zt,Is=1e8,At=1/Is,d2=Math.PI*2,PK=d2/4,TK=0,sA=Math.sqrt,IK=Math.cos,RK=Math.sin,zn=function(e){return typeof e=="string"},hn=function(e){return typeof e=="function"},xo=function(e){return typeof e=="number"},gw=function(e){return typeof e>"u"},Li=function(e){return typeof e=="object"},Br=function(e){return e!==!1},yw=function(){return typeof window<"u"},$p=function(e){return hn(e)||zn(e)},iA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},dr=Array.isArray,AK=/random\([^)]+\)/g,MK=/,\s*/g,k8=/(?:-?\.?\d|\.)+/gi,oA=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Au=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,X1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,aA=/[+-]=-?[.\d]+/,LK=/[^,'"\[\]\s]+/gi,OK=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,nn,yi,f2,_w,ds={},d0={},lA,uA=function(e){return(d0=mc(e,ds))&&Gr},xw=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Sf=function(e,n){return!n&&console.warn(e)},cA=function(e,n){return e&&(ds[e]=n)&&d0&&(d0[e]=n)||ds},Ef=function(){return 0},DK={suppressEvents:!0,isStart:!0,kill:!1},cm={suppressEvents:!0,kill:!1},NK={suppressEvents:!0},ww={},la=[],h2={},dA,ns={},Q1={},C8=30,dm=[],bw="",Sw=function(e){var n=e[0],r,s;if(Li(n)||hn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=dm.length;s--&&!dm[s].targetTest(n););r=dm[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new LA(e[s],r)))||e.splice(s,1);return e},Pl=function(e){return e._gsap||Sw(Rs(e))[0]._gsap},fA=function(e,n,r){return(r=e[n])&&hn(r)?e[n]():gw(r)&&e.getAttribute&&e.getAttribute(n)||r},Wr=function(e,n){return(e=e.split(",")).forEach(n)||e},_n=function(e){return Math.round(e*1e5)/1e5||0},tn=function(e){return Math.round(e*1e7)/1e7||0},zu=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},jK=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},f0=function(){var e=la.length,n=la.slice(0),r,s;for(h2={},la.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},Ew=function(e){return!!(e._initted||e._startAt||e.add)},hA=function(e,n,r,s){la.length&&!Jn&&f0(),e.render(n,r,!!(Jn&&n<0&&Ew(e))),la.length&&!Jn&&f0()},pA=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(LK).length<2?n:zn(e)?e.trim():e},mA=function(e){return e},fs=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},FK=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},mc=function(e,n){for(var r in n)e[r]=n[r];return e},P8=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=Li(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},h0=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Zd=function(e){var n=e.parent||nn,r=e.keyframes?FK(dr(e.keyframes)):fs;if(Br(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},VK=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},vA=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},W0=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},ga=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Tl=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},$K=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},p2=function(e,n,r,s){return e._startAt&&(Jn?e._startAt.revert(cm):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},HK=function t(e){return!e||e._ts&&t(e.parent)},T8=function(e){return e._repeat?vc(e._tTime,e=e.duration()+e._rDelay)*e:0},vc=function(e,n){var r=Math.floor(e=tn(e/n));return e&&r===e?r-1:r},p0=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},q0=function(e){return e._end=tn(e._start+(e._tDur/Math.abs(e._ts||e._rts||At)||0))},Z0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=tn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),q0(e),r._dirty||Tl(r,e)),e},gA=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=p0(e.rawTime(),n),(!n._dur||Zf(0,n.totalDuration(),r)-n._tTime>At)&&n.render(r,!0)),Tl(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=-At}},ki=function(e,n,r,s){return n.parent&&ga(n),n._start=tn((xo(r)?r:r||e!==nn?ks(e,r,n):e._time)+n._delay),n._end=tn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),vA(e,n,"_first","_last",e._sort?"_start":0),m2(n)||(e._recent=n),s||gA(e,n),e._ts<0&&Z0(e,e._tTime),e},yA=function(e,n){return(ds.ScrollTrigger||xw("scrollTrigger",n))&&ds.ScrollTrigger.create(n,e)},_A=function(e,n,r,s,i){if(Cw(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!Jn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&dA!==rs.frame)return la.push(e),e._lazy=[i,s],1},zK=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},m2=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},UK=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&zK(e)&&!(!e._initted&&m2(e))||(e._ts<0||e._dp._ts<0)&&!m2(e))?0:1,u=e._rDelay,c=0,d,f,p;if(u&&e._repeat&&(c=Zf(0,e._tDur,n),f=vc(c,u),e._yoyo&&f&1&&(a=1-a),f!==vc(e._tTime,u)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||Jn||s||e._zTime===At||!n&&e._zTime){if(!e._initted&&_A(e,n,s,r,c))return;for(p=e._zTime,e._zTime=n||(r?At: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&&p2(e,n,r,!0),e._onUpdate&&!r&&is(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&is(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&ga(e,1),!r&&!Jn&&(is(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},BK=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}},gc=function(e,n,r,s){var i=e._repeat,a=tn(n)||0,u=e._tTime/e._tDur;return u&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:tn(a*(i+1)+e._rDelay*i):a,u>0&&!s&&Z0(e,e._tTime=e._tDur*u),e.parent&&q0(e),r||Tl(e.parent,e),e},I8=function(e){return e instanceof $r?Tl(e):gc(e,e._dur)},WK={_start:0,endTime:Ef,totalDuration:Ef},ks=function t(e,n,r){var s=e.labels,i=e._recent||WK,a=e.duration()>=Is?i.endTime(!1):e._dur,u,c,d;return zn(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*(dr(r)?r[0]:r).totalDuration()),u>1?t(e,n.substr(0,u-1),r)+c:a+c)):n==null?a:+n},Gd=function(e,n,r){var s=xo(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=Br(c.vars.inherit)&&c.parent;a.immediateRender=Br(u.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new Pn(n[0],a,n[i+1])},Ca=function(e,n){return e||e===0?n(e):n},Zf=function(e,n,r){return r<e?e:r>n?n:r},lr=function(e,n){return!zn(e)||!(n=OK.exec(e))?"":n[1]},qK=function(e,n,r){return Ca(r,function(s){return Zf(e,n,s)})},v2=[].slice,xA=function(e,n){return e&&Li(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&Li(e[0]))&&!e.nodeType&&e!==yi},ZK=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return zn(s)&&!n||xA(s,1)?(i=r).push.apply(i,Rs(s)):r.push(s)})||r},Rs=function(e,n,r){return Zt&&!n&&Zt.selector?Zt.selector(e):zn(e)&&!r&&(f2||!yc())?v2.call((n||_w).querySelectorAll(e),0):dr(e)?ZK(e,r):xA(e)?v2.call(e,0):e?[e]:[]},g2=function(e){return e=Rs(e)[0]||Sf("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Rs(n,r.querySelectorAll?r:r===e?Sf("Invalid scope")||_w.createElement("div"):e)}},wA=function(e){return e.sort(function(){return .5-Math.random()})},bA=function(e){if(hn(e))return e;var n=Li(e)?e:{each:e},r=Il(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},u=s>0&&s<1,c=isNaN(s)||u,d=n.axis,f=s,p=s;return zn(s)?f=p={center:.5,edges:.5,end:1}[s]||0:!u&&c&&(f=s[0],p=s[1]),function(m,_,x){var y=(x||n).length,w=a[y],S,C,P,T,I,A,O,R,L;if(!w){if(L=n.grid==="auto"?0:(n.grid||[1,Is])[1],!L){for(O=-Is;O<(O=x[L++].getBoundingClientRect().left)&&L<y;);L<y&&L--}for(w=a[y]=[],S=c?Math.min(L,y)*f-.5:s%L,C=L===Is?0:c?y*p/L-.5:s/L|0,O=0,R=Is,A=0;A<y;A++)P=A%L-S,T=C-(A/L|0),w[A]=I=d?Math.abs(d==="y"?T:P):sA(P*P+T*T),I>O&&(O=I),I<R&&(R=I);s==="random"&&wA(w),w.max=O-R,w.min=R,w.v=y=(parseFloat(n.amount)||parseFloat(n.each)*(L>y?y-1:d?d==="y"?y/L:L:Math.max(L,y/L))||0)*(s==="edges"?-1:1),w.b=y<0?i-y:i,w.u=lr(n.amount||n.each)||0,r=r&&y<0?oY(r):r}return y=(w[m]-w.min)/w.max||0,tn(w.b+(r?r(y):y)*w.v)+w.u}},y2=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=tn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(xo(r)?0:lr(r))}},SA=function(e,n){var r=dr(e),s,i;return!r&&Li(e)&&(s=r=e.radius||Is,e.values?(e=Rs(e.values),(i=!xo(e[0]))&&(s*=s)):e=y2(e.increment)),Ca(n,r?hn(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=Is,f=0,p=e.length,m,_;p--;)i?(m=e[p].x-u,_=e[p].y-c,m=m*m+_*_):m=Math.abs(e[p]-u),m<d&&(d=m,f=p);return f=!s||d<=s?e[f]:a,i||f===a||xo(a)?f:f+lr(a)}:y2(e))},EA=function(e,n,r,s){return Ca(dr(e)?!n:r===!0?!!(r=0):!s,function(){return dr(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})},GK=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)}},KK=function(e,n){return function(r){return e(parseFloat(r))+(n||lr(r))}},YK=function(e,n,r){return CA(e,n,0,1,r)},kA=function(e,n,r){return Ca(r,function(s){return e[~~n(s)]})},XK=function t(e,n,r){var s=n-e;return dr(e)?kA(e,t(0,e.length),n):Ca(r,function(i){return(s+(i-e)%s)%s+e})},QK=function t(e,n,r){var s=n-e,i=s*2;return dr(e)?kA(e,t(0,e.length-1),n):Ca(r,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},kf=function(e){return e.replace(AK,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(MK);return EA(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},CA=function(e,n,r,s,i){var a=n-e,u=s-r;return Ca(i,function(c){return r+((c-e)/a*u||0)})},JK=function t(e,n,r,s){var i=isNaN(e+n)?0:function(_){return(1-_)*e+_*n};if(!i){var a=zn(e),u={},c,d,f,p,m;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(dr(e)&&!dr(n)){for(f=[],p=e.length,m=p-2,d=1;d<p;d++)f.push(t(e[d-1],e[d]));p--,i=function(x){x*=p;var y=Math.min(m,~~x);return f[y](x-y)},r=n}else s||(e=mc(dr(e)?[]:{},e));if(!f){for(c in n)kw.call(u,e,c,"get",n[c]);i=function(x){return Iw(x,u)||(a?e.p:e)}}}return Ca(r,i)},R8=function(e,n,r){var s=e.labels,i=Is,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},is=function(e,n,r){var s=e.vars,i=s[n],a=Zt,u=e._ctx,c,d,f;if(i)return c=s[n+"Params"],d=s.callbackScope||e,r&&la.length&&f0(),u&&(Zt=u),f=c?i.apply(d,c):i.call(d),Zt=a,f},Od=function(e){return ga(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Jn),e.progress()<1&&is(e,"onInterrupt"),e},Mu,PA=[],TA=function(e){if(e)if(e=!e.name&&e.default||e,yw()||e.headless){var n=e.name,r=hn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Ef,render:Iw,add:kw,kill:vY,modifier:mY,rawVars:0},a={targetTest:0,get:0,getSetter:Tw,aliases:{},register:0};if(yc(),e!==s){if(ns[n])return;fs(s,fs(h0(e,i),a)),mc(s.prototype,mc(i,h0(e,a))),ns[s.prop=n]=s,e.targetTest&&(dm.push(s),ww[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}cA(n,s),e.register&&e.register(Gr,s,qr)}else PA.push(e)},Rt=255,Dd={aqua:[0,Rt,Rt],lime:[0,Rt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Rt],navy:[0,0,128],white:[Rt,Rt,Rt],olive:[128,128,0],yellow:[Rt,Rt,0],orange:[Rt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Rt,0,0],pink:[Rt,192,203],cyan:[0,Rt,Rt],transparent:[Rt,Rt,Rt,0]},J1=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)*Rt+.5|0},IA=function(e,n,r){var s=e?xo(e)?[e>>16,e>>8&Rt,e&Rt]:0:Dd.black,i,a,u,c,d,f,p,m,_,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Dd[e])s=Dd[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&Rt,s&Rt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Rt,e&Rt]}else if(e.substr(0,3)==="hsl"){if(s=x=e.match(k8),!n)c=+s[0]%360/360,d=+s[1]/100,f=+s[2]/100,a=f<=.5?f*(d+1):f+d-f*d,i=f*2-a,s.length>3&&(s[3]*=1),s[0]=J1(c+1/3,i,a),s[1]=J1(c,i,a),s[2]=J1(c-1/3,i,a);else if(~e.indexOf("="))return s=e.match(oA),r&&s.length<4&&(s[3]=1),s}else s=e.match(k8)||Dd.transparent;s=s.map(Number)}return n&&!x&&(i=s[0]/Rt,a=s[1]/Rt,u=s[2]/Rt,p=Math.max(i,a,u),m=Math.min(i,a,u),f=(p+m)/2,p===m?c=d=0:(_=p-m,d=f>.5?_/(2-p-m):_/(p+m),c=p===i?(a-u)/_+(a<u?6:0):p===a?(u-i)/_+2:(i-a)/_+4,c*=60),s[0]=~~(c+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},RA=function(e){var n=[],r=[],s=-1;return e.split(ua).forEach(function(i){var a=i.match(Au)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},A8=function(e,n,r){var s="",i=(e+s).match(ua),a=n?"hsla(":"rgba(",u=0,c,d,f,p;if(!i)return e;if(i=i.map(function(m){return(m=IA(m,n,1))&&a+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(f=RA(e),c=r.c,c.join(s)!==f.c.join(s)))for(d=e.replace(ua,"1").split(Au),p=d.length-1;u<p;u++)s+=d[u]+(~c.indexOf(u)?i.shift()||a+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split(ua),p=d.length-1;u<p;u++)s+=d[u]+i[u];return s+d[p]},ua=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Dd)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),eY=/hsl[a]?\(/,AA=function(e){var n=e.join(" "),r;if(ua.lastIndex=0,ua.test(n))return r=eY.test(n),e[1]=A8(e[1],r),e[0]=A8(e[0],r,RA(e[1])),!0},Cf,rs=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,u=[],c,d,f,p,m,_,x=function y(w){var S=t()-s,C=w===!0,P,T,I,A;if((S>e||S<0)&&(r+=S-n),s+=S,I=s-r,P=I-a,(P>0||C)&&(A=++p.frame,m=I-p.time*1e3,p.time=I=I/1e3,a+=P+(P>=i?4:i-P),T=1),C||(c=d(y)),T)for(_=0;_<u.length;_++)u[_](I,m,A,w)};return p={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(w){return m/(1e3/(w||60))},wake:function(){lA&&(!f2&&yw()&&(yi=f2=window,_w=yi.document||{},ds.gsap=Gr,(yi.gsapVersions||(yi.gsapVersions=[])).push(Gr.version),uA(d0||yi.GreenSockGlobals||!yi.gsap&&yi||{}),PA.forEach(TA)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&p.sleep(),d=f||function(w){return setTimeout(w,a-p.time*1e3+1|0)},Cf=1,x(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(c),Cf=0,d=Ef},lagSmoothing:function(w,S){e=w||1/0,n=Math.min(S||33,e)},fps:function(w){i=1e3/(w||240),a=p.time*1e3+i},add:function(w,S,C){var P=S?function(T,I,A,O){w(T,I,A,O),p.remove(P)}:w;return p.remove(w),u[C?"unshift":"push"](P),yc(),P},remove:function(w,S){~(S=u.indexOf(w))&&u.splice(S,1)&&_>=S&&_--},_listeners:u},p})(),yc=function(){return!Cf&&rs.wake()},ft={},tY=/^[\d.\-M][\d.\-,\s]/,nY=/["']/g,rY=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(nY,"").trim():+d,s=c.substr(u+1).trim();return n},sY=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)},iY=function(e){var n=(e+"").split("("),r=ft[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[rY(n[1])]:sY(e).split(",").map(pA)):ft._CE&&tY.test(e)?ft._CE("",e):r},oY=function(e){return function(n){return 1-e(1-n)}},Il=function(e,n){return e&&(hn(e)?e:ft[e]||iY(e))||n},Nl=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 Wr(e,function(u){ft[u]=ds[u]=i,ft[a=u.toLowerCase()]=r;for(var c in i)ft[a+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ft[u+"."+c]=i[c]}),i},MA=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},ey=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/d2*(Math.asin(1/s)||0),u=function(f){return f===1?1:s*Math.pow(2,-10*f)*RK((f-a)*i)+1},c=e==="out"?u:e==="in"?function(d){return 1-u(1-d)}:MA(u);return i=d2/i,c.config=function(d,f){return t(e,d,f)},c},ty=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)}:MA(r);return s.config=function(i){return t(e,i)},s};Wr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Nl(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})});ft.Linear.easeNone=ft.none=ft.Linear.easeIn;Nl("Elastic",ey("in"),ey("out"),ey());(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};Nl("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);Nl("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Nl("Circ",function(t){return-(sA(1-t*t)-1)});Nl("Sine",function(t){return t===1?1:-IK(t*PK)+1});Nl("Back",ty("in"),ty("out"),ty());ft.SteppedEase=ft.steps=ds.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-At;return function(u){return((s*Zf(0,a,u)|0)+i)*r}}};bf.ease=ft["quad.out"];Wr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return bw+=t+","+t+"Params,"});var LA=function(e,n){this.id=TK++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:fA,this.set=n?n.getSetter:Tw},Pf=(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,gc(this,+n.duration,1,1),this.data=n.data,Zt&&(this._ctx=Zt,Zt.data.push(this)),Cf||rs.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,gc(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(yc(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Z0(this,r),!i._dp||i.parent||gA(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)&&ki(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===At||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),hA(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+T8(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)+T8(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?vc(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-At?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?p0(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-At?0:this._rts,this.totalTime(Zf(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),q0(this),$K(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):(yc(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==At&&(this._tTime-=At)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=tn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&ki(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Br(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?p0(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=NK);var s=Jn;return Jn=r,Ew(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Jn=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,I8(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,I8(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(ks(this,r),Br(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Br(s)),this._dur||(this._zTime=-At),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?-At:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-At,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)-At)},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=hn(r)?r:mA,c=function(){var f=s.then;s.then=null,i&&i(),hn(u)&&(u=u(s))&&(u.then||u===s)&&(s.then=f),a(u),s.then=f};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?c():s._prom=c})},e.kill=function(){Od(this)},t})();fs(Pf.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:-At,_prom:0,_ps:!1,_rts:1});var $r=(function(t){rA(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=Br(r.sortChildren),nn&&ki(r.parent||nn,no(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&yA(no(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return Gd(0,arguments,this),this},n.from=function(s,i,a){return Gd(1,arguments,this),this},n.fromTo=function(s,i,a,u){return Gd(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,Zd(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Pn(s,i,ks(this,a),1),this},n.call=function(s,i,a){return ki(this,Pn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,u,c,d,f){return a.duration=i,a.stagger=a.stagger||u,a.onComplete=d,a.onCompleteParams=f,a.parent=this,new Pn(s,a,ks(this,c)),this},n.staggerFrom=function(s,i,a,u,c,d,f){return a.runBackwards=1,Zd(a).immediateRender=Br(a.immediateRender),this.staggerTo(s,i,a,u,c,d,f)},n.staggerFromTo=function(s,i,a,u,c,d,f,p){return u.startAt=a,Zd(u).immediateRender=Br(u.immediateRender),this.staggerTo(s,i,u,c,d,f,p)},n.render=function(s,i,a){var u=this._time,c=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:tn(s),p=this._zTime<0!=s<0&&(this._initted||!d),m,_,x,y,w,S,C,P,T,I,A,O;if(this!==nn&&f>c&&s>=0&&(f=c),f!==this._tTime||a||p){if(u!==this._time&&d&&(f+=this._time-u,s+=this._time-u),m=f,T=this._start,P=this._ts,S=!P,p&&(d||(u=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(A=this._yoyo,w=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(w*100+s,i,a);if(m=tn(f%w),f===c?(y=this._repeat,m=d):(I=tn(f/w),y=~~I,y&&y===I&&(m=d,y--),m>d&&(m=d)),I=vc(this._tTime,w),!u&&this._tTime&&I!==y&&this._tTime-I*w-this._dur<=0&&(I=y),A&&y&1&&(m=d-m,O=1),y!==I&&!this._lock){var R=A&&I&1,L=R===(A&&y&1);if(y<I&&(R=!R),u=R?0:f%d?d:f,this._lock=1,this.render(u||(O?0:tn(y*w)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&is(this,"onRepeat"),this.vars.repeatRefresh&&!O&&(this.invalidate()._lock=1,I=y),u&&u!==this._time||S!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,c=this._tDur,L&&(this._lock=2,u=R?d:-1e-4,this.render(u,!0),this.vars.repeatRefresh&&!O&&this.invalidate()),this._lock=0,!this._ts&&!S)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(C=BK(this,tn(u),tn(m)),C&&(f-=m-(m=C._start))),this._tTime=f,this._time=m,this._act=!!P,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,u=0),!u&&f&&d&&!i&&!I&&(is(this,"onStart"),this._tTime!==f))return this;if(m>=u&&s>=0)for(_=this._first;_;){if(x=_._next,(_._act||m>=_._start)&&_._ts&&C!==_){if(_.parent!==this)return this.render(s,i,a);if(_.render(_._ts>0?(m-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(m-_._start)*_._ts,i,a),m!==this._time||!this._ts&&!S){C=0,x&&(f+=this._zTime=-At);break}}_=x}else{_=this._last;for(var D=s<0?s:m;_;){if(x=_._prev,(_._act||D<=_._end)&&_._ts&&C!==_){if(_.parent!==this)return this.render(s,i,a);if(_.render(_._ts>0?(D-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(D-_._start)*_._ts,i,a||Jn&&Ew(_)),m!==this._time||!this._ts&&!S){C=0,x&&(f+=this._zTime=D?-At:At);break}}_=x}}if(C&&!i&&(this.pause(),C.render(m>=u?0:-At)._zTime=m>=u?1:-1,this._ts))return this._start=T,q0(this),this.render(s,i,a);this._onUpdate&&!i&&is(this,"onUpdate",!0),(f===c&&this._tTime>=this.totalDuration()||!f&&u)&&(T===this._start||Math.abs(P)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===c&&this._ts>0||!f&&this._ts<0)&&ga(this,1),!i&&!(s<0&&!u)&&(f||u||!c)&&(is(this,f===c&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<c&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var a=this;if(xo(i)||(i=ks(this,i,s)),!(s instanceof Pf)){if(dr(s))return s.forEach(function(u){return a.add(u,i)}),this;if(zn(s))return this.addLabel(s,i);if(hn(s))s=Pn.delayedCall(0,s);else return this}return this!==s?ki(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=-Is);for(var c=[],d=this._first;d;)d._start>=u&&(d instanceof Pn?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 zn(s)?this.removeLabel(s):hn(s)?this.killTweensOf(s):(s.parent===this&&W0(this,s),s===this._recent&&(this._recent=this._last),Tl(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=tn(rs.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]=ks(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var u=Pn.delayedCall(0,i||Ef,a);return u.data="isPause",this._hasPause=1,ki(this,u,ks(this,s))},n.removePause=function(s){var i=this._first;for(s=ks(this,s);i;)i._start===s&&i.data==="isPause"&&ga(i),i=i._next},n.killTweensOf=function(s,i,a){for(var u=this.getTweensOf(s,a),c=u.length;c--;)ra!==u[c]&&u[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],u=Rs(s),c=this._first,d=xo(i),f;c;)c instanceof Pn?jK(c._targets,u)&&(d?(!ra||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&a.push(c):(f=c.getTweensOf(u,i)).length&&a.push.apply(a,f),c=c._next;return a},n.tweenTo=function(s,i){i=i||{};var a=this,u=ks(a,s),c=i,d=c.startAt,f=c.onStart,p=c.onStartParams,m=c.immediateRender,_,x=Pn.to(a,fs({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())||At,onStart:function(){if(a.pause(),!_){var w=i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale());x._dur!==w&&gc(x,w,0,1).render(x._time,!0,!0),_=1}f&&f.apply(x,p||[])}},i));return m?x.render(0):x},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,fs({startAt:{time:ks(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),R8(this,ks(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),R8(this,ks(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+At)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var u=this._first,c=this.labels,d;for(s=tn(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 Tl(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={}),Tl(this)},n.totalDuration=function(s){var i=0,a=this,u=a._last,c=Is,d,f,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(),f=u._start,f>c&&a._sort&&u._ts&&!a._lock?(a._lock=1,ki(a,u,f-u._delay,1)._lock=0):c=f,f<0&&u._ts&&(i-=f,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=tn(f/a._ts),a._time-=f,a._tTime-=f),a.shiftChildren(-f,!1,-1/0),c=0),u._end>i&&u._ts&&(i=u._end),u=d;gc(a,a===nn&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(nn._ts&&(hA(nn,p0(s,nn)),dA=rs.frame),rs.frame>=C8){C8+=us.autoSleep||120;var i=nn._first;if((!i||!i._ts)&&us.autoSleep&&rs._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||rs.sleep()}}},e})(Pf);fs($r.prototype,{_lock:0,_hasPause:0,_forcing:0});var aY=function(e,n,r,s,i,a,u){var c=new qr(this._pt,e,n,0,1,VA,null,i),d=0,f=0,p,m,_,x,y,w,S,C;for(c.b=r,c.e=s,r+="",s+="",(S=~s.indexOf("random("))&&(s=kf(s)),a&&(C=[r,s],a(C,e,n),r=C[0],s=C[1]),m=r.match(X1)||[];p=X1.exec(s);)x=p[0],y=s.substring(d,p.index),_?_=(_+1)%5:y.substr(-5)==="rgba("&&(_=1),x!==m[f++]&&(w=parseFloat(m[f-1])||0,c._pt={_next:c._pt,p:y||f===1?y:",",s:w,c:x.charAt(1)==="="?zu(w,x)-w:parseFloat(x)-w,m:_&&_<4?Math.round:0},d=X1.lastIndex);return c.c=d<s.length?s.substring(d,s.length):"",c.fp=u,(aA.test(s)||S)&&(c.e=0),this._pt=c,c},kw=function(e,n,r,s,i,a,u,c,d,f){hn(s)&&(s=s(i||0,e,a));var p=e[n],m=r!=="get"?r:hn(p)?d?e[n.indexOf("set")||!hn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,_=hn(p)?d?fY:jA:Pw,x;if(zn(s)&&(~s.indexOf("random(")&&(s=kf(s)),s.charAt(1)==="="&&(x=zu(m,s)+(lr(m)||0),(x||x===0)&&(s=x))),!f||m!==s||_2)return!isNaN(m*s)&&s!==""?(x=new qr(this._pt,e,n,+m||0,s-(m||0),typeof p=="boolean"?pY:FA,0,_),d&&(x.fp=d),u&&x.modifier(u,this,e),this._pt=x):(!p&&!(n in e)&&xw(n,s),aY.call(this,e,n,m,s,_,c||us.stringFilter,d))},lY=function(e,n,r,s,i){if(hn(e)&&(e=Kd(e,i,n,r,s)),!Li(e)||e.style&&e.nodeType||dr(e)||iA(e))return zn(e)?Kd(e,i,n,r,s):e;var a={},u;for(u in e)a[u]=Kd(e[u],i,n,r,s);return a},OA=function(e,n,r,s,i,a){var u,c,d,f;if(ns[e]&&(u=new ns[e]).init(i,u.rawVars?n[e]:lY(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=c=new qr(r._pt,i,e,0,1,u.render,u,0,u.priority),r!==Mu))for(d=r._ptLookup[r._targets.indexOf(i)],f=u._props.length;f--;)d[u._props[f]]=c;return u},ra,_2,Cw=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,u=s.immediateRender,c=s.lazy,d=s.onUpdate,f=s.runBackwards,p=s.yoyoEase,m=s.keyframes,_=s.autoRevert,x=e._dur,y=e._startAt,w=e._targets,S=e.parent,C=S&&S.data==="nested"?S.vars.targets:w,P=e._overwrite==="auto"&&!vw,T=e.timeline,I=s.easeReverse||p,A,O,R,L,D,j,F,Z,Q,K,q,W,H;if(T&&(!m||!i)&&(i="none"),e._ease=Il(i,bf.ease),e._rEase=I&&(Il(I)||e._ease),e._from=!T&&!!s.runBackwards,e._from&&(e.ratio=1),!T||m&&!s.stagger){if(Z=w[0]?Pl(w[0]).harness:0,W=Z&&s[Z.prop],A=h0(s,ww),y&&(y._zTime<0&&y.progress(1),n<0&&f&&u&&!_?y.render(-1,!0):y.revert(f&&x?cm:DK),y._lazy=0),a){if(ga(e._startAt=Pn.set(w,fs({data:"isStart",overwrite:!1,parent:S,immediateRender:!0,lazy:!y&&Br(c),startAt:null,delay:0,onUpdate:d&&function(){return is(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Jn||!u&&!_)&&e._startAt.revert(cm),u&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&x&&!y){if(n&&(u=!1),R=fs({overwrite:!1,data:"isFromStart",lazy:u&&!y&&Br(c),immediateRender:u,stagger:0,parent:S},A),W&&(R[Z.prop]=W),ga(e._startAt=Pn.set(w,R)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Jn?e._startAt.revert(cm):e._startAt.render(-1,!0)),e._zTime=n,!u)t(e._startAt,At,At);else if(!n)return}for(e._pt=e._ptCache=0,c=x&&Br(c)||c&&!x,O=0;O<w.length;O++){if(D=w[O],F=D._gsap||Sw(w)[O]._gsap,e._ptLookup[O]=K={},h2[F.id]&&la.length&&f0(),q=C===w?O:C.indexOf(D),Z&&(Q=new Z).init(D,W||A,e,q,C)!==!1&&(e._pt=L=new qr(e._pt,D,Q.name,0,1,Q.render,Q,0,Q.priority),Q._props.forEach(function(X){K[X]=L}),Q.priority&&(j=1)),!Z||W)for(R in A)ns[R]&&(Q=OA(R,A,e,q,D,C))?Q.priority&&(j=1):K[R]=L=kw.call(e,D,R,"get",A[R],q,C,0,s.stringFilter);e._op&&e._op[O]&&e.kill(D,e._op[O]),P&&e._pt&&(ra=e,nn.killTweensOf(D,K,e.globalTime(n)),H=!e.parent,ra=0),e._pt&&c&&(h2[F.id]=1)}j&&$A(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!H,m&&n<=0&&T.render(Is,!0,!0)},uY=function(e,n,r,s,i,a,u,c){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,p,m,_;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,_=e._targets.length;_--;){if(f=m[_][n],f&&f.d&&f.d._pt)for(f=f.d._pt;f&&f.p!==n&&f.fp!==n;)f=f._next;if(!f)return _2=1,e.vars[n]="+=0",Cw(e,u),_2=0,c?Sf(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(_=d.length;_--;)p=d[_],f=p._pt||p,f.s=(s||s===0)&&!i?s:f.s+(s||0)+a*f.c,f.c=r-f.s,p.e&&(p.e=_n(r)+lr(p.e)),p.b&&(p.b=f.s+lr(p.b))},cY=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=mc({},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},dY=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,u;if(dr(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})},Kd=function(e,n,r,s,i){return hn(e)?e.call(n,r,s,i):zn(e)&&~e.indexOf("random(")?kf(e):e},DA=bw+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",NA={};Wr(DA+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return NA[t]=1});var Pn=(function(t){rA(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:Zd(s))||this;var c=u.vars,d=c.duration,f=c.delay,p=c.immediateRender,m=c.stagger,_=c.overwrite,x=c.keyframes,y=c.defaults,w=c.scrollTrigger,S=s.parent||nn,C=(dr(r)||iA(r)?xo(r[0]):"length"in s)?[r]:Rs(r),P,T,I,A,O,R,L,D;if(u._targets=C.length?Sw(C):Sf("GSAP target "+r+" not found. https://gsap.com",!us.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=_,x||m||$p(d)||$p(f)){s=u.vars;var j=s.easeReverse||s.yoyoEase;if(P=u.timeline=new $r({data:"nested",defaults:y||{},targets:S&&S.data==="nested"?S.vars.targets:C}),P.kill(),P.parent=P._dp=no(u),P._start=0,m||$p(d)||$p(f)){if(A=C.length,L=m&&bA(m),Li(m))for(O in m)~DA.indexOf(O)&&(D||(D={}),D[O]=m[O]);for(T=0;T<A;T++)I=h0(s,NA),I.stagger=0,j&&(I.easeReverse=j),D&&mc(I,D),R=C[T],I.duration=+Kd(d,no(u),T,R,C),I.delay=(+Kd(f,no(u),T,R,C)||0)-u._delay,!m&&A===1&&I.delay&&(u._delay=f=I.delay,u._start+=f,I.delay=0),P.to(R,I,L?L(T,R,C):0),P._ease=ft.none;P.duration()?d=f=0:u.timeline=0}else if(x){Zd(fs(P.vars.defaults,{ease:"none"})),P._ease=Il(x.ease||s.ease||"none");var F=0,Z,Q,K;if(dr(x))x.forEach(function(q){return P.to(C,q,">")}),P.duration();else{I={};for(O in x)O==="ease"||O==="easeEach"||dY(O,x[O],I,x.easeEach);for(O in I)for(Z=I[O].sort(function(q,W){return q.t-W.t}),F=0,T=0;T<Z.length;T++)Q=Z[T],K={ease:Q.e,duration:(Q.t-(T?Z[T-1].t:0))/100*d},K[O]=Q.v,P.to(C,K,F),F+=K.duration;P.duration()<d&&P.to({},{duration:d-P.duration()})}}d||u.duration(d=P.duration())}else u.timeline=0;return _===!0&&!vw&&(ra=no(u),nn.killTweensOf(C),ra=0),ki(S,no(u),i),s.reversed&&u.reverse(),s.paused&&u.paused(!0),(p||!d&&!x&&u._start===tn(S._time)&&Br(p)&&HK(no(u))&&S.data!=="nested")&&(u._tTime=-At,u.render(Math.max(0,-f)||0)),w&&yA(no(u),w),u}var n=e.prototype;return n.render=function(s,i,a){var u=this._time,c=this._tDur,d=this._dur,f=s<0,p=s>c-At&&!f?c:s<At?0:s,m,_,x,y,w,S,C,P;if(!d)UK(this,s,i,a);else if(p!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(m=p,P=this.timeline,this._repeat){if(y=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(y*100+s,i,a);if(m=tn(p%y),p===c?(x=this._repeat,m=d):(w=tn(p/y),x=~~w,x&&x===w?(m=d,x--):m>d&&(m=d)),S=this._yoyo&&x&1,S&&(m=d-m),w=vc(this._tTime,y),m===u&&!a&&this._initted&&x===w)return this._tTime=p,this;x!==w&&this.vars.repeatRefresh&&!S&&!this._lock&&m!==y&&this._initted&&(this._lock=a=1,this.render(tn(y*x),!0).invalidate()._lock=0)}if(!this._initted){if(_A(this,f?s:m,a,i,p))return this._tTime=0,this;if(u!==this._time&&!(a&&this.vars.repeatRefresh&&x!==w))return this;if(d!==this._dur)return this.render(s,i,a)}if(this._rEase){var T=m<u;if(T!==this._inv){var I=T?u:d-u;this._inv=T,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=u,this._invRecip=I?(T?-1:1)/I:0,this._invScale=T?-this.ratio:1-this.ratio,this._invEase=T?this._rEase:this._ease}this.ratio=C=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=C=this._ease(m/d);if(this._from&&(this.ratio=C=1-C),this._tTime=p,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!u&&p&&!i&&!w&&(is(this,"onStart"),this._tTime!==p))return this;for(_=this._pt;_;)_.r(C,_.d),_=_._next;P&&P.render(s<0?s:P._dur*P._ease(m/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&p2(this,s,i,a),is(this,"onUpdate")),this._repeat&&x!==w&&this.vars.onRepeat&&!i&&this.parent&&is(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(f&&!this._onUpdate&&p2(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&ga(this,1),!i&&!(f&&!u)&&(p||u||S)&&(is(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||rs.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||Cw(this,d),f=this._ease(d/this._dur),uY(this,s,i,a,u,f,d,c)?this.resetTo(s,i,a,u,1):(Z0(this,0),this.parent||vA(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?Od(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Jn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,ra&&ra.vars.overwrite!==!0)._first||Od(this),this.parent&&a!==this.timeline.totalDuration()&&gc(this,this._dur*this.timeline._tDur/a,0,1),this}var u=this._targets,c=s?Rs(s):u,d=this._ptLookup,f=this._pt,p,m,_,x,y,w,S;if((!i||i==="all")&&VK(u,c))return i==="all"&&(this._pt=0),Od(this);for(p=this._op=this._op||[],i!=="all"&&(zn(i)&&(y={},Wr(i,function(C){return y[C]=1}),i=y),i=cY(u,i)),S=u.length;S--;)if(~c.indexOf(u[S])){m=d[S],i==="all"?(p[S]=i,x=m,_={}):(_=p[S]=p[S]||{},x=i);for(y in x)w=m&&m[y],w&&((!("kill"in w.d)||w.d.kill(y)===!0)&&W0(this,w,"_pt"),delete m[y]),_!=="all"&&(_[y]=1)}return this._initted&&!this._pt&&f&&Od(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Gd(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 Gd(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 nn.killTweensOf(s,i,a)},e})(Pf);fs(Pn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Wr("staggerTo,staggerFrom,staggerFromTo",function(t){Pn[t]=function(){var e=new $r,n=v2.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var Pw=function(e,n,r){return e[n]=r},jA=function(e,n,r){return e[n](r)},fY=function(e,n,r,s){return e[n](s.fp,r)},hY=function(e,n,r){return e.setAttribute(n,r)},Tw=function(e,n){return hn(e[n])?jA:gw(e[n])&&e.setAttribute?hY:Pw},FA=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},pY=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},VA=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)},Iw=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},mY=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},vY=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?W0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},gY=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},$A=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},qr=(function(){function t(n,r,s,i,a,u,c,d,f){this.t=r,this.s=i,this.c=a,this.p=s,this.r=u||FA,this.d=c||this,this.set=d||Pw,this.pr=f||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=gY,this.m=r,this.mt=i,this.tween=s},t})();Wr(bw+"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 ww[t]=1});ds.TweenMax=ds.TweenLite=Pn;ds.TimelineLite=ds.TimelineMax=$r;nn=new $r({sortChildren:!1,defaults:bf,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});us.stringFilter=AA;var Rl=[],fm={},yY=[],M8=0,_Y=0,ny=function(e){return(fm[e]||yY).map(function(n){return n()})},x2=function(){var e=Date.now(),n=[];e-M8>2&&(ny("matchMediaInit"),Rl.forEach(function(r){var s=r.queries,i=r.conditions,a,u,c,d;for(u in s)a=yi.matchMedia(s[u]).matches,a&&(c=1),a!==i[u]&&(i[u]=a,d=1);d&&(r.revert(),c&&n.push(r))}),ny("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),M8=e,ny("matchMedia"))},HA=(function(){function t(n,r){this.selector=r&&g2(r),this.data=[],this._r=[],this.isReverted=!1,this.id=_Y++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){hn(r)&&(i=s,s=r,r=hn);var a=this,u=function(){var d=Zt,f=a.selector,p;return d&&d!==a&&d.data.push(a),i&&(a.selector=g2(i)),Zt=a,p=s.apply(a,arguments),hn(p)&&a._r.push(p),Zt=d,a.selector=f,a.isReverted=!1,p};return a.last=u,r===hn?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 Pn&&!(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(f){return u.splice(u.indexOf(f),1)}));for(u.map(function(f){return{g:f._dur||f._delay||f._sat&&!f._sat.vars.immediateRender?f.globalTime(0):-1/0,t:f}}).sort(function(f,p){return p.g-f.g||-1/0}).forEach(function(f){return f.t.revert(r)}),c=i.data.length;c--;)d=i.data[c],d instanceof $r?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof Pn)&&d.revert&&d.revert(r);i._r.forEach(function(f){return f(r,i)}),i.isReverted=!0})():this.data.forEach(function(u){return u.kill&&u.kill()}),this.clear(),s)for(var a=Rl.length;a--;)Rl[a].id===this.id&&Rl.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),xY=(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){Li(r)||(r={matches:r});var a=new HA(0,i||this.scope),u=a.conditions={},c,d,f;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"?f=1:(c=yi.matchMedia(r[d]),c&&(Rl.indexOf(a)<0&&Rl.push(a),(u[d]=c.matches)&&(f=1),c.addListener?c.addListener(x2):c.addEventListener("change",x2)));return f&&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})(),m0={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 TA(s)})},timeline:function(e){return new $r(e)},getTweensOf:function(e,n){return nn.getTweensOf(e,n)},getProperty:function(e,n,r,s){zn(e)&&(e=Rs(e)[0]);var i=Pl(e||{}).get,a=r?mA:pA;return r==="native"&&(r=""),e&&(n?a((ns[n]&&ns[n].get||i)(e,n,r,s)):function(u,c,d){return a((ns[u]&&ns[u].get||i)(e,u,c,d))})},quickSetter:function(e,n,r){if(e=Rs(e),e.length>1){var s=e.map(function(f){return Gr.quickSetter(f,n,r)}),i=s.length;return function(f){for(var p=i;p--;)s[p](f)}}e=e[0]||{};var a=ns[n],u=Pl(e),c=u.harness&&(u.harness.aliases||{})[n]||n,d=a?function(f){var p=new a;Mu._pt=0,p.init(e,r?f+r:f,Mu,0,[e]),p.render(1,p),Mu._pt&&Iw(1,Mu)}:u.set(e,c);return a?d:function(f){return d(e,c,r?f+r:f,u,1)}},quickTo:function(e,n,r){var s,i=Gr.to(e,fs((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(c,d,f){return i.resetTo(n,c,d,f)};return a.tween=i,a},isTweening:function(e){return nn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Il(e.ease,bf.ease)),P8(bf,e||{})},config:function(e){return P8(us,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&&!ns[u]&&!ds[u]&&Sf(n+" effect requires "+u+" plugin.")}),Q1[n]=function(u,c,d){return r(Rs(u),fs(c||{},i),d)},a&&($r.prototype[n]=function(u,c,d){return this.add(Q1[n](u,Li(c)?c:(d=c)&&{},this),d)})},registerEase:function(e,n){ft[e]=Il(n)},parseEase:function(e,n){return arguments.length?Il(e,n):ft},getById:function(e){return nn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new $r(e),s,i;for(r.smoothChildTiming=Br(e.smoothChildTiming),nn.remove(r),r._dp=0,r._time=r._tTime=nn._time,s=nn._first;s;)i=s._next,(n||!(!s._dur&&s instanceof Pn&&s.vars.onComplete===s._targets[0]))&&ki(r,s,s._start-s._delay),s=i;return ki(nn,r,0),r},context:function(e,n){return e?new HA(e,n):Zt},matchMedia:function(e){return new xY(e)},matchMediaRefresh:function(){return Rl.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||x2()},addEventListener:function(e,n){var r=fm[e]||(fm[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=fm[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:XK,wrapYoyo:QK,distribute:bA,random:EA,snap:SA,normalize:YK,getUnit:lr,clamp:qK,splitColor:IA,toArray:Rs,selector:g2,mapRange:CA,pipe:GK,unitize:KK,interpolate:JK,shuffle:wA},install:uA,effects:Q1,ticker:rs,updateRoot:$r.updateRoot,plugins:ns,globalTimeline:nn,core:{PropTween:qr,globals:cA,Tween:Pn,Timeline:$r,Animation:Pf,getCache:Pl,_removeLinkedListItem:W0,reverting:function(){return Jn},context:function(e){return e&&Zt&&(Zt.data.push(e),e._ctx=Zt),Zt},suppressOverwrites:function(e){return vw=e}}};Wr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return m0[t]=Pn[t]});rs.add($r.updateRoot);Mu=m0.to({},{duration:0});var wY=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},bY=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=wY(a,s)),a&&a.modifier&&a.modifier(n[s],e,r[i],s))},ry=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(u){var c,d;if(zn(i)&&(c={},Wr(i,function(f){return c[f]=1}),i=c),n){c={};for(d in i)c[d]=n(i[d]);i=c}bY(u,i)}}}},Gr=m0.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;)Jn?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)}},ry("roundProps",y2),ry("modifiers"),ry("snap",SA))||m0;Pn.version=$r.version=Gr.version="3.15.0";lA=1;yw()&&yc();ft.Power0;ft.Power1;ft.Power2;ft.Power3;ft.Power4;ft.Linear;ft.Quad;ft.Cubic;ft.Quart;ft.Quint;ft.Strong;ft.Elastic;ft.Back;ft.SteppedEase;ft.Bounce;ft.Sine;ft.Expo;ft.Circ;/*!
123
+ * CSSPlugin 3.15.0
124
+ * https://gsap.com
125
+ *
126
+ * Copyright 2008-2026, GreenSock. All rights reserved.
127
+ * Subject to the terms at https://gsap.com/standard-license
128
+ * @author: Jack Doyle, jack@greensock.com
129
+ */var L8,sa,Uu,Rw,hl,O8,Aw,SY=function(){return typeof window<"u"},wo={},ol=180/Math.PI,Bu=Math.PI/180,_u=Math.atan2,D8=1e8,Mw=/([A-Z])/g,EY=/(left|right|width|margin|padding|x)/i,kY=/[\s,\(]\S/,Ti={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},w2=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},CY=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)},PY=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)},TY=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)},IY=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},zA=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},UA=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},RY=function(e,n,r){return e.style[n]=r},AY=function(e,n,r){return e.style.setProperty(n,r)},MY=function(e,n,r){return e._gsap[n]=r},LY=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},OY=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},DY=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},rn="transform",Zr=rn+"Origin",NY=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in wo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Ti[e]||e,~e.indexOf(",")?e.split(",").forEach(function(u){return r.tfm[u]=so(s,u)}):this.tfm[e]=a.x?a[e]:so(s,e),e===Zr&&(this.tfm.zOrigin=a.zOrigin);else return Ti.transform.split(",").forEach(function(u){return t.call(r,u,n)});if(this.props.indexOf(rn)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Zr,n,"")),e=rn}(i||n)&&this.props.push(e,n,i[e])},BA=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},jY=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(Mw,"-$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=Aw(),(!i||!i.isStart)&&!r[rn]&&(BA(r),s.zOrigin&&r[Zr]&&(r[Zr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},WA=function(e,n){var r={target:e,props:[],revert:jY,save:NY};return e._gsap||Gr.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},qA,b2=function(e,n){var r=sa.createElementNS?sa.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):sa.createElement(e);return r&&r.style?r:sa.createElement(e)},os=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(Mw,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,_c(n)||n,1)||""},N8="O,Moz,ms,Ms,Webkit".split(","),_c=function(e,n,r){var s=n||hl,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(N8[a]+e in i););return a<0?null:(a===3?"ms":a>=0?N8[a]:"")+e},S2=function(){SY()&&window.document&&(L8=window,sa=L8.document,Uu=sa.documentElement,hl=b2("div")||{style:{}},b2("div"),rn=_c(rn),Zr=rn+"Origin",hl.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",qA=!!_c("perspective"),Aw=Gr.core.reverting,Rw=1)},j8=function(e){var n=e.ownerSVGElement,r=b2("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Uu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Uu.removeChild(r),i},F8=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},ZA=function(e){var n,r;try{n=e.getBBox()}catch{n=j8(e),r=1}return n&&(n.width||n.height)||r||(n=j8(e)),n&&!n.width&&!n.x&&!n.y?{x:+F8(e,["x","cx","x1"])||0,y:+F8(e,["y","cy","y1"])||0,width:0,height:0}:n},GA=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&ZA(e))},ya=function(e,n){if(n){var r=e.style,s;n in wo&&n!==Zr&&(n=rn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(Mw,"-$1").toLowerCase())):r.removeAttribute(n)}},ia=function(e,n,r,s,i,a){var u=new qr(e._pt,n,r,0,1,a?UA:zA);return e._pt=u,u.b=s,u.e=i,e._props.push(r),u},V8={deg:1,rad:1,turn:1},FY={grid:1,flex:1},_a=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",u=hl.style,c=EY.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(c?"Width":"Height"),p=100,m=s==="px",_=s==="%",x,y,w,S;if(s===a||!i||V8[s]||V8[a])return i;if(a!=="px"&&!m&&(i=t(e,n,r,"px")),S=e.getCTM&&GA(e),(_||a==="%")&&(wo[n]||~n.indexOf("adius")))return x=S?e.getBBox()[c?"width":"height"]:e[f],_n(_?i/x*p:i/100*x);if(u[c?"width":"height"]=p+(m?a:s),y=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,S&&(y=(e.ownerSVGElement||{}).parentNode),(!y||y===sa||!y.appendChild)&&(y=sa.body),w=y._gsap,w&&_&&w.width&&c&&w.time===rs.time&&!w.uncache)return _n(i/w.width*p);if(_&&(n==="height"||n==="width")){var C=e.style[n];e.style[n]=p+s,x=e[f],C?e.style[n]=C:ya(e,n)}else(_||a==="%")&&!FY[os(y,"display")]&&(u.position=os(e,"position")),y===e&&(u.position="static"),y.appendChild(hl),x=hl[f],y.removeChild(hl),u.position="absolute";return c&&_&&(w=Pl(y),w.time=rs.time,w.width=y[f]),_n(m?x*i/p:x&&i?p/x*i:0)},so=function(e,n,r,s){var i;return Rw||S2(),n in Ti&&n!=="transform"&&(n=Ti[n],~n.indexOf(",")&&(n=n.split(",")[0])),wo[n]&&n!=="transform"?(i=If(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:g0(os(e,Zr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=v0[n]&&v0[n](e,n,r)||os(e,n)||fA(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?_a(e,n,i,r)+r:i},VY=function(e,n,r,s){if(!r||r==="none"){var i=_c(n,e,1),a=i&&os(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=os(e,"borderTopColor"))}var u=new qr(this._pt,e.style,n,0,1,VA),c=0,d=0,f,p,m,_,x,y,w,S,C,P,T,I;if(u.b=r,u.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=os(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(y=e.style[n],e.style[n]=s,s=os(e,n)||s,y?e.style[n]=y:ya(e,n)),f=[r,s],AA(f),r=f[0],s=f[1],m=r.match(Au)||[],I=s.match(Au)||[],I.length){for(;p=Au.exec(s);)w=p[0],C=s.substring(c,p.index),x?x=(x+1)%5:(C.substr(-5)==="rgba("||C.substr(-5)==="hsla(")&&(x=1),w!==(y=m[d++]||"")&&(_=parseFloat(y)||0,T=y.substr((_+"").length),w.charAt(1)==="="&&(w=zu(_,w)+T),S=parseFloat(w),P=w.substr((S+"").length),c=Au.lastIndex-P.length,P||(P=P||us.units[n]||T,c===s.length&&(s+=P,u.e+=P)),T!==P&&(_=_a(e,n,y,P)||0),u._pt={_next:u._pt,p:C||d===1?C:",",s:_,c:S-_,m:x&&x<4||n==="zIndex"?Math.round:0});u.c=c<s.length?s.substring(c,s.length):""}else u.r=n==="display"&&s==="none"?UA:zA;return aA.test(s)&&(u.e=0),this._pt=u,u},$8={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},$Y=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]=$8[r]||r,n[1]=$8[s]||s,n.join(" ")},HY=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],wo[u]&&(c=1,u=u==="transformOrigin"?Zr:rn),ya(r,u);c&&(ya(r,rn),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",If(r,1),a.uncache=1,BA(s)))}},v0={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new qr(e._pt,n,r,0,0,HY);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},Tf=[1,0,0,1,0,0],KA={},YA=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},H8=function(e){var n=os(e,rn);return YA(n)?Tf:n.substr(7).match(oA).map(_n)},Lw=function(e,n){var r=e._gsap||Pl(e),s=e.style,i=H8(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"?Tf:i):(i===Tf&&!e.offsetParent&&e!==Uu&&!r.svg&&(c=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,u=e.nextElementSibling,Uu.appendChild(e)),i=H8(e),c?s.display=c:ya(e,"display"),d&&(u?a.insertBefore(e,u):a?a.appendChild(e):Uu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},E2=function(e,n,r,s,i,a){var u=e._gsap,c=i||Lw(e,!0),d=u.xOrigin||0,f=u.yOrigin||0,p=u.xOffset||0,m=u.yOffset||0,_=c[0],x=c[1],y=c[2],w=c[3],S=c[4],C=c[5],P=n.split(" "),T=parseFloat(P[0])||0,I=parseFloat(P[1])||0,A,O,R,L;r?c!==Tf&&(O=_*w-x*y)&&(R=T*(w/O)+I*(-y/O)+(y*C-w*S)/O,L=T*(-x/O)+I*(_/O)-(_*C-x*S)/O,T=R,I=L):(A=ZA(e),T=A.x+(~P[0].indexOf("%")?T/100*A.width:T),I=A.y+(~(P[1]||P[0]).indexOf("%")?I/100*A.height:I)),s||s!==!1&&u.smooth?(S=T-d,C=I-f,u.xOffset=p+(S*_+C*y)-S,u.yOffset=m+(S*x+C*w)-C):u.xOffset=u.yOffset=0,u.xOrigin=T,u.yOrigin=I,u.smooth=!!s,u.origin=n,u.originIsAbsolute=!!r,e.style[Zr]="0px 0px",a&&(ia(a,u,"xOrigin",d,T),ia(a,u,"yOrigin",f,I),ia(a,u,"xOffset",p,u.xOffset),ia(a,u,"yOffset",m,u.yOffset)),e.setAttribute("data-svg-origin",T+" "+I)},If=function(e,n){var r=e._gsap||new LA(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=os(e,Zr)||"0",f,p,m,_,x,y,w,S,C,P,T,I,A,O,R,L,D,j,F,Z,Q,K,q,W,H,X,z,N,Y,oe,J,se;return f=p=m=y=w=S=C=P=T=0,_=x=1,r.svg=!!(e.getCTM&&GA(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[rn]=(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[rn]!=="none"?c[rn]:"")),s.scale=s.rotate=s.translate="none"),O=Lw(e,r.svg),r.svg&&(r.uncache?(H=e.getBBox(),d=r.xOrigin-H.x+"px "+(r.yOrigin-H.y)+"px",W=""):W=!n&&e.getAttribute("data-svg-origin"),E2(e,W||d,!!W||r.originIsAbsolute,r.smooth!==!1,O)),I=r.xOrigin||0,A=r.yOrigin||0,O!==Tf&&(j=O[0],F=O[1],Z=O[2],Q=O[3],f=K=O[4],p=q=O[5],O.length===6?(_=Math.sqrt(j*j+F*F),x=Math.sqrt(Q*Q+Z*Z),y=j||F?_u(F,j)*ol:0,C=Z||Q?_u(Z,Q)*ol+y:0,C&&(x*=Math.abs(Math.cos(C*Bu))),r.svg&&(f-=I-(I*j+A*Z),p-=A-(I*F+A*Q))):(se=O[6],oe=O[7],z=O[8],N=O[9],Y=O[10],J=O[11],f=O[12],p=O[13],m=O[14],R=_u(se,Y),w=R*ol,R&&(L=Math.cos(-R),D=Math.sin(-R),W=K*L+z*D,H=q*L+N*D,X=se*L+Y*D,z=K*-D+z*L,N=q*-D+N*L,Y=se*-D+Y*L,J=oe*-D+J*L,K=W,q=H,se=X),R=_u(-Z,Y),S=R*ol,R&&(L=Math.cos(-R),D=Math.sin(-R),W=j*L-z*D,H=F*L-N*D,X=Z*L-Y*D,J=Q*D+J*L,j=W,F=H,Z=X),R=_u(F,j),y=R*ol,R&&(L=Math.cos(R),D=Math.sin(R),W=j*L+F*D,H=K*L+q*D,F=F*L-j*D,q=q*L-K*D,j=W,K=H),w&&Math.abs(w)+Math.abs(y)>359.9&&(w=y=0,S=180-S),_=_n(Math.sqrt(j*j+F*F+Z*Z)),x=_n(Math.sqrt(q*q+se*se)),R=_u(K,q),C=Math.abs(R)>2e-4?R*ol:0,T=J?1/(J<0?-J:J):0),r.svg&&(W=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!YA(os(e,rn)),W&&e.setAttribute("transform",W))),Math.abs(C)>90&&Math.abs(C)<270&&(i?(_*=-1,C+=y<=0?180:-180,y+=y<=0?180:-180):(x*=-1,C+=C<=0?180:-180)),n=n||r.uncache,r.x=f-((r.xPercent=f&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-f)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+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=_n(_),r.scaleY=_n(x),r.rotation=_n(y)+u,r.rotationX=_n(w)+u,r.rotationY=_n(S)+u,r.skewX=C+u,r.skewY=P+u,r.transformPerspective=T+a,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Zr]=g0(d)),r.xOffset=r.yOffset=0,r.force3D=us.force3D,r.renderTransform=r.svg?UY:qA?XA:zY,r.uncache=0,r},g0=function(e){return(e=e.split(" "))[0]+" "+e[1]},sy=function(e,n,r){var s=lr(n);return _n(parseFloat(n)+parseFloat(_a(e,"x",r+"px",s)))+s},zY=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,XA(e,n)},Ja="0deg",Cd="0px",el=") ",XA=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,f=r.rotationY,p=r.rotationX,m=r.skewX,_=r.skewY,x=r.scaleX,y=r.scaleY,w=r.transformPerspective,S=r.force3D,C=r.target,P=r.zOrigin,T="",I=S==="auto"&&e&&e!==1||S===!0;if(P&&(p!==Ja||f!==Ja)){var A=parseFloat(f)*Bu,O=Math.sin(A),R=Math.cos(A),L;A=parseFloat(p)*Bu,L=Math.cos(A),a=sy(C,a,O*L*-P),u=sy(C,u,-Math.sin(A)*-P),c=sy(C,c,R*L*-P+P)}w!==Cd&&(T+="perspective("+w+el),(s||i)&&(T+="translate("+s+"%, "+i+"%) "),(I||a!==Cd||u!==Cd||c!==Cd)&&(T+=c!==Cd||I?"translate3d("+a+", "+u+", "+c+") ":"translate("+a+", "+u+el),d!==Ja&&(T+="rotate("+d+el),f!==Ja&&(T+="rotateY("+f+el),p!==Ja&&(T+="rotateX("+p+el),(m!==Ja||_!==Ja)&&(T+="skew("+m+", "+_+el),(x!==1||y!==1)&&(T+="scale("+x+", "+y+el),C.style[rn]=T||"translate(0, 0)"},UY=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,f=r.skewY,p=r.scaleX,m=r.scaleY,_=r.target,x=r.xOrigin,y=r.yOrigin,w=r.xOffset,S=r.yOffset,C=r.forceCSS,P=parseFloat(a),T=parseFloat(u),I,A,O,R,L;c=parseFloat(c),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,c+=f),c||d?(c*=Bu,d*=Bu,I=Math.cos(c)*p,A=Math.sin(c)*p,O=Math.sin(c-d)*-m,R=Math.cos(c-d)*m,d&&(f*=Bu,L=Math.tan(d-f),L=Math.sqrt(1+L*L),O*=L,R*=L,f&&(L=Math.tan(f),L=Math.sqrt(1+L*L),I*=L,A*=L)),I=_n(I),A=_n(A),O=_n(O),R=_n(R)):(I=p,R=m,A=O=0),(P&&!~(a+"").indexOf("px")||T&&!~(u+"").indexOf("px"))&&(P=_a(_,"x",a,"px"),T=_a(_,"y",u,"px")),(x||y||w||S)&&(P=_n(P+x-(x*I+y*O)+w),T=_n(T+y-(x*A+y*R)+S)),(s||i)&&(L=_.getBBox(),P=_n(P+s/100*L.width),T=_n(T+i/100*L.height)),L="matrix("+I+","+A+","+O+","+R+","+P+","+T+")",_.setAttribute("transform",L),C&&(_.style[rn]=L)},BY=function(e,n,r,s,i){var a=360,u=zn(i),c=parseFloat(i)*(u&&~i.indexOf("rad")?ol:1),d=c-s,f=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*D8)%a-~~(d/a)*a:p==="ccw"&&d>0&&(d=(d-a*D8)%a-~~(d/a)*a)),e._pt=m=new qr(e._pt,n,r,s,d,CY),m.e=f,m.u="deg",e._props.push(r),m},z8=function(e,n){for(var r in n)e[r]=n[r];return e},WY=function(e,n,r){var s=z8({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,u,c,d,f,p,m,_,x;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),a[rn]=n,u=If(r,1),ya(r,rn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[rn],a[rn]=n,u=If(r,1),a[rn]=d);for(c in wo)d=s[c],f=u[c],d!==f&&i.indexOf(c)<0&&(_=lr(d),x=lr(f),p=_!==x?_a(r,c,d,x):parseFloat(d),m=parseFloat(f),e._pt=new qr(e._pt,u,c,p,m-p,w2),e._pt.u=x||0,e._props.push(c));z8(u,s)};Wr("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});v0[e>1?"border"+t:t]=function(u,c,d,f,p){var m,_;if(arguments.length<4)return m=a.map(function(x){return so(u,x,d)}),_=m.join(" "),_.split(m[0]).length===5?m[0]:_;m=(f+"").split(" "),_={},a.forEach(function(x,y){return _[x]=m[y]=m[y]||m[(y-1)/2|0]}),u.init(c,_,p)}});var QA={name:"css",register:S2,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,f,p,m,_,x,y,w,S,C,P,T,I,A,O,R,L;Rw||S2(),this.styles=this.styles||WA(e),R=this.styles.props,this.tween=r;for(y in n)if(y!=="autoRound"&&(f=n[y],!(ns[y]&&OA(y,n,r,s,e,i)))){if(_=typeof f,x=v0[y],_==="function"&&(f=f.call(r,s,e,i),_=typeof f),_==="string"&&~f.indexOf("random(")&&(f=kf(f)),x)x(this,e,y,f,r)&&(O=1);else if(y.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(y)+"").trim(),f+="",ua.lastIndex=0,ua.test(d)||(w=lr(d),S=lr(f),S?w!==S&&(d=_a(e,y,d,S)+S):w&&(f+=w)),this.add(u,"setProperty",d,f,s,i,0,0,y),a.push(y),R.push(y,0,u[y]);else if(_!=="undefined"){if(c&&y in c?(d=typeof c[y]=="function"?c[y].call(r,s,e,i):c[y],zn(d)&&~d.indexOf("random(")&&(d=kf(d)),lr(d+"")||d==="auto"||(d+=us.units[y]||lr(so(e,y))||""),(d+"").charAt(1)==="="&&(d=so(e,y))):d=so(e,y),m=parseFloat(d),C=_==="string"&&f.charAt(1)==="="&&f.substr(0,2),C&&(f=f.substr(2)),p=parseFloat(f),y in Ti&&(y==="autoAlpha"&&(m===1&&so(e,"visibility")==="hidden"&&p&&(m=0),R.push("visibility",0,u.visibility),ia(this,u,"visibility",m?"inherit":"hidden",p?"inherit":"hidden",!p)),y!=="scale"&&y!=="transform"&&(y=Ti[y],~y.indexOf(",")&&(y=y.split(",")[0]))),P=y in wo,P){if(this.styles.save(y),L=f,_==="string"&&f.substring(0,6)==="var(--"){if(f=os(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var D=e.style.perspective;e.style.perspective=f,f=os(e,"perspective"),D?e.style.perspective=D:ya(e,"perspective")}p=parseFloat(f)}if(T||(I=e._gsap,I.renderTransform&&!n.parseTransform||If(e,n.parseTransform),A=n.smoothOrigin!==!1&&I.smooth,T=this._pt=new qr(this._pt,u,rn,0,1,I.renderTransform,I,0,-1),T.dep=1),y==="scale")this._pt=new qr(this._pt,I,"scaleY",I.scaleY,(C?zu(I.scaleY,C+p):p)-I.scaleY||0,w2),this._pt.u=0,a.push("scaleY",y),y+="X";else if(y==="transformOrigin"){R.push(Zr,0,u[Zr]),f=$Y(f),I.svg?E2(e,f,0,A,0,this):(S=parseFloat(f.split(" ")[2])||0,S!==I.zOrigin&&ia(this,I,"zOrigin",I.zOrigin,S),ia(this,u,y,g0(d),g0(f)));continue}else if(y==="svgOrigin"){E2(e,f,1,A,0,this);continue}else if(y in KA){BY(this,I,y,m,C?zu(m,C+f):f);continue}else if(y==="smoothOrigin"){ia(this,I,"smooth",I.smooth,f);continue}else if(y==="force3D"){I[y]=f;continue}else if(y==="transform"){WY(this,f,e);continue}}else y in u||(y=_c(y)||y);if(P||(p||p===0)&&(m||m===0)&&!kY.test(f)&&y in u)w=(d+"").substr((m+"").length),p||(p=0),S=lr(f)||(y in us.units?us.units[y]:w),w!==S&&(m=_a(e,y,d,S)),this._pt=new qr(this._pt,P?I:u,y,m,(C?zu(m,C+p):p)-m,!P&&(S==="px"||y==="zIndex")&&n.autoRound!==!1?IY:w2),this._pt.u=S||0,P&&L!==f?(this._pt.b=d,this._pt.e=L,this._pt.r=TY):w!==S&&S!=="%"&&(this._pt.b=d,this._pt.r=PY);else if(y in u)VY.call(this,e,y,d,C?C+f:f);else if(y in e)this.add(e,y,d||e[y],C?C+f:f,s,i);else if(y!=="parseTransform"){xw(y,f);continue}P||(y in u?R.push(y,0,u[y]):typeof e[y]=="function"?R.push(y,2,e[y]()):R.push(y,1,d||e[y])),a.push(y)}}O&&$A(this)},render:function(e,n){if(n.tween._time||!Aw())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:so,aliases:Ti,getSetter:function(e,n,r){var s=Ti[n];return s&&s.indexOf(",")<0&&(n=s),n in wo&&n!==Zr&&(e._gsap.x||so(e,"x"))?r&&O8===r?n==="scale"?LY:MY:(O8=r||{})&&(n==="scale"?OY:DY):e.style&&!gw(e.style[n])?RY:~n.indexOf("-")?AY:Tw(e,n)},core:{_removeProperty:ya,_getMatrix:Lw}};Gr.utils.checkPrefix=_c;Gr.core.getStyleSaver=WA;(function(t,e,n,r){var s=Wr(t+","+e+","+n,function(i){wo[i]=1});Wr(e,function(i){us.units[i]="deg",KA[i]=1}),Ti[s[13]]=t+","+e,Wr(r,function(i){var a=i.split(":");Ti[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");Wr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){us.units[t]="px"});Gr.registerPlugin(QA);var Us=Gr.registerPlugin(QA)||Gr;Us.core.Tween;const hm="/assets/logo-animation",iy=1280,qY=[{id:"eraser",src:`${hm}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${hm}/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:`${hm}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],ZY=[{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}],k2=({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=(S,C)=>S+Math.random()*(C-S);let d=null,f,p=1;const m=qY.map(S=>({...S})),_=()=>{s.querySelectorAll(".la-obj").forEach(R=>R.remove());const S=s.getBoundingClientRect(),C=S.width||iy,P=S.height||iy*.64;p=C/iy,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const I=250*p/337,A=[],O=(R,L,D)=>{const j=document.createElement("div");return j.className="la-obj",j.style.width=`${L}px`,j.innerHTML=`<img src="${R}" alt="" style="${D?"transform:scaleX(-1)":""}">`,s.appendChild(j),j};return ZY.forEach((R,L)=>{const D=R.w*p,j=O(`${hm}/sea/${R.k}.png`,D,L%2===0);Us.set(j,{x:R.x*C-D/2,y:R.y*P-D/2,rotation:R.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),A.push({el:j,hero:!1,rest:1})}),m.forEach(R=>{const L=R.cssW*p;R.el=O(R.src,L,!!R.flip),R.finalScale=R.fit*I/(R.cssW*p),Us.set(R.el,{x:R.seaX*C-L/2,y:R.seaY*P-R.cssH*p/2,rotation:R.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),A.push({el:R.el,hero:!0,rest:150/R.cssW})}),A},x=(S,C)=>{const P=s.getBoundingClientRect(),T=a.getBoundingClientRect();return{x:T.left-P.left+S/326*T.width,y:T.top-P.top+C/337*T.height}},y=()=>{d&&d.revert();const S=_();if(u){d=Us.context(()=>{S.filter(T=>!T.hero).forEach(T=>Us.set(T.el,{scale:0})),m.forEach(T=>{if(!T.el)return;const I=x(T.localX,T.localY);Us.set(T.el,{x:I.x-T.cssW*p/2,y:I.y-T.cssH*p/2,rotation:T.rot,scale:T.finalScale})})},s);return}const C=[],P=[];d=Us.context(()=>{const T=Us.timeline();T.to(S.map(I=>I.el),{scale:I=>S[I].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),T.add(()=>{S.forEach(({el:I,hero:A},O)=>{const R=A?C:P,L=O%2?1:-1;R.push(Us.to(I,{rotation:"+="+c(2.5,6)*L,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),Us.to(I,{y:"+="+c(5,11)*L,x:"+="+c(4,9)*-L,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((I,A)=>{I.el&&T.to(I.el,{scale:150/I.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+A*.08)}),T.add("clear","pick+=0.7"),T.add(()=>P.forEach(I=>I.kill()),"clear"),T.to(S.filter(I=>!I.hero).map(I=>I.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(()=>C.forEach(I=>I.kill()),"assemble"),m.forEach((I,A)=>{if(!I.el||I.finalScale===void 0)return;const O=x(I.localX,I.localY);T.to(I.el,{x:O.x-I.cssW*p/2,y:O.y-I.cssH*p/2,rotation:I.rot,scale:I.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+A*.12)}),m.forEach(I=>{!I.el||I.finalScale===void 0||T.to(I.el,{scale:I.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};Us.ticker.fps(12),y();const w=()=>{clearTimeout(f),f=setTimeout(y,250)};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(S=>S.remove())}},[]),E.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:E.jsx("div",{ref:n,className:"la-logo-stage",children:E.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},GY=Object.freeze(Object.defineProperty({__proto__:null,default:k2},Symbol.toStringTag,{value:"Module"})),U8=({isSigningIn:t})=>t?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),E.jsx("span",{children:"Signing in..."})]}):E.jsxs(E.Fragment,{children:[E.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),E.jsx("span",{children:"Sign in with Google"})]}),KY=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,isDesktopShell:r=!1,displayMode:s="full"})=>s==="modal"?E.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[E.jsx(k2,{className:"relative z-0 h-44 w-full"}),E.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[E.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[E.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),E.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),E.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(U8,{isSigningIn:t})}),n?E.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):E.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[r?E.jsx("div",{className:"fixed left-0 right-0 top-0 z-10 h-8",style:{WebkitAppRegion:"drag"}}):null,E.jsx(k2,{className:"absolute inset-0 z-0"}),E.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[E.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[E.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),E.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),E.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(U8,{isSigningIn:t})}),n?E.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),YY="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",XY=({message:t})=>E.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:E.jsxs("div",{className:"flex flex-col items-center gap-10",children:[E.jsx("img",{src:YY,alt:"Rivet",className:"h-8 w-auto object-contain"}),E.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[E.jsx(O0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),E.jsx("span",{children:t})]})]})}),QY="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",y0=44,Pd=8,Hp=16,JY=4,B8=-18,eX=.18,tX=[.22,1,.36,1],W8=.92,nX=1,rX=.95,sX=.4,iX=[.19,1,.22,1],oy=0,oX=1,aX=0,lX=0,uX=0,JA=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Pd,s=Math.max(r,e.width-y0-Pd),i=Math.max(Pd,e.height-y0-Pd);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Pd,t.y))}},Ow=()=>({width:window.innerWidth,height:window.innerHeight}),cX=({position:t,boundsLeftPx:e=0})=>JA({position:t,viewport:Ow(),boundsLeft:e}),dX=()=>{if(typeof window>"u")return{x:Hp,y:Hp};const t=Ow();return{x:t.width-y0-Hp,y:t.height-y0-Hp}},fX=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=JY,hX=t=>t.button===void 0||t.button<=uX,q8=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},pX=({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,f]=v.useState(!1),[p,m]=v.useState(!1),_=n?!1:{opacity:oy,scale:W8,x:B8},x=n?{opacity:oy}:{opacity:oy,scale:W8,x:B8},y=n?{duration:lX}:{duration:eX,ease:tX,scale:{duration:sX,ease:iX}},w=v.useCallback(()=>{const I=u.current;I&&(c.current=I.hasMoved),u.current=null,f(!1)},[]),S=v.useCallback(I=>{const A=u.current;if(!A)return;const O=q8(I),R=O.x-A.startPointer.x,L=O.y-A.startPointer.y,D=A.hasMoved||fX({deltaX:R,deltaY:L});u.current={...A,hasMoved:D},D&&a(JA({position:{x:A.startPosition.x+R,y:A.startPosition.y+L},viewport:Ow(),boundsLeft:s}))},[a,s]),C=v.useCallback(I=>{if(u.current||!hX(I))return;const A=q8(I);u.current={startPointer:A,startPosition:r,hasMoved:!1},f(!0)},[r]),P=v.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),T=e?"Close panel":"Open panel";return E.jsxs(E.Fragment,{children:[d?E.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:S,onPointerUp:w,onPointerCancel:w,onMouseMove:S,onMouseUp:w}):null,E.jsx(Qs,{children:t?E.jsx(Ys,{label:T,side:"top",forceOpen:p&&!d?void 0:!1,children:E.jsx(po.button,{type:"button","aria-label":T,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:_,animate:{opacity:oX,scale:nX,x:aX},whileTap:{scale:rX},exit:x,transition:y,onPointerDown:C,onMouseDown:C,onPointerMove:S,onPointerUp:w,onPointerCancel:w,onMouseMove:S,onMouseUp:w,onClick:P,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${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:E.jsx("img",{src:QY,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},ay=Ls("useConfig"),mX=300*1e3,vX=1800*1e3,gX=60*1e3,yX=300*1e3,_X=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},xX=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},wX=t=>({...zI,...t??{}}),bX=()=>{const t=tt(r2),e=at(r2),n=at(QI),r=at(JI),s=at(D0),i=at(kW),a=at(XI),u=at(SW),c=at(Wf),d=at(qI),f=v.useCallback(S=>{a(S.agentModeAvailable),d({name:S.name??null,email:S.email??null}),S.isMCPSession&&n(!0),S.mcpEditor&&r(S.mcpEditor),s(S.agentApplyMode??xX()??null),i(S.queueAccessToken??_X())},[s,a,n,r,i,d]),p=Cy({queryKey:["rivet-config"],queryFn:async()=>{const S=await fetch("/api/config");if(!S.ok)throw new Error(`Failed to fetch config: ${S.statusText}`);return await S.json()},staleTime:mX,gcTime:vX}),m=Cy({queryKey:["rivet-feature-flags"],queryFn:async()=>{const S=await fetch("/api/feature-flags");if(!S.ok)throw new Error(`Failed to fetch feature flags: ${S.statusText}`);return await S.json()},staleTime:gX,gcTime:yX}),{refetch:_}=p,{refetch:x}=m;v.useLayoutEffect(()=>{p.data&&(f(p.data),c(!1),ay.info("Config loaded:",p.data)),m.data&&(e(wX(m.data.featureFlags)),u(!0))},[p.data,m.data,f,c,e,u]),v.useLayoutEffect(()=>{p.error&&(u(!0),c(!1),ay.warn("Failed to load config:",p.error instanceof Error?p.error.message:"Failed to load config")),m.error&&(u(!0),ay.warn("Failed to load feature flags:",m.error instanceof Error?m.error.message:"Failed to load feature flags"))},[p.error,m.error,c,u]);const y=v.useCallback(async()=>{const[S]=await Promise.all([_(),x()]);return S.data?S.data:null},[_,x]);let w=null;return p.error instanceof Error?w=p.error.message:p.error&&(w="Failed to load config"),{config:p.data??null,featureFlags:t,loading:p.isPending||!p.error&&m.isPending,error:w,refetchConfig:y}},pm="rivet_just_signed_in",xu=Ls("useOAuthCallback"),SX="https://rivet-proxy.onrender.com",EX=()=>{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{xu.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),p=f.get("access_token"),m=f.get("refresh_token"),x=new URLSearchParams(a).get("session");if(!p)throw new Error("No access token found in URL");if(!x)throw new Error("No session ID found in URL");xu.info(`Completing OAuth with session: ${x}`);const y=await fetch(`${SX}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:p,refreshToken:m}),signal:n.signal}),w=await y.json();if(!y.ok||!w.success)throw new Error(w.error||w.message||"Failed to complete authentication");if(xu.info("OAuth authentication completed successfully"),r)return;if((u=w.user)!=null&&u.id?(Ee.identify(w.user.id,{...w.user.email?{email:w.user.email}:{}}),w.user.email&&Ee.alias(w.user.email,w.user.id)):(c=w.user)!=null&&c.email&&Ee.identify(w.user.email,{email:w.user.email}),(d=w.user)!=null&&d.email&&p)try{const C=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w.user.email,token:p,refreshToken:m,userId:w.user.id}),signal:n.signal});C.ok||xu.warn(`Local auth store returned ${C.status}`)}catch(C){if(r)return;xu.warn("Failed to store auth locally:",C)}if(r)return;window.sessionStorage.setItem(pm,"1");const S=window.location.pathname;window.history.replaceState({},document.title,S),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;const p=f instanceof Error?f.message:"Unknown error occurred";xu.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},ly=Ls("useAgentVariantsSession"),kX=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,Z8=(t,e,n)=>{e.size===0&&!n||t.set(mf,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})},CX=(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},PX=({enabled:t=!0}={})=>{const e=at(Bf),n=at(UI),r=at(yW),s=at(KI),i=at(bW),a=sx(),u=v.useRef(null);v.useEffect(()=>{if(!t)return;const c=new EventSource("/api/variants/events");return c.onmessage=d=>{try{const f=JSON.parse(d.data),p=u.current;if(f.active){const x=new Set(f.variants.map(y=>y.requestId).filter(y=>!!y));s(y=>y.filter(S=>!x.has(S.requestId))),Z8(a,x,!1),a.set(mf,y=>{let w=y;for(const S of f.variants){const C=S.adoptedSource;C&&(w=wW(w,{kind:"variant",sessionId:C.sessionId,variantId:C.variantId},{kind:"variant",sessionId:f.sessionId,variantId:S.workItemId}))}return w}),a.set(mf,y=>CX(y,f)),f.sessionId!==u.current&&(u.current=f.sessionId,n(!0),r("directions"))}else u.current=null,Z8(a,new Set,kX(f));e(f);const m=!f.active&&p!==null,_=f.active&&f.sessionId!==p;if(_&&fetch(`/api/variants/${f.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(x=>ly.warn("failed to reset preview-port on session switch",x)),m||_){const x=new Set;if(f.active)for(const w of f.variants)x.add(hf({kind:"variant",sessionId:f.sessionId,variantId:w.workItemId}));const y=a.get(yo);for(const w of[y==null?void 0:y.left,y==null?void 0:y.right])w&&x.add(hf({kind:"variant",sessionId:w.sessionId,variantId:w.variantId}));i(x)}}catch(f){ly.warn("failed to parse SSE event payload",f)}},c.onerror=d=>{ly.warn("SSE error (auto-reconnects)",d)},()=>{c.close()}},[t,e,n,r,s,i,a])};var TX=Object.defineProperty,$n=(t,e)=>TX(t,"name",{value:e,configurable:!0});function Dw(t){const e=t+"CollectionProvider",[n,r]=Oi(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=$n(y=>{const{scope:w,children:S}=y,C=v.useRef(null),P=v.useRef(new Map).current;return E.jsx(s,{scope:w,itemMap:P,collectionRef:C,children:S})},"CollectionProvider");a.displayName=e;const u=t+"CollectionSlot",c=pa(u),d=v.forwardRef((y,w)=>{const{scope:S,children:C}=y,P=i(u,S),T=Bt(w,P.collectionRef);return E.jsx(c,{ref:T,children:C})});d.displayName=u;const f=t+"CollectionItemSlot",p="data-radix-collection-item",m=pa(f),_=v.forwardRef((y,w)=>{const{scope:S,children:C,...P}=y,T=v.useRef(null),I=Bt(w,T),A=i(f,S);return v.useEffect(()=>(A.itemMap.set(T,{ref:T,...P}),()=>void A.itemMap.delete(T))),E.jsx(m,{[p]:"",ref:I,children:C})});_.displayName=f;function x(y){const w=i(t+"CollectionConsumer",y);return v.useCallback(()=>{const C=w.collectionRef.current;if(!C)return[];const P=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((A,O)=>P.indexOf(A.ref.current)-P.indexOf(O.ref.current))},[w.collectionRef,w.itemMap])}return $n(x,"useCollection"),[{Provider:a,Slot:d,ItemSlot:_},x,r]}$n(Dw,"createCollection");var G8=new WeakMap,kn,es,uy=(es=class extends Map{constructor(n){super(n);Be(this,kn);Ce(this,kn,[...super.keys()]),G8.set(this,!0)}set(n,r){return G8.get(this)&&(this.has(n)?U(this,kn)[U(this,kn).indexOf(n)]=n:U(this,kn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),a=U(this,kn).length,u=Nw(n);let c=u>=0?u:a+u;const d=c<0||c>=a?-1:c;if(d===this.size||i&&d===this.size-1||d===-1)return this.set(r,s),this;const f=this.size+(i?0:1);u<0&&c++;const p=[...U(this,kn)];let m,_=!1;for(let x=c;x<f;x++)if(c===x){let y=p[x];p[x]===r&&(y=p[x+1]),i&&this.delete(r),m=this.get(y),this.set(r,s)}else{!_&&p[x-1]===r&&(_=!0);const y=p[_?x:x-1],w=m;m=this.get(y),this.delete(y),this.set(y,w)}return this}with(n,r,s){const i=new es(this);return i.insert(n,r,s),i}before(n){const r=U(this,kn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=U(this,kn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=U(this,kn).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=U(this,kn).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Ce(this,kn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&U(this,kn).splice(U(this,kn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=mm(U(this,kn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=mm(U(this,kn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return U(this,kn).indexOf(n)}keyAt(n){return mm(U(this,kn),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const a of this)Reflect.apply(n,r,[a,i,this])&&s.push(a),i++;return new es(s)}map(n,r){const s=[];let i=0;for(const a of this)s.push([a[0],Reflect.apply(n,r,[a,i,this])]),i++;return new es(s)}reduce(...n){const[r,s]=n;let i=0,a=s??this.at(0);for(const u of this)i===0&&n.length===1?a=u:a=Reflect.apply(r,this,[a,u,i,this]),i++;return a}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let a=this.size-1;a>=0;a--){const u=this.at(a);a===this.size-1&&n.length===1?i=u:i=Reflect.apply(r,this,[i,u,a,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new es(r)}toReversed(){const n=new es;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new es(r)}slice(n,r){const s=new es;let i=this.size-1;if(n===void 0)return s;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let a=n;a<=i;a++){const u=this.keyAt(a),c=this.get(u);s.set(u,c)}return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},kn=new WeakMap,$n(es,"OrderedDict"),es);function mm(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=eM(t,e);return n===-1?void 0:t[n]}$n(mm,"at");function eM(t,e){const n=t.length,r=Nw(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}$n(eM,"toSafeIndex");function Nw(t){return t!==t||t===0?0:Math.trunc(t)}$n(Nw,"toSafeInteger");function IX(t){const e=t+"CollectionProvider",[n,r]=Oi(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new uy,setItemMap:$n(()=>{},"setItemMap")}),a=$n(({state:P,...T})=>P?E.jsx(c,{...T,state:P}):E.jsx(u,{...T}),"CollectionProvider");a.displayName=e;const u=$n(P=>{const T=w();return E.jsx(c,{...P,state:T})},"CollectionInit");u.displayName=e+"Init";const c=$n(P=>{const{scope:T,children:I,state:A}=P,O=v.useRef(null),[R,L]=v.useState(null),D=Bt(O,L),[j,F]=A;return v.useEffect(()=>{if(!R)return;const Z=rM(()=>{});return Z.observe(R,{childList:!0,subtree:!0}),()=>{Z.disconnect()}},[R]),E.jsx(s,{scope:T,itemMap:j,setItemMap:F,collectionRef:D,collectionRefObject:O,collectionElement:R,children:I})},"CollectionProviderImpl");c.displayName=e+"Impl";const d=t+"CollectionSlot",f=pa(d),p=v.forwardRef((P,T)=>{const{scope:I,children:A}=P,O=i(d,I),R=Bt(T,O.collectionRef);return E.jsx(f,{ref:R,children:A})});p.displayName=d;const m=t+"CollectionItemSlot",_="data-radix-collection-item",x=pa(m),y=v.forwardRef((P,T)=>{const{scope:I,children:A,...O}=P,R=v.useRef(null),[L,D]=v.useState(null),j=Bt(T,R,D),F=i(m,I),{setItemMap:Z}=F,Q=v.useRef(O);tM(Q.current,O)||(Q.current=O);const K=Q.current;return v.useEffect(()=>{const q=K;return Z(W=>L?W.has(L)?W.set(L,{...q,element:L}).toSorted(C2):(W.set(L,{...q,element:L}),W.toSorted(C2)):W),()=>{Z(W=>!L||!W.has(L)?W:(W.delete(L),new uy(W)))}},[L,K,Z]),E.jsx(x,{[_]:"",ref:j,children:A})});y.displayName=m;function w(){return v.useState(new uy)}$n(w,"useInitCollection");function S(P){const{itemMap:T}=i(t+"CollectionConsumer",P);return T}return $n(S,"useCollection"),[{Provider:a,Slot:p,ItemSlot:y},{createCollectionScope:r,useCollection:S,useInitCollection:w}]}$n(IX,"createCollection");function tM(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||t[s]!==e[s])return!1;return!0}$n(tM,"shallowEqual");function nM(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}$n(nM,"isElementPreceding");function C2(t,e){return!t[1].element||!e[1].element?0:nM(t[1].element,e[1].element)?-1:1}$n(C2,"sortByDocumentPosition");function rM(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}$n(rM,"getChildListObserver");var RX=Object.defineProperty,Gf=(t,e)=>RX(t,"name",{value:e,configurable:!0}),jw="Collapsible",[AX,sM]=Oi(jw),[MX,Fw]=AX(jw),LX=v.forwardRef(Gf(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:a,onOpenChange:u,...c}=e,[d,f]=wa({prop:s,defaultProp:i??!1,onChange:u,caller:jw});return E.jsx(MX,{scope:r,disabled:a,contentId:oa(),open:d,onOpenToggle:v.useCallback(()=>f(p=>!p),[f]),children:E.jsx(xn.div,{"data-state":G0(d),"data-disabled":a?"":void 0,...c,ref:n})})},"Collapsible")),OX="CollapsibleTrigger",DX=v.forwardRef(Gf(function(e,n){const{__scopeCollapsible:r,...s}=e,i=Fw(OX,r);return E.jsx(xn.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":G0(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:zt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),iM="CollapsibleContent",NX=v.forwardRef(Gf(function(e,n){const{forceMount:r,...s}=e,i=Fw(iM,e.__scopeCollapsible);return E.jsx(ba,{present:r||i.open,children:({present:a})=>E.jsx(jX,{...s,ref:n,present:a})})},"CollapsibleContent")),jX=v.forwardRef(Gf(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...a}=e,u=Fw(iM,r),[c,d]=v.useState(s),f=v.useRef(null),p=Bt(n,f),m=v.useRef(0),_=m.current,x=v.useRef(0),y=x.current,w=u.open||c,S=v.useRef(w),C=v.useRef(void 0);return v.useEffect(()=>{const P=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(P)},[]),zr(()=>{const P=f.current;if(P){C.current=C.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,x.current=T.width,S.current||(P.style.transitionDuration=C.current.transitionDuration,P.style.animationName=C.current.animationName),d(s)}},[u.open,s]),E.jsx(xn.div,{"data-state":G0(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...a,ref:p,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:w&&i})},"CollapsibleContentImpl"));function G0(t){return t?"open":"closed"}Gf(G0,"getState");var FX=LX,VX=DX,$X=NX,HX=Object.defineProperty,zX=(t,e)=>HX(t,"name",{value:e,configurable:!0}),UX=v.createContext(void 0);function Vw(t){const e=v.useContext(UX);return t||e||"ltr"}zX(Vw,"useDirection");var BX=Object.defineProperty,cs=(t,e)=>BX(t,"name",{value:e,configurable:!0}),Di="Accordion",WX=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[$w,qX,ZX]=Dw(Di),[K0,lte]=Oi(Di,[ZX,sM]),Hw=sM(),GX=v.forwardRef(cs(function(e,n){const{type:r,...s}=e,i=s,a=s;return E.jsx($w.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?E.jsx(QX,{...a,ref:n}):E.jsx(XX,{...i,ref:n})})},"Accordion")),[oM,KX]=K0(Di),[aM,YX]=K0(Di,{collapsible:!1}),XX=v.forwardRef(cs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=cs(()=>{},"onValueChange"),collapsible:a=!1,...u}=e,[c,d]=wa({prop:r,defaultProp:s??"",onChange:i,caller:Di});return E.jsx(oM,{scope:e.__scopeAccordion,value:v.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:v.useCallback(()=>a&&d(""),[a,d]),children:E.jsx(aM,{scope:e.__scopeAccordion,collapsible:a,children:E.jsx(lM,{...u,ref:n})})})},"AccordionImplSingle")),QX=v.forwardRef(cs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=cs(()=>{},"onValueChange"),...a}=e,[u,c]=wa({prop:r,defaultProp:s??[],onChange:i,caller:Di}),d=v.useCallback(p=>c((m=[])=>[...m,p]),[c]),f=v.useCallback(p=>c((m=[])=>m.filter(_=>_!==p)),[c]);return E.jsx(oM,{scope:e.__scopeAccordion,value:u,onItemOpen:d,onItemClose:f,children:E.jsx(aM,{scope:e.__scopeAccordion,collapsible:!0,children:E.jsx(lM,{...a,ref:n})})})},"AccordionImplMultiple")),[JX,Y0]=K0(Di),lM=v.forwardRef(cs(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:a="vertical",...u}=e,c=v.useRef(null),d=Bt(c,n),f=qX(r),m=Vw(i)==="ltr",_=zt(e.onKeyDown,x=>{var L;if(!WX.includes(x.key))return;const y=x.target,w=f().filter(D=>{var j;return!((j=D.ref.current)!=null&&j.disabled)}),S=w.findIndex(D=>D.ref.current===y),C=w.length;if(S===-1)return;x.preventDefault();let P=S;const T=0,I=C-1,A=cs(()=>{P=S+1,P>I&&(P=T)},"moveNext"),O=cs(()=>{P=S-1,P<T&&(P=I)},"movePrev");switch(x.key){case"Home":P=T;break;case"End":P=I;break;case"ArrowRight":a==="horizontal"&&(m?A():O());break;case"ArrowDown":a==="vertical"&&A();break;case"ArrowLeft":a==="horizontal"&&(m?O():A());break;case"ArrowUp":a==="vertical"&&O();break}const R=P%C;(L=w[R].ref.current)==null||L.focus()});return E.jsx(JX,{scope:r,disabled:s,direction:i,orientation:a,children:E.jsx($w.Slot,{scope:r,children:E.jsx(xn.div,{...u,"data-orientation":a,ref:d,onKeyDown:s?void 0:_})})})},"AccordionImpl")),P2="AccordionItem",[eQ,zw]=K0(P2),tQ=v.forwardRef(cs(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,a=Y0(P2,r),u=KX(P2,r),c=Hw(r),d=oa(),f=s&&u.value.includes(s)||!1,p=a.disabled||e.disabled;return E.jsx(eQ,{scope:r,open:f,disabled:p,triggerId:d,children:E.jsx(FX,{"data-orientation":a.orientation,"data-state":Uw(f),...c,...i,ref:n,disabled:p,open:f,onOpenChange:m=>{m?u.onItemOpen(s):u.onItemClose(s)}})})},"AccordionItem")),nQ="AccordionHeader",rQ=v.forwardRef(cs(function(e,n){const{__scopeAccordion:r,...s}=e,i=Y0(Di,r),a=zw(nQ,r);return E.jsx(xn.h3,{"data-orientation":i.orientation,"data-state":Uw(a.open),"data-disabled":a.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),K8="AccordionTrigger",sQ=v.forwardRef(cs(function(e,n){const{__scopeAccordion:r,...s}=e,i=Y0(Di,r),a=zw(K8,r),u=YX(K8,r),c=Hw(r);return E.jsx($w.ItemSlot,{scope:r,children:E.jsx(VX,{"aria-disabled":a.open&&!u.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...c,...s,ref:n})})},"AccordionTrigger")),iQ="AccordionContent",oQ=v.forwardRef(cs(function(e,n){const{__scopeAccordion:r,...s}=e,i=Y0(Di,r),a=zw(iQ,r),u=Hw(r);return E.jsx($X,{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 Uw(t){return t?"open":"closed"}cs(Uw,"getState");var uM=GX,aQ=tQ,lQ=rQ,uQ=sQ,cQ=oQ;/**
130
+ * @license lucide-react v1.34.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const cM=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
135
+ * @license lucide-react v1.34.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const dQ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
140
+ * @license lucide-react v1.34.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const fQ=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
145
+ * @license lucide-react v1.34.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const Y8=t=>{const e=fQ(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
150
+ * @license lucide-react v1.34.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */var cy={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"};/**
155
+ * @license lucide-react v1.34.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const hQ=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},pQ=v.createContext({}),mQ=()=>v.useContext(pQ),vQ=v.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...u},c)=>{const{size:d=24,strokeWidth:f=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:_=""}=mQ()??{},x=r??p?Number(n??f)*24/Number(e??d):n??f;return v.createElement("svg",{ref:c,...cy,width:e??d??cy.width,height:e??d??cy.height,stroke:t??m,strokeWidth:x,className:cM("lucide",_,s),...!i&&!hQ(u)&&{"aria-hidden":"true"},...u},[...a.map(([y,w])=>v.createElement(y,w)),...Array.isArray(i)?i:[i]])});/**
160
+ * @license lucide-react v1.34.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const et=(t,e)=>{const n=v.forwardRef(({className:r,...s},i)=>v.createElement(vQ,{ref:i,iconNode:e,className:cM(`lucide-${dQ(Y8(t))}`,`lucide-${t}`,r),...s}));return n.displayName=Y8(t),n};/**
165
+ * @license lucide-react v1.34.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const gQ=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],yQ=et("arrow-left",gQ);/**
170
+ * @license lucide-react v1.34.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const _Q=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],xQ=et("arrow-right",_Q);/**
175
+ * @license lucide-react v1.34.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const wQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],bQ=et("arrow-up",wQ);/**
180
+ * @license lucide-react v1.34.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const SQ=[["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"}]],EQ=et("bell",SQ);/**
185
+ * @license lucide-react v1.34.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const kQ=[["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"}]],CQ=et("brain",kQ);/**
190
+ * @license lucide-react v1.34.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const PQ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],TQ=et("check",PQ);/**
195
+ * @license lucide-react v1.34.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const IQ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],RQ=et("chevron-down",IQ);/**
200
+ * @license lucide-react v1.34.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const AQ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],MQ=et("chevron-right",AQ);/**
205
+ * @license lucide-react v1.34.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const LQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],OQ=et("circle",LQ);/**
210
+ * @license lucide-react v1.34.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const DQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],NQ=et("clock",DQ);/**
215
+ * @license lucide-react v1.34.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const jQ=[["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"}]],FQ=et("copy",jQ);/**
220
+ * @license lucide-react v1.34.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const VQ=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],$Q=et("dot",VQ);/**
225
+ * @license lucide-react v1.34.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const HQ=[["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"}]],zQ=et("globe",HQ);/**
230
+ * @license lucide-react v1.34.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const UQ=[["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"}]],BQ=et("heart",UQ);/**
235
+ * @license lucide-react v1.34.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const WQ=[["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"}]],qQ=et("house",WQ);/**
240
+ * @license lucide-react v1.34.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const ZQ=[["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"}]],GQ=et("image",ZQ);/**
245
+ * @license lucide-react v1.34.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const KQ=[["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"}]],YQ=et("inbox",KQ);/**
250
+ * @license lucide-react v1.34.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const XQ=[["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"}]],QQ=et("lightbulb",XQ);/**
255
+ * @license lucide-react v1.34.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const JQ=[["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"}]],eJ=et("link",JQ);/**
260
+ * @license lucide-react v1.34.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const tJ=[["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"}]],nJ=et("loader",tJ);/**
265
+ * @license lucide-react v1.34.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const rJ=[["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"}]],sJ=et("lock",rJ);/**
270
+ * @license lucide-react v1.34.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const iJ=[["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"}]],oJ=et("mail",iJ);/**
275
+ * @license lucide-react v1.34.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const aJ=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],lJ=et("menu",aJ);/**
280
+ * @license lucide-react v1.34.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const uJ=[["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"}]],cJ=et("message-circle",uJ);/**
285
+ * @license lucide-react v1.34.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const dJ=[["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"}]],fJ=et("monitor",dJ);/**
290
+ * @license lucide-react v1.34.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const hJ=[["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"}]],pJ=et("moon",hJ);/**
295
+ * @license lucide-react v1.34.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const mJ=[["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"}]],vJ=et("paintbrush",mJ);/**
300
+ * @license lucide-react v1.34.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const gJ=[["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"}]],yJ=et("palette",gJ);/**
305
+ * @license lucide-react v1.34.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const _J=[["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"}]],xJ=et("pause",_J);/**
310
+ * @license lucide-react v1.34.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const wJ=[["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"}]],bJ=et("pencil",wJ);/**
315
+ * @license lucide-react v1.34.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const SJ=[["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"}]],EJ=et("pipette",SJ);/**
320
+ * @license lucide-react v1.34.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const kJ=[["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"}]],CJ=et("play",kJ);/**
325
+ * @license lucide-react v1.34.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const PJ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],TJ=et("plus",PJ);/**
330
+ * @license lucide-react v1.34.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const IJ=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],RJ=et("rectangle-horizontal",IJ);/**
335
+ * @license lucide-react v1.34.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const AJ=[["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"}]],MJ=et("rocket",AJ);/**
340
+ * @license lucide-react v1.34.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const LJ=[["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"}]],OJ=et("rotate-ccw",LJ);/**
345
+ * @license lucide-react v1.34.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const DJ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],NJ=et("search",DJ);/**
350
+ * @license lucide-react v1.34.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const jJ=[["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"}]],FJ=et("settings",jJ);/**
355
+ * @license lucide-react v1.34.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const VJ=[["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"}]],$J=et("shield",VJ);/**
360
+ * @license lucide-react v1.34.0 - ISC
361
+ *
362
+ * This source code is licensed under the ISC license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */const HJ=[["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"}]],zJ=et("skip-forward",HJ);/**
365
+ * @license lucide-react v1.34.0 - ISC
366
+ *
367
+ * This source code is licensed under the ISC license.
368
+ * See the LICENSE file in the root directory of this source tree.
369
+ */const UJ=[["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"}]],BJ=et("square-library",UJ);/**
370
+ * @license lucide-react v1.34.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */const WJ=[["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"}]],qJ=et("star",WJ);/**
375
+ * @license lucide-react v1.34.0 - ISC
376
+ *
377
+ * This source code is licensed under the ISC license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */const ZJ=[["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"}]],GJ=et("sun",ZJ);/**
380
+ * @license lucide-react v1.34.0 - ISC
381
+ *
382
+ * This source code is licensed under the ISC license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */const KJ=[["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"}]],YJ=et("user",KJ);/**
385
+ * @license lucide-react v1.34.0 - ISC
386
+ *
387
+ * This source code is licensed under the ISC license.
388
+ * See the LICENSE file in the root directory of this source tree.
389
+ */const XJ=[["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"}]],QJ=et("users",XJ);/**
390
+ * @license lucide-react v1.34.0 - ISC
391
+ *
392
+ * This source code is licensed under the ISC license.
393
+ * See the LICENSE file in the root directory of this source tree.
394
+ */const JJ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],eee=et("x",JJ),tee={"chevron-right":MQ,"chevron-down":RQ,pipette:EJ,x:eee,copy:FQ,menu:lJ,dot:$Q,monitor:fJ,sun:GJ,moon:pJ,"rectangle-horizontal":RJ,circle:OQ,"square-library":BJ,clock:NQ,star:qJ,settings:FJ,plus:TJ,"arrow-left":yQ,"arrow-right":xQ,"arrow-up":bQ,search:NJ,loader:nJ,users:QJ,lock:sJ,mail:oJ,bell:EQ,shield:$J,palette:yJ,lightbulb:QQ,rocket:MJ,heart:BQ,paintbrush:vJ,brain:CQ,globe:zQ,user:YJ,image:GQ,link:eJ,check:TQ,"rotate-ccw":OJ,play:CJ,pause:xJ,home:qQ,"message-circle":cJ,inbox:YQ,pencil:bJ,"skip-forward":zJ},X8={lucide:tee},dM=v.createContext(null);function nee(t){const e=v.useContext(dM);return e?X8[e.iconLibrary][t]:X8.lucide[t]}function ree({children:t,defaultLibrary:e="lucide"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{r(i)},[]);return E.jsx(dM.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const fM=v.createContext(null);function Bw(){return v.useContext(fM)}const hM=v.createContext(null);function pM(){const t=v.useContext(hM);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const see=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:f,setActiveIndex:p,itemRects:m,sessionRef:_,handlers:x,registerItem:y,measureItems:w}=jI(a),S=v.useCallback((ce,ae)=>{ae?u.current.set(ce,ae):u.current.delete(ce)},[]),C=v.useCallback(()=>{if(!a.current)return;const ce=new Map;u.current.forEach((ae,$e)=>{ce.set($e,{top:ae.offsetTop,left:ae.offsetLeft,width:ae.offsetWidth,height:ae.offsetHeight})}),d(ce)},[]),[P,T]=v.useState(()=>r==="single"?t.defaultValue??"":""),[I,A]=v.useState(()=>r==="multiple"?t.defaultValue??[]:[]),O=t.onValueChange,R=t.onValueChange,L=t.value,D=new Set(r==="multiple"?t.value??I:(()=>{const ce=t.value??P;return ce?[ce]:[]})()),j=v.useCallback(ce=>{const ae=t;ae.onValueChange?ae.onValueChange(ce):T(ce)},[O]),F=v.useCallback(ce=>{const ae=t;ae.onValueChange?ae.onValueChange(ce):A(ce)},[R]),Z=v.useCallback(ce=>{if(r==="multiple"){const ae=t.value??I;F(ae.filter($e=>$e!==ce))}else j("")},[r,j,F,I,L]);v.useEffect(()=>{w(),C()},[w,C,n]);const Q=[...D].join(",");v.useEffect(()=>{w(),C()},[w,C,Q]);const[K,q]=v.useState(null),W=f!==null?m[f]:null,H=K!==null?m[K]:null,X=f!==null&&!c.has(f),z=U0(),{value:N,defaultValue:Y,onValueChange:oe,collapsible:J,type:se,...pe}=i,Se=r==="multiple"?{type:"multiple",value:t.value??I,onValueChange:F}:{type:"single",collapsible:t.collapsible??!0,value:t.value??P,onValueChange:j};return E.jsx(fM.Provider,{value:{registerItem:y,registerFullItem:S,activeIndex:f,grouped:!0,remeasure:()=>{w(),C()},openValues:D,openItemRects:c,toggleValue:Z},children:E.jsx(uM,{...Se,asChild:!0,children:E.jsxs("div",{ref:ce=>{a.current=ce,typeof e=="function"?e(ce):e&&(e.current=ce)},onMouseEnter:x.onMouseEnter,onMouseMove:ce=>{const ae=a.current;if(ae){const $e=ae.getBoundingClientRect(),We=ae.offsetHeight,He=$e.height,Fe=We>0?He/We:1,ct=(ce.clientY-$e.top)/Fe+ae.scrollTop;for(const[Gt,rt]of c){const Ve=m[Gt];if(!Ve)continue;const Oe=Ve.top+Ve.height,Je=rt.top+rt.height;if(ct>=Oe&&ct<=Je){p(null);return}}}x.onMouseMove(ce)},onMouseLeave:x.onMouseLeave,onFocus:ce=>{var $e;const ae=($e=ce.target.closest("[data-proximity-index]"))==null?void 0:$e.getAttribute("data-proximity-index");if(ae!=null){const We=Number(ae);p(We),q(ce.target.matches(":focus-visible")?We:null)}},onBlur:ce=>{var ae;(ae=a.current)!=null&&ae.contains(ce.relatedTarget)||(q(null),p(null))},className:cr("relative flex flex-col gap-0.5 w-72 max-w-full",s),...pe,children:[E.jsx(Qs,{children:[...c.entries()].map(([ce,ae])=>E.jsx(ho.div,{className:`absolute ${z.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:ae.top,left:ae.left,width:ae.width,height:ae.height,opacity:X?.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-${ce}`))}),E.jsx(Qs,{children:W&&E.jsx(ho.div,{className:`absolute ${z.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:W.top,left:W.left,width:W.width,height:W.height},animate:{opacity:1,top:W.top,left:W.left,width:W.width,height:W.height},exit:{opacity:0,transition:{duration:.06}},transition:{...ff.fast,opacity:{duration:.08}}},_.current)}),E.jsx(Qs,{children:H&&E.jsx(ho.div,{className:`absolute ${z.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:H.left-2,top:H.top-2,width:H.width+4,height:H.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...ff.fast,opacity:{duration:.08}}})}),n]})})})});see.displayName="AccordionGroup";const mM=v.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...u},c)=>{const[d,f]=v.useState(()=>e==="single"?r??"":""),[p,m]=v.useState(()=>e==="multiple"?r??[]:[]),_=new Set(e==="multiple"?s??p:(()=>{const C=s??d;return C?[C]:[]})()),x=v.useCallback(C=>{i?i(C):f(C)},[i]),y=v.useCallback(C=>{i?i(C):m(C)},[i]),w=v.useCallback(C=>{e==="multiple"?y((s??p).filter(T=>T!==C)):x("")},[e,s,p,x,y]),S=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:y}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:x};return E.jsx(uM,{...S,asChild:!0,children:E.jsx("div",{ref:c,className:cr("w-72 max-w-full flex flex-col gap-0.5",a),...u,children:E.jsx(vM.Provider,{value:_,children:E.jsx(gM.Provider,{value:w,children:t})})})})});mM.displayName="Accordion";const vM=v.createContext(new Set),gM=v.createContext(()=>{}),yM=v.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const u=v.useRef(null),c=Bw(),d=v.useContext(vM),f=v.useContext(gM),p=U0(),m=c!=null&&c.grouped?c.openValues.has(t):d.has(t),_=v.useRef(null),x=v.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):f(t)},[c,f,t]);return v.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,_.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]),E.jsx(hM.Provider,{value:{index:e,value:t,isOpen:m,onToggle:x,triggerRef:_},children:E.jsxs(aQ,{ref:y=>{u.current=y,typeof a=="function"?a(y):a&&(a.current=y)},value:t,disabled:n,"data-proximity-index":e,className:cr(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&E.jsx(Qs,{children:m&&E.jsx(ho.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]})})});yM.displayName="AccordionItem";const _M=v.forwardRef(({children:t,className:e,...n},r)=>{const s=nee("chevron-right"),i=Bw(),{index:a,isOpen:u,triggerRef:c}=pM(),d=U0(),[f,p]=v.useState(!1),m=i!=null&&i.grouped?i.activeIndex===a:f,_=E.jsx(lQ,{asChild:!0,children:E.jsx("div",{children:E.jsxs(uQ,{ref:r,className:cr(`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:[E.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[E.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Wd.semibold},"aria-hidden":"true",children:t}),E.jsx("span",{className:cr("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",u||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:u?Wd.semibold:Wd.normal},children:t})]}),E.jsx(ho.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:u?90:0},transition:ff.fast,children:E.jsx(s,{size:16,strokeWidth:u||m?2:1.5,className:cr("transition-[color,stroke-width] duration-80",u||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?E.jsx("div",{ref:c,children:_}):E.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[E.jsx(Qs,{children:f&&E.jsx(ho.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}})}),_]})});_M.displayName="AccordionTrigger";const xM=v.forwardRef(({children:t,className:e,...n},r)=>{const s=Bw(),{isOpen:i}=pM();return E.jsx(Qs,{initial:!1,children:i&&E.jsx(cQ,{forceMount:!0,asChild:!0,...n,children:E.jsx(ho.div,{ref:r,className:cr("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...ff.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:E.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});xM.displayName="AccordionContent";const vm=({children:t,defaultValue:e=[],className:n=""})=>E.jsx(mM,{type:"multiple",defaultValue:e,className:cr("w-full",n),children:t}),iee=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const u=a.includes("first-item");return E.jsxs(yM,{value:t,className:cr("w-full",!u&&"border-t border-main-border"),children:[E.jsxs(_M,{"data-cy":r,children:[s?E.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),E.jsxs(xM,{children:[n?E.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};vm.Item=iee;const oee=({message:t,isLoading:e=!0})=>E.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?E.jsx(O0,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,E.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),aee=()=>{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},lee=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},Q8="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",J8="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",uee="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",gm=["Applying","Thinking","Planning","Crafting"],cee=gm.reduce((t,e)=>t.length>=e.length?t:e),dee=20,fee="Still working — runs can take a few minutes.",hee=({hint:t,showElapsed:e=!0})=>{const[n,r]=v.useState(0),s=aee();v.useEffect(()=>{const a=setInterval(()=>{r(u=>(u+1)%gm.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=dee?fee:null);return E.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[E.jsx(po.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:E.jsx(po.path,{animate:{d:[Q8,J8,uee,J8,Q8]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),E.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Wd.medium},children:[E.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:cee}),E.jsx(Qs,{mode:"popLayout",initial:!1,children:E.jsx(po.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:gm[n]},gm[n])})]}),e?E.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:lee(s)}):null,i?E.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var pee=Object.defineProperty,mee=(t,e)=>pee(t,"name",{value:e,configurable:!0});function Ww(t,[e,n]){return Math.min(n,Math.max(e,t))}mee(Ww,"clamp");var vee=Object.defineProperty,gee=(t,e)=>vee(t,"name",{value:e,configurable:!0});function wM(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])}gee(wM,"usePrevious");var yee=Object.defineProperty,yt=(t,e)=>yee(t,"name",{value:e,configurable:!0}),bM=["PageUp","PageDown"],SM=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],EM={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Kf="Slider",[T2,_ee,xee]=Dw(Kf),[qw,ute]=Oi(Kf,[xee]),[wee,Yf]=qw(Kf),bee=v.forwardRef(yt(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:f=[s],value:p,onValueChange:m=yt(()=>{},"onValueChange"),onValueCommit:_=yt(()=>{},"onValueCommit"),inverted:x=!1,form:y,...w}=e,S=v.useRef(new Set),C=v.useRef(0),P=v.useRef(!1),I=u==="horizontal"?See:Eee,[A,O]=v.useState(null),R=Bt(n,O),[L=[],D]=wa({prop:p,defaultProp:f,onChange:yt(W=>{var X;(X=[...S.current][C.current])==null||X.focus({preventScroll:!0,focusVisible:P.current}),P.current=!1,m(W)},"onChange")}),j=v.useRef(L),F=v.useRef(L);v.useEffect(()=>{const W=y?A==null?void 0:A.ownerDocument.getElementById(y):A==null?void 0:A.closest("form");if(W instanceof HTMLFormElement){const H=yt(()=>D(F.current),"reset");return W.addEventListener("reset",H),()=>W.removeEventListener("reset",H)}},[A,y,D]);function Z(W){const H=MM(L,W);q(W,H)}yt(Z,"handleSlideStart");function Q(W){q(W,C.current)}yt(Q,"handleSlideMove");function K(){String(L)!==String(j.current)&&_(L)}yt(K,"handleSlideEnd");function q(W,H,{commit:X}={commit:!1}){const z=Gw(a),N=Yd(Math.round((W-s)/a)*a+s,z),Y=Ww(N,[s,i]);D((oe=[])=>{const J=RM(oe,Y,H);if(DM(J,d*a)){C.current=J.indexOf(Y);const se=String(J)!==String(oe);return se&&X&&_(J),se?J:oe}else return oe})}return yt(q,"updateValues"),E.jsx(wee,{scope:e.__scopeSlider,name:r,disabled:c,min:s,max:i,valueIndexToChangeRef:C,thumbs:S.current,values:L,orientation:u,form:y,children:E.jsx(T2.Provider,{scope:e.__scopeSlider,children:E.jsx(T2.Slot,{scope:e.__scopeSlider,children:E.jsx(I,{"aria-disabled":c,"data-disabled":c?"":void 0,...w,ref:R,onPointerDown:zt(w.onPointerDown,()=>{c||(j.current=L,P.current=!1)}),min:s,max:i,inverted:x,onSlideStart:c?void 0:Z,onSlideMove:c?void 0:Q,onSlideEnd:c?void 0:K,onHomeKeyDown:()=>{c||(P.current=!0,q(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(P.current=!0,q(i,L.length-1,{commit:!0}))},onStepKeyDown:({event:W,direction:H})=>{if(!c){P.current=!0;const N=bM.includes(W.key)||W.shiftKey&&SM.includes(W.key)?10:1,Y=C.current,oe=L[Y],J=NM(oe,{min:s,step:a,direction:H,multiplier:N});q(J,Y,{commit:!0})}}})})})})},"Slider")),[kM,CM]=qw(Kf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),See=v.forwardRef(yt(function(e,n){const{min:r,max:s,dir:i,inverted:a,onSlideStart:u,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...p}=e,[m,_]=v.useState(null),x=Bt(n,_),y=v.useRef(void 0),w=Vw(i),S=w==="ltr",C=S&&!a||!S&&a;function P(T){const I=y.current||m.getBoundingClientRect(),A=[0,I.width],R=X0(A,C?[r,s]:[s,r]);return y.current=I,R(T-I.left)}return yt(P,"getValueFromPointer"),E.jsx(kM,{scope:e.__scopeSlider,startEdge:C?"left":"right",endEdge:C?"right":"left",direction:C?1:-1,size:"width",children:E.jsx(PM,{dir:w,"data-orientation":"horizontal",...p,ref:x,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:T=>{const I=P(T.clientX);u==null||u(I)},onSlideMove:T=>{const I=P(T.clientX);c==null||c(I)},onSlideEnd:()=>{y.current=void 0,d==null||d()},onStepKeyDown:T=>{const A=EM[C?"from-left":"from-right"].includes(T.key);f==null||f({event:T,direction:A?-1:1})}})})},"SliderHorizontal")),Eee=v.forwardRef(yt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:a,onSlideMove:u,onSlideEnd:c,onStepKeyDown:d,...f}=e,p=v.useRef(null),m=Bt(n,p),_=v.useRef(void 0),x=!i;function y(w){const S=_.current||p.current.getBoundingClientRect(),C=[0,S.height],T=X0(C,x?[s,r]:[r,s]);return _.current=S,T(w-S.top)}return yt(y,"getValueFromPointer"),E.jsx(kM,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:E.jsx(PM,{"data-orientation":"vertical",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const S=y(w.clientY);a==null||a(S)},onSlideMove:w=>{const S=y(w.clientY);u==null||u(S)},onSlideEnd:()=>{_.current=void 0,c==null||c()},onStepKeyDown:w=>{const C=EM[x?"from-bottom":"from-top"].includes(w.key);d==null||d({event:w,direction:C?-1:1})}})})},"SliderVertical")),PM=v.forwardRef(yt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:u,onEndKeyDown:c,onStepKeyDown:d,...f}=e,p=Yf(Kf,r);return E.jsx(xn.span,{...f,ref:n,onKeyDown:zt(e.onKeyDown,m=>{m.key==="Home"?(u(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):bM.concat(SM).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:zt(e.onPointerDown,m=>{const _=m.target;_.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(_)?_.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:zt(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:zt(e.onPointerUp,m=>{const _=m.target;_.hasPointerCapture(m.pointerId)&&(_.releasePointerCapture(m.pointerId),a(m))})})},"SliderImpl")),kee="SliderTrack",Cee=v.forwardRef(yt(function(e,n){const{__scopeSlider:r,...s}=e,i=Yf(kee,r);return E.jsx(xn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),e6="SliderRange",Pee=v.forwardRef(yt(function(e,n){const{__scopeSlider:r,...s}=e,i=Yf(e6,r),a=CM(e6,r),u=v.useRef(null),c=Bt(n,u),d=i.values.length,f=i.values.map(_=>Zw(_,i.min,i.max)),p=d>1?Math.min(...f):0,m=100-Math.max(...f);return E.jsx(xn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:c,style:{...e.style,[a.startEdge]:p+"%",[a.endEdge]:m+"%"}})},"SliderRange")),Tee="SliderThumb",[Iee,TM]=qw(Tee),Ree="SliderThumbProvider";function IM(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=Yf(Ree,e),a=_ee(e),[u,c]=v.useState(null),d=v.useMemo(()=>u?a().findIndex(w=>w.ref.current===u):-1,[a,u]),f=ow(u),p=u?!!i.form||!!u.closest("form"):!0,m=i.values[d],_=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),x=m===void 0?0:Zw(m,i.min,i.max);v.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]);const y={value:m,name:_,form:i.form,isFormControl:p,index:d,thumb:u,onThumbChange:c,percent:x,size:f};return E.jsx(Iee,{scope:e,...y,children:jM(s)?s(y):r})}yt(IM,"SliderThumbProvider");var dy="SliderThumbTrigger",Aee=v.forwardRef(yt(function(e,n){const{__scopeSlider:r,...s}=e,i=Yf(dy,r),a=CM(dy,r),{index:u,value:c,percent:d,size:f,onThumbChange:p}=TM(dy,r),m=Bt(n,p),_=AM(u,i.values.length),x=f==null?void 0:f[a.size],y=x?LM(x,d,a.direction):0;return E.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${d}% + ${y}px)`},children:E.jsx(T2.ItemSlot,{scope:r,children:E.jsx(xn.span,{role:"slider","aria-label":e["aria-label"]||_,"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:zt(e.onFocus,()=>{i.valueIndexToChangeRef.current=u})})})})},"SliderThumbTrigger")),Mee=v.forwardRef(yt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return E.jsx(IM,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:a,isFormControl:u})=>E.jsxs(E.Fragment,{children:[E.jsx(Aee,{...i,ref:n,__scopeSlider:r}),u?E.jsx(Oee,{__scopeSlider:r},a):null]})})},"SliderThumb")),Lee="SliderBubbleInput",Oee=v.forwardRef(yt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:a}=TM(Lee,e),u=v.useRef(null),c=Bt(u,r),d=wM(s);return v.useEffect(()=>{const f=u.current;if(!f)return;const p=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&_){const x=new Event("input",{bubbles:!0});_.call(f,s),f.dispatchEvent(x)}},[d,s]),E.jsx(xn.input,{style:{display:"none"},name:i,form:a,...n,ref:c,defaultValue:s})},"SliderBubbleInput"));function RM(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}yt(RM,"getNextSortedValues");function Zw(t,e,n){const i=100/(n-e)*(t-e);return Ww(i,[0,100])}yt(Zw,"convertValueToPercentage");function AM(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}yt(AM,"getLabel");function MM(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)}yt(MM,"getClosestValueIndex");function LM(t,e,n){const r=t/2,i=X0([0,50],[0,r]);return(r-i(e)*n)*n}yt(LM,"getThumbInBoundsOffset");function OM(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}yt(OM,"getStepsBetweenValues");function DM(t,e){if(e>0){const n=OM(t);return Math.min(...n)>=e}return!0}yt(DM,"hasMinStepsBetweenValues");function X0(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])}}yt(X0,"linearScale");function Gw(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}yt(Gw,"getDecimalCount");function Yd(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}yt(Yd,"roundValue");function NM(t,{min:e,step:n,direction:r,multiplier:s}){const i=Gw(n),a=(t-e)/n,u=Math.round(a),c=Yd(u*n+e,i)===Yd(t,i);let d;return c?d=u+s*r:r>0?d=Math.ceil(a):d=Math.floor(a),Yd(d*n+e,i)}yt(NM,"getNextStepValue");function jM(t){return typeof t=="function"}yt(jM,"isFunction");const I2=v.forwardRef(({className:t,...e},n)=>E.jsxs(bee,{ref:n,className:cr("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[E.jsx(Cee,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:E.jsx(Pee,{className:"absolute h-full bg-primary"})}),E.jsx(Mee,{className:cr("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")})]}));I2.displayName="Slider";const Dee=[{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"}],Nee=[{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"}],jee=[{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"}],zp=[{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."}],Fee=()=>{window.location.hash=""},Yi=({title:t,eyebrow:e,description:n,children:r})=>E.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[E.jsxs("div",{className:"mb-5 max-w-2xl",children:[E.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),E.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),E.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),t6=({swatches:t})=>E.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[E.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),E.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[E.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),E.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),Vee=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",$ee=()=>{const t=zp.filter(n=>n.status==="showcased").length,e=zp.filter(n=>n.status==="cataloged").length;return E.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:E.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[E.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[E.jsxs("button",{type:"button",onClick:Fee,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[E.jsx(oB,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),E.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[E.jsxs("div",{className:"max-w-3xl",children:[E.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),E.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),E.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),E.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:E.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[E.jsx(gI,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",E.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),E.jsx(Yi,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"The gallery uses Rivet's tooltip-wrapped button, compound split button, and the lower-level Radix tooltip wrapper so the reusable control APIs are visible.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button wrapper"}),E.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[E.jsx($u,{title:"Primary action",shortcut:"D",className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Design action"}),E.jsx($u,{title:"Secondary action",className:"border-border bg-surface-4 text-content hover:bg-surface-5 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",children:"Secondary"}),E.jsx($u,{title:"Disabled action",disabled:!0,className:"border-border bg-muted text-muted-foreground rounded-lg border px-4 py-2 text-sm font-medium opacity-60",children:"Disabled"}),E.jsx(CR,{primaryLabel:"Ship",primaryIcon:F1,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),E.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[E.jsx(Ys,{label:"Rivet tooltip API",side:"bottom",children:E.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),E.jsx(hw,{content:"Forced open preview",forceOpen:!0,side:"right",children:E.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),E.jsx(Yi,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:E.jsx(t6,{swatches:Dee})}),E.jsx(Yi,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:E.jsx(t6,{swatches:Nee})}),E.jsx(Yi,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),E.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),E.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),E.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),E.jsx(Yi,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:E.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:E.jsx("div",{className:"flex flex-col gap-3",children:jee.map(n=>E.jsxs("div",{className:"flex items-center gap-4",children:[E.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),E.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),E.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),E.jsx(Yi,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[E.jsxs(vm,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[E.jsx(vm.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:E.jsx(F1,{className:"text-primary h-4 w-4"}),children:E.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),E.jsx(vm.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:E.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[E.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),E.jsxs("div",{className:"space-y-6",children:[E.jsx(I2,{defaultValue:[64],max:100,step:1}),E.jsx(I2,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),E.jsx(Yi,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:E.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),E.jsx(oee,{message:"Applying visual change..."})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),E.jsx(Jx,{className:"text-primary text-xl"})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),E.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),E.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:E.jsx(hee,{hint:"Reading selected elements"})})]})}),E.jsx(Yi,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:E.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(c2,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(tA,{icon:E.jsx(F1,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(mw,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),E.jsxs(Yi,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[E.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),E.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:zp.length})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),E.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),E.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),E.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[E.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[E.jsx("span",{children:"Component"}),E.jsx("span",{children:"Status"}),E.jsx("span",{children:"Coverage note"})]}),E.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:zp.map(n=>E.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[E.jsxs("div",{children:[E.jsx("p",{className:"text-foreground font-medium",children:n.name}),E.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),E.jsx("div",{children:E.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${Vee(n.status)}`,children:n.status})}),E.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},Hee=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",zee=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},fy=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:"editor_gate",method:"google_oauth",...s?{failure_reason:s}:{}}}),n6=Ls("App"),Uee=2e3,Bee=60,r6="Connecting to Google...",s6="https://rivet-proxy.onrender.com",Wee=`<!doctype html>
395
+ <html lang="en">
396
+ <head>
397
+ <meta charset="utf-8" />
398
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
399
+ <title>${r6}</title>
400
+ <style>
401
+ :root { color-scheme: light dark; }
402
+ body {
403
+ margin: 0;
404
+ min-height: 100vh;
405
+ display: grid;
406
+ place-items: center;
407
+ font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
408
+ background: #111215;
409
+ color: #f3f4f6;
410
+ }
411
+ .panel {
412
+ border: 1px solid rgba(255, 255, 255, 0.16);
413
+ border-radius: 12px;
414
+ padding: 18px 22px;
415
+ background: rgba(255, 255, 255, 0.06);
416
+ font-size: 14px;
417
+ }
418
+ </style>
419
+ </head>
420
+ <body>
421
+ <div class="panel">${r6}</div>
422
+ </body>
423
+ </html>`,R2=274,_0=395,hy=Math.min(_0,Math.round((R2+_0)/2*1.1)),i6="rivet:panelWidth:v2",qee=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},Zee=({projectPath:t})=>{const e=tt(WI)>0,[n,r]=C3(UI),s=NH(),[i,a]=v.useState(()=>{if(typeof window>"u")return hy;const T=Number(window.localStorage.getItem(i6));return Number.isFinite(T)&&T>=R2&&T<=_0?T:hy}),[u,c]=v.useState(!1),[d,f]=v.useState(dX),p=n?i:0,[m,_]=v.useState(n);v.useEffect(()=>{if(!n){_(!1);return}f(T=>cX({position:T,boundsLeftPx:i}))},[n,i]),v.useEffect(()=>{window.localStorage.setItem(i6,String(i))},[i]),v.useEffect(()=>{if(!n)return;const T=I=>{I.key==="Escape"&&(qee(I.target)||(I.preventDefault(),r(!1)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[n,r]);const x=v.useCallback(T=>{T.preventDefault(),T.stopPropagation();const I=T.clientX,A=i;c(!0);const O=L=>{const D=Math.min(_0,Math.max(R2,A+(L.clientX-I)));a(D)},R=()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",R),c(!1)};window.addEventListener("pointermove",O),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",R)},[i]),y=v.useCallback(()=>a(hy),[]),w=EX(),S=tt(Wf);PX({enabled:!S});const C=w.isProcessing?"Completing authentication...":null,P=at(YI);return v.useEffect(()=>{P(t??null)},[t,P]),E.jsxs(po.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[C!==null?E.jsx("div",{className:"absolute inset-0 z-50",children:E.jsx(XY,{message:C})}):null,E.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col",children:E.jsx(kK,{})}),E.jsx(E.Fragment,{children:e?null:E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:m?i:0},children:E.jsxs(po.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:n?0:-i},transition:s?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{n&&_(!0)},style:{width:i,willChange:"transform"},children:[E.jsx(OG,{onClose:()=>r(!1)}),E.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:x,onDoubleClick:y,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:E.jsx("span",{className:`h-full transition-all duration-150 ${u?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),u&&E.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),E.jsx(pX,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!s,position:d,dragBoundsLeftPx:p,onPositionChange:f,onToggle:()=>r(T=>!T)})]})}),E.jsx(fz,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},A2="rivet_connect_deep_link",Gee=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(A2);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(A2,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},Kee=Gee(),Yee=()=>{const[t,e]=v.useState(window.location.hash),[n]=v.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(pm)==="1"),[r,s]=v.useState(!1),[i,a]=v.useState(Kee);v.useEffect(()=>{n&&window.sessionStorage.removeItem(pm)},[n]);const{config:u,refetchConfig:c,loading:d,error:f}=bX(),p=at(Wf),[m,_]=v.useState(!1),[x,y]=v.useState(null),[w,S]=v.useState(!1);v.useEffect(()=>{u!=null&&u.userId?(Ee.identify(u.userId,{...u.email?{email:u.email}:{}}),u.email&&Ee.alias(u.email,u.userId)):u!=null&&u.email&&Ee.identify(u.email,{email:u.email})},[u==null?void 0:u.userId,u==null?void 0:u.email]),v.useEffect(()=>{u&&Ee.register({source:"visual_editor",surface:"visual_editor"})},[u]);const C=v.useCallback(async()=>{var Z;const L=globalThis.crypto.randomUUID(),D=Date.now();_(!0),y(null);const j=fy({outcome:"started",authAttemptId:L,startedAt:D,now:D});Ee.capture(j.event,j.properties);let F=null;try{if(F=window.open("","_blank"),!F)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{F.document.open(),F.document.write(Wee),F.document.close()}catch(q){n6.warn("Failed to render loading state in auth popup:",q)}const Q=await fetch(`${s6}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),K=await Q.json();if(!Q.ok||!K.success||!K.authUrl||!K.sessionId||!K.pollSecret)throw new Error(K.error||K.message||"Failed to start Google login");if(F.closed)throw new Error("Sign-in window was closed before Google login started.");F.location.href=K.authUrl;for(let q=0;q<Bee;q+=1){if(F.closed)throw new Error("Sign-in window was closed before authentication completed.");const H=await(await fetch(`${s6}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:K.sessionId,pollSecret:K.pollSecret})})).json();if(H.success&&H.token&&((Z=H.user)!=null&&Z.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:H.user.email,token:H.token,refreshToken:H.refreshToken,userId:H.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");F.close(),window.sessionStorage.setItem(pm,"1");const z=fy({outcome:"completed",authAttemptId:L,startedAt:D,now:Date.now()});Ee.capture(z.event,z.properties),window.location.reload();return}if(H.error&&H.error!=="Pending")throw new Error(H.error||"Google login failed");await new Promise(X=>setTimeout(X,Uee))}throw new Error("Authentication timed out. Please try again.")}catch(Q){F&&!F.closed&&F.close();const K=Q instanceof Error?Q.message:"Failed to start login flow";n6.warn("Login failed:",K);const q=fy({outcome:"failed",authAttemptId:L,startedAt:D,now:Date.now(),failureReason:zee(K)});Ee.capture(q.event,q.properties),y(K),_(!1)}},[]),P=u!=null&&u.agentModeAvailable!==!0,T=Hee(t),I=v.useCallback(async()=>{S(!0),p(!0);try{await c()}finally{p(!1),S(!1)}},[c,p]);if(v.useEffect(()=>{const L=()=>{const D=window.location.hash;e(D)};return window.addEventListener("hashchange",L),()=>window.removeEventListener("hashchange",L)},[]),T==="design-system")return E.jsx($ee,{});if(!d&&u===null&&!w){const L=f||"Could not load Rivet configuration.";return E.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:E.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[E.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),E.jsx("p",{className:"text-content-dim mt-2 text-xs",children:L}),E.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{I()},children:"Retry"})]})})}if(P)return E.jsx(KY,{isSigningIn:m,onStartSignIn:()=>{C()},errorMessage:x,displayMode:"full"});const O=(u==null?void 0:u.agentModeAvailable)===!0&&i!==null,R=(u==null?void 0:u.agentModeAvailable)===!0&&n&&!r&&!O;return E.jsxs(E.Fragment,{children:[E.jsx(Zee,{projectPath:u==null?void 0:u.projectPath}),E.jsx(u2,{context:"onboarding",isOpen:R,onClose:()=>s(!0)}),E.jsx(u2,{context:"menu",isOpen:O,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(A2),a(null)}})]})},Xee="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",Qee=new GO,Jee={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},ete=()=>E.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:E.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})});aj.createRoot(document.getElementById("root")).render(E.jsx(we.StrictMode,{children:E.jsx(G9,{apiKey:Xee,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",...Jee,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.16.0",env:"production"})}},children:E.jsx(tj,{fallback:E.jsx(ete,{}),children:E.jsx(bO,{client:Qee,children:E.jsx(OZ,{defaultShape:"rounded",children:E.jsx(ree,{defaultLibrary:"lucide",children:E.jsx(Yee,{})})})})})})}));