rivet-design 0.13.4 → 0.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-variants/SessionStore.d.ts +3 -2
- package/dist/agent-variants/SessionStore.d.ts.map +1 -1
- package/dist/agent-variants/SessionStore.js +1 -0
- package/dist/agent-variants/SessionStore.js.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.d.ts +13 -1
- package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +54 -2
- package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/agent-variants/contracts.d.ts +10 -13
- package/dist/agent-variants/contracts.d.ts.map +1 -1
- package/dist/agent-variants/contracts.js +7 -2
- package/dist/agent-variants/contracts.js.map +1 -1
- package/dist/agent-variants/runLabel.d.ts +5 -4
- package/dist/agent-variants/runLabel.d.ts.map +1 -1
- package/dist/agent-variants/runLabel.js +16 -8
- package/dist/agent-variants/runLabel.js.map +1 -1
- package/dist/agent-variants/workItemBriefing.d.ts.map +1 -1
- package/dist/agent-variants/workItemBriefing.js +1 -1
- package/dist/agent-variants/workItemBriefing.js.map +1 -1
- package/dist/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +19 -20
- package/dist/cli/commands/mcpServe.js.map +1 -1
- package/dist/cli/commands/variants.d.ts.map +1 -1
- package/dist/cli/commands/variants.js +74 -2
- package/dist/cli/commands/variants.js.map +1 -1
- package/dist/cli/router.js +2 -2
- package/dist/cli/router.js.map +1 -1
- package/dist/mcp/changeBatchClassification.d.ts +2 -0
- package/dist/mcp/changeBatchClassification.d.ts.map +1 -1
- package/dist/mcp/changeBatchClassification.js +5 -0
- package/dist/mcp/changeBatchClassification.js.map +1 -1
- package/dist/routes/agentVariants.d.ts.map +1 -1
- package/dist/routes/agentVariants.js +9 -2
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/routes/emptyStatePage.d.ts +14 -0
- package/dist/routes/emptyStatePage.d.ts.map +1 -0
- package/dist/routes/emptyStatePage.js +601 -0
- package/dist/routes/emptyStatePage.js.map +1 -0
- package/dist/routes/static.d.ts.map +1 -1
- package/dist/routes/static.js +2 -73
- package/dist/routes/static.js.map +1 -1
- package/dist/services/VariantGenerationService.d.ts.map +1 -1
- package/dist/services/VariantGenerationService.js +6 -0
- package/dist/services/VariantGenerationService.js.map +1 -1
- package/dist/services/VariantRunService.d.ts.map +1 -1
- package/dist/services/VariantRunService.js +2 -1
- package/dist/services/VariantRunService.js.map +1 -1
- package/dist/types/change-request-types.d.ts +2 -0
- package/dist/types/change-request-types.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +2 -2
- package/dist/utils/skills/claude-skill.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.js +1 -1
- package/dist/utils/skills/cli-guidance.d.ts +2 -2
- package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
- package/dist/utils/skills/cli-guidance.js +8 -7
- package/dist/utils/skills/cli-guidance.js.map +1 -1
- package/dist/utils/skills/cursor-rules.d.ts +2 -2
- package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
- package/dist/utils/skills/cursor-rules.js +1 -1
- package/package.json +1 -1
- package/src/ui/dist/assets/main-Ct4AXMqD.js +422 -0
- package/src/ui/dist/index.html +1 -1
- package/src/ui/dist/assets/main-T3U4Gt16.js +0 -419
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
var BM=Object.defineProperty;var hS=t=>{throw TypeError(t)};var WM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var So=(t,e,n)=>WM(t,typeof e!="symbol"?e+"":e,n),nv=(t,e,n)=>e.has(t)||hS("Cannot "+n);var G=(t,e,n)=>(nv(t,e,"read from private field"),n?n.call(t):e.get(t)),Ue=(t,e,n)=>e.has(t)?hS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Re=(t,e,n,r)=>(nv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ot=(t,e,n)=>(nv(t,e,"access private method"),n);var Eh=(t,e,n,r)=>({set _(s){Re(t,e,s,n)},get _(){return G(t,e,r)}});function GM(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function jm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rv={exports:{}},Dc={},sv={exports:{}},rt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var pS;function KM(){if(pS)return rt;pS=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"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function v(L){return L===null||typeof L!="object"?null:(L=p&&L[p]||L["@@iterator"],typeof L=="function"?L:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function b(L,Z,ne){this.props=L,this.context=Z,this.refs=_,this.updater=ne||y}b.prototype.isReactComponent={},b.prototype.setState=function(L,Z){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,Z,"setState")},b.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function E(){}E.prototype=b.prototype;function C(L,Z,ne){this.props=L,this.context=Z,this.refs=_,this.updater=ne||y}var P=C.prototype=new E;P.constructor=C,x(P,b.prototype),P.isPureReactComponent=!0;var T=Array.isArray,R=Object.prototype.hasOwnProperty,O={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function A(L,Z,ne){var ie,ae={},ue=null,ke=null;if(Z!=null)for(ie in Z.ref!==void 0&&(ke=Z.ref),Z.key!==void 0&&(ue=""+Z.key),Z)R.call(Z,ie)&&!M.hasOwnProperty(ie)&&(ae[ie]=Z[ie]);var ee=arguments.length-2;if(ee===1)ae.children=ne;else if(1<ee){for(var le=Array(ee),pe=0;pe<ee;pe++)le[pe]=arguments[pe+2];ae.children=le}if(L&&L.defaultProps)for(ie in ee=L.defaultProps,ee)ae[ie]===void 0&&(ae[ie]=ee[ie]);return{$$typeof:t,type:L,key:ue,ref:ke,props:ae,_owner:O.current}}function N(L,Z){return{$$typeof:t,type:L.type,key:Z,ref:L.ref,props:L.props,_owner:L._owner}}function D(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function j(L){var Z={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ne){return Z[ne]})}var V=/\/+/g;function W(L,Z){return typeof L=="object"&&L!==null&&L.key!=null?j(""+L.key):Z.toString(36)}function Y(L,Z,ne,ie,ae){var ue=typeof L;(ue==="undefined"||ue==="boolean")&&(L=null);var ke=!1;if(L===null)ke=!0;else switch(ue){case"string":case"number":ke=!0;break;case"object":switch(L.$$typeof){case t:case e:ke=!0}}if(ke)return ke=L,ae=ae(ke),L=ie===""?"."+W(ke,0):ie,T(ae)?(ne="",L!=null&&(ne=L.replace(V,"$&/")+"/"),Y(ae,Z,ne,"",function(pe){return pe})):ae!=null&&(D(ae)&&(ae=N(ae,ne+(!ae.key||ke&&ke.key===ae.key?"":(""+ae.key).replace(V,"$&/")+"/")+L)),Z.push(ae)),1;if(ke=0,ie=ie===""?".":ie+":",T(L))for(var ee=0;ee<L.length;ee++){ue=L[ee];var le=ie+W(ue,ee);ke+=Y(ue,Z,ne,le,ae)}else if(le=v(L),typeof le=="function")for(L=le.call(L),ee=0;!(ue=L.next()).done;)ue=ue.value,le=ie+W(ue,ee++),ke+=Y(ue,Z,ne,le,ae);else if(ue==="object")throw Z=String(L),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return ke}function K(L,Z,ne){if(L==null)return L;var ie=[],ae=0;return Y(L,ie,"","",function(ue){return Z.call(ne,ue,ae++)}),ie}function B(L){if(L._status===-1){var Z=L._result;Z=Z(),Z.then(function(ne){(L._status===0||L._status===-1)&&(L._status=1,L._result=ne)},function(ne){(L._status===0||L._status===-1)&&(L._status=2,L._result=ne)}),L._status===-1&&(L._status=0,L._result=Z)}if(L._status===1)return L._result.default;throw L._result}var X={current:null},$={transition:null},te={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:$,ReactCurrentOwner:O};function H(){throw Error("act(...) is not supported in production builds of React.")}return rt.Children={map:K,forEach:function(L,Z,ne){K(L,function(){Z.apply(this,arguments)},ne)},count:function(L){var Z=0;return K(L,function(){Z++}),Z},toArray:function(L){return K(L,function(Z){return Z})||[]},only:function(L){if(!D(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},rt.Component=b,rt.Fragment=n,rt.Profiler=s,rt.PureComponent=C,rt.StrictMode=r,rt.Suspense=c,rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,rt.act=H,rt.cloneElement=function(L,Z,ne){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var ie=x({},L.props),ae=L.key,ue=L.ref,ke=L._owner;if(Z!=null){if(Z.ref!==void 0&&(ue=Z.ref,ke=O.current),Z.key!==void 0&&(ae=""+Z.key),L.type&&L.type.defaultProps)var ee=L.type.defaultProps;for(le in Z)R.call(Z,le)&&!M.hasOwnProperty(le)&&(ie[le]=Z[le]===void 0&&ee!==void 0?ee[le]:Z[le])}var le=arguments.length-2;if(le===1)ie.children=ne;else if(1<le){ee=Array(le);for(var pe=0;pe<le;pe++)ee[pe]=arguments[pe+2];ie.children=ee}return{$$typeof:t,type:L.type,key:ae,ref:ue,props:ie,_owner:ke}},rt.createContext=function(L){return L={$$typeof:a,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:i,_context:L},L.Consumer=L},rt.createElement=A,rt.createFactory=function(L){var Z=A.bind(null,L);return Z.type=L,Z},rt.createRef=function(){return{current:null}},rt.forwardRef=function(L){return{$$typeof:u,render:L}},rt.isValidElement=D,rt.lazy=function(L){return{$$typeof:h,_payload:{_status:-1,_result:L},_init:B}},rt.memo=function(L,Z){return{$$typeof:f,type:L,compare:Z===void 0?null:Z}},rt.startTransition=function(L){var Z=$.transition;$.transition={};try{L()}finally{$.transition=Z}},rt.unstable_act=H,rt.useCallback=function(L,Z){return X.current.useCallback(L,Z)},rt.useContext=function(L){return X.current.useContext(L)},rt.useDebugValue=function(){},rt.useDeferredValue=function(L){return X.current.useDeferredValue(L)},rt.useEffect=function(L,Z){return X.current.useEffect(L,Z)},rt.useId=function(){return X.current.useId()},rt.useImperativeHandle=function(L,Z,ne){return X.current.useImperativeHandle(L,Z,ne)},rt.useInsertionEffect=function(L,Z){return X.current.useInsertionEffect(L,Z)},rt.useLayoutEffect=function(L,Z){return X.current.useLayoutEffect(L,Z)},rt.useMemo=function(L,Z){return X.current.useMemo(L,Z)},rt.useReducer=function(L,Z,ne){return X.current.useReducer(L,Z,ne)},rt.useRef=function(L){return X.current.useRef(L)},rt.useState=function(L){return X.current.useState(L)},rt.useSyncExternalStore=function(L,Z,ne){return X.current.useSyncExternalStore(L,Z,ne)},rt.useTransition=function(){return X.current.useTransition()},rt.version="18.3.1",rt}var mS;function U_(){return mS||(mS=1,sv.exports=KM()),sv.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 gS;function qM(){if(gS)return Dc;gS=1;var t=U_(),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,f){var h,p={},v=null,y=null;f!==void 0&&(v=""+f),c.key!==void 0&&(v=""+c.key),c.ref!==void 0&&(y=c.ref);for(h in c)r.call(c,h)&&!i.hasOwnProperty(h)&&(p[h]=c[h]);if(u&&u.defaultProps)for(h in c=u.defaultProps,c)p[h]===void 0&&(p[h]=c[h]);return{$$typeof:e,type:u,key:v,ref:y,props:p,_owner:s.current}}return Dc.Fragment=n,Dc.jsx=a,Dc.jsxs=a,Dc}var vS;function ZM(){return vS||(vS=1,rv.exports=qM()),rv.exports}var S=ZM(),g=U_();const ge=jm(g),B_=GM({__proto__:null,default:ge},[g]);var lf=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(){}},Ga,To,gu,WC,YM=(WC=class extends lf{constructor(){super();Ue(this,Ga);Ue(this,To);Ue(this,gu);Re(this,gu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){G(this,To)||this.setEventListener(G(this,gu))}onUnsubscribe(){var e;this.hasListeners()||((e=G(this,To))==null||e.call(this),Re(this,To,void 0))}setEventListener(e){var n;Re(this,gu,e),(n=G(this,To))==null||n.call(this),Re(this,To,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){G(this,Ga)!==e&&(Re(this,Ga,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof G(this,Ga)=="boolean"?G(this,Ga):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ga=new WeakMap,To=new WeakMap,gu=new WeakMap,WC),W_=new YM,XM={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ro,z_,GC,QM=(GC=class{constructor(){Ue(this,Ro,XM);Ue(this,z_,!1)}setTimeoutProvider(t){Re(this,Ro,t)}setTimeout(t,e){return G(this,Ro).setTimeout(t,e)}clearTimeout(t){G(this,Ro).clearTimeout(t)}setInterval(t,e){return G(this,Ro).setInterval(t,e)}clearInterval(t){G(this,Ro).clearInterval(t)}},Ro=new WeakMap,z_=new WeakMap,GC),Ha=new QM;function JM(t){setTimeout(t,0)}var eN=typeof window>"u"||"Deno"in globalThis;function wr(){}function tN(t,e){return typeof t=="function"?t(e):t}function T1(t){return typeof t=="number"&&t>=0&&t!==1/0}function t8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function zo(t,e){return typeof t=="function"?t(e):t}function Fr(t,e){return typeof t=="function"?t(e):t}function yS(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==G_(a,e.options))return!1}else if(!Ed(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 _S(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Sd(e.options.mutationKey)!==Sd(i))return!1}else if(!Ed(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function G_(t,e){return((e==null?void 0:e.queryKeyHashFn)||Sd)(t)}function Sd(t){return JSON.stringify(t,(e,n)=>A1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ed(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Ed(t[n],e[n])):!1}var nN=Object.prototype.hasOwnProperty;function n8(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=xS(t)&&xS(e);if(!r&&!(A1(t)&&A1(e)))return e;const i=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),u=a.length,c=r?new Array(u):{};let f=0;for(let h=0;h<u;h++){const p=r?h:a[h],v=t[p],y=e[p];if(v===y){c[p]=v,(r?h<i:nN.call(t,p))&&f++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){c[p]=y;continue}const x=n8(v,y,n+1);c[p]=x,x===v&&f++}return i===u&&f===i?t:c}function R1(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 xS(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function A1(t){if(!wS(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!wS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function wS(t){return Object.prototype.toString.call(t)==="[object Object]"}function rN(t){return new Promise(e=>{Ha.setTimeout(e,t)})}function I1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?n8(t,e):e}function sN(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function iN(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var K_=Symbol();function r8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===K_?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function s8(t,e){return typeof t=="function"?t(...e):!!t}function oN(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}var kd=(()=>{let t=()=>eN;return{isServer(){return t()},setIsServer(e){t=e}}})();function M1(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var aN=JM;function lN(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=aN;const i=u=>{e?t.push(u):s(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&s(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;e++;try{c=u()}finally{e--,e||a()}return c},batchCalls:u=>(...c)=>{i(()=>{u(...c)})},schedule:i,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var Ln=lN(),vu,Ao,yu,KC,uN=(KC=class extends lf{constructor(){super();Ue(this,vu,!0);Ue(this,Ao);Ue(this,yu);Re(this,yu,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(){G(this,Ao)||this.setEventListener(G(this,yu))}onUnsubscribe(){var e;this.hasListeners()||((e=G(this,Ao))==null||e.call(this),Re(this,Ao,void 0))}setEventListener(e){var n;Re(this,yu,e),(n=G(this,Ao))==null||n.call(this),Re(this,Ao,e(this.setOnline.bind(this)))}setOnline(e){G(this,vu)!==e&&(Re(this,vu,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return G(this,vu)}},vu=new WeakMap,Ao=new WeakMap,yu=new WeakMap,KC),Dp=new uN;function cN(t){return Math.min(1e3*2**t,3e4)}function i8(t){return(t??"online")==="online"?Dp.isOnline():!0}var N1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function o8(t){let e=!1,n=0,r;const s=M1(),i=()=>s.status!=="pending",a=_=>{var b;if(!i()){const E=new N1(_);v(E),(b=t.onCancel)==null||b.call(t,E)}},u=()=>{e=!0},c=()=>{e=!1},f=()=>W_.isFocused()&&(t.networkMode==="always"||Dp.isOnline())&&t.canRun(),h=()=>i8(t.networkMode)&&t.canRun(),p=_=>{i()||(r==null||r(),s.resolve(_))},v=_=>{i()||(r==null||r(),s.reject(_))},y=()=>new Promise(_=>{var b;r=E=>{(i()||f())&&_(E)},(b=t.onPause)==null||b.call(t)}).then(()=>{var _;r=void 0,i()||(_=t.onContinue)==null||_.call(t)}),x=()=>{if(i())return;let _;const b=n===0?t.initialPromise:void 0;try{_=b??t.fn()}catch(E){_=Promise.reject(E)}Promise.resolve(_).then(p).catch(E=>{var O;if(i())return;const C=t.retry??(kd.isServer()?0:3),P=t.retryDelay??cN,T=typeof P=="function"?P(n,E):P,R=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,E);if(e||!R){v(E);return}n++,(O=t.onFail)==null||O.call(t,n,E),rN(T).then(()=>f()?void 0:y()).then(()=>{e?v(E):x()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?x():y().then(x),s)}}var Ka,qC,a8=(qC=class{constructor(){Ue(this,Ka)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),T1(this.gcTime)&&Re(this,Ka,Ha.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(kd.isServer()?1/0:300*1e3))}clearGcTimeout(){G(this,Ka)!==void 0&&(Ha.clearTimeout(G(this,Ka)),Re(this,Ka,void 0))}},Ka=new WeakMap,qC);function dN(t){return{onFetch:(e,n)=>{var h,p,v,y,x;const r=e.options,s=(v=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,i=((y=e.state.data)==null?void 0:y.pages)||[],a=((x=e.state.data)==null?void 0:x.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const f=async()=>{let _=!1;const b=P=>{oN(P,()=>e.signal,()=>_=!0)},E=r8(e.options,e.fetchOptions),C=async(P,T,R)=>{if(_)return Promise.reject(e.signal.reason);if(T==null&&P.pages.length)return Promise.resolve(P);const M=(()=>{const j={client:e.client,queryKey:e.queryKey,pageParam:T,direction:R?"backward":"forward",meta:e.options.meta};return b(j),j})(),A=await E(M),{maxPages:N}=e.options,D=R?iN:sN;return{pages:D(P.pages,A,N),pageParams:D(P.pageParams,T,N)}};if(s&&i.length){const P=s==="backward",T=P?fN:bS,R={pages:i,pageParams:a},O=T(r,R);u=await C(R,O,P)}else{const P=t??i.length;do{const T=c===0?a[0]??r.initialPageParam:bS(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 _,b;return(b=(_=e.options).persister)==null?void 0:b.call(_,f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=f}}}function bS(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 fN(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var _u,qa,xu,ss,Za,Pn,nf,Ya,jr,l8,Mi,ZC,hN=(ZC=class extends a8{constructor(e){super();Ue(this,jr);Ue(this,_u);Ue(this,qa);Ue(this,xu);Ue(this,ss);Ue(this,Za);Ue(this,Pn);Ue(this,nf);Ue(this,Ya);Re(this,Ya,!1),Re(this,nf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Re(this,Za,e.client),Re(this,ss,G(this,Za).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Re(this,qa,ES(this.options)),this.state=e.state??G(this,qa),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return G(this,_u)}get promise(){var e;return(e=G(this,Pn))==null?void 0:e.promise}setOptions(e){if(this.options={...G(this,nf),...e},e!=null&&e._type&&Re(this,_u,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=ES(this.options);n.data!==void 0&&(this.setState(SS(n.data,n.dataUpdatedAt)),Re(this,qa,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&G(this,ss).remove(this)}setData(e,n){const r=I1(this.state.data,e,this.options);return ot(this,jr,Mi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){ot(this,jr,Mi).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=G(this,Pn))==null?void 0:r.promise;return(s=G(this,Pn))==null||s.cancel(e),n?n.then(wr).catch(wr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return G(this,qa)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Fr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===K_||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>zo(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!t8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=G(this,Pn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=G(this,Pn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),G(this,ss).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(G(this,Pn)&&(G(this,Ya)||ot(this,jr,l8).call(this)?G(this,Pn).cancel({revert:!0}):G(this,Pn).cancelRetry()),this.scheduleGc()),G(this,ss).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ot(this,jr,Mi).call(this,{type:"invalidate"})}async fetch(e,n){var f,h,p,v,y,x,_,b,E,C,P;if(this.state.fetchStatus!=="idle"&&((f=G(this,Pn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(G(this,Pn))return G(this,Pn).continueRetry(),G(this,Pn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(R=>R.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Re(this,Ya,!0),r.signal)})},i=()=>{const T=r8(this.options,n),O=(()=>{const M={client:G(this,Za),queryKey:this.queryKey,meta:this.meta};return s(M),M})();return Re(this,Ya,!1),this.options.persister?this.options.persister(T,O,this):T(O)},u=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:G(this,Za),state:this.state,fetchFn:i};return s(T),T})(),c=G(this,_u)==="infinite"?dN(this.options.pages):this.options.behavior;c==null||c.onFetch(u,this),Re(this,xu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=u.fetchOptions)==null?void 0:h.meta))&&ot(this,jr,Mi).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),Re(this,Pn,o8({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:T=>{T instanceof N1&&T.revert&&this.setState({...G(this,xu),fetchStatus:"idle"}),r.abort()},onFail:(T,R)=>{ot(this,jr,Mi).call(this,{type:"failed",failureCount:T,error:R})},onPause:()=>{ot(this,jr,Mi).call(this,{type:"pause"})},onContinue:()=>{ot(this,jr,Mi).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const T=await G(this,Pn).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(v=G(this,ss).config).onSuccess)==null||y.call(v,T,this),(_=(x=G(this,ss).config).onSettled)==null||_.call(x,T,this.state.error,this),T}catch(T){if(T instanceof N1){if(T.silent)return G(this,Pn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw ot(this,jr,Mi).call(this,{type:"error",error:T}),(E=(b=G(this,ss).config).onError)==null||E.call(b,T,this),(P=(C=G(this,ss).config).onSettled)==null||P.call(C,this.state.data,T,this),T}finally{this.scheduleGc()}}},_u=new WeakMap,qa=new WeakMap,xu=new WeakMap,ss=new WeakMap,Za=new WeakMap,Pn=new WeakMap,nf=new WeakMap,Ya=new WeakMap,jr=new WeakSet,l8=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Mi=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,...u8(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...SS(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Re(this,xu,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),Ln.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),G(this,ss).notify({query:this,type:"updated",action:e})})},ZC);function u8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:i8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function SS(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ES(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,ut,rf,tr,Xa,wu,$i,Io,sf,bu,Su,Qa,Ja,Mo,Eu,pt,Jc,O1,D1,L1,j1,F1,V1,$1,c8,YC,pN=(YC=class extends lf{constructor(e,n){super();Ue(this,pt);Ue(this,yr);Ue(this,ut);Ue(this,rf);Ue(this,tr);Ue(this,Xa);Ue(this,wu);Ue(this,$i);Ue(this,Io);Ue(this,sf);Ue(this,bu);Ue(this,Su);Ue(this,Qa);Ue(this,Ja);Ue(this,Mo);Ue(this,Eu,new Set);this.options=n,Re(this,yr,e),Re(this,Io,null),Re(this,$i,M1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(G(this,ut).addObserver(this),kS(G(this,ut),this.options)?ot(this,pt,Jc).call(this):this.updateResult(),ot(this,pt,j1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return H1(G(this,ut),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return H1(G(this,ut),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,pt,F1).call(this),ot(this,pt,V1).call(this),G(this,ut).removeObserver(this)}setOptions(e){const n=this.options,r=G(this,ut);if(this.options=G(this,yr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fr(this.options.enabled,G(this,ut))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ot(this,pt,$1).call(this),G(this,ut).setOptions(this.options),n._defaulted&&!R1(this.options,n)&&G(this,yr).getQueryCache().notify({type:"observerOptionsUpdated",query:G(this,ut),observer:this});const s=this.hasListeners();s&&CS(G(this,ut),r,this.options,n)&&ot(this,pt,Jc).call(this),this.updateResult(),s&&(G(this,ut)!==r||Fr(this.options.enabled,G(this,ut))!==Fr(n.enabled,G(this,ut))||zo(this.options.staleTime,G(this,ut))!==zo(n.staleTime,G(this,ut)))&&ot(this,pt,O1).call(this);const i=ot(this,pt,D1).call(this);s&&(G(this,ut)!==r||Fr(this.options.enabled,G(this,ut))!==Fr(n.enabled,G(this,ut))||i!==G(this,Mo))&&ot(this,pt,L1).call(this,i)}getOptimisticResult(e){const n=G(this,yr).getQueryCache().build(G(this,yr),e),r=this.createResult(n,e);return gN(this,r)&&(Re(this,tr,r),Re(this,wu,this.options),Re(this,Xa,G(this,ut).state)),r}getCurrentResult(){return G(this,tr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&G(this,$i).status==="pending"&&G(this,$i).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){G(this,Eu).add(e)}getCurrentQuery(){return G(this,ut)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=G(this,yr).defaultQueryOptions(e),r=G(this,yr).getQueryCache().build(G(this,yr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return ot(this,pt,Jc).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),G(this,tr)))}createResult(e,n){var N;const r=G(this,ut),s=this.options,i=G(this,tr),a=G(this,Xa),u=G(this,wu),f=e!==r?e.state:G(this,rf),{state:h}=e;let p={...h},v=!1,y;if(n._optimisticResults){const D=this.hasListeners(),j=!D&&kS(e,n),V=D&&CS(e,r,n,s);(j||V)&&(p={...p,...u8(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:_,status:b}=p;y=p.data;let E=!1;if(n.placeholderData!==void 0&&y===void 0&&b==="pending"){let D;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(D=i.data,E=!0):D=typeof n.placeholderData=="function"?n.placeholderData((N=G(this,Su))==null?void 0:N.state.data,G(this,Su)):n.placeholderData,D!==void 0&&(b="success",y=I1(i==null?void 0:i.data,D,n),v=!0)}if(n.select&&y!==void 0&&!E)if(i&&y===(a==null?void 0:a.data)&&n.select===G(this,sf))y=G(this,bu);else try{Re(this,sf,n.select),y=n.select(y),y=I1(i==null?void 0:i.data,y,n),Re(this,bu,y),Re(this,Io,null)}catch(D){Re(this,Io,D)}G(this,Io)&&(x=G(this,Io),y=G(this,bu),_=Date.now(),b="error");const C=p.fetchStatus==="fetching",P=b==="pending",T=b==="error",R=P&&C,O=y!==void 0,A={status:b,fetchStatus:p.fetchStatus,isPending:P,isSuccess:b==="success",isError:T,isInitialLoading:R,isLoading:R,data:y,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!P,isLoadingError:T&&!O,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:T&&O,isStale:q_(e,n),refetch:this.refetch,promise:G(this,$i),isEnabled:Fr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const D=A.data!==void 0,j=A.status==="error"&&!D,V=K=>{j?K.reject(A.error):D&&K.resolve(A.data)},W=()=>{const K=Re(this,$i,A.promise=M1());V(K)},Y=G(this,$i);switch(Y.status){case"pending":e.queryHash===r.queryHash&&V(Y);break;case"fulfilled":(j||A.data!==Y.value)&&W();break;case"rejected":(!j||A.error!==Y.reason)&&W();break}}return A}updateResult(){const e=G(this,tr),n=this.createResult(G(this,ut),this.options);if(Re(this,Xa,G(this,ut).state),Re(this,wu,this.options),G(this,Xa).data!==void 0&&Re(this,Su,G(this,ut)),R1(n,e))return;Re(this,tr,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!G(this,Eu).size)return!0;const a=new Set(i??G(this,Eu));return this.options.throwOnError&&a.add("error"),Object.keys(G(this,tr)).some(u=>{const c=u;return G(this,tr)[c]!==e[c]&&a.has(c)})};ot(this,pt,c8).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,pt,j1).call(this)}},yr=new WeakMap,ut=new WeakMap,rf=new WeakMap,tr=new WeakMap,Xa=new WeakMap,wu=new WeakMap,$i=new WeakMap,Io=new WeakMap,sf=new WeakMap,bu=new WeakMap,Su=new WeakMap,Qa=new WeakMap,Ja=new WeakMap,Mo=new WeakMap,Eu=new WeakMap,pt=new WeakSet,Jc=function(e){ot(this,pt,$1).call(this);let n=G(this,ut).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(wr)),n},O1=function(){ot(this,pt,F1).call(this);const e=zo(this.options.staleTime,G(this,ut));if(kd.isServer()||G(this,tr).isStale||!T1(e))return;const r=t8(G(this,tr).dataUpdatedAt,e)+1;Re(this,Qa,Ha.setTimeout(()=>{G(this,tr).isStale||this.updateResult()},r))},D1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(G(this,ut)):this.options.refetchInterval)??!1},L1=function(e){ot(this,pt,V1).call(this),Re(this,Mo,e),!(kd.isServer()||Fr(this.options.enabled,G(this,ut))===!1||!T1(G(this,Mo))||G(this,Mo)===0)&&Re(this,Ja,Ha.setInterval(()=>{(this.options.refetchIntervalInBackground||W_.isFocused())&&ot(this,pt,Jc).call(this)},G(this,Mo)))},j1=function(){ot(this,pt,O1).call(this),ot(this,pt,L1).call(this,ot(this,pt,D1).call(this))},F1=function(){G(this,Qa)!==void 0&&(Ha.clearTimeout(G(this,Qa)),Re(this,Qa,void 0))},V1=function(){G(this,Ja)!==void 0&&(Ha.clearInterval(G(this,Ja)),Re(this,Ja,void 0))},$1=function(){const e=G(this,yr).getQueryCache().build(G(this,yr),this.options);if(e===G(this,ut))return;const n=G(this,ut);Re(this,ut,e),Re(this,rf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},c8=function(e){Ln.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(G(this,tr))}),G(this,yr).getQueryCache().notify({query:G(this,ut),type:"observerResultsUpdated"})})},YC);function mN(t,e){return Fr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Fr(e.retryOnMount,t)===!1)}function kS(t,e){return mN(t,e)||t.state.data!==void 0&&H1(t,e,e.refetchOnMount)}function H1(t,e,n){if(Fr(e.enabled,t)!==!1&&zo(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&q_(t,e)}return!1}function CS(t,e,n,r){return(t!==e||Fr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&q_(t,n)}function q_(t,e){return Fr(e.enabled,t)!==!1&&t.isStaleByTime(zo(e.staleTime,t))}function gN(t,e){return!R1(t.getCurrentResult(),e)}var of,Zs,Kn,el,Ys,ko,XC,vN=(XC=class extends a8{constructor(e){super();Ue(this,Ys);Ue(this,of);Ue(this,Zs);Ue(this,Kn);Ue(this,el);Re(this,of,e.client),this.mutationId=e.mutationId,Re(this,Kn,e.mutationCache),Re(this,Zs,[]),this.state=e.state||yN(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){G(this,Zs).includes(e)||(G(this,Zs).push(e),this.clearGcTimeout(),G(this,Kn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Re(this,Zs,G(this,Zs).filter(n=>n!==e)),this.scheduleGc(),G(this,Kn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){G(this,Zs).length||(this.state.status==="pending"?this.scheduleGc():G(this,Kn).remove(this))}continue(){var e;return((e=G(this,el))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,u,c,f,h,p,v,y,x,_,b,E,C,P,T,R,O,M;const n=()=>{ot(this,Ys,ko).call(this,{type:"continue"})},r={client:G(this,of),meta:this.options.meta,mutationKey:this.options.mutationKey};Re(this,el,o8({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,N)=>{ot(this,Ys,ko).call(this,{type:"failed",failureCount:A,error:N})},onPause:()=>{ot(this,Ys,ko).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>G(this,Kn).canRun(this)}));const s=this.state.status==="pending",i=!G(this,el).canStart();try{if(s)n();else{ot(this,Ys,ko).call(this,{type:"pending",variables:e,isPaused:i}),G(this,Kn).config.onMutate&&await G(this,Kn).config.onMutate(e,this,r);const N=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,e,r));N!==this.state.context&&ot(this,Ys,ko).call(this,{type:"pending",context:N,variables:e,isPaused:i})}const A=await G(this,el).start();return await((f=(c=G(this,Kn).config).onSuccess)==null?void 0:f.call(c,A,e,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,A,e,this.state.context,r)),await((y=(v=G(this,Kn).config).onSettled)==null?void 0:y.call(v,A,null,this.state.variables,this.state.context,this,r)),await((_=(x=this.options).onSettled)==null?void 0:_.call(x,A,null,e,this.state.context,r)),ot(this,Ys,ko).call(this,{type:"success",data:A}),A}catch(A){try{await((E=(b=G(this,Kn).config).onError)==null?void 0:E.call(b,A,e,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((P=(C=this.options).onError)==null?void 0:P.call(C,A,e,this.state.context,r))}catch(N){Promise.reject(N)}try{await((R=(T=G(this,Kn).config).onSettled)==null?void 0:R.call(T,void 0,A,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((M=(O=this.options).onSettled)==null?void 0:M.call(O,void 0,A,e,this.state.context,r))}catch(N){Promise.reject(N)}throw ot(this,Ys,ko).call(this,{type:"error",error:A}),A}finally{G(this,Kn).runNext(this)}}},of=new WeakMap,Zs=new WeakMap,Kn=new WeakMap,el=new WeakMap,Ys=new WeakSet,ko=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),Ln.batch(()=>{G(this,Zs).forEach(r=>{r.onMutationUpdate(e)}),G(this,Kn).notify({mutation:this,type:"updated",action:e})})},XC);function yN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Hi,Cs,af,QC,_N=(QC=class extends lf{constructor(e={}){super();Ue(this,Hi);Ue(this,Cs);Ue(this,af);this.config=e,Re(this,Hi,new Set),Re(this,Cs,new Map),Re(this,af,0)}build(e,n,r){const s=new vN({client:e,mutationCache:this,mutationId:++Eh(this,af)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){G(this,Hi).add(e);const n=kh(e);if(typeof n=="string"){const r=G(this,Cs).get(n);r?r.push(e):G(this,Cs).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(G(this,Hi).delete(e)){const n=kh(e);if(typeof n=="string"){const r=G(this,Cs).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&G(this,Cs).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=kh(e);if(typeof n=="string"){const r=G(this,Cs).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=kh(e);if(typeof n=="string"){const s=(r=G(this,Cs).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ln.batch(()=>{G(this,Hi).forEach(e=>{this.notify({type:"removed",mutation:e})}),G(this,Hi).clear(),G(this,Cs).clear()})}getAll(){return Array.from(G(this,Hi))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>_S(n,r))}findAll(e={}){return this.getAll().filter(n=>_S(e,n))}notify(e){Ln.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Ln.batch(()=>Promise.all(e.map(n=>n.continue().catch(wr))))}},Hi=new WeakMap,Cs=new WeakMap,af=new WeakMap,QC);function kh(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Xs,JC,xN=(JC=class extends lf{constructor(e={}){super();Ue(this,Xs);this.config=e,Re(this,Xs,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??G_(s,n);let a=this.get(i);return a||(a=new hN({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){G(this,Xs).has(e.queryHash)||(G(this,Xs).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=G(this,Xs).get(e.queryHash);n&&(e.destroy(),n===e&&G(this,Xs).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ln.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return G(this,Xs).get(e)}getAll(){return[...G(this,Xs).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>yS(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>yS(e,r)):n}notify(e){Ln.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Ln.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ln.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Xs=new WeakMap,JC),Jt,No,Oo,ku,Cu,Do,Pu,Tu,e8,wN=(e8=class{constructor(t={}){Ue(this,Jt);Ue(this,No);Ue(this,Oo);Ue(this,ku);Ue(this,Cu);Ue(this,Do);Ue(this,Pu);Ue(this,Tu);Re(this,Jt,t.queryCache||new xN),Re(this,No,t.mutationCache||new _N),Re(this,Oo,t.defaultOptions||{}),Re(this,ku,new Map),Re(this,Cu,new Map),Re(this,Do,0)}mount(){Eh(this,Do)._++,G(this,Do)===1&&(Re(this,Pu,W_.subscribe(async t=>{t&&(await this.resumePausedMutations(),G(this,Jt).onFocus())})),Re(this,Tu,Dp.subscribe(async t=>{t&&(await this.resumePausedMutations(),G(this,Jt).onOnline())})))}unmount(){var t,e;Eh(this,Do)._--,G(this,Do)===0&&((t=G(this,Pu))==null||t.call(this),Re(this,Pu,void 0),(e=G(this,Tu))==null||e.call(this),Re(this,Tu,void 0))}isFetching(t){return G(this,Jt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return G(this,No).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=G(this,Jt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=G(this,Jt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(zo(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return G(this,Jt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=G(this,Jt).get(r.queryHash),i=s==null?void 0:s.state.data,a=tN(e,i);if(a!==void 0)return G(this,Jt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Ln.batch(()=>G(this,Jt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=G(this,Jt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=G(this,Jt);Ln.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=G(this,Jt);return Ln.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Ln.batch(()=>G(this,Jt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(wr).catch(wr)}invalidateQueries(t,e={}){return Ln.batch(()=>(G(this,Jt).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=Ln.batch(()=>G(this,Jt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(wr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(wr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=G(this,Jt).build(this,e);return n.isStaleByTime(zo(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(wr).catch(wr)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(wr).catch(wr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Dp.isOnline()?G(this,No).resumePausedMutations():Promise.resolve()}getQueryCache(){return G(this,Jt)}getMutationCache(){return G(this,No)}getDefaultOptions(){return G(this,Oo)}setDefaultOptions(t){Re(this,Oo,t)}setQueryDefaults(t,e){G(this,ku).set(Sd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...G(this,ku).values()],n={};return e.forEach(r=>{Ed(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){G(this,Cu).set(Sd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...G(this,Cu).values()],n={};return e.forEach(r=>{Ed(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...G(this,Oo).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=G_(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===K_&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...G(this,Oo).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){G(this,Jt).clear(),G(this,No).clear()}},Jt=new WeakMap,No=new WeakMap,Oo=new WeakMap,ku=new WeakMap,Cu=new WeakMap,Do=new WeakMap,Pu=new WeakMap,Tu=new WeakMap,e8),d8=g.createContext(void 0),f8=t=>{const e=g.useContext(d8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},bN=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(d8.Provider,{value:t,children:e})),h8=g.createContext(!1),SN=()=>g.useContext(h8);h8.Provider;function EN(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var kN=g.createContext(EN()),CN=()=>g.useContext(kN),PN=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?s8(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},TN=t=>{g.useEffect(()=>{t.clearReset()},[t])},RN=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||s8(n,[t.error,r])),AN=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))}},IN=(t,e)=>t.isLoading&&t.isFetching&&!e,MN=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,PS=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function NN(t,e,n){var y,x,_,b;const r=SN(),s=CN(),i=f8(),a=i.defaultQueryOptions(t);(x=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||x.call(y,a);const u=i.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,AN(a),PN(a,s,u),TN(s);const f=!i.getQueryCache().get(a.queryHash),[h]=g.useState(()=>new e(i,a)),p=h.getOptimisticResult(a),v=!r&&c;if(g.useSyncExternalStore(g.useCallback(E=>{const C=v?h.subscribe(Ln.batchCalls(E)):wr;return h.updateResult(),C},[h,v]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),g.useEffect(()=>{h.setOptions(a)},[a,h]),MN(a,p))throw PS(a,h,s);if(RN({result:p,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw p.error;if((b=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||b.call(_,a,p),a.experimental_prefetchInRender&&!kd.isServer()&&IN(p,r)){const E=f?PS(a,h,s):u==null?void 0:u.promise;E==null||E.catch(wr).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?p:h.trackResult(p)}function z1(t,e){return NN(t,pN)}var re=typeof window<"u"?window:void 0,_n=typeof globalThis<"u"?globalThis:re;typeof self>"u"&&(_n.self=_n),typeof File>"u"&&(_n.File=function(){});var rr=_n==null?void 0:_n.navigator,Se=_n==null?void 0:_n.document,on=_n==null?void 0:_n.location,Z_=_n==null?void 0:_n.fetch,U1=_n!=null&&_n.XMLHttpRequest&&"withCredentials"in new _n.XMLHttpRequest?_n.XMLHttpRequest:void 0,TS=_n==null?void 0:_n.AbortController,ON=_n==null?void 0:_n.CompressionStream,_r=rr==null?void 0:rr.userAgent,$e=re??{};function p8(){return!(!re||re.navigator.onLine===!1)}var RS="1.402.3",$t={DEBUG:!1,LIB_VERSION:RS,LIB_NAME:"web",JS_SDK_VERSION:RS};function AS(t,e,n,r,s,i,a){try{var u=t[i](a),c=u.value}catch(f){return void n(f)}u.done?e(c):Promise.resolve(c).then(r,s)}function tn(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(c){AS(i,r,s,a,u,"next",c)}function u(c){AS(i,r,s,a,u,"throw",c)}a(void 0)}))}}function fe(){return fe=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},fe.apply(null,arguments)}function m8(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 IS=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function MS(t){return typeof t=="string"||t}function NS(t){return typeof t=="string"?t:void 0}var Lc,Li=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),OS=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),DN=["$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"],LN=["token"],g8="NativeGzipValidationError",B1=t=>t.length>=2&&t[0]===31&&t[1]===139,DS=(t,e)=>t===OS.GZipJS||e===OS.GZipJS||e==="gzip",LS=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Ch=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=g8,e},jN=(function(){var t=tn((function*(e,n){18>e.size&&Ch("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());B1(r)&&r[2]===8||Ch("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var u=(()=>{if(Lc)return Lc;Lc=[];for(var h=0;256>h;h++){for(var p=h,v=0;8>v;v++)p=1&p?3988292384^p>>>1:p>>>1;Lc[h]=p>>>0}return Lc})(),c=4294967295,f=0;a.length>f;f++)c=u[255&(c^a[f])]^c>>>8;return(4294967295^c)>>>0})(n)&&Ch("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Ch("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function W1(){return W1=tn((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new CompressionStream("gzip"),i=s.writable.getWriter(),a=i.write(r).then((()=>i.close())).catch((function(){var f=tn((function*(h){try{yield i.abort(h)}catch{}throw h}));return function(h){return f.apply(this,arguments)}})()),u=new Response(s.readable).blob(),c=(yield Promise.all([u,a]))[0];return yield jN(c,r),c}catch(f){if(n!=null&&n.rethrow)throw f;return e&&console.error("Failed to gzip compress data",f),null}})),W1.apply(this,arguments)}var FN=["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"],jS=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return FN.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Be(t,e){return t.indexOf(e)!==-1}var Fm=function(t){return t.trim()},G1=function(t){return t.replace(/^\$/,"")};function v8(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 y8=Object.prototype,_8=y8.hasOwnProperty,Vm=y8.toString,et=Array.isArray||function(t){return Vm.call(t)==="[object Array]"},Ps=t=>typeof t=="function",Ot=t=>t===Object(t)&&!et(t),Lo=t=>{if(Ot(t)){for(var e in t)if(_8.call(t,e))return!1;return!0}return!1},_e=t=>t===void 0,_t=t=>Vm.call(t)=="[object String]",K1=t=>_t(t)&&t.trim().length===0,or=t=>t===null,Xe=t=>_e(t)||or(t),Fn=t=>Vm.call(t)=="[object Number]"&&t==t,Ni=t=>Fn(t)&&t>0,ii=t=>Vm.call(t)==="[object Boolean]",VN=t=>t instanceof FormData,$N=t=>Be(DN,t),HN=t=>Be(LN,t);function x8(t){return t===null||typeof t!="object"}function Lp(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Y_(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var zN=[!0,"true",1,"1","yes"],iv=t=>Be(zN,t),UN=[!1,"false",0,"0","no"];function ni(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Fn(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),ni(s||n,e,n,r))}class BN{constructor(e){this.tt={},this.et=e.et,this.rt=ni(e.bucketSize,0,100,e.it),this.nt=ni(e.refillRate,0,this.rt,e.it),this.st=ni(e.refillInterval,0,864e5,e.it)}ot(e,n){var r=Math.floor((n-e.lastAccess)/this.st);r>0&&(e.tokens=Math.min(e.tokens+r*this.nt,this.rt),e.lastAccess=e.lastAccess+r*this.st)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.tt[s];return i?this.ot(i,r):this.tt[s]=i={tokens:this.rt,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.et)==null||n.call(this,e)),i.tokens===0)}stop(){this.tt={}}}var Br="Mobile",jp="iOS",Wi="Android",Ru="Tablet",w8=Wi+" "+Ru,b8="iPad",S8="Apple",E8=S8+" Watch",ld="Safari",Au="BlackBerry",k8="Samsung",C8=k8+"Browser",P8=k8+" Internet",tl="Chrome",WN=tl+" OS",T8=tl+" "+jp,X_="Internet Explorer",R8=X_+" "+Br,Q_="Opera",GN=Q_+" Mini",J_="Edge",A8="Microsoft "+J_,au="Firefox",I8=au+" "+jp,Cd="Nintendo",Pd="PlayStation",lu="Xbox",M8=Wi+" "+Br,N8=Br+" "+ld,ed="Windows",q1=ed+" Phone",FS="Nokia",Z1="Ouya",O8="Generic",KN=O8+" "+Br.toLowerCase(),D8=O8+" "+Ru.toLowerCase(),Y1="Konqueror",L8="Oculus Browser",Fp="Vivaldi",j8="Yandex",Vp="Whale",X1="DuckDuckGo",F8="Pale Moon",$p="Waterfox",ud="Brave",V8="Google Search App",Vt="(\\d+(\\.\\d+)?)",ov=new RegExp("Version/"+Vt),qN=new RegExp(lu,"i"),ZN=new RegExp(Pd+" \\w+","i"),YN=new RegExp(Cd+" \\w+","i"),e2=new RegExp(Au+"|PlayBook|BB10","i"),XN={"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"},$8=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?ud:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Be(t,"GSA/")?V8:Be(t," OPR/")&&Be(t,"Mini")?GN:Be(t," OPR/")?Q_:e2.test(t)?Au:Be(t,"IE"+Br)||Be(t,"WPDesktop")?R8:Be(t,"OculusBrowser")?L8:Be(t,C8)?P8:Be(t,J_)||Be(t,"Edg/")?A8:Be(t,Fp+"/")?Fp:Be(t,"YaBrowser/")?j8:Be(t,Vp+"/")?Vp:Be(t,X1+"/")||Be(t,"Ddg/")?X1:Be(t,"FBIOS")?"Facebook "+Br:Be(t,"UCWEB")||Be(t,"UCBrowser")?"UC Browser":Be(t,"CriOS")?T8:Be(t,"CrMo")||Be(t,tl)?tl:Be(t,Wi)&&Be(t,ld)?M8:Be(t,"FxiOS")?I8:Be(t.toLowerCase(),Y1.toLowerCase())?Y1:Be(t,ud+"/")?ud:((i,a)=>a&&Be(a,S8)||(function(u){return Be(u,ld)&&!Be(u,tl)&&!Be(u,Wi)})(i))(t,e)?Be(t,Br)?N8:ld:Be(t,"PaleMoon/")?F8:Be(t,$p+"/")?$p:Be(t,au)?au:Be(t,"MSIE")||Be(t,"Trident/")?X_:Be(t,"Gecko")?au:"")},QN={[R8]:[new RegExp("rv:"+Vt)],[A8]:[new RegExp(J_+"?\\/"+Vt)],[tl]:[new RegExp("("+tl+"|CrMo)\\/"+Vt)],[T8]:[new RegExp("CriOS\\/"+Vt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Vt)],[ld]:[ov],[N8]:[ov],[Q_]:[new RegExp("(Opera|OPR)\\/"+Vt)],[au]:[new RegExp(au+"\\/"+Vt)],[I8]:[new RegExp("FxiOS\\/"+Vt)],[Y1]:[new RegExp("Konqueror[:/]?"+Vt,"i")],[Au]:[new RegExp(Au+" "+Vt),ov],[M8]:[new RegExp("android\\s"+Vt,"i")],[P8]:[new RegExp(C8+"\\/"+Vt)],[L8]:[new RegExp("OculusBrowser\\/"+Vt)],[Fp]:[new RegExp(Fp+"\\/"+Vt)],[j8]:[new RegExp("YaBrowser\\/"+Vt)],[Vp]:[new RegExp(Vp+"\\/"+Vt)],[ud]:[new RegExp(ud+"\\/"+Vt)],[X1]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Vt)],[F8]:[new RegExp("PaleMoon\\/"+Vt)],[$p]:[new RegExp($p+"\\/"+Vt)],[V8]:[new RegExp("GSA\\/"+Vt)],[X_]:[new RegExp("(rv:|MSIE )"+Vt)],Mozilla:[new RegExp("rv:"+Vt)]},JN=function(t,e,n,r){var s=$8(t,e,n,r),i=QN[s];if(_e(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},VS=[[new RegExp(lu+"; "+lu+" (.*?)[);]","i"),t=>[lu,t&&t[1]||""]],[new RegExp(Cd,"i"),[Cd,""]],[new RegExp(Pd,"i"),[Pd,""]],[e2,[Au,""]],[new RegExp(ed,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[q1,""];if(new RegExp(Br).test(e)&&!/IEMobile\b/.test(e))return[ed+" "+Br,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=XN[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[ed,r]}return[ed,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[jp,[t[3],t[4],t[5]||"0"].join(".")]:[jp,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=_e(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Wi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Wi+")","i"),t=>t&&t[2]?[Wi,[t[2],t[3],t[4]||"0"].join(".")]:[Wi,""]],[/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/,[WN,""]],[/Linux|debian/i,["Linux",""]]],$S=function(t){return YN.test(t)?Cd:ZN.test(t)?Pd:qN.test(t)?lu:new RegExp(Z1,"i").test(t)?Z1:new RegExp("("+q1+"|WPDesktop)","i").test(t)?q1:/iPad/.test(t)?b8:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?E8:e2.test(t)?Au:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(FS,"i").test(t)?FS:/(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(Br).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)?Wi:w8:new RegExp("(pda|"+Br+")","i").test(t)?KN:new RegExp(Ru,"i").test(t)&&!new RegExp(Ru+" pc","i").test(t)?D8:""},eO=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function HS(t,e){return typeof(n=t)=="string"&&eO.test(n)?t:e();var n}function Wo(t){return t&&t.split("#")[0]}function ip(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}var tO=t=>t instanceof Error,H8={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}},nO=H8.info;function z8(t){if(ii(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(et(t))return{arrayValue:{values:t.map((e=>z8(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function Hp(t){var e=[];for(var n in t){var r=t[n];or(r)||_e(r)||e.push({key:n,value:z8(r)})}return e}function rO(t,e){var n=H8[t.level||"info"]||nO,r=n.text,s=n.number,i=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Xe(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Xe(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var u=fe({},a,t.attributes||{}),c={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:Hp(u)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),_e(t.trace_flags)||(c.flags=t.trace_flags),c}function U8(t,e,n){return fe({},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 B8(t,e,n,r){return{resourceLogs:[{resource:{attributes:Hp(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let sO=class{constructor(t,e,n,r,s,i,a){var u;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.Se=e,this.it=n,this.ut=r,this.ht=s,this.dt=i,this.ct=a,this.vt=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max((u=e.maxQueueSize)!==null&&u!==void 0?u:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.It=e.rateCapWindowMs,this.Tt=e.maxLogsPerInterval}reset(){this.Mt(),this.vt=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Se.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.Et()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.Rt(t);if(e!==null)if(e.body){if(this.Pt()){var n={record:rO(e,this.ut())};this.ht((()=>this.Ot(n)))}}else this.it.info("Log was rejected in beforeSend function")}}Rt(t){var e=this.Se.beforeSend;if(!e)return t;var n=et(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.it.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.it.error("Error in beforeSend function for log:",a),null}return r}Pt(){if(this.Tt===void 0)return!0;var t=Date.now(),e=t-this.bt;return this.It>e&&e>=0||(this.bt=t,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.it.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.It+"ms"),this.wt=!0),!1)}flush(){var t=this;return tn((function*(){if(!t._instance.isDisabled)return t.vt||(t.vt=t.Ft().finally((()=>{t.vt=null}))),t.vt}))()}Ft(){var t=this;return tn((function*(){var e;t.Mt();var n=(e=t._instance.getPersistedProperty(Li.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.ft=0;var u=Math.min(n.length,t.Ct),c=n.slice(0,u),f=B8(c.map((p=>p.record)),t.Lt(),(i=t.ct)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.At(f);if(h.kind==="too-large"&&c.length>1)t.Ct=Math.max(1,Math.floor(c.length/2)),t.it.warn("Received 413 when sending logs batch of size "+c.length+", reducing batch size to "+t.Ct);else if(h.kind==="retry-later"||(h.kind==="too-large"?t.it.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Se.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Se.maxBatchRecordsPerPost,t.Ct+1)),yield t.$t(c.length),n=(a=t._instance.getPersistedProperty(Li.LogsQueue))!==null&&a!==void 0?a:[],s+=c.length,h.kind==="fatal"))throw h.error}}))()}$t(t){var e=this;return tn((function*(){var n,r=Math.max(0,t-e.ft),s=(n=e._instance.getPersistedProperty(Li.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Li.LogsQueue,s.slice(r)),yield e.dt()}))()}Lt(){return U8(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Li.LogsQueue))!==null&&e!==void 0?e:[];this.kt>n.length||(n.shift(),this.ft++,this.it.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Li.LogsQueue,n),this.xt>n.length?this.Nt():this.Et()}}Nt(t){t===void 0&&(t=this.St),this.Dt||(this.Dt=ip((()=>{this.Dt=void 0,this.Et()}),t))}qt(){var t=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,t)}jt(){var t=this._instance.getPersistedProperty(Li.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return tn((function*(){e.Mt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((r=>ip(r,t)))]):yield n}))()}flushWithTimeout(t){var e=this;return tn((function*(){var n=!1,r=e.flush(),s=new Promise((i=>ip((()=>{n=!0,i()}),t)));try{yield Promise.race([r,s])}finally{n&&r.catch((()=>{}))}}))()}Et(){this.flush().then((()=>{this.yt=0}),(t=>{this.yt++,this.it.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.jt()&&this.Nt(this.qt())}))}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}};var av=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function zS(t){return String(t)+"000000"}function US(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 iO=class{constructor(t,e,n){this._instance=t,this.Se=e,this.it=n,this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Vt=0}count(t,e,n){e===void 0&&(e=1),this.Wt({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.Wt({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.Wt({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.vt,n=(function(){var s=tn((function*(){e&&(yield e.catch((()=>{}))),yield t.Zt()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.vt===r&&(this.vt=null)}));return this.vt=r,r}drainWindow(){if(this.Ht.size===0)return null;var t=this.Ht;return this.Ht=new Map,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Gt(t)}reset(){this.Vt++,this.Mt(),this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set}Wt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Rt(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.it.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?fe({},e.attributes):void 0,r=US(e.type,e.name,e.unit,n)}catch(a){return void this.it.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var s=this.Ht.get(r);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Ht.set(r,s)}var i=this.Ut.get(e.name);i===void 0?this.Ut.set(e.name,e.type):i===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.it.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.Jt(s,e.value),this.Nt()}else this.it.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.it.warn("Dropping metric with empty name")}}Qt(){return this.Se.maxSeriesPerFlush>this.Ht.size||(this.Bt||(this.Bt=!0,this.it.warn("Metric series cap reached ("+this.Se.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(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(av.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,av)]+=1}}Rt(t){var e=this.Se.beforeSend;if(!e)return t;var n=et(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.it.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.it.error("Error in beforeSend function for metric:",a),null}return r}Nt(){this.Dt||(this.Dt=ip((()=>{this.Dt=void 0,this.flush().catch((t=>{this.it.error("Metrics flush failed:",t)}))}),this.Se.flushIntervalMs))}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}Zt(){var t=this;return tn((function*(){if(t.Ht.size!==0){var e=t.Ht;t.Ht=new Map,t.Bt=!1,t.Ut=new Map,t.zt=new Set;var n=t.Vt,r=yield t._instance.Kt(t.Gt(e));if(n===t.Vt)switch(r.kind){case"ok":return;case"retry-later":return t.Yt(e),void t.Nt();case"too-large":return void t.it.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.it.error("Failed to send metrics batch:",r.error)}}}))()}Gt(t){return(function(s,i,a,u){return{resourceMetrics:[{resource:{attributes:Hp(i)},scopeMetrics:[{scope:{name:a,version:u},metrics:s}]}]}})(this.Xt(t),(e=this.Se,n=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),fe({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":n,"telemetry.sdk.version":r})),this._instance.getLibraryId(),this._instance.getLibraryVersion());var e,n,r}Xt(t){var e=zS(Date.now()),n=new Map;for(var r of t.values()){var s,i=US(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=fe({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=Hp((s=r.attributes)!==null&&s!==void 0?s:{}),c=zS(r.windowStartMs);if(r.type==="count"){var f,h={attributes:u,startTimeUnixNano:c,timeUnixNano:e,asDouble:(f=r.total)!==null&&f!==void 0?f:0};a.sum.dataPoints.push(h)}else if(r.type==="gauge"){var p,v={attributes:u,timeUnixNano:e,asDouble:(p=r.last)!==null&&p!==void 0?p:0};a.gauge.dataPoints.push(v)}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:av})}return Array.from(n.values())}Yt(t){var e,n;for(var r of t){var s=r[0],i=r[1],a=this.Ht.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.Qt()&&this.Ht.set(s,i)}}};var Ph,BS,lv;function oO(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return lv&&n.length===BS||(BS=n.length,lv=n.reduce(((r,s)=>{Ph||(Ph={});var i=Ph[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],f=c==null?void 0:c.filename,h=e[s];if(f&&h){r[f]=h,Ph[s]=[f,h];break}}return r}),{})),lv}}class aO{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 tn((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&et(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),fe({},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 tn((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,fe({},n,{handled:!0}))),u}buildParsingContext(e){var n;return{chunkIdMap:oO(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 fe({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Iu="?";function Q1(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?Iu:n,in_app:!0};return _e(r)||(i.lineno=r),_e(s)||(i.colno=s),i}var W8=(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]:Iu,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},lO=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,uO=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,cO=/\((\S*)(?::(\d+))(?::(\d+))\)/,dO=(t,e)=>{var n=lO.exec(t);if(n)return Q1(e,n[1],Iu,+n[2],+n[3]);var r=uO.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=cO.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=W8(r[1]||Iu,r[2]);return Q1(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},fO=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,hO=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,pO=(t,e)=>{var n=fO.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=hO.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]||Iu,a=W8(i,s);return Q1(e,s=a[1],i=a[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},WS=/\(error: (.*)\)/;class mO{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=_t(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 Lp(e,"DOMException")}isDOMError(e){return Lp(e,"DOMError")}}class gO{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class vO{constructor(){}match(e){return Lp(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r;return n.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var yO=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class _O{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(yO);return s&&(n=s[1],r=s[2]),[n,r]}}var xO=["fatal","error","warning","log","info","debug"];function G8(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 wO{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s=this.getErrorPropertyFromObject(e);return s?n.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Y_(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+G8(e)}isSeverityLevel(e){return _t(e)&&!K1(e)&&xO.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(tO(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class bO{match(e){return Y_(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+G8(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class SO{match(e){return x8(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 EO{match(e){return Lp(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Y_(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 x8(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 zp="$message",Up="$timestamp",kO=new Set([zp,Up]),uv={enabled:!0,max_bytes:32768};function Bp(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:uv.enabled,max_bytes:PO(t.max_bytes,uv.max_bytes)}:fe({},uv)}class CO{constructor(e){this.Pe=[],this.Oe=0,this.Se=Bp(e)}setConfig(e){this.Se=Bp(e),this.Fe()}add(e){var n=(function(s){var i;try{i=v8(s)}catch{return}try{var a=JSON.parse(i);if(!Ot(a))return;var u=a,c=u[zp],f=u[Up];return!_t(c)||c.trim().length===0||!_t(f)&&!Fn(f)?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.Se.max_bytes||(this.Pe.push({step:n.step,bytes:r}),this.Oe+=r,this.Fe())}}getAttachable(){return this.Pe.map((e=>e.step))}clear(){this.Pe=[],this.Oe=0}size(){return this.Pe.length}Fe(){for(;this.Oe>this.Se.max_bytes&&this.Pe.length>0;){var e=this.Pe.shift();e&&(this.Oe-=e.bytes)}}}function PO(t,e){if(!Fn(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var K8=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={k(s){if(re&&($t.DEBUG||$e.POSTHOG_DEBUG||n)&&!_e(re.console)&&re.console){for(var i=("__rrweb_original__"in re.console[s])?re.console[s].__rrweb_original__:re.console[s],a=arguments.length,u=new Array(a>1?a-1:0),c=1;a>c;c++)u[c-1]=arguments[c];i(t,...u)}},debug(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];console.error(t,...i)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>K8(t+" "+s,i)};return r},ye=K8("[PostHog.js]"),Lt=ye.createLogger,TO=Lt("[ExternalScriptsLoader]"),cv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return TO.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Se==null?void 0:Se.querySelectorAll("script");if(r){for(var s,i=function(){if(r[a].src===e){var c=r[a];return c.__posthog_loading_callback_fired?{v:n()}:(c.addEventListener("load",(f=>{c.__posthog_loading_callback_fired=!0,n(void 0,f)})),c.onerror=f=>n(f),{v:void 0})}},a=0;r.length>a;a++)if(s=i())return s.v}var u=()=>{if(!Se)return n("document not found");var c=Se.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=e,c.onload=p=>{c.__posthog_loading_callback_fired=!0,n(void 0,p)},c.onerror=p=>n(p),t.config.prepare_external_dependency_script&&(c=t.config.prepare_external_dependency_script(c)),!c)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")Se.head.appendChild(c);else{var f,h=Se.querySelectorAll("body > script");h.length>0?(f=h[0].parentNode)==null||f.insertBefore(c,h[0]):Se.body.appendChild(c)}};Se!=null&&Se.body?u():Se==null||Se.addEventListener("DOMContentLoaded",u)};$e.__PosthogExtensions__=$e.__PosthogExtensions__||{},$e.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var i=3e5;s=s+"&t="+Math.floor(Date.now()/i)*i}r=t.requestRouter.endpointFor("assets",s)}cv(t,r,n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");cv(t,a,n)}},$e.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);cv(t,r,n)};var q8="$people_distinct_id",Wp="$device_id",dv="$device_model",td="__alias",nd="__timers",J1="$autocapture_disabled_server_side",ey="$heatmaps_enabled_server_side",ty="$exception_capture_enabled_server_side",ny="$error_tracking_suppression_rules",ry="$error_tracking_capture_extension_exceptions",sy="$web_vitals_enabled_server_side",t2="$dead_clicks_enabled_server_side",n2="$product_tours_enabled_server_side",iy="$web_vitals_allowed_metrics",za="$session_recording_remote_config",Z8="$replay_sample_rate",Y8="$replay_override_sampling",X8="$replay_override_linked_flag",Q8="$replay_override_url_trigger",J8="$replay_override_event_trigger",eu="$sesid",r2="$session_is_sampled",Va="$enabled_feature_flags",op="$active_feature_flags",rd="$early_access_features",oy="$feature_flag_details",ap="$feature_flag_payloads",ay="$feature_flag_request_id",Oi="$override_feature_flags",Yl="$override_feature_flag_payloads",Oa="$stored_person_properties",Da="$stored_group_properties",ly="$surveys",Gp="$surveys_loaded_at",uy="$surveys_activated",sd="ph_product_tours",cd="$flag_call_reported",cy="$flag_call_reported_session_id",dy="$feature_flag_errors",Td="$feature_flag_evaluated_at",Ss="$user_state",fy="$client_session_props",hy="$capture_rate_limit",py="$initial_campaign_params",my="$initial_referrer_info",Kp="$initial_person_info",qp="$epp",e6="__POSTHOG_TOOLBAR__",Th="$posthog_cookieless",t6="$sdk_debug_extensions_init_method",n6="$sdk_debug_extensions_init_time_ms",r6="$sdk_debug_recording_script_not_loaded",s2="PostHog loadExternalDependency extension not found.",La="on_reject",zi="always",$l="anonymous",Hl="identified",gy="identified_only",Zp="visibilitychange",Yp="beforeunload",Xl="$pageview",fv="$pageleave",hv="$identify",GS="$groupidentify";function Rh(t,e){et(t)&&t.forEach(e)}function bt(t,e){if(!Xe(t))if(et(t))t.forEach(e);else if(VN(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)_8.call(t,n)&&e(t[n],n)}var Tt=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 lp(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 KS=function(t){try{return t()}catch{return}},RO=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){ye.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ye.critical(s)}}},i2=function(t){var e={};return bt(t,(function(n,r){(_t(n)&&n.length>0||Fn(n))&&(e[r]=n)})),e},AO=["herokuapp.com","vercel.app","netlify.app"];function IO(t){var e=t==null?void 0:t.hostname;if(!_t(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of AO)if(n===r)return!1;return!0}function Ht(t,e,n,r){var s=r??{},i=s.capture,a=s.passive;t==null||t.addEventListener(e,n,{capture:i!==void 0&&i,passive:a===void 0||a})}function s6(t){return t.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Fn(t)&&isFinite(t)&&Math.floor(t)===t});class Xp{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/Math.pow(2,8),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 Xp(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 Xp(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 MO{constructor(){this.S=0,this.C=0,this.I=new NO}generate(){var e=this.generateOrAbort();if(_e(e)){this.S=0;var n=this.generateOrAbort();if(_e(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Xp.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var qS,i6=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};re&&!_e(re.crypto)&&crypto.getRandomValues&&(i6=t=>crypto.getRandomValues(t));class NO{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(i6(this.R),this.O=0),this.R[this.O++]}}var Fi=()=>OO().toString(),OO=()=>(qS||(qS=new MO)).generate(),jc="",DO=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Js={N:()=>!!Se,F(t){ye.error("cookieStore error: "+t)},A(t){if(Se){try{for(var e=t+"=",n=Se.cookie.split(";").filter((i=>i.length)),r=0;n.length>r;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}},D(t){var e;try{e=JSON.parse(Js.A(t))||{}}catch{}return e},q(t,e,n,r,s){if(!Se)return!1;try{var i="",a="",u=(function(h,p){if(p){var v=(function(x,_){if(_===void 0&&(_=Se),jc)return jc;if(!_||["localhost","127.0.0.1"].includes(x))return"";for(var b=x.split("."),E=Math.min(b.length,8),C="dmn_chk_"+Fi();!jc&&E--;){var P=b.slice(E).join("."),T=C+"=1;domain=."+P+";path=/";_.cookie=T+";max-age=3",_.cookie.includes(C)&&(_.cookie=T+";max-age=0",jc=P)}return jc})(h);if(!v){var y=(x=>{var _=x.match(DO);return _?_[0]:""})(h);y!==v&&ye.info("Warning: cookie subdomain discovery mismatch",y,v),v=y}return v?"; domain=."+v:""}return""})(Se.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),i="; expires="+c.toUTCString()}s&&(a="; secure");var f=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+u+a;return f.length>3686.4&&ye.warn("cookieStore warning: large cookie, len="+f.length),Se.cookie=f,!0}catch{return!1}},P(t,e){if(Se!=null&&Se.cookie)try{Js.q(t,"",-1,e)}catch{return}}},pv=null,wt={N(){if(!or(pv))return pv;var t=!0;if(_e(re))t=!1;else try{var e="__mplssupport__";wt.q(e,"xyz"),wt.A(e)!=='"xyz"'&&(t=!1),wt.P(e)}catch{t=!1}return t||ye.error("localStorage unsupported; falling back to cookie store"),pv=t,t},F(t){ye.error("localStorage error: "+t)},A(t){try{return re==null?void 0:re.localStorage.getItem(t)}catch(e){wt.F(e)}return null},D(t){try{return JSON.parse(wt.A(t))||{}}catch{}return null},q(t,e){try{return re==null||re.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){wt.F(n)}return!1},P(t){try{re==null||re.localStorage.removeItem(t)}catch(e){wt.F(e)}}},LO=[Wp,"distinct_id",eu,r2,qp,Kp,Ss],Ah={},jO={N:()=>!0,F(t){ye.error("memoryStorage error: "+t)},A:t=>Ah[t]||null,D:t=>Ah[t]||null,q:(t,e)=>(Ah[t]=e,!0),P(t){delete Ah[t]}},ba=null,Dn={N(){if(!or(ba))return ba;if(ba=!0,_e(re))ba=!1;else try{var t="__support__";Dn.q(t,"xyz"),Dn.A(t)!=='"xyz"'&&(ba=!1),Dn.P(t)}catch{ba=!1}return ba},F(t){ye.error("sessionStorage error: ",t)},A(t){try{return re==null?void 0:re.sessionStorage.getItem(t)}catch(e){Dn.F(e)}return null},D(t){try{return JSON.parse(Dn.A(t))||null}catch{}return null},q(t,e){try{return re==null||re.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Dn.F(n)}return!1},P(t){try{re==null||re.sessionStorage.removeItem(t)}catch(e){Dn.F(e)}}};class FO{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.Ne()?0:this.De}isOptedOut(){return this.Se.cookieless_mode===zi||this.isRejected()||this.consent===-1&&this.Se.cookieless_mode===La}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Se.opt_out_capturing_by_default}optInOut(e){this.qe.q(this.je,e?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.qe.P(this.je,this.Se.cross_subdomain_cookie)}get je(){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 De(){var e=this.qe.A(this.je);return iv(e)?1:Be(UN,e)?0:-1}get qe(){var e=this.Se.opt_out_capturing_persistence_type,n=e==="localStorage"?wt:Js;if(!this.He||this.He!==n){this.He=n;var r=e==="localStorage"?Js:wt;r.A(this.je)&&(this.He.A(this.je)||this.optInOut(iv(r.A(this.je))),r.P(this.je,this.Se.cross_subdomain_cookie))}return this.He}Ne(){return!!this.Se.respect_dnt&&[rr==null?void 0:rr.doNotTrack,rr==null?void 0:rr.msDoNotTrack,$e.doNotTrack].some((e=>iv(e)))}}function o6(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!Ps(r))return e;try{var s=r(e);return _t(s)&&s?s:e}catch(i){return ye.error("Error in get_current_url, falling back to window.location.href",i),e}}var VO=1,$O=3,HO=11;function ZS(t){return t instanceof Element&&(t.id===e6||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Go(t){return!!t&&t.nodeType===VO}function Hr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function a6(t){return!!t&&t.nodeType===$O}function l6(t){return!!t&&t.nodeType===HO&&Go(t.host)}var u6=1e3;function o2(t){return t?Fm(t).split(/\s+/):[]}function YS(t,e){var n=(function(r){var s,i=re==null||(s=re.location)==null?void 0:s.href;return _e(i)?void 0:o6(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function Qp(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 o2(e)}function c6(t){return Xe(t)?null:Fm(t).split(/(\s+)/).filter((e=>dd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Rd(t){var e="";return yy(t)&&!p6(t)&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;a6(n)&&n.textContent&&(e+=(r=c6(n.textContent))!==null&&r!==void 0?r:"")})),Fm(e)}function mv(t){return _e(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var a2=["a","button","form","input","select","textarea","label"];function vy(t,e){if(_e(e))return!0;var n,r=function(i){if(e.some((a=>(function(u,c){var f=u.matches||u.matchesSelector||u.msMatchesSelector||u.mozMatchesSelector||u.webkitMatchesSelector||u.oMatchesSelector;try{return!!f&&f.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 d6(t){var e=t.parentNode;return!(!e||!Go(e))&&e}var zO=[".ph-no-autocapture","[data-ph-no-autocapture]"],f6=["next","previous","prev",">","<"],UO=[...f6,"+","-","−","–"],XS=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,QS=[".ph-no-rageclick",".ph-no-capture"],BO=["","text","search","email","password","url","tel","number"];function JS(t,e){if(!re||l2(t))return!1;var n,r,s,i,a;if(ii(e)?(n=!!e&&QS,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:QS,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||!Go(c))&&(!!Hr(c,"textarea")||(Hr(c,"input")?Be(BO,(c.getAttribute("type")||"").toLowerCase()):(function(f){if(f.isContentEditable)return!0;var h=f.getAttribute==null?void 0:f.getAttribute("contenteditable");return h==="true"||h===""})(c)))})(t))return!1;var u=h6(t,!1).targetElementList;return!(function(c,f){if(c===!1||_e(c))return!1;var h;if(c===!0)h=f6;else{if(!et(c))return!1;if(c.length>10)return ye.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;h=c.map((p=>p.toLowerCase()))}return f.some((p=>{var v=p.safeText,y=p.ariaLabel;return h.some((x=>XS(v,x)||XS(y,x)))}))})(r,u.map((c=>{var f;return{safeText:Rd(c).toLowerCase(),ariaLabel:((f=c.getAttribute("aria-label"))==null?void 0:f.toLowerCase().trim())||""}})))&&!vy(u,n)}var l2=t=>!t||Hr(t,"html")||!Go(t),h6=(t,e)=>{if(!re||l2(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Hr(s,"body");)if(l6(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=d6(s);if(!i)break;if(e||a2.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var a=re.getComputedStyle(i);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function yy(t){for(var e=new Set,n=0,r=t;r.parentNode&&!Hr(r,"body");r=r.parentNode){if(n++>=u6||e.has(r))return!1;e.add(r);var s=Qp(r);if(Be(s,"ph-sensitive")||Be(s,"ph-no-capture"))return!1}if(Be(Qp(t),"ph-include"))return!0;var i=t.type||"";if(_t(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!_t(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 p6(t){return!!(Hr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Hr(t,"select")||Hr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var m6="(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})",WO=new RegExp("^(?:"+m6+")$"),GO=new RegExp(m6),g6="\\d{3}-?\\d{2}-?\\d{4}",KO=new RegExp("^("+g6+")$"),qO=new RegExp("("+g6+")");function dd(t,e){return e===void 0&&(e=!0),!(Xe(t)||_t(t)&&(t=Fm(t),(e?WO:GO).test((t||"").replace(/[- ]/g,""))||(e?KO:qO).test(t)))}function eE(t){var e=Rd(t);return dd(e=(e+" "+v6(t)).trim())?e:""}function v6(t){var e="";return t&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Rd(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+v6(n)).trim())}catch(i){ye.error("[AutoCapture]",i)}})),e}function tE(t){return t.replace(/"|\\"/g,'\\"')}function ZO(t){var e=t.attr__class;return e?et(e)?e:o2(e):void 0}var Ih=Lt("[Dead Clicks]"),YO=()=>!0,XO=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(t2)),r=t.instance.config.capture_dead_clicks;return ii(r)?r:!!Ot(r)||n};class nE{get lazyLoadedDeadClicksAutocapture(){return this.Be}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[t2]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Ue((()=>{this.ze()})):this.stop()}Ue(e){var n,r;(n=$e.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Ih.error("failed to load script",s):e()}))}ze(){var e;if(Se){if(!this.Be&&(e=$e.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Ot(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.Be=$e.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Be.start(Se),Ih.info("starting...")}}else Ih.error("`document` not found. Cannot start.")}stop(){this.Be&&(this.Be.stop(),this.Be=void 0,Ih.info("stopping..."))}}var gv=Lt("[SegmentIntegration]"),y6="posthog-js";function _6(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,f=c===void 0||c;return h=>{var p,v,y,x,_;if(u!=="*"&&!u.includes(h.level)||!t.__loaded)return h;h.tags||(h.tags={});var b=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());h.tags["PostHog Person URL"]=b,t.sessionRecordingStarted()&&(h.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var E,C=((p=h.exception)==null?void 0:p.values)||[],P=C.map((R=>fe({},R,{stacktrace:R.stacktrace?fe({},R.stacktrace,{type:"raw",frames:(R.stacktrace.frames||[]).map((O=>fe({},O,{platform:"web:javascript"})))}):void 0}))),T={$exception_message:((v=C[0])==null?void 0:v.value)||h.message,$exception_type:(y=C[0])==null?void 0:y.type,$exception_level:h.level,$exception_list:P,$sentry_event_id:h.event_id,$sentry_exception:h.exception,$sentry_exception_message:((x=C[0])==null?void 0:x.value)||h.message,$sentry_exception_type:(_=C[0])==null?void 0:_.type,$sentry_tags:h.tags};return r&&s&&(T.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+h.event_id),f&&((E=t.exceptions)==null||E.sendExceptionEvent(T)),h}}class QO{constructor(e,n,r,s,i,a){this.name=y6,this.setupOnce=function(u){u(_6(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}class rE{constructor(e){this.Ve=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(ye.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.We=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Ze()}Ze(){var e;this.Ge=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Ve)}destroy(){var e;(e=this.Ge)==null||e.call(this),this.Ge=void 0}doPageView(e,n){var r,s=this.Qe(e,n);return this.We={pathname:(r=re==null?void 0:re.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.Qe(e,(n=this.We)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.We)==null?void 0:e.pageViewId}}Qe(e,n){var r=this.We;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,f=i.maxContentHeight,h=i.lastContentY,p=i.maxContentY;if(!(_e(a)||_e(u)||_e(c)||_e(f)||_e(h)||_e(p))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),f=Math.ceil(f),h=Math.ceil(h),p=Math.ceil(p);var v=a>1?ni(u/a,0,1,ye):1,y=a>1?ni(c/a,0,1,ye):1,x=f>1?ni(h/f,0,1,ye):1,_=f>1?ni(p/f,0,1,ye):1;s=Tt(s,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:v,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:y,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:x,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var Mh=["flags","surveys"],JO={[q8]:{exposure:"hidden"},[td]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[nd]:{exposure:"hidden"},[J1]:{exposure:"event"},[ey]:{exposure:"hidden"},[ty]:{exposure:"event"},[ny]:{exposure:"hidden"},[ry]:{exposure:"event"},[sy]:{exposure:"event"},[t2]:{exposure:"event"},[n2]:{exposure:"hidden"},[iy]:{exposure:"event"},[za]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[eu]:{exposure:"hidden"},[r2]:{exposure:"event"},[Z8]:{exposure:"event",shouldSkipFromEventProperties:t=>or(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"},[Va]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Ot(t))return{};for(var e={},n=Object.keys(t),r=0;n.length>r;r++)e["$feature/"+n[r]]=t[n[r]];return e}},[op]:{exposure:"event",storageGroup:"flags"},[rd]:{exposure:"hidden"},[oy]:{exposure:"hidden",storageGroup:"flags"},[ap]:{exposure:"event",storageGroup:"flags"},[ay]:{exposure:"event",storageGroup:"flags",volatile:!0},[Oi]:{exposure:"event"},[Yl]:{exposure:"hidden"},[Oa]:{exposure:"hidden"},[Da]:{exposure:"hidden"},[ly]:{exposure:"hidden",storageGroup:"surveys"},[Gp]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[uy]:{exposure:"event"},[sd]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[cd]:{exposure:"hidden"},[cy]:{exposure:"hidden"},[dy]:{exposure:"hidden"},[Td]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ss]:{exposure:"hidden"},[fy]:{exposure:"hidden"},[hy]:{exposure:"hidden"},[py]:{exposure:"hidden"},[my]:{exposure:"hidden"},[Kp]:{exposure:"hidden"},[qp]:{exposure:"hidden"},[Y8]:{exposure:"event"},[X8]:{exposure:"event"},[Q8]:{exposure:"event"},[J8]:{exposure:"event"},[t6]:{exposure:"event"},[n6]:{exposure:"event"},[r6]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},eD=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Sa=t=>{var e=JO[t];if(e)return e;for(var n of eD){var r=n[1];if(t.indexOf(n[0])===0)return r}},Ad=t=>{var e=Se==null?void 0:Se.createElement("a");return _e(e)?null:(e.href=t,e)},Mu=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var i=r[s].split("=");if(i[0]===e){n=i;break}}if(!et(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{ye.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Id=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("&"),f=[],h=0;c.length>h;h++){var p=c[h].split("=");et(p)&&(e.includes(p[0])?f.push(p[0]+"="+n):f.push(c[h]))}var v=u;return a!=null&&(v+="?"+f.join("&")),s!=null&&(v+="#"+s),v},Jp=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},x6=(t,e)=>t>=e&&p8(),w6=(t,e,n,r)=>{if(t===0){if(p8()){var s=e+1;return s===n&&r(),s}return e}return 0},Nh="https?://(.*)",Nu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],tD=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Nu],Md="<masked>",nD=["li_fat_id"];function b6(t,e,n){if(!Se)return{};var r,s=e?[...Nu,...n||[]]:[],i=S6(Id(Se.URL,s,Md),t),a=(r={},bt(nD,(function(u){var c=Js.A(u);r[u]=c||null})),r);return Tt(a,i)}function S6(t,e){var n=tD.concat(e||[]),r={};return bt(n,(function(s){var i=Mu(t,s);r[s]=i||null})),r}function E6(t){var e=(function(i){return i?i.search(Nh+"google.([^/?]*)")===0?"google":i.search(Nh+"bing.com")===0?"bing":i.search(Nh+"yahoo.com")===0?"yahoo":i.search(Nh+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!or(e)){r.$search_engine=e;var s=Se?Mu(Se.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function sE(){return navigator.language||navigator.userLanguage}var em="$direct";function k6(){return(Se==null?void 0:Se.referrer)||em}function C6(t,e,n){n===void 0&&(n=!1);var r=t?[...Nu,...e||[]]:[],s=n?Wo(on==null?void 0:on.href):on==null?void 0:on.href,i=s==null?void 0:s.substring(0,1e3);return{r:k6().substring(0,1e3),u:i?Id(i,r,Md):void 0}}function P6(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?Wo(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==em?em:(n=Ad(r))==null?void 0:n.host};if(i){a.$current_url=i;var u=Ad(i);a.$host=u==null?void 0:u.host,a.$pathname=u==null?void 0:u.pathname;var c=S6(i);Tt(a,c)}if(r){var f=E6(r);Tt(a,f)}return a}function T6(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function rD(){try{return new Date().getTimezoneOffset()}catch{return}}var sD={flags:Td,surveys:Gp},iD=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],zl="main";class vv{constructor(e,n,r){if(r===void 0&&(r=!0),this.Je={},this.Ke=!1,this.Ye=!1,this.Se=e,this.Xe=r,this.props={},this.tr=!1,this.er=(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.qe=this.rr(e),this.Ye=this.ir(e),this.load(),e.debug&&ye.info("Persistence loaded",e.persistence,fe({},this.props)),this.update_config(e,e,n),this.save(),re){var s=()=>this.flush();Ht(re,"beforeunload",s,{capture:!1}),Ht(re,"pagehide",s,{capture:!1})}}nr(){var e,n=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return Fn(n)&&n>0?n:0}isDisabled(){return!!this.sr}rr(e){iD.indexOf(e.persistence.toLowerCase())===-1&&(ye.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=[...LO,...a];return fe({},wt,{D(f){try{var h={};try{h=Js.D(f)||{}}catch{}var p,v=JSON.parse(wt.A(f)||"{}");if(u){var y={};for(var x in h){var _=h[x];or(_)||_===""||(y[x]=_)}p=Tt(v,y)}else p=Tt(h,v);return wt.q(f,p),p}catch{}return null},q(f,h,p,v,y,x){var _=wt.q(f,h,void 0,void 0,x);try{var b={};c.forEach((E=>{h[E]&&(b[E]=h[E])})),Object.keys(b).length&&Js.q(f,b,p,v,y,x)}catch(E){wt.F(E)}return _},P(f,h){try{re==null||re.localStorage.removeItem(f),Js.P(f,h)}catch(p){wt.F(p)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&wt.N()?(n=wt,s=!0):i==="localstorage+cookie"&&r.N()?(n=r,s=!0):i==="sessionstorage"&&Dn.N()?n=Dn:i==="memory"?n=jO:i==="cookie"?n=Js:r.N()?(n=r,s=!0):n=Js,this.Ke=s,n}ar(e){return this.er+"__"+e}ir(e){return this.Ke&&!!e.split_storage}lr(e){var n=e??this.Se.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[Td];return!r||typeof r!="number"||Date.now()-r>n}properties(){var e={};return bt(this.props,((n,r)=>{var s=Sa(r);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,r===Va?()=>this.lr():()=>!1))return;s.transformToEventProperties&&Tt(e,s.transformToEventProperties(n))}else if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,(()=>!1)))return;e[r]=n}})),e}load(){if(!this.sr){var e=this.qe.D(this.er);e&&(this.props=Tt({},e)),this.Ye&&this.ur()}}ur(){for(var e of Mh){var n=wt.D(this.ar(e));if(n&&!Lo(n)){var r=this.hr(e);r.persisted=!0,this.dr(e)||(r.fingerprint=this.cr(n,e)),this.vr(e,n)||Tt(this.props,n)}}}dr(e){return Object.keys(this.props).some((n=>{var r;return((r=Sa(n))==null?void 0:r.storageGroup)===e}))}vr(e,n){var r=sD[e];if(!r)return!1;var s=n[r],i=this.props[r];return Fn(s)&&Fn(i)&&i>s}refreshKey(e){var n;if(!this.sr){var r=this.Ye?(n=Sa(e))==null?void 0:n.storageGroup:void 0,s=r?wt.D(this.ar(r)):this.qe.D(this.er);if(s&&e in s)this.pr(e,s[e]);else{if(r){var i=this.qe.D(this.er);if(i&&e in i)return void this.pr(e,i[e])}this.gr(e)}}}save(){if(!this.sr){var e=this.nr();e>0?_e(this.mr)&&(this.mr=setTimeout((()=>{this.mr=void 0,this.yr()}),e)):this.yr()}}flush(){_e(this.mr)||(clearTimeout(this.mr),this.mr=void 0,this.yr())}yr(){this.sr||(this.Ye?this.br():this._r(this.qe,this.er,this.props,zl))}br(){var e=this.wr(),n=e.main,r=e.groups;for(var s of(this._r(this.qe,this.er,n,zl),Mh)){var i,a=r[s];(!Lo(a)||(i=this.Je[s])!=null&&i.persisted)&&this._r(wt,this.ar(s),a,s)}}wr(){var e={},n={};for(var r of Mh)n[r]={};return bt(this.props,((s,i)=>{var a,u=(a=Sa(i))==null?void 0:a.storageGroup;u?n[u][i]=s:e[i]=s})),{main:e,groups:n}}cr(e,n){if(n===zl)return JSON.stringify(e)+"|"+this.kr+"|"+this.Sr+"|"+this.Cr;var r={};return bt(e,((s,i)=>{var a;r[i]=(a=Sa(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}_r(e,n,r,s){var i=this.hr(s);if(s===zl||i.dirty||_e(i.fingerprint)){var a;try{if((a=this.cr(r,s))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(n,r,this.kr,this.Sr,this.Cr,this.Se.debug)?(i.dirty=!1,s!==zl&&(i.persisted=!0),_e(a)||(i.fingerprint=a)):this.Se.debug&&ye.warn('failed to persist storage entry "'+n+'"; will retry on next save')}}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(_e(this.mr)||(clearTimeout(this.mr),this.mr=void 0),this.qe.P(this.er,!1),this.qe.P(this.er,!0),!r&&this.Xe)for(var s of Mh)wt.P(this.ar(s));r?delete this.Je[zl]:this.Je={}}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Ot(e)){_e(n)&&(n="None"),this.kr=_e(r)?this.Ir:r;var s=!1;if(bt(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.pr(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(Ot(e)){this.kr=_e(n)?this.Ir:n;var r=!1;if(bt(e,((s,i)=>{e.hasOwnProperty(i)&&this.props[i]!==s&&(this.pr(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.gr(e),this.save())}update_campaign_params(){if(!this.tr){var e=b6(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);Lo(i2(e))||this.register(e),this.tr=!0}}update_search_keyword(){var e;this.register((e=Se==null?void 0:Se.referrer)?E6(e):{})}update_referrer_info(){var e;this.register_once({$referrer:k6(),$referring_domain:Se!=null&&Se.referrer&&((e=Ad(Se.referrer))==null?void 0:e.host)||em},void 0)}set_initial_person_info(){this.props[py]||this.props[my]||this.register_once({[Kp]:C6(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};bt([my,py],(s=>{var i=this.props[s];i&&bt(i,(function(a,u){e["$initial_"+G1(u)]=a}))}));var n=this.props[Kp];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=P6(s,i),u={};return bt(a,(function(c,f){u["$initial_"+G1(f)]=c})),u})(n,this.Se.disable_capture_url_hashes);Tt(e,r)}return e}safe_merge(e){return bt(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){this.Ir=this.kr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==n.persistence||!((c,f)=>{if(c.length!==f.length)return!1;var h=[...c].sort(),p=[...f].sort();return h.every(((v,y)=>v===p[y]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),i=s?this.rr(e):this.qe,a=this.ir(e);if(s||a!==this.Ye){var u=this.props;this.clear(),this.qe=i,this.Ye=a,this.props=u,this.save()}}set_disabled(e){this.sr=e,this.sr?this.remove():this.save()}set_cross_subdomain(e){e!==this.Sr&&(this.Sr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Cr&&(this.Cr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[nd]||{};r[e]=n,this.pr(nd,r),this.save()}remove_event_timer(e){var n=this.props[nd]||{},r=n[e];return _e(r)||(delete n[e],this.pr(nd,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.pr(e,n),this.save()}pr(e,n){var r;this.props[e]=n,(r=Sa(e))!=null&&r.volatile||this.Tr(e)}gr(e){delete this.props[e],this.Tr(e)}Tr(e){var n,r=(n=Sa(e))==null?void 0:n.storageGroup;r&&(this.hr(r).dirty=!0)}hr(e){return this.Je[e]||(this.Je[e]={})}}var Fc={Activation:"events",Cancellation:"cancelEvents"},yv={Popover:"popover",API:"api",Widget:"widget"},Ui={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},_v={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},_y={Popover:"popover",Inline:"inline"},oD={SHOWN:"product tour shown"},iE={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},oE=Lt("[RateLimiter]");class aD{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=>{oE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void oE.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(hy))!==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 f=1>c.tokens;return f||e||(c.tokens=Math.max(0,c.tokens-1)),!f||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=f,(s=this.instance.persistence)==null||s.set_property(hy,c),{isRateLimited:f,remainingTokens:c.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Vc=Lt("[RemoteConfig]");class R6{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=$e._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Mr(e){var n,r;(n=$e.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}Er(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){e(n.json)}})}load(){try{if(this.remoteConfig)return Vc.info("Using preloaded remote config",this.remoteConfig),this.Rr(this.remoteConfig),void this.Pr();if(this._instance.Or())return void Vc.warn("Remote config is disabled. Falling back to local config.");this.Mr((e=>{if(!e)return Vc.info("No config found after loading remote JS config. Falling back to JSON."),void this.Er((n=>{this.Rr(n),this.Pr()}));this.Rr(e),this.Pr()}))}catch(e){Vc.error("Error loading remote config",e)}}stop(){this.Fr&&(clearInterval(this.Fr),this.Fr=void 0)}refresh(){!this._instance.Or()&&Se&&Se.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Pr(){var e;if(!this.Fr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.Fr=setInterval((()=>{this.refresh()}),n))}}Rr(e){var n;e||Vc.error("Failed to fetch remote config from PostHog."),this._instance.Rr(e??{}),(e==null?void 0:e.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var nr={GZipJS:"gzip-js",Base64:"base64"},us=Uint8Array,Sr=Uint16Array,Ou=Uint32Array,u2=new us([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]),c2=new us([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]),aE=new us([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A6=function(t,e){for(var n=new Sr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new Ou(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]},I6=A6(u2,2),xy=I6[1];I6[0][28]=258,xy[258]=28;for(var lE=A6(c2,0)[1],M6=new Sr(32768),Dt=0;32768>Dt;++Dt){var Ul=(43690&Dt)>>>1|(21845&Dt)<<1;M6[Dt]=((65280&(Ul=(61680&(Ul=(52428&Ul)>>>2|(13107&Ul)<<2))>>>4|(3855&Ul)<<4))>>>8|(255&Ul)<<8)>>>1}var fd=function(t,e,n){for(var r=t.length,s=0,i=new Sr(e);r>s;++s)++i[t[s]-1];var a,u=new Sr(e);for(s=0;e>s;++s)u[s]=u[s-1]+i[s-1]<<1;for(a=new Sr(r),s=0;r>s;++s)a[s]=M6[u[t[s]-1]++]>>>15-t[s];return a},cl=new us(288);for(Dt=0;144>Dt;++Dt)cl[Dt]=8;for(Dt=144;256>Dt;++Dt)cl[Dt]=9;for(Dt=256;280>Dt;++Dt)cl[Dt]=7;for(Dt=280;288>Dt;++Dt)cl[Dt]=8;var tm=new us(32);for(Dt=0;32>Dt;++Dt)tm[Dt]=5;var lD=fd(cl,9),uD=fd(tm,5),N6=function(t){return(t/8>>0)+(7&t&&1)},O6=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Sr?Sr:t instanceof Ou?Ou:us)(n-e);return r.set(t.subarray(e,n)),r},ki=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},$c=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},xv=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 us(0),0];if(s==1){var a=new us(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(R,O){return R.f-O.f})),n.push({s:-1,f:25001});var u=n[0],c=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=s-1;)u=n[n[p].f>n[f].f?f++:p++],c=n[f!=h&&n[p].f>n[f].f?f++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var v=i[0].s;for(r=1;s>r;++r)i[r].s>v&&(v=i[r].s);var y=new Sr(v+1),x=wy(n[h-1],y,0);if(x>e){r=0;var _=0,b=x-e,E=1<<b;for(i.sort((function(R,O){return y[O.s]-y[R.s]||R.f-O.f}));s>r;++r){var C=i[r].s;if(e>=y[C])break;_+=E-(1<<x-y[C]),y[C]=e}for(_>>>=b;_>0;){var P=i[r].s;e>y[P]?_-=1<<e-y[P]++-1:++r}for(;r>=0&&_;--r){var T=i[r].s;y[T]==e&&(--y[T],++_)}x=e}return[new us(y),x]},wy=function(t,e,n){return t.s==-1?Math.max(wy(t.l,e,n+1),wy(t.r,e,n+1)):e[t.s]=n},uE=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Sr(++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]},Hc=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},by=function(t,e,n){var r=n.length,s=N6(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)},cE=function(t,e,n,r,s,i,a,u,c,f,h){ki(e,h++,n),++s[256];for(var p=xv(s,15),v=p[0],y=p[1],x=xv(i,15),_=x[0],b=x[1],E=uE(v),C=E[0],P=E[1],T=uE(_),R=T[0],O=T[1],M=new Sr(19),A=0;C.length>A;++A)M[31&C[A]]++;for(A=0;R.length>A;++A)M[31&R[A]]++;for(var N=xv(M,7),D=N[0],j=N[1],V=19;V>4&&!D[aE[V-1]];--V);var W,Y,K,B,X=f+5<<3,$=Hc(s,cl)+Hc(i,tm)+a,te=Hc(s,v)+Hc(i,_)+a+14+3*V+Hc(M,D)+(2*M[16]+3*M[17]+7*M[18]);if($>=X&&te>=X)return by(e,h,t.subarray(c,c+f));if(ki(e,h,1+($>te)),h+=2,$>te){W=fd(v,y),Y=v,K=fd(_,b),B=_;var H=fd(D,j);for(ki(e,h,P-257),ki(e,h+5,O-1),ki(e,h+10,V-4),h+=14,A=0;V>A;++A)ki(e,h+3*A,D[aE[A]]);h+=3*V;for(var L=[C,R],Z=0;2>Z;++Z){var ne=L[Z];for(A=0;ne.length>A;++A)ki(e,h,H[ie=31&ne[A]]),h+=D[ie],ie>15&&(ki(e,h,ne[A]>>>5&127),h+=ne[A]>>>12)}}else W=lD,Y=cl,K=uD,B=tm;for(A=0;u>A;++A)if(r[A]>255){var ie;$c(e,h,W[257+(ie=r[A]>>>18&31)]),h+=Y[ie+257],ie>7&&(ki(e,h,r[A]>>>23&31),h+=u2[ie]);var ae=31&r[A];$c(e,h,K[ae]),h+=B[ae],ae>3&&($c(e,h,r[A]>>>5&8191),h+=c2[ae])}else $c(e,h,W[r[A]]),h+=Y[r[A]];return $c(e,h,W[256]),h+Y[256]},cD=new Ou([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),dD=(function(){for(var t=new Ou(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),wv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function fD(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(v){for(var y=p,x=0;v.length>x;++x)y=dD[255&y^v[x]]^y>>>8;p=y},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,a,u,c,f=(u=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(p,v,y,x,_,b){var E=p.length,C=new us(x+E+5*(1+Math.floor(E/7e3))+_),P=C.subarray(x,C.length-_),T=0;if(!v||8>E)for(var R=0;E>=R;R+=65535){var O=R+65535;E>O?T=by(P,T,p.subarray(R,O)):(P[R]=!0,T=by(P,T,p.subarray(R,E)))}else{for(var M=cD[v-1],A=M>>>13,N=8191&M,D=(1<<y)-1,j=new Sr(32768),V=new Sr(D+1),W=Math.ceil(y/3),Y=2*W,K=function(vt){return(p[vt]^p[vt+1]<<W^p[vt+2]<<Y)&D},B=new Ou(25e3),X=new Sr(288),$=new Sr(32),te=0,H=0,L=(R=0,0),Z=0,ne=0;E>R;++R){var ie=K(R),ae=32767&R,ue=V[ie];if(j[ae]=ue,V[ie]=ae,R>=Z){var ke=E-R;if((te>7e3||L>24576)&&ke>423){T=cE(p,P,0,B,X,$,H,L,ne,R-ne,T),L=te=H=0,ne=R;for(var ee=0;286>ee;++ee)X[ee]=0;for(ee=0;30>ee;++ee)$[ee]=0}var le=2,pe=0,we=N,Ie=ae-ue&32767;if(ke>2&&ie==K(R-Ie))for(var qe=Math.min(A,ke)-1,it=Math.min(32767,R),Ae=Math.min(258,ke);it>=Ie&&--we&&ae!=ue;){if(p[R+le]==p[R+le-Ie]){for(var at=0;Ae>at&&p[R+at]==p[R+at-Ie];++at);if(at>le){if(le=at,pe=Ie,at>qe)break;var At=Math.min(Ie,at-2),mt=0;for(ee=0;At>ee;++ee){var je=R-Ie+ee+32768&32767,Ye=je-j[je]+32768&32767;Ye>mt&&(mt=Ye,ue=je)}}}Ie+=(ae=ue)-(ue=j[ae])+32768&32767}if(pe){B[L++]=268435456|xy[le]<<18|lE[pe];var lt=31&xy[le],Je=31&lE[pe];H+=u2[lt]+c2[Je],++X[257+lt],++$[Je],Z=R+le,++te}else B[L++]=p[R],++X[p[R]]}}T=cE(p,P,!0,B,X,$,H,L,ne,R-ne,T)}return O6(C,0,x+N6(T)+_)})(i=t,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+a.mem,u,c)),h=f.length;return(function(p,v){var y=v.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>v.level?4:v.level==9?2:0,p[9]=3,v.mtime!=0&&wv(p,4,Math.floor(new Date(v.mtime||Date.now())/1e3)),y){p[3]=8;for(var x=0;y.length>=x;++x)p[x+10]=y.charCodeAt(x)}})(f,e),wv(f,h-8,n.d()),wv(f,h-4,r),f}var hD=!!U1||!!Z_,D6="text/plain",up=!1,Sy=(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:"")},d2=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],a=s[1],u=fe({},e),c=(r=a==null?void 0:a.split("&").map((h=>{var p,v=h.split("="),y=v[0],x=n&&(p=u[y])!==null&&p!==void 0?p:v[1];return delete u[y],y+"="+x})))!==null&&r!==void 0?r:[],f=(function(h,p){var v,y;p===void 0&&(p="&");var x=[];return bt(h,(function(_,b){_e(_)||_e(b)||b==="undefined"||(v=encodeURIComponent((E=>E instanceof File)(_)?_.name:_.toString()),y=encodeURIComponent(b),x[x.length]=y+"="+v)})),x.join(p)})(u);return f&&c.push(f),i+"?"+c.join("&")},tu=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return v8(t)}},bv=t=>{if(t.Ae)return t.Ae;var e=t.data,n=t.compression;if(e){if(n===nr.GZipJS){var r=fD((function(u,c){var f=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var h=new us(u.length+(u.length>>>1)),p=0,v=function(b){h[p++]=b},y=0;f>y;++y){if(p+5>h.length){var x=new us(p+8+(f-y<<1));x.set(h),h=x}var _=u.charCodeAt(y);128>_?v(_):2048>_?(v(192|_>>>6),v(128|63&_)):_>55295&&57344>_?(v(240|(_=65536+(1047552&_)|1023&u.charCodeAt(++y))>>>18),v(128|_>>>12&63),v(128|_>>>6&63),v(128|63&_)):(v(224|_>>>12),v(128|_>>>6&63),v(128|63&_))}return O6(h,0,p)})(tu(e)),{mtime:0});return{contentType:D6,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===nr.Base64){var s=(function(u){return u&&btoa(encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,((c,f)=>String.fromCharCode(parseInt(f,16)))))})(tu(e)),i=(u=>"data="+encodeURIComponent(typeof u=="string"?u:tu(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=tu(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},L6=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:d2(t.url,{compression:nr.Base64}),encodedBody:bv(fe({},t,{compression:nr.Base64,Ae:void 0}))}:{url:Sy(t.url,"compression"),encodedBody:bv(fe({},t,{compression:void 0,Ae:void 0}))};try{e=bv(t)}catch(s){if(DS(t.compression,Mu(t.url,"compression")))return ye.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&DS(t.compression,Mu(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?B1(new Uint8Array(n)):ArrayBuffer.isView(n)&&B1(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(up=!0,r()):{url:t.url,encodedBody:e}},j6=t=>{try{return L6(t)}catch(e){return ye.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},pD=(function(){var t=tn((function*(e){var n=tu(e.data),r=yield(function(i,a,u){return W1.apply(this,arguments)})(n,$t.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return fe({},e,{Ae:{contentType:D6,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),mD=/Failed to fetch|NetworkError|Load failed/i,F6=t=>{var e,n=j6(t);if(n){var r=n.url,s=n.encodedBody,i=s??{},a=i.contentType,u=i.body,c=i.estimatedSize,f=new Headers;bt(t.headers,(function(y,x){f.append(x,y)})),a&&f.append("Content-Type",a);var h=null,p=!1;if(TS){var v=new TS;h={signal:v.signal,timeout:setTimeout((()=>{var y,x;p=!0,v.abort((y=t.timeout,(x=new Error("PostHog request timed out"+(y?" after "+y+"ms":""))).name="AbortError",x))}),t.timeout)}}Z_(r,fe({method:(t==null?void 0:t.method)||"GET",headers:f,keepalive:t.method==="POST"&&!t.$e&&52428.8>(c||0),body:u,signal:(e=h)==null?void 0:e.signal},t.fetchOptions)).then((y=>y.text().then((x=>{var _={statusCode:y.status,text:x};if(y.status===200)try{_.json=JSON.parse(x)}catch(b){ye.error(b)}t.callback==null||t.callback(_)})))).catch((y=>{p&&(y==null?void 0:y.name)==="AbortError"||(x=>(x==null?void 0:x.name)==="TypeError"&&mD.test((x==null?void 0:x.message)||""))(y)?ye.warn(y):ye.error(y),t.callback==null||t.callback({statusCode:0,error:y})})).finally((()=>h?clearTimeout(h.timeout):null))}},Ey=t=>{try{var e=L6(t),n=e.url,r=e.encodedBody,s=r??{},i=s.body,a=s.estimatedSize;if(!i)return;var u=i instanceof Blob?i:new Blob([i],{type:s.contentType});if(rr.sendBeacon(n,u))return;if(et(t.data)&&t.data.length>1&&(a??0)>16384){var c=Math.ceil(t.data.length/2);return Ey(fe({},t,{data:t.data.slice(0,c)})),void Ey(fe({},t,{data:t.data.slice(c)}))}ye.warn("Beacon of ~"+(a??0)+" bytes was rejected by the browser, falling back to fetch"),F6(fe({},t,{$e:!0}))}catch(f){ye.warn("Beacon send failed",f)}},gD=["/e/","/s/"],dE=(t,e)=>{var n=(s=>{var i=(a=>{var u=Ad(a),c=(u==null?void 0:u.pathname)||a.split(/[?#]/)[0];return c?c[0]==="/"?c:"/"+c:"/"})(s);return gD.some((a=>((u,c)=>u.slice(u.length-c.length)===c)(i,a)))})(t),r=n?Sy(t,"ver"):t;return d2(e===nr.GZipJS?Sy(r,"compression"):r,fe({_:new Date().getTime().toString()},n?{}:{ver:$t.JS_SDK_VERSION},e===nr.GZipJS?{}:{compression:e}))},cp=[];Z_&&cp.push({transport:"fetch",method:F6}),U1&&cp.push({transport:"XHR",method(t){var e=j6(t);if(e){var n=new U1,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,a=s.body;bt(t.headers,(function(u,c){n.setRequestHeader(c,u)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(u)}},n.send(a)}}}),rr!=null&&rr.sendBeacon&&cp.push({transport:"sendBeacon",method:Ey});var ky=3e3;class vD{constructor(e,n){this.Lr=!0,this.Ar=[],this.$r=ni((n==null?void 0:n.flush_interval_ms)||ky,250,5e3,ye.createLogger("flush interval"),ky),this.Nr=e}enqueue(e){this.Ar.push(e),this.Dr||this.qr()}unload(){this.jr();var e=this.Ar.length>0?this.Hr():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Br(fe({},r,{transport:"sendBeacon"}))}))}enable(){this.Lr=!1,this.qr()}qr(){var e=this;this.Lr||(this.Dr=setTimeout((()=>{if(this.jr(),this.Ar.length>0){var n=this.Hr(),r=function(){var i=n[s],a=new Date().getTime();i.data&&et(i.data)&&bt(i.data,(u=>{u.offset=Math.abs(u.timestamp-a),delete u.timestamp})),e.Br(i)};for(var s in n)r()}}),this.$r))}Br(e){try{this.Nr(e)}catch(n){ye.error(n)}}jr(){clearTimeout(this.Dr),this.Dr=void 0}Hr(){var e={};return bt(this.Ar,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;_e(e[i])&&(e[i]=fe({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.Ar=[],e}}var yD=["retriesPerformedSoFar"];class _D{constructor(e){this.Ur=!1,this.zr=3e3,this.Ar=[],this._instance=e,this.Ar=[],this.Vr=!0,!_e(re)&&"onLine"in re.navigator&&(this.Vr=re.navigator.onLine,this.Wr=()=>{this.Vr=!0,this.Zr()},this.Gr=()=>{this.Vr=!1},Ht(re,"online",this.Wr),Ht(re,"offline",this.Gr))}get length(){return this.Ar.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=m8(e,yD);Ni(n)&&(r.url=d2(r.url,{retry_count:n})),this._instance._send_request(fe({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Ot(fe({retriesPerformedSoFar:n},r));s.statusCode===0&&ye.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)}}))}Ot(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(a){var u=3e3*Math.pow(2,a),c=u/2,f=Math.min(18e5,u),h=Math.random()-.5;return Math.ceil(f+h*(f-c))})(n),s=Date.now()+r;this.Ar.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),ye.warn(i),this.Ur||(this.Ur=!0,this.Qr())}Qr(){if(this.Jr&&clearTimeout(this.Jr),this.Ar.length===0)return this.Ur=!1,void(this.Jr=void 0);this.Jr=setTimeout((()=>{this.Vr&&this.Ar.length>0&&this.Zr(),this.Qr()}),this.zr)}Zr(){var e=Date.now(),n=[],r=this.Ar.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.Ar=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.Jr&&(clearTimeout(this.Jr),this.Jr=void 0),this.Ur=!1,_e(re)||(this.Wr&&(re.removeEventListener("online",this.Wr),this.Wr=void 0),this.Gr&&(re.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Ar)){var n=e.requestOptions;try{this._instance._send_request(fe({},n,{transport:"sendBeacon"}))}catch(r){ye.error(r)}}this.Ar=[]}}class xD{constructor(e){this.Kr=()=>{var n,r,s,i;this.Yr||(this.Yr={});var a=this.scrollElement(),u=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,f=u+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this.Yr.lastScrollY=Math.ceil(u),this.Yr.maxScrollY=Math.max(u,(n=this.Yr.maxScrollY)!==null&&n!==void 0?n:0),this.Yr.maxScrollHeight=Math.max(c,(r=this.Yr.maxScrollHeight)!==null&&r!==void 0?r:0),this.Yr.lastContentY=f,this.Yr.maxContentY=Math.max(f,(s=this.Yr.maxContentY)!==null&&s!==void 0?s:0),this.Yr.maxContentHeight=Math.max(h,(i=this.Yr.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get Xr(){return this._instance.config.scroll_root_selector}getContext(){return this.Yr}resetContext(){var e=this.Yr;return setTimeout(this.Kr,0),e}startMeasuringScrollPosition(){Ht(re,"scroll",this.Kr,{capture:!0}),Ht(re,"scrollend",this.Kr,{capture:!0}),Ht(re,"resize",this.Kr)}scrollElement(){if(!this.Xr)return re==null?void 0:re.document.documentElement;var e=et(this.Xr)?this.Xr:[this.Xr];for(var n of e){var r=re==null?void 0:re.document.querySelector(n);if(r)return r}}ti(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.Xr){var r=this.scrollElement();return r&&r[n]||0}return re?e==="y"?re.scrollY||re.pageYOffset||re.document.documentElement.scrollTop||0:re.scrollX||re.pageXOffset||re.document.documentElement.scrollLeft||0:0}scrollY(){return this.ti("y")}scrollX(){return this.ti("x")}}var wD=t=>C6(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 fE{constructor(e,n,r,s){this.ei=i=>{var a=this.ri();if(!a||a.sessionId!==i){var u={sessionId:i,props:this.ii(this._instance)};this.ni.register({[fy]:u})}},this._instance=e,this.si=n,this.ni=r,this.ii=s||wD,this.si.onSessionId(this.ei)}ri(){return this.ni.props[fy]}getSetOnceProps(){var e,n=(e=this.ri())==null?void 0:e.props;return n?"r"in n?P6(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return bt(i2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+G1(r)]=n})),e}}class f2{constructor(){this.oi={}}on(e,n){return this.oi[e]||(this.oi[e]=[]),this.oi[e].push(n),()=>{this.oi[e]=this.oi[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.oi[e]||[])r(n);for(var s of this.oi["*"]||[])s(e,n)}}var zc=Lt("[SessionId]");class hE{on(e,n){return this.ai.on(e,n)}constructor(e,n,r){var s;if(this.li=null,this.ui=[],this.hi=void 0,this.di=!1,this.ai=new f2,this.ci=(f,h)=>!(!Ni(f)||!Ni(h))&&Math.abs(f-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===zi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.ni=e.persistence,this.vi=void 0,this.fi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.pi=n||Fi,this.gi=r||Fi;var i=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*ni(this.Se.session_idle_timeout_seconds||1800,60,36e3,zc.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.mi(),this.yi="ph_"+i+"_window_id",this.bi="ph_"+i+"_primary_window_exists",this.wi()){var a=Dn.D(this.yi),u=Dn.D(this.bi);a&&!u?this.vi=a:Dn.P(this.yi),Dn.q(this.bi,!0)}if((s=this.Se.bootstrap)!=null&&s.sessionID)try{var c=(f=>{var h=this.Se.bootstrap.sessionID.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})();this.xi(this.Se.bootstrap.sessionID,new Date().getTime(),c)}catch(f){zc.error("Invalid sessionID in bootstrap",f)}this.ki()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return _e(this.ui)&&(this.ui=[]),this.ui.push(e),this.fi&&e(this.fi,this.vi),()=>{this.ui=this.ui.filter((n=>n!==e))}}wi(){return this.Se.persistence!=="memory"&&!this.ni.sr&&Dn.N()}Si(e){e!==this.vi&&(this.vi=e,this.wi()&&Dn.q(this.yi,e))}Ci(){return this.vi?this.vi:this.wi()?Dn.D(this.yi):null}Ii(e){var n=this.li;return!or(n)&&!or(e)&&5e3>Math.abs(e-n)}xi(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this.fi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.fi=e,i&&!s||i&&this.Ii(n)||(this.li=n,this.ni.register({[eu]:[n,e,r]}))}Ti(){var e,n=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return Ni(n)&&n>0}Mi(){this.Ti()?this.ni.refreshKey(eu):(this.ni.flush(),this.ni.load())}Ei(){var e;if(!or(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.li){this.Mi();var n=this.Ri();n[1]===this.fi&&n[2]===this._sessionStartTimestamp&&(this.li=this._sessionActivityTimestamp,this.ni.register({[eu]:[this._sessionActivityTimestamp,(e=this.fi)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.ni.flush())}}Pi(){var e=this.Ri()[0],n=Ni(e)?e:0,r=Ni(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}Oi(e){return this.Mi(),this.ci(e,this.Pi())}Ri(){var e=this.ni.props[eu];return et(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.li=null,clearTimeout(this.Fi),this.Fi=void 0,this.xi(null,null,null)}destroy(){this.di=!0,this.Ei(),clearTimeout(this.Fi),this.Fi=void 0,this.hi&&re&&(re.removeEventListener(Yp,this.hi,{capture:!1}),this.hi=void 0),this.ui=[]}ki(){this.hi=()=>{this.Ei(),this.wi()&&Dn.P(this.bi)},Ht(re,Yp,this.hi,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Se.cookieless_mode===zi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),s=this.Ri(),i=s[1],a=s[2],u=this.Pi(),c=this.Ci(),f=Ni(a)&&Math.abs(r-a)>864e5,h=!1,p=!1,v=!i,y=i,x=!v&&!e&&this.ci(r,u);if(x){(x=this.Oi(r))||zc.info("cross-tab refresh kept the session alive",{sessionId:i});var _=this.Ri();i=_[1],a=_[2]}v||x||f?(i=this.pi(),c=this.gi(),zc.info("new session ID generated",{sessionId:i,windowId:c,changeReason:{noSessionId:v,activityTimeout:x,sessionPastMaximumLength:f}}),a=r,h=!0):(c||(c=this.gi(),h=!0),(p=i!==y)&&(zc.info("adopted cross-tab session id",{sessionId:i,windowId:c}),h=!0));var b=Ni(u)&&e&&!f?u:r,E=Ni(a)?a:new Date().getTime();this.Si(c),this.xi(i,b,E),e||this.mi();var C={noSessionId:v,activityTimeout:x,sessionPastMaximumLength:f,crossTabAdoption:p};return h&&this.ui.forEach((P=>P(i,c,C))),{sessionId:i,windowId:c,sessionStartTimestamp:E,changeReason:h?C:void 0,lastActivityTimestamp:u}}mi(){this.di||(clearTimeout(this.Fi),this.Fi=setTimeout((()=>{if(!this.di)if(this.Oi(new Date().getTime())){var e=this.fi;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:e})}else this.mi()}),1.1*this.sessionTimeoutMs))}}var V6=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&jS(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>jS(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function $6(){return($6=tn((function*(){var t=rr==null?void 0:rr.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return _t(n)&&n.length>0?n:void 0}catch(r){return void ye.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var nm=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function pE(t,e,n){return tu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var H6={exact:(t,e)=>e.some((n=>t.some((r=>n===r)))),is_not:(t,e)=>e.every((n=>t.every((r=>n!==r)))),regex:(t,e)=>e.some((n=>t.some((r=>nm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!nm(n,r))))),icontains:(t,e)=>e.map(Oh).some((n=>t.map(Oh).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Oh).every((n=>t.map(Oh).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)))}))},Oh=t=>t.toLowerCase();function z6(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(_e(s)||or(s))return!1;var i=[String(s)],a=H6[r.operator];return!!a&&a(r.values,i)}))}var Cy="custom",mE="i.posthog.com",bD=/^\/static\//;class SD{constructor(e){this.Li={},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("."+mE,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Li[this.apiHost]||(this.Li[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":Cy),this.Li[this.apiHost]}Ai(e){if(bD.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(e==="assets"){var r=this.Ai(n);if(r)return""+r+n}if(this.region===Cy)return this.apiHost+n;var s=mE+n;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}function U6(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var yt=Lt("[Surveys]"),B6="seenSurvey_",W6=t=>{try{var e=(n=>((r,s)=>""+B6+(function(i){return i.current_iteration&&i.current_iteration>0?i.id+"_"+i.current_iteration:i.id})(s))(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){yt.error("Failed to persist survey seen state",n)}},ED=[yv.Popover,yv.Widget,yv.API],kD={ignoreConditions:!1,ignoreDelay:!1,displayType:_y.Popover},CD=Lt("[PostHog ExternalIntegrations]"),PD={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class TD{constructor(e){this._instance=e}Ue(e,n){var r;(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return CD.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var i,a,u,c=r[0],f=r[1];!f||(i=$e.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[c]||e.Ue(PD[c],(()=>{var h;(h=$e.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[c])==null||h.start(e._instance)})),!f&&(a=$e.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[c]&&((u=$e.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[c])==null||u.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}var hd={},Sv=0,rm=()=>{},gE='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Uc="Surveys module not available",vE="sanitize_properties is deprecated. Use before_send instead",G6="Invalid value for property_denylist config: ",Ql="posthog",K6=!hD&&(_r==null?void 0:_r.indexOf("MSIE"))===-1&&(_r==null?void 0:_r.indexOf("Mozilla"))===-1,yE=t=>{var e;return fe({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:IO(Se==null?void 0:Se.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:rm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:on&&_t(on==null?void 0:on.search)&&on.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(re==null||(e=re.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){ye.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:gy,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:ky},error_tracking:{},_onCapture:rm},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:UO,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n)}))(t))},RD=[["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"]],_E=t=>{var e={};for(var n of RD){var r=n[0],s=n[1];_e(t[r])||(e[s]=t[r])}var i=Tt({},e,t),a=t.__preview_external_dependency_versioned_paths;return _e(a)||(_e(t.strict_script_versioning)&&(i.strict_script_versioning=!!a),_t(a)&&_e(t.asset_host)&&(i.asset_host=a)),et(t.property_blacklist)&&(_e(t.property_denylist)?i.property_denylist=t.property_blacklist:et(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:ye.error(G6+t.property_denylist)),i};class AD{constructor(){this.__forceAllowLocalhost=!1}get $i(){return this.__forceAllowLocalhost}set $i(e){ye.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class is{Ni(e,n){if(e){var r=this.Di.indexOf(e);r!==-1&&this.Di.splice(r,1)}return this.Di.push(n),n.initialize==null||n.initialize(),n}qi(){return this.config.cookieless_mode===zi||this.config.cookieless_mode===La&&this.consent.isRejected()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new AD,this.ji=!1,this.version=$t.LIB_VERSION,this.Hi=new f2,this.Di=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=yE(),this.SentryIntegration=QO,this.sentryIntegration=r=>(function(s,i){var a=_6(s,i);return{name:y6,processEvent:u=>a(u)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Bi=!1,this.Ui=null,this.zi=null,this.Vi=null,this.scrollManager=new xD(this),this.pageViewManager=new rE(this),this.rateLimiter=new aD(this),this.requestRouter=new SD(this),this.consent=new FO(this),this.externalIntegrations=new TD(this);var n=(e=is.__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=_t(r)?{[r]:s}:r;this.setPersonProperties(a),i==null||i({})},set_once:(r,s,i)=>{var a=_t(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),i==null||i({})}},this.on("eventCaptured",(r=>ye.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==Ql){var s,i=(s=hd[r])!==null&&s!==void 0?s:new is;return i._init(e,n,r),hd[r]=i,hd[Ql][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var a=_t(e)?e.trim():"";if(!a)return ye.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Wi(n.debug),this.Zi=n,this.Gi=[],n.person_profiles?this.zi=n.person_profiles:n.process_person&&(this.zi=n.process_person);var u=yE(n.defaults),c=_E(n),f=Tt({},u,c,{name:r,token:a});Ot(u.rageclick)&&Ot(c.rageclick)&&(f.rageclick=Tt({},u.rageclick,c.rageclick)),Ot(u.session_recording)&&Ot(c.session_recording)&&(f.session_recording=Tt({},u.session_recording,c.session_recording)),this.set_config(f),this.config.on_xhr_error&&ye.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:nr.GZipJS;var h=this.Qi();this.persistence=new vv(this.config,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new vv(fe({},this.config,{persistence:"sessionStorage"}),h,!1);var p=fe({},this.persistence.props),v=fe({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Ji=new vD((T=>this.Ki(T)),this.config.request_queue_config),this.Yi=new _D(this),this.__request_queue=[];var y=this.qi();if(y||(this.sessionManager=new hE(this),this.sessionPropsManager=new fE(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ye.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Xi(y)}),0)):(ye.info("Initializing extensions synchronously"),this.Xi(y)),$t.DEBUG=$t.DEBUG||this.config.debug,$t.DEBUG&&ye.info("Starting in debug mode",{this:this,config:n,thisC:fe({},this.config),p,s:v}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=fe({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var x=n.bootstrap.distinctID,_=this.get_distinct_id(),b=this.persistence.get_property(Ss);if(n.bootstrap.isIdentifiedID&&_!=null&&_!==x&&b===$l)this.identify(x);else if(n.bootstrap.isIdentifiedID&&_!=null&&_!==x&&b===Hl)ye.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var E=this.config.get_device_id(Fi()),C=n.bootstrap.isIdentifiedID?E:x;this.persistence.set_property(Ss,n.bootstrap.isIdentifiedID?Hl:$l),this.register({distinct_id:x,$device_id:C})}}if(y)this.register_once({distinct_id:Th,$device_id:null},"");else if(!this.get_distinct_id()){var P=this.config.get_device_id(Fi());this.register_once({distinct_id:P,$device_id:P},""),this.persistence.set_property(Ss,$l)}return Ht(re,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(T,R){var O=T.config.segment;if(!O)return R();(function(M,A){var N=M.config.segment;if(!N)return A();var D=V=>{var W=()=>V.anonymousId()||Fi();M.config.get_device_id=W,V.id()&&(M.register({distinct_id:V.id(),$device_id:W()}),M.persistence.set_property(Ss,Hl)),A()},j=N.user();"then"in j&&Ps(j.then)?j.then(D):D(j)})(T,(()=>{O.register((M=>{typeof Promise<"u"&&Promise.resolve||gv.warn("This browser does not have Promise support, and can not use the segment integration");var A=(N,D)=>{if(!D)return N;N.event.userId||N.event.anonymousId===M.get_distinct_id()||(gv.info("No userId set, resetting PostHog"),M.reset()),N.event.userId&&N.event.userId!==M.get_distinct_id()&&(gv.info("UserId set, identifying with PostHog"),M.identify(N.event.userId));var j=M.calculateEventProperties(D,N.event.properties);return N.event.properties=Object.assign({},j,N.event.properties),N};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:N=>A(N,N.event.event),page:N=>A(N,Xl),identify:N=>A(N,hv),screen:N=>A(N,"$screen")}})(T)).then((()=>{R()}))}))})(this,(()=>this.tn())):this.tn(),Ps(this.config._onCapture)&&this.config._onCapture!==rm&&(ye.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(T=>this.config._onCapture(T.event,T)))),this.config.ip&&ye.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 $6.apply(this,arguments)})().then((T=>{T&&this.register({[dv]:T})})).catch(rm),this}Xi(e){var n,r,s,i,a,u,c,f,h=performance.now(),p=fe({},is.__defaultExtensionClasses,this.config.__extensionClasses),v=[];p.featureFlags&&this.Di.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.Di.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.Di.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.Di.push(this.tracingHeaders=new p.tracingHeaders(this)),p.siteApps&&this.Di.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!e&&this.Di.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||v.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.Di.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.Di.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new p.surveys(this)),p.logs&&this.Di.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new p.logs(this)),p.metrics&&this.Di.push(this.metrics=(a=this.metrics)!==null&&a!==void 0?a:new p.metrics(this)),p.conversations&&this.Di.push(this.conversations=(u=this.conversations)!==null&&u!==void 0?u:new p.conversations(this)),p.productTours&&this.Di.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.Di.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.Di.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.Di.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.Di.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,XO)),p.toolbar&&this.Di.push(this.toolbar=(c=this.toolbar)!==null&&c!==void 0?c:new p.toolbar(this)),p.experiments&&this.Di.push(this.experiments=(f=this.experiments)!==null&&f!==void 0?f:new p.experiments(this)),this.Di.forEach((y=>{y.initialize&&v.push((()=>{y.initialize==null||y.initialize()}))})),v.push((()=>{if(this.en){var y=this.en;this.en=void 0,this.Rr(y)}})),this.rn(v,h)}rn(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.rn(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){ye.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[t6]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[n6]:s}),this.config.__preview_deferred_init_extensions&&ye.info("PostHog extensions initialized ("+s+"ms)")}Rr(e){var n;if(!Se||!Se.body)return ye.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Rr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.en=e),this.nn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Be(e.supportedCompression,nr.GZipJS)?nr.GZipJS:Be(e.supportedCompression,nr.Base64)?nr.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.zi?this.zi:gy}),this.Di.forEach((r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(e)))}tn(){try{this.config.loaded(this)}catch(r){ye.critical("`loaded` function failed",r)}if(this.sn(),this.config.internal_or_test_user_hostname&&on!=null&&on.hostname){var e=on.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.qi())&&this.an()}),1),this.ln=new R6(this),this.ln.load()}sn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Ji)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Rh(this.__request_queue,(e=>this.Ki(e))),this.__request_queue=[],this.sn()}_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.un()&&this.capture(fv),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.Ji)==null||s.unload(),(i=this.Yi)==null||i.unload()):this.un()&&this.capture(fv,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?K6?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=fe({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(_e(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=fe({},n);a.timeout=a.timeout||6e4;var u=(r=a.transport)!==null&&r!==void 0?r:"fetch";u==="sendBeacon"&&_e(a.compression)&&a.data&&(a.compression=nr.Base64),a.url=dE(a.url,a.compression);var c=cp.filter((h=>!a.disableTransport||!h.transport||!a.disableTransport.includes(h.transport))),f=(s=(i=(function(h,p){for(var v=0;h.length>v;v++)if(h[v].transport===u)return h[v]})(c))==null?void 0:i.method)!==null&&s!==void 0?s:c[0].method;if(!f)throw new Error("No available transport method");u!=="sendBeacon"&&a.data&&a.compression===nr.GZipJS&&ON&&typeof Promise<"u"&&!up?pD(a).then((h=>{f(h)})).catch((h=>{if(LS(h))return up=!0,void f(fe({},a,{compression:void 0,url:dE(n.url,void 0)}));(p=>{if(!p||typeof p!="object")return!1;var v="name"in p?String(p.name):"";return LS(p)||v===g8})(h)&&(up=!0),f(a)})):f(a)})(fe({},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}))}Ki(e){this.Yi?this.Yi.retriableRequest(e):this._send_request(e)}_execute_array(e){Sv++;try{var n,r=[],s=[],i=[];Rh(e,(u=>{if(u)if(et(n=u[0]))i.push(u);else if(Ps(u))try{u.call(this)}catch(c){ye.error("Error executing queued PostHog call",u,c)}else et(u)&&n==="alias"?r.push(u):et(u)&&n.indexOf("capture")!==-1&&Ps(this[n])?i.push(u):s.push(u)}));var a=function(u,c){Rh(u,(function(f){try{if(et(f[0])){var h=c;bt(f,(function(p){h=h[p[0]].apply(h,p.slice(1))}))}else c[f[0]].apply(c,f.slice(1))}catch(p){ye.error("Error executing queued PostHog call",f,p)}}))};a(r,this),a(s,this),a(i,this)}finally{Sv--}}push(e){if(Sv>0&&et(e)&&_t(e[0])){var n=is.prototype[e[0]];Ps(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.Ji){if(this.is_capturing())if(!_e(e)&&_t(e)){var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var h=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(h==null||!h.isRateLimited){n!=null&&n.$current_url&&!_t(n==null?void 0:n.$current_url)&&(ye.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.hn||ye.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,v=(r==null?void 0:r.timestamp)||p,y=HS(r==null?void 0:r.uuid,Fi),x={uuid:y,event:e,properties:this.calculateEventProperties(e,n||{},v,y)};e===Xl&&this.config.__preview_capture_bot_pageviews&&f&&(x.event="$bot_pageview",x.properties.$browser_type="bot"),h&&(x.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens),r!=null&&r.$set&&(x.$set=r==null?void 0:r.$set);var _=r==null?void 0:r.$unset;_&&(x.$unset=_);var b,E,C,P=this.dn(r==null?void 0:r.$set_once,e!==GS,e===hv);if(P&&(x.$set_once=P),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=x,u=D=>_t(D)?D.slice(0,i):D,c=new Set,x=(function D(j,V){return j!==Object(j)?u?u(j):j:c.has(j)?void 0:(c.add(j),et(j)?(W=[],Rh(j,(Y=>{W.push(D(Y))}))):(W={},bt(j,((Y,K)=>{c.has(Y)||(W[K]=D(Y))}))),W);var W})(a)),x.timestamp=v,_e(r==null?void 0:r.timestamp)||(x.properties.$event_time_override_provided=!0,x.properties.$event_time_override_system_time=p),e===Ui.DISMISSED||e===Ui.SENT){var T=n==null?void 0:n[_v.SURVEY_ID],R=n==null?void 0:n[_v.SURVEY_ITERATION];W6({id:T,current_iteration:R}),x.$set=fe({},x.$set,{[(b={id:T,current_iteration:R},E=e===Ui.SENT?"responded":"dismissed",C="$survey_"+E+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(C="$survey_"+E+"/"+b.id+"/"+b.current_iteration),C)]:!0})}else e===Ui.SHOWN&&(x.$set=fe({},x.$set,{[_v.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===oD.SHOWN){var O=n==null?void 0:n[iE.TOUR_TYPE];O&&(x.$set=fe({},x.$set,{[iE.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var M=fe({},x.properties.$set,x.$set);if(Lo(M)||this.setPersonPropertiesForFlags(M),!Xe(this.config.before_send)){var A=this.Rt(x);if(!A)return;(x=A).uuid=HS(x.uuid,Fi)}this.Hi.emit("eventCaptured",x);var N={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:x,compression:"best-available",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ki(N):this.Ji.enqueue(N),x}ye.critical("This capture call is ignored due to client rate limiting.")}}else ye.error("No event name provided to posthog.capture")}else ye.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var a=i?void 0:this.persistence.remove_event_timer(e),u=fe({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.qi()&&(u.$cookieless_mode=!0),e==="$snapshot"){var c=fe({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=c.distinct_id,(!_t(u.distinct_id)&&!Fn(u.distinct_id)||K1(u.distinct_id))&&ye.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var f,h=(function(E,C,P,T){var R,O,M,A;if(T===void 0&&(T=!1),!_r)return{};var N,D,j,V,W,Y,K,B,X,$=E?[...Nu,...C||[]]:[],te=(function(ne){for(var ie=0;VS.length>ie;ie++){var ae=VS[ie],ue=ae[1],ke=ae[0].exec(ne),ee=ke&&(Ps(ue)?ue(ke,ne):ue);if(ee)return ee}return["",""]})(_r),H=(N=typeof navigator<"u"?navigator:void 0)!=null&&N.brave?{brave:!0}:{},L={detectGoogleSearchApp:P},Z=Tt(i2({$os:te[0],$os_version:te[1],$browser:$8(_r,navigator.vendor,H,L),$device:$S(_r),$device_type:(j=_r,V={userAgentDataPlatform:(R=navigator)==null||(R=R.userAgentData)==null?void 0:R.platform,maxTouchPoints:(O=navigator)==null?void 0:O.maxTouchPoints,screenWidth:re==null||(M=re.screen)==null?void 0:M.width,screenHeight:re==null||(A=re.screen)==null?void 0:A.height,devicePixelRatio:re==null?void 0:re.devicePixelRatio},X=$S(j),X===b8||X===w8||X==="Kobo"||X==="Kindle Fire"||X===D8?Ru:X===Cd||X===lu||X===Pd||X===Z1?"Console":X===E8?"Wearable":X?Br:(V==null?void 0:V.userAgentDataPlatform)==="Android"&&((W=V==null?void 0:V.maxTouchPoints)!==null&&W!==void 0?W:0)>0?600>Math.min((Y=V==null?void 0:V.screenWidth)!==null&&Y!==void 0?Y:0,(K=V==null?void 0:V.screenHeight)!==null&&K!==void 0?K:0)/((B=V==null?void 0:V.devicePixelRatio)!==null&&B!==void 0?B:1)?Br:Ru:"Desktop"),$timezone:T6(),$timezone_offset:rD()}),{$current_url:Id(T?Wo(on==null?void 0:on.href):on==null?void 0:on.href,$,Md),$host:on==null?void 0:on.host,$pathname:on==null?void 0:on.pathname,$raw_user_agent:_r.length>1e3?_r.substring(0,997)+"...":_r,$browser_version:JN(_r,navigator.vendor,H,L),$browser_language:sE(),$browser_language_prefix:(D=sE(),typeof D=="string"?D.split("-")[0]:void 0),$screen_height:re==null?void 0:re.screen.height,$screen_width:re==null?void 0:re.screen.width,$viewport_height:re==null?void 0:re.innerHeight,$viewport_width:re==null?void 0:re.innerWidth,$lib:$t.LIB_NAME,$lib_version:$t.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return $t.SDK_DIST_CHANNEL&&(Z.$sdk_dist_channel=$t.SDK_DIST_CHANNEL),Z})(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()),v=p.windowId;u.$session_id=p.sessionId,u.$window_id=v}this.sessionPropsManager&&Tt(u,this.sessionPropsManager.getSessionProps());try{var y;this.sessionRecording&&Tt(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=(y=this.Yi)==null?void 0:y.length}catch(E){u.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===Cy&&(u.$lib_custom_api_host=this.config.api_host),f=e!==Xl||i?e!==fv||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=Tt(u,f),e===Xl&&Se&&(u.title=Se.title),!_e(a)){var x=r.getTime()-a;u.$duration=parseFloat((x/1e3).toFixed(3))}_r&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser"),(u=Tt({},h,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),et(this.config.property_denylist)?bt(this.config.property_denylist,(function(E){delete u[E]})):ye.error(G6+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(ye.error(vE),u=_(u,e));var b=this.cn();return u.$process_person_profile=b,b&&!i&&this.vn("_calculate_event_properties"),u}dn(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.cn()||this.ji&&!r)return e;var i=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),u=Tt({},i,a||{},e||{}),c=this.config.sanitize_properties;return c&&(ye.error(vE),u=c(u,"$set_once")),n&&(this.ji=!0),Lo(u)?void 0:u}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}fn(e,n){this.register({[e]:n})}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(e,n)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Hi.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:Uc}),()=>{})}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:Uc})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Uc})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=kD),(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:Uc}}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:Uc})}pn(e){return!e||K1(e)?(ye.critical("Unique user id has not been set in posthog.identify"),!1):e===Th?(ye.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())||(ye.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 ye.uninitializedWarning("posthog.identify");if(Fn(e)&&(e=e.toString(),ye.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.pn(e)&&this.vn("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Wp)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(td)&&(this.unregister(td),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Ss)||$l)===$l;e!==s&&a?(this.persistence.set_property(Ss,Hl),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(hv,{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.Vi=pE(e,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(cd))}}setPersonProperties(e,n){if((e||n)&&this.vn("posthog.setPersonProperties")){var r=pE(this.get_distinct_id(),e,n);this.Vi!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Vi=r):ye.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(et(e)?e:[e]).filter((s=>_t(s)&&s.length>0));r.length!==0&&this.vn("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Vi=null)}group(e,n,r){if(e&&n){var s=this.getGroups(),i=s[e]!==n;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:fe({},s,{[e]:n})}),i||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(GS,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),i&&!r&&this.reloadFeatureFlags()}else ye.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.vn("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n,r,s,i,a,u,c,f,h,p;if(ye.info("reset"),!this.__loaded)return ye.uninitializedWarning("posthog.reset");var v,y=this.get_property(Wp),x=this.get_property(dv),_=this.get_property(za);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),_e(_)||(v=this.persistence)==null||v.register({[za]:_}),(s=this.surveys)==null||s.reset(),(i=this.ln)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(u=this.conversations)==null||u.reset(),(c=this.logs)==null||c.reset(),(f=this.metrics)==null||f.reset(),(h=this.persistence)==null||h.set_property(Ss,$l),(p=this.sessionManager)==null||p.resetSessionId(),this.Vi=null,this.config.cookieless_mode===zi)this.register_once({distinct_id:Th,$device_id:null},"");else{var b=this.config.get_device_id(Fi());this.register_once({distinct_id:b,$device_id:e?b:y},""),e||_e(x)||this.register({[dv]:x})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var n=this;return tn((function*(){var r,s,i,a,u;n.__loaded?((r=n.logs)==null||r.flushLogs("sendBeacon"),(s=n.metrics)==null||s.flush("sendBeacon"),(i=n.Ji)==null||i.unload(),(a=n.Yi)==null||a.unload(),(u=n.featureFlags)==null||u.destroy()):ye.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.gn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.mn()}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(q8)?(ye.critical("Attempting to create alias for existing People user - aborting."),-2):this.vn("posthog.alias")?(_e(n)&&(n=this.get_distinct_id()),e!==n?(this.fn(td,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ye.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=fe({},this.config);if(Ot(e)){var r,s,i,a,u,c,f,h,p,v,y;Tt(this.config,_E(e));var x=this.Qi();(r=this.persistence)==null||r.update_config(this.config,n,x),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new vv(fe({},this.config,{persistence:"sessionStorage"}),x,!1);var _=this.Wi(this.config.debug);ii(_)&&(this.config.debug=_),ii(this.config.debug)&&(this.config.debug?($t.DEBUG=!0,wt.N()&&wt.q("ph_debug",!0),ye.info("set_config",{config:e,oldConfig:n,newConfig:fe({},this.config)})):($t.DEBUG=!1,wt.N()&&wt.P("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(u=this.tracingHeaders)==null||u.startIfEnabledOrStop(),(c=this.autocapture)==null||c.startIfEnabled(),(f=this.heatmaps)==null||f.startIfEnabled(),(h=this.exceptionObserver)==null||h.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(v=this.surveys)==null||v.loadIfEnabled(),this.yn(),(y=this.externalIntegrations)==null||y.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){$t.LIB_NAME=e,$t.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(fe({},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:is.bn}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:Ql;return n!==Ql&&(n=Ql+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Ss))===Hl||((n=this.sessionPersistence)==null?void 0:n.get_property(Ss))===Hl}cn(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===gy&&!this._isIdentified()&&Lo(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[td])&&((n=this.persistence)==null||(n=n.props)==null||!n[qp]))}un(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.cn()||this.vn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.vn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}vn(e){return this.config.person_profiles==="never"?(ye.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.fn(qp,!0),!0)}Qi(){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!==La)}yn(){var e,n,r,s,i=this.Qi();return((e=this.persistence)==null?void 0:e.sr)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.sr)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==zi){if(this.qi()){var r,s,i,a,u;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new hE(this),this.pageViewManager=new rE(this),this.persistence&&(this.sessionPropsManager=new fE(this,this.sessionManager,this.persistence));var c,f=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(u=is.__defaultExtensionClasses)==null?void 0:u.sessionRecording;f&&(this.sessionRecording=this.Ni(this.sessionRecording,new f(this)),this.nn&&((c=this.sessionRecording)==null||c.onRemoteConfig==null||c.onRemoteConfig(this.nn)))}var h,p;this.consent.optInOut(!0),this.yn(),this.sn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==La&&((h=this.surveys)==null||h.loadIfEnabled()),(_e(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.an()}else ye.warn(gE)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==zi?(this.config.cookieless_mode===La&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.yn(),this.config.cookieless_mode===La&&(this.register({distinct_id:Th,$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.an(),this.sn())):ye.warn(gE)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===zi||(this.config.cookieless_mode===La?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.yn()}_is_bot(){return rr?V6(rr,this.config.custom_blocked_useragents):void 0}an(){Se&&(Se.visibilityState==="visible"?this.Bi||(this.Bi=!0,this.capture(Xl,{title:Se.title},{send_instantly:!0}),this.Ui&&(Se.removeEventListener(Zp,this.Ui),this.Ui=null)):this.Ui||(this.Ui=this.an.bind(this),Ht(Se,Zp,this.Ui)))}debug(e){e===!1?(re==null||re.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(re==null||re.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Or(){var e,n,r,s,i,a,u=this.Zi||{};return"advanced_disable_flags"in u?!!u.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(ye.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):(r="advanced_disable_decide",s=ye,i=(n="advanced_disable_flags")in(e=u)&&!Xe(e[n]),a=r in e&&!Xe(e[r]),i?e[n]:!!a&&(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]))}Rt(e){var n;if(Xe(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(HN),s=et(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s){if(i=a(i),Xe(i)){var u="Event '"+e.event+"' was rejected in beforeSend function";return $N(e.event)?ye.warn(u+". This can cause unexpected behavior."):ye.info(u),null}i.properties&&!Lo(i.properties)||ye.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var c of r)if(i.properties&&Xe(i.properties[c]))return ye.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.We)==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)})}Wi(e){var n=ii(e)&&!e,r=wt.N()&&wt.A("ph_debug")==="true";return!n&&(!!r||e)}}is.__defaultExtensionClasses={},is.bn=(()=>{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]]=RO(t.prototype[e[n]])})(is,["identify"]);class xE{constructor(e){this.disabled=e===!1;var n=Ot(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&this.timeoutMs>r-s.timestamp){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var Ev="$copy_autocapture",kv=Lt("[AutoCapture]");function Cv(t,e){return e.length>t?e.slice(0,t)+"...":e}function ID(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Go(e));return e}function MD(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,c=e.elementsChainAsString,f=e.disableCaptureUrlHashes;if(!Go(t))return{props:{}};for(var h=[t],p=new Set([t]),v=t;v.parentNode&&!Hr(v,"body")&&u6>h.length;)if(l6(v.parentNode)){var y=v.parentNode.host;if(p.has(y))break;p.add(y),h.push(y),v=y}else{if(!Go(v.parentNode)||p.has(v.parentNode))break;p.add(v.parentNode),h.push(v.parentNode),v=v.parentNode}var x,_,b=[],E={},C=!1,P=!1;if(bt(h,(A=>{var N=yy(A);if(Hr(A,"a")){var D=A.getAttribute("href");C=!!(N&&D&&dd(D))&&(f?Wo(D):D)}Be(Qp(A),"ph-no-capture")&&(P=!0),b.push((function(V,W,Y,K,B){B===void 0&&(B=!1);var X=V.tagName.toLowerCase(),$={tag_name:X};a2.indexOf(X)>-1&&!Y&&($.$el_text=X.toLowerCase()==="a"||X.toLowerCase()==="button"?Cv(1024,eE(V)):Cv(1024,Rd(V)));var te=Qp(V);te.length>0&&($.classes=te.filter((function(ne){return ne!==""}))),bt(V.attributes,(function(ne){var ie;if((!p6(V)||["name","id","class","aria-label"].indexOf(ne.name)!==-1)&&(K==null||!K.includes(ne.name))&&!W&&dd(ne.value)&&(!_t(ie=ne.name)||ie.substring(0,10)!=="_ngcontent"&&ie.substring(0,7)!=="_nghost")){var ae=ne.value;ne.name==="class"&&(ae=o2(ae).join(" ")),$["attr__"+ne.name]=Cv(1024,ne.name==="href"&&B?Wo(ae):ae)}}));for(var H=1,L=1,Z=V;Z=ID(Z);)H++,Z.tagName===V.tagName&&L++;return $.nth_child=H,$.nth_of_type=L,$})(A,i,a,u,f));var j=(function(V){if(!yy(V))return{};var W={};return bt(V.attributes,(function(Y){if(Y.name&&Y.name.indexOf("data-ph-capture-attribute")===0){var K=Y.name.replace("data-ph-capture-attribute-",""),B=Y.value;K&&B&&dd(B)&&(W[K]=B)}})),W})(A);Tt(E,j)})),P)return{props:{},explicitNoCapture:P};if(a||(b[0].$el_text=Hr(t,"a")||Hr(t,"button")?eE(t):Rd(t)),C){var T,R;b[0].attr__href=C;var O=(T=Ad(C))==null?void 0:T.host,M=re==null||(R=re.location)==null?void 0:R.host;O&&M&&O!==M&&(x=C)}return{props:Tt({$event_type:s.type,$ce_version:1},c?{}:{$elements:b},{$elements_chain:(_=b,(function(A){return A.map((N=>{var D,j,V="";if(N.tag_name&&(V+=N.tag_name),N.attr_class)for(var W of(N.attr_class.sort(),N.attr_class))V+="."+W.replace(/"/g,"");var Y=fe({},N.text?{text:N.text}:{},{"nth-child":(D=N.nth_child)!==null&&D!==void 0?D:0,"nth-of-type":(j=N.nth_of_type)!==null&&j!==void 0?j:0},N.href?{href:N.href}:{},N.attr_id?{attr_id:N.attr_id}:{},N.attributes),K={};return lp(Y).sort(((B,X)=>B[0].localeCompare(X[0]))).forEach((B=>{var X=B[1];return K[tE(B[0].toString())]=tE(X.toString())})),(V+=":")+lp(K).map((B=>B[0]+'="'+B[1]+'"')).join("")})).join(";")})((function(A){return A.map((N=>{var D,j,V={text:(D=N.$el_text)==null?void 0:D.slice(0,400),tag_name:N.tag_name,href:(j=N.attr__href)==null?void 0:j.slice(0,2048),attr_class:ZO(N),attr_id:N.attr__id,nth_child:N.nth_child,nth_of_type:N.nth_of_type,attributes:{}};return lp(N).filter((W=>W[0].indexOf("attr__")===0)).forEach((W=>V.attributes[W[0]]=W[1])),V}))})(_)))},(n=b[0])!=null&&n.$el_text?{$el_text:(r=b[0])==null?void 0:r.$el_text}:{},x&&s.type==="click"?{$external_click_url:x}:{},E)}}var Bc=Lt("[ExceptionAutocapture]"),wE=()=>{},ND=Lt("[TracingHeaders]"),Ea=Lt("[Web Vitals]"),bE=9e5,SE="disabled",EE="lazy_loading",Wc="awaiting_config",Dh="missing_config";Lt("[SessionRecording]"),Lt("[SessionRecording]");var Py="[SessionRecording]",Ci=Lt(Py),OD=Lt("[Heatmaps]");function kE(t){return Ot(t)&&"clientX"in t&&"clientY"in t&&Fn(t.clientX)&&Fn(t.clientY)}var Pv=Lt("[Product Tours]"),Tv=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(n2))},DD=["$set_once","$set"],Us=Lt("[SiteApps]"),CE="Error while initializing PostHog app with config id ";function Bl(t,e,n){if(Xe(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class LD{constructor(e){this._n=new f2,this.wn=(n,r)=>this.xn(n,r)&&this.kn(n,r)&&this.Sn(n,r)&&this.Cn(n,r),this.xn=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.In=new Set,this.Tn=new Set}init(){var e,n;_e((e=this._instance)==null?void 0:e._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,s)=>{this.on(r,s)}))}register(e){var n,r;if(!_e((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var u,c;(u=this.Tn)==null||u.add(a),(c=a.steps)==null||c.forEach((f=>{var h;(h=this.In)==null||h.add((f==null?void 0:f.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;e.forEach((a=>{var u;(u=a.steps)==null||u.forEach((c=>{c!=null&&c.selector&&i.add(c==null?void 0:c.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(e,n){var r;n!=null&&e.length!=0&&(this.In.has(e)||this.In.has(n==null?void 0:n.event))&&this.Tn&&((r=this.Tn)==null?void 0:r.size)>0&&this.Tn.forEach((s=>{this.Mn(n,s)&&this._n.emit("actionCaptured",s.name)}))}En(e){this.onAction("actionCaptured",(n=>e(n)))}Mn(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.wn(e,r))return!0;return!1}onAction(e,n){return this._n.on(e,n)}kn(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"||!Bl(s,n.url,n.url_matching||"contains"))return!1}return!0}Sn(e,n){return!!this.Rn(e,n)&&!!this.Pn(e,n)&&!!this.On(e,n)}Rn(e,n){var r;if(n==null||!n.href)return!0;var s=this.Fn(e);if(s.length>0)return s.some((u=>Bl(u.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&Bl((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}Pn(e,n){var r;if(n==null||!n.text)return!0;var s=this.Fn(e);if(s.length>0)return s.some((f=>Bl(f.text,n.text,n.text_matching||"exact")||Bl(f.$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(f){for(var h,p=[],v=/(?::|")text="(.*?)"/g;!Xe(h=v.exec(f));)p.includes(h[1])||p.push(h[1]);return p})(c),a=n.text,u=n.text_matching||"exact",i.some((f=>Bl(f,a,u))))}On(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}Fn(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}Cn(e,n){return n==null||!n.properties||n.properties.length===0||z6(n.properties.reduce(((r,s)=>{var i=et(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class jD{constructor(e){this.Ln=[],this._instance=e,this.An=new Map,this.$n=new Map,this.Nn=new Map}Dn(e,n){return!!e&&z6(e.propertyFilters,n==null?void 0:n.properties)}qn(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}jn(e,n,r){var s=(r===Fc.Activation?this.An:this.$n).get(e),i=[];return this.Hn((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((f=>f.name===e));return this.Dn(c,n)}))}register(e){var n;_e((n=this._instance)==null?void 0:n._addCaptureHook)||(this.Bn(e),this.Un(e))}Un(e){var n=e.filter((r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));n.length!==0&&(this.zn==null&&(this.zn=new LD(this._instance),this.zn.init(),this.zn.En((r=>{this.onAction(r)}))),n.forEach((r=>{var s,i,a,u,c;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((u=this.zn)==null||u.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((f=>{if(f&&f.name){var h=this.Nn.get(f.name);h&&h.push(r.id),this.Nn.set(f.name,h||[r.id])}})))})))}Bn(e){var n,r=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.events)&&((u=i.conditions)==null||(u=u.events)==null||(u=u.values)==null?void 0:u.length)>0})),s=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.cancelEvents)&&((u=i.conditions)==null||(u=u.cancelEvents)==null||(u=u.values)==null?void 0:u.length)>0}));r.length===0&&s.length===0||((n=this._instance)==null||n._addCaptureHook(((i,a)=>{this.onEvent(i,a)})),this.An=this.qn(e,Fc.Activation),this.$n=this.qn(e,Fc.Cancellation))}onEvent(e,n){var r,s,i=this.Vn(),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.Wn(e,a);if(u==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.Zn([a]);if(u==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.Gn(a)}if(this.$n.has(e)){var c=this.jn(e,n,Fc.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((h=>h.id))}),this.Zn(c.map((h=>h.id))),c.forEach((h=>this.Qn(h.id))))}if(this.An.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.An.get(e)});var f=this.jn(e,n,Fc.Activation);this.Jn(f.map((h=>h.id)))}}onAction(e){this.Nn.has(e)&&this.Jn(this.Nn.get(e)||[])}Jn(e){e.length!==0&&(this.Ln=[...new Set([...this.Ln,...e])],this.Vn().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Gn(e){this.Ln=this.Ln.filter((r=>r!==e));var n=this.Kn();n.includes(e)||this.Yn([...n,e])}Zn(e){var n=new Set(e);this.Ln=this.Ln.filter((i=>!n.has(i)));var r=this.Kn(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&this.Yn(s)}Kn(){var e,n=this.Xn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}getActivatedIds(){return[...new Set([...this.Kn(),...this.Ln])].filter((e=>!this.ts(e)))}reset(){this.Ln=[],this.Kn().length>0&&this.Yn([])}getEventToItemsMap(){return this.An}es(){return this.zn}}class FD extends jD{constructor(e){super(e)}Xn(){return uy}rs(){return Ui.SHOWN}Hn(e){var n;(n=this._instance)==null||n.getSurveys(e)}Qn(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Vn(){return yt}Yn(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[uy]:e})}ts(){return!1}Wn(e,n){var r;this.Hn((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a;return U6(i)&&!((a=i.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||i.schedule==="always"})(r);return s?e===Ui.SHOWN?"consume":"ignore":e===Ui.SHOWN?"persist":e===Ui.DISMISSED||e===Ui.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Rv="SDK is not enabled or survey functionality is not yet loaded",PE="Disabled. Not loading surveys.",VD=re!=null&&re.location?Jp(re.location.hash,"__posthog")||Jp(location.hash,"state"):null,TE="_postHogToolbarParams",RE=Lt("[Toolbar]"),cn=Lt("[FeatureFlags]"),ka=Lt("[FeatureFlags]",{debugEnabled:!0}),Av=`" failed. Feature flags didn't load in time.`,AE=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},IE=t=>{var e={};for(var n of lp(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},Pi=Lt("[Error tracking]"),ME="Refusing to render web experiment since the viewer is a likely bot",$D={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>nm(e,t),not_regex:(t,e)=>!nm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Gn{get Se(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{Gn.ns("retrieved web experiments from the server"),n.ss=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n.ss&&(Gn.ns("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.ss)==null||a.set(i.feature_flag_key,i));var u=n._instance.getFeatureFlag(i.feature_flag_key);_t(u)&&i.variants[u]&&n.os(i.name,u,i.variants[u].transforms)}else if(i.variants)for(var c in i.variants){var f=i.variants[c];Gn.ls(f,n._instance)&&n.os(i.name,c,f.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Gn.ns(ME);else if(!this.Se.disable_web_experiments){if(Xe(this.ss))return this.ss=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Gn.ns("applying feature flags",e),e.forEach((n=>{var r;if(this.ss&&(r=this.ss)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this.ss)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.os(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=Gn.getWindowLocation();if(e!=null&&e.search){var n=Mu(e==null?void 0:e.search,"__experiment_id"),r=Mu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Gn.ns("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.us(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Se.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.Se.token),method:"GET",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}us(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(Gn.ns("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.os(s[0].name,n,s[0].variants[n].transforms))}static ls(e,n){return!Xe(e.conditions)&&Gn.hs(e,n)&&Gn.ds(e)}static hs(e,n){var r;if(Xe(e.conditions)||Xe((r=e.conditions)==null?void 0:r.url))return!0;var s=Gn.getWindowLocation();if(s){var i,a,u,c=o6(n,s.href);return(i=e.conditions)==null||!i.url||$D[(a=(u=e.conditions)==null?void 0:u.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,c)}return!1}static getWindowLocation(){return re==null?void 0:re.location}static ds(e){var n;if(Xe(e.conditions)||Xe((n=e.conditions)==null?void 0:n.utm))return!0;var r=b6();if(r.utm_source){var s,i,a,u,c,f,h,p,v=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,y=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_source)==r.utm_source,x=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_medium||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_medium)==r.utm_medium,_=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return v&&x&&_&&y}return!1}static ns(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];ye.info("[WebExperiments] "+e,r)}os(e,n,r){this._is_bot()?Gn.ns(ME):n!=="control"?r.forEach((s=>{if(s.selector){var i;Gn.ns("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)}))}})):Gn.ns("Control variants leave the page unmodified.")}_is_bot(){return rr&&this._instance?V6(rr,this.Se.custom_blocked_useragents):void 0}}var ns=Lt("[Conversations]"),Ca="Conversations not available yet.",NE="console",$m={featureFlags:class{constructor(t){this.cs=!1,this.vs=!1,this.fs=!1,this.ps=!1,this.gs=!1,this.ys=!1,this.bs=!1,this._s=!1,this.ws=0,this.xs=()=>{var e=this.ks();this.ws=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],re&&Ht(re,"online",this.xs)}destroy(){re==null||re.removeEventListener("online",this.xs)}get Se(){return this._instance.config}get ni(){return this._instance.persistence}Ss(t){return this._instance.get_property(t)}Cs(){var t,e;return(t=(e=this.ni)==null?void 0:e.lr(this.Se.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Is(){return!!this.Cs()&&(this._s||this.fs||(this._s=!0,cn.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ts(){var t,e=(t=this.Se.evaluation_contexts)!==null&&t!==void 0?t:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.bs||(cn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.bs=!0),e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||cn.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}Ms(){return this.Ts().length>0}Es(){var t=this.Se.flag_keys;if(!_e(t)){if(et(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||cn.error("Invalid flag key found:",e,"Expected non-empty string"),n}));cn.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,n=this._instance.config,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i,a=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},u=Object.keys(r).filter((f=>!!r[f])).reduce(((f,h)=>(f[h]=r[h]||!1,f)),{}),c=Object.keys(a).filter((f=>u[f])).reduce(((f,h)=>(a[h]&&(f[h]=a[h]),f)),{});this.receivedFeatureFlags({featureFlags:u,featureFlagPayloads:c})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.Ss(Va))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.Ss(ap))!==null&&s!==void 0?s:{},u=fe({},i,t),c=fe({},a,e),f={};for(var h of Object.entries(u)){var p=h[0],v=h[1];f[p]={key:p,enabled:MS(v),variant:NS(v),reason:void 0,metadata:_e(c==null?void 0:c[p])?void 0:{id:0,version:void 0,description:void 0,payload:c[p]}}}this.receivedFeatureFlags({flags:f})}get hasLoadedFlags(){return this.vs}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Ss(oy),e=this.Ss(Oi),n=this.Ss(Yl);if(!n&&!e)return t||{};var r=Tt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var a,u,c=r[i],f=e==null?void 0:e[i],h=_e(f)?(a=c==null?void 0:c.enabled)!==null&&a!==void 0&&a:!!f,p=_e(f)?c.variant:typeof f=="string"?f:void 0,v=n==null?void 0:n[i],y=fe({},c,{enabled:h,variant:h?p??(c==null?void 0:c.variant):void 0});h!==(c==null?void 0:c.enabled)&&(y.original_enabled=c==null?void 0:c.enabled),p!==(c==null?void 0:c.variant)&&(y.original_variant=c==null?void 0:c.variant),v&&(y.metadata=fe({},c==null?void 0:c.metadata,{payload:v,original_payload:c==null||(u=c.metadata)==null?void 0:u.payload})),r[i]=y}return this.cs||(cn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.cs=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:MS(r),variant:NS(r),payload:IS(e[n])}}))}getFlagVariants(){var t=this.Ss(Va),e=this.Ss(Oi);if(!e)return t||{};for(var n=Tt({},t),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.cs||(cn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.cs=!0),n}getFlagPayloads(){var t=this.Ss(ap),e=this.Ss(Yl);if(!e)return t||{};for(var n=Tt({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.cs||(cn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.cs=!0),n}reloadFeatureFlags(){this.ps||this.Se.advanced_disable_feature_flags||this.ks()||this.Rs||(this._instance.Hi.emit("featureFlagsReloading",!0),this.Rs=setTimeout((()=>{this.Ps()}),5))}Os(){clearTimeout(this.Rs),this.Rs=void 0}ensureFlagsLoaded(){this.vs||this.fs||this.Rs||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ps=t}Ps(t){var e;if(this.Os(),!this._instance.Or()&&!this.ks())if(this.fs)this.gs=!0;else{var n=this.Se.token,r=this.Ss(Wp),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:fe({},((e=this.ni)==null?void 0:e.get_initial_props())||{},this.Ss(Oa)||{}),group_properties:this.Ss(Da),timezone:T6()};or(r)||_e(r)||(s.$device_id=r),(t!=null&&t.disableFlags||this.Se.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Ms()&&(s.evaluation_contexts=this.Ts());var i=this.Es();_e(i)||(s.flag_keys=i);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,u=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.fs=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this.Se.disable_compression?void 0:nr.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:c=>{var f,h,p,v=!0;if(this.Fs(c.statusCode),c.statusCode===200&&(this.gs||(this.$anon_distinct_id=void 0),v=!1),this.fs=!1,!s.disable_flags||this.gs){this.ys=!v;var y=[];c.error?c.error instanceof Error?y.push(c.error.name==="AbortError"?"timeout":"connection_error"):y.push("unknown_error"):c.statusCode!==200&&y.push("api_error_"+c.statusCode),(f=c.json)!=null&&f.errorsWhileComputingFlags&&y.push("errors_while_computing_flags");var x,_=!((h=c.json)==null||(h=h.quotaLimited)==null||!h.includes("feature_flags"));_&&y.push("quota_limited"),(p=this.ni)==null||p.register({[dy]:y}),_?cn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(s.disable_flags||this.receivedFeatureFlags((x=c.json)!==null&&x!==void 0?x:{},v,{partialResponse:a}),this.gs&&(this.gs=!1,this.Ps()))}}})}}ks(){return x6(this.ws,3)}Fs(t){this.ws=w6(t,this.ws,3,(()=>cn.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.ys)if(this.vs||this.getFlags()&&this.getFlags().length>0){if(!this.Is()){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 cn.warn('getFeatureFlag for key "'+t+Av)}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.ys)if(this.vs||this.getFlags()&&this.getFlags().length>0){if(!this.Is()){var n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],a=String(s),u=this.Ss(ay)||void 0,c=this.Ss(Td)||void 0,f=this.Ss(cd)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var h,p=this._instance.get_session_id(),v=this.Ss(cy);p&&p!==v&&(f={},(h=this.ni)==null||h.register({[cd]:f,[cy]:p}))}if((e.send_event||!("send_event"in e))&&(!(t in f)||!f[t].includes(a))){var y,x,_,b,E,C,P,T,R,O;et(f[t])?f[t].push(a):f[t]=[a],(y=this.ni)==null||y.register({[cd]:f});var M=this.getFeatureFlagDetails(t),A=[...(x=this.Ss(dy))!==null&&x!==void 0?x:[]];_e(s)&&A.push("flag_missing");var N={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i||null,$feature_flag_request_id:u,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((_=this.Se.bootstrap)==null||(_=_.featureFlags)==null?void 0:_[t])||null,$feature_flag_bootstrapped_payload:((b=this.Se.bootstrap)==null||(b=b.featureFlagPayloads)==null?void 0:b[t])||null,$used_bootstrap_value:!this.ys};_e(M==null||(E=M.metadata)==null?void 0:E.version)||(N.$feature_flag_version=M.metadata.version);var D,j=(C=M==null||(P=M.reason)==null?void 0:P.description)!==null&&C!==void 0?C:M==null||(T=M.reason)==null?void 0:T.code;j&&(N.$feature_flag_reason=j),M!=null&&(R=M.metadata)!=null&&R.id&&(N.$feature_flag_id=M.metadata.id),_e(M==null?void 0:M.original_variant)&&_e(M==null?void 0:M.original_enabled)||(N.$feature_flag_original_response=_e(M.original_variant)?M.original_enabled:M.original_variant),M!=null&&(O=M.metadata)!=null&&O.original_payload&&(N.$feature_flag_original_payload=M==null||(D=M.metadata)==null?void 0:D.original_payload),A.length&&(N.$feature_flag_error=A.join(",")),this._instance.capture("$feature_flag_called",N)}if(r)return{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:IS(i)}}}else cn.warn('getFeatureFlagResult for key "'+t+Av)}getRemoteConfigPayload(t,e){var n=this.Se.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.Ms()&&(r.evaluation_contexts=this.Ts());var s=this.Es();_e(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Se.disable_compression?void 0:nr.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback(i){var a,u=(a=i.json)==null?void 0:a.featureFlagPayloads;e((u==null?void 0:u[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),!e.fresh||this.ys){if(this.vs||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(t,e);return _e(n)?void 0:!!n}cn.warn('isFeatureEnabled for key "'+t+Av)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.ni){this.vs=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(a,u,c,f,h,p){c===void 0&&(c={}),f===void 0&&(f={}),h===void 0&&(h={});var v=(A=>{var N=A.flags;return N?(A.featureFlags=Object.fromEntries(Object.keys(N).map((D=>{var j;return[D,(j=N[D].variant)!==null&&j!==void 0?j:N[D].enabled]}))),A.featureFlagPayloads=Object.fromEntries(Object.keys(N).filter((D=>N[D].enabled)).filter((D=>{var j;return(j=N[D].metadata)==null?void 0:j.payload})).map((D=>{var j;return[D,(j=N[D].metadata)==null?void 0:j.payload]})))):A.featureFlags&&cn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),A})(a),y=v.flags,x=v.featureFlags,_=v.featureFlagPayloads;if(x){var b=a.requestId,E=a.evaluatedAt;if(et(x)){cn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var C={};if(x)for(var P=0;x.length>P;P++)C[x[P]]=!0;u&&u.register({[op]:x,[Va]:C})}else{var T=x,R=_,O=y;if(p!=null&&p.partialResponse)T=fe({},c,T),R=fe({},f,R),O=fe({},h,O);else if(a.errorsWhileComputingFlags)if(y){var M=new Set(Object.keys(y).filter((A=>{var N;return!((N=y[A])!=null&&N.failed)})));T=fe({},c,Object.fromEntries(Object.entries(T).filter((A=>M.has(A[0]))))),R=fe({},f,Object.fromEntries(Object.entries(R||{}).filter((A=>M.has(A[0]))))),O=fe({},h,Object.fromEntries(Object.entries(O||{}).filter((A=>M.has(A[0])))))}else T=fe({},c,T),R=fe({},f,R),O=fe({},h,O);u&&u.register(fe({[op]:Object.keys(IE(T)),[Va]:T||{},[ap]:R||{},[oy]:O||{}},b?{[ay]:b}:{},E?{[Td]:E}:{}))}}})(t,this.ni,r,s,i,n),e||(this._s=!1),this.Ls(e)}}override(t,e){e===void 0&&(e=!1),cn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ni)return cn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.ni.unregister(Oi),this.ni.unregister(Yl),this.Ls(),ka.info("All overrides cleared");if(et(t)){var e=AE(t);return this.ni.register({[Oi]:e}),this.Ls(),ka.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.cs=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.ni.unregister(Oi),ka.info("Flag overrides cleared");else if(r.flags){if(et(r.flags)){var s=AE(r.flags);this.ni.register({[Oi]:s})}else this.ni.register({[Oi]:r.flags});ka.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.ni.unregister(Yl),ka.info("Payload overrides cleared")):r.payloads&&(this.ni.register({[Yl]:r.payloads}),ka.info("Payload overrides set",{payloads:r.payloads}))),void this.Ls()}if(t&&typeof t=="object")return this.ni.register({[Oi]:t}),this.Ls(),ka.info("Flag overrides set",{flags:t});cn.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.vs){var e=this.As(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){cn.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r,s=(this.Ss(rd)||[]).find((c=>c.flagKey===t)),i={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(a.$early_access_feature_name=s.name),n&&(a.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(i,!1);var u=fe({},this.getFlagVariants(),{[t]:e});(r=this.ni)==null||r.register({[op]:Object.keys(IE(u)),[Va]:u}),this.Ls()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.Ss(rd),s=n?"&"+n.map((i=>"stage="+i)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+s),method:"GET",callback:i=>{var a,u;if(i.json){var c=i.json.earlyAccessFeatures;return(a=this.ni)==null||a.unregister(rd),(u=this.ni)==null||u.register({[rd]:c}),t(c)}}})}As(){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)),{})}}Ls(t){var e=this.As(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){cn.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.Ss(Oa)||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in n||(i[a]=s[a]));this._instance.register({[Oa]:fe({},n,i,r)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=fe({},this.Ss(Oa)||{});t.forEach((r=>{delete n[r]})),this._instance.register({[Oa]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(Oa),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.Ss(Da)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=fe({},n[r],t[r]),delete t[r]})),this._instance.register({[Da]:fe({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Ss(Da)||{};this._instance.register({[Da]:fe({},e,{[t]:{}})})}else this._instance.unregister(Da)}reset(){this.vs=!1,this.fs=!1,this.ps=!1,this.gs=!1,this.ys=!1,this.$anon_distinct_id=void 0,this.Os(),this.cs=!1,this.ws=0}}},HD={sessionRecording:class{get Se(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var t;return!((t=this.$s)==null||!t.isStarted)}get status(){var t,e;return this.Ns===Wc||this.Ns===Dh?this.Ns:(t=(e=this.$s)==null?void 0:e.status)!==null&&t!==void 0?t:this.Ns}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ns=SE,this.Ds=void 0,this._instance=t,!this._instance.sessionManager)throw Ci.error("started without valid sessionManager"),new Error(Py+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===zi)throw new Error(Py+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get qs(){var t,e=!((t=this._instance.get_property(za))==null||!t.enabled),n=!this.Se.disable_session_recording,r=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return re&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this.qs||(e=this.$s)==null||!e.isStarted){var n=!_e(Object.assign)&&!_e(Array.from);this.qs&&n?(this.js(t),Ci.info("starting")):(this.Ns=SE,this.stopRecording())}}js(t){var e,n,r;this.qs&&(this.Ns!==Wc&&this.Ns!==Dh&&(this.Ns=EE),$e!=null&&(e=$e.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=$e.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Hs(t):(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Bs,(s=>{if(s)return Ci.error("could not load recorder",s);this.Hs(t)})))}stopRecording(){var t,e;(t=this.Ds)==null||t.call(this),this.Ds=void 0,(e=this.$s)==null||e.stop()}Us(){var t,e;(t=this.Ds)==null||t.call(this),this.Ds=void 0,(e=this.$s)==null||e.discard()}zs(){var t,e;(t=this.ni)==null||t.unregister(r2),(e=this.ni)==null||e.unregister(Z8)}Vs(t,e){if(Xe(t))return null;var n,r=Fn(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Ci.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Ws(t){if(this.ni){var e,n,r=this.ni,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,u=this.Vs((i=this.Se.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.Vs(a==null?void 0:a.sampleRate,"remote config sampleRate"),f=u??c;Xe(f)&&this.zs();var h=a==null?void 0:a.minimumDurationMilliseconds;r.register({[za]:fe({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:fe({capturePerformance:t.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:f,minimumDurationMilliseconds:_e(h)?null:h,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers,version:a==null?void 0:a.version,triggerGroups:a==null?void 0:a.triggerGroups})})};s(),(e=this.Ds)==null||e.call(this),this.Ds=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?t.sessionRecording===!1?(this.Ws(t),void this.Us()):(this.Ws(t),void this.startIfEnabledOrStop()):(this.Ns===Wc&&(this.Ns=Dh,Ci.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.$s)!=null&&n.log?this.$s.log(t,e):Ci.warn("log called before recorder was ready")}get Bs(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(za);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Zs(){var t,e,n=this._instance.get_property(za);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(s){return Ci.warn("persisted remote config for session recording is invalid and will be ignored",s),!1}var r=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-r}Hs(t){var e,n;if((e=$e.__PosthogExtensions__)==null||!e.initSessionRecording)return Ci.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[r6]:!0});if(this.$s||(this.$s=(n=$e.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.$s._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Zs())return this.Ns===Dh||this.Ns===Wc?void 0:(this.Ns=Wc,Ci.info("persisted remote config is stale, requesting fresh config before starting"),void new R6(this._instance).load());this.Ns=EE,this.$s.start(t)}onRRwebEmit(t){var e;(e=this.$s)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.$s||(e=this.ni)==null||e.register({[X8]:!0}),(t=this.$s)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.$s||(e=this.ni)==null||e.register({[Y8]:!0}),(t=this.$s)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.$s||(n=this.ni)==null||n.register({[t==="url"?Q8:J8]:!0}),(e=this.$s)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.$s)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.$s)==null||!n.tryAddCustomEvent(t,e))}}},zD={autocapture:class{constructor(t){this.Gs=!1,this.Qs=null,this.Js=!1,this.instance=t,this.rageclicks=new xE(t.config.rageclick),this.Ks=null}initialize(){this.startIfEnabled()}get Se(){var t,e,n=Ot(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((r=>new RegExp(r))),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map((r=>new RegExp(r))),n}Ys(){if(this.isBrowserSupported()){if(re&&Se){var t=n=>{n=n||(re==null?void 0:re.event);try{this.Xs(n)}catch(r){kv.error("Failed to capture event",r)}};if(Ht(Se,"submit",t,{capture:!0}),Ht(Se,"change",t,{capture:!0}),Ht(Se,"click",t,{capture:!0}),this.Se.capture_copied_text){var e=n=>{n=n||(re==null?void 0:re.event);try{this.Xs(n,Ev)}catch(r){kv.error("Failed to capture copy/cut event",r)}};Ht(Se,"copy",e,{capture:!0}),Ht(Se,"cut",e,{capture:!0})}}}else kv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Gs&&(this.Ys(),this.Gs=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Js=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[J1]:!!t.autocapture_opt_out}),this.Qs=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Ks=t}getElementSelectors(t){var e,n=[];return(e=this.Ks)==null||e.forEach((r=>{var s=Se==null?void 0:Se.querySelectorAll(r);s==null||s.forEach((i=>{t===i&&n.push(r)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[J1];if(or(this.Qs)&&!ii(n)&&!this.instance.Or())return!1;var r=(e=this.Qs)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!r}Xs(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=mv(t);a6(r)&&(r=r.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&JS(r,this.instance.config.rageclick)&&this.Xs(t,"$rageclick");var s=e===Ev;if(r&&(function(p,v,y,x,_,b){var E,C,P,T,R,O;if(y===void 0&&(y=void 0),!re||l2(p)||(E=y)!=null&&E.url_allowlist&&!YS(y.url_allowlist,b)||(C=y)!=null&&C.url_ignorelist&&YS(y.url_ignorelist,b))return!1;if((P=y)!=null&&P.dom_event_allowlist){var M=y.dom_event_allowlist;if(M&&!M.some((W=>v.type===W)))return!1}var A=h6(p,x),N=A.parentIsUsefulElement,D=A.targetElementList;if(!(function(W,Y){var K=Y==null?void 0:Y.element_allowlist;if(_e(K))return!0;var B,X=function(te){if(K.some((H=>te.tagName.toLowerCase()===H)))return{v:!0}};for(var $ of W)if(B=X($))return B.v;return!1})(D,y)||!vy(D,(T=y)==null?void 0:T.css_selector_allowlist)||vy(D,(R=(O=y)==null?void 0:O.css_selector_ignorelist)!==null&&R!==void 0?R:zO))return!1;try{var j=re.getComputedStyle(p);if(j&&j.getPropertyValue("cursor")==="pointer"&&v.type==="click")return!0}catch{}var V=p.tagName.toLowerCase();switch(V){case"html":return!1;case"form":return(_||["submit"]).indexOf(v.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(v.type)>=0;default:return N?(_||["click"]).indexOf(v.type)>=0:(_||["click"]).indexOf(v.type)>=0&&(a2.indexOf(V)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,this.Se,s,s?["copy","cut"]:void 0,this.instance)){var i=MD(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Js,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=i.props;if(i.explicitNoCapture)return!1;var u=this.getElementSelectors(r);if(u&&u.length>0&&(a.$element_selectors=u),e===Ev){var c,f=c6(re==null||(c=re.getSelection())==null?void 0:c.toString()),h=t.type||"clipboard";if(!f)return!1;a.$selected_content=f,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Ps(Se==null?void 0:Se.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.eo=(re==null||(e=re.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(ye.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ro&&this.ro(),this.ro=void 0,ye.info("History API monitoring stopped")}monitorHistoryChanges(){re&&re.history&&(this.io("pushState"),this.io("replaceState"),this.no())}io(t){var e;if(re&&((e=re.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,i){try{if(!(s in r))return wE;var a={next:r[s]},u=i((function(){for(var c=arguments.length,f=new Array(c),h=0;c>h;h++)f[h]=arguments[h];return a.next.apply(this,f)}));return Ps(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];Ps(c)&&c.__posthog_layer__;){var f=c.__posthog_layer__;if(f.next===u)return void(f.next=a.next);c=f.next}else r[s]=a.next}}catch{return wE}})(re.history,t,(r=>function(s,i,a){r.call(this,s,i,a),n.so(t)}))}}so(t){try{var e,n=re==null||(e=re.location)==null?void 0:e.pathname;if(!n)return;n!==this.eo&&this.isEnabled&&this._instance.capture(Xl,{navigation_type:t}),this.eo=n}catch(r){ye.error("Error capturing "+t+" pageview",r)}}no(){if(!this.ro){var t=()=>{this.so("popstate")};Ht(re,"popstate",t),this.ro=()=>{re&&re.removeEventListener("popstate",t)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(t){var e;this.oo=!1,this.Gs=!1,this.ao=null,this.instance=t,this.oo=!((e=this.instance.persistence)==null||!e.props[ey]),this.rageclicks=new xE(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Ot(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(t=this.Se.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Xe(this.Se.capture_heatmaps)?Xe(this.Se.enable_heatmaps)?this.oo:this.Se.enable_heatmaps:this.Se.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Gs)return;OD.info("starting..."),this.lo(),this.ke()}else{var t;clearInterval((t=this.ao)!==null&&t!==void 0?t:void 0),this.uo(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ey]:e}),this.oo=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}ho(t){this.fe(t.originalEvent,"deadclick")}ke(){this.ao&&clearInterval(this.ao),this.ao=(Se==null?void 0:Se.visibilityState)==="visible"?setInterval(this.Zr.bind(this),this.flushIntervalMilliseconds):null}lo(){re&&Se&&(this.do=this.Zr.bind(this),Ht(re,Yp,this.do),this.co=t=>this.fe(t||(re==null?void 0:re.event)),Ht(Se,"click",this.co,{capture:!0}),this.vo=t=>this.fo(t||(re==null?void 0:re.event)),Ht(Se,"mousemove",this.vo,{capture:!0}),this.po=new nE(this.instance,YO,this.ho.bind(this)),this.po.startIfEnabledOrStop(),this.mo=this.ke.bind(this),Ht(Se,Zp,this.mo),this.Gs=!0)}uo(){var t;re&&Se&&(this.do&&re.removeEventListener(Yp,this.do),this.co&&Se.removeEventListener("click",this.co,{capture:!0}),this.vo&&Se.removeEventListener("mousemove",this.vo,{capture:!0}),this.mo&&Se.removeEventListener(Zp,this.mo),clearTimeout(this.yo),(t=this.po)==null||t.stop(),this.Gs=!1)}bo(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 f=a;f&&Go(f)&&!Hr(f,"body");){if(f===c)return!1;var h=void 0;try{var p,v,y;h=(p=(v=(y=f.ownerDocument)==null?void 0:y.defaultView)!==null&&v!==void 0?v:re)==null?void 0:p.getComputedStyle(f).position}catch{return!1}if(Be(u,h))return!0;f=d6(f)}return!1})(mv(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}fe(t,e){var n;if(e===void 0&&(e="click"),!ZS(t.target)&&kE(t)){var r=this.bo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&JS(mv(t),this.instance.config.rageclick)&&this.Wt(fe({},r,{type:"rageclick"})),this.Wt(r)}}fo(t){!ZS(t.target)&&kE(t)&&(clearTimeout(this.yo),this.yo=setTimeout((()=>{this.Wt(this.bo(t,"mousemove"))}),500))}Wt(t){if(re){var e=this.Se.disable_capture_url_hashes?Wo(re.location.href):re.location.href,n=this.Se.custom_personal_data_properties,r=this.Se.mask_personal_data_properties?[...Nu,...n||[]]:[],s=Id(e,r,Md);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(t)}}Zr(){this.R&&!Lo(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:nE,webVitalsAutocapture:class{constructor(t){var e;this.oo=!1,this.Gs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this._o=()=>{clearTimeout(this.wo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>fe({},n,{["$web_vitals_"+r.name+"_event"]:fe({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.xo=n=>{var r;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.ko();if(!_e(s))if(Xe(n==null?void 0:n.name)||Xe(n==null?void 0:n.value))Ea.error("Invalid metric received",n);else if(!this.So||this.So>n.value){this.R.url!==s&&(this._o(),this.wo=setTimeout(this._o,this.flushToCaptureTimeoutMs)),_e(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=_e(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var i=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),a=fe({},n,{$current_url:s,timestamp:Date.now()});_e(i)||(a.$session_id=i.sessionId,a.$window_id=i.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this._o()}else Ea.error("Ignoring metric with value >= "+this.So,n)},this.Co=()=>{if(!this.Gs){var n,r,s,i,a=$e.__PosthogExtensions__;if(!_e(a)&&!_e(a.postHogWebVitalsCallbacks)){var u=a.postHogWebVitalsCallbacks;n=u.onLCP,r=u.onCLS,s=u.onFCP,i=u.onINP}n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.xo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.xo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.xo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.xo.bind(this)),this.Gs=!0):Ea.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.oo=!((e=this._instance.persistence)==null||!e.props[sy]),this.startIfEnabled()}get Io(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=Ot(this.Io)?(t=this.Io)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Xe(n)?((e=this._instance.persistence)==null?void 0:e.props[iy])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Ot(this.Io)?this.Io.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Ot(this.Io)?this.Io.web_vitals_attribution:void 0;return t!=null&&t}get So(){var t=Ot(this.Io)&&Fn(this.Io.__web_vitals_max_value)?this.Io.__web_vitals_max_value:bE;return t>0&&6e4>=t?bE:t}get isEnabled(){var t=on==null?void 0:on.protocol;if(t!=="http:"&&t!=="https:")return Ea.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ot(this.Io)?this.Io.web_vitals:ii(this.Io)?this.Io:void 0;return ii(e)?e:this.oo}startIfEnabled(){this.isEnabled&&!this.Gs&&(Ea.info("enabled, starting..."),this.Ue(this.Co))}onRemoteConfig(t){if("capturePerformance"in t){var e=Ot(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=Ot(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[sy]:e}),this._instance.persistence.register({[iy]:n})),this.oo=e,this.startIfEnabled()}}Ue(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?Ea.error("failed to load script",r):t()}))}ko(){var t=re?this._instance.config.disable_capture_url_hashes?Wo(re.location.href):re.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Nu,...e||[]]:[];return Id(t,n,Md)}Ea.error("Could not determine current URL")}}},UD={exceptionObserver:class{constructor(t){var e,n,r,s,i,a;this.Co=()=>{var u;if(re&&this.isEnabled&&(u=$e.__PosthogExtensions__)!=null&&u.errorWrappingFunctions){var c=$e.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,f=$e.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,h=$e.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.To&&this.Se.capture_unhandled_errors&&(this.To=c(this.captureException.bind(this))),!this.Mo&&this.Se.capture_unhandled_rejections&&(this.Mo=f(this.captureException.bind(this))),!this.Eo&&this.Se.capture_console_errors&&(this.Eo=h(this.captureException.bind(this)))}catch(p){Bc.error("failed to start",p),this.Ro()}}},this._instance=t,this.Po=!((e=this._instance.persistence)==null||!e.props[ty]),this.Oo=new BN(fe({},((n=this._instance.config.error_tracking)===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}),{refillInterval:1e4,it:Bc})),this.Se=this.Fo(),this.startIfEnabledOrStop()}Fo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ot(t)?e=fe({},e,t):(_e(t)?this.Po:t)&&(e=fe({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Bc.info("enabled"),this.Ro(),this.Ue(this.Co)):this.Ro()}Ue(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return Bc.error("failed to load script",r);t()}))}Ro(){var t,e,n;(t=this.To)==null||t.call(this),this.To=void 0,(e=this.Mo)==null||e.call(this),this.Mo=void 0,(n=this.Eo)==null||n.call(this),this.Eo=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.Po=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[ty]:this.Po}),this.Se=this.Fo(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.Fo()}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.Oo.consumeRateLimit(s)?Bc.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.Lo=[],this.Ao=new aO([new mO,new EO,new vO,new gO,new bO,new wO,new _O,new SO],(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 f=[],h=u.split(`
|
|
18
|
+
`),p=c;h.length>p;p++){var v=h[p];if(1024>=v.length){var y=WS.test(v)?v.replace(WS,"$1"):v;if(!y.match(/\S*Error: /)){for(var x of i){var _=x(y,r);if(_){f.push(_);break}}if(f.length>=50)break}}}return(function(b){if(!b.length)return[];var E=Array.from(b);return E.reverse(),E.slice(0,50).map((C=>{return fe({},C,{filename:C.filename||(P=E,P[P.length-1]||{}).filename,function:C.function||Iu});var P}))})(f)}})("web:javascript",dO,pO)),this._instance=t,this.Lo=(e=(n=this._instance.persistence)==null?void 0:n.get_property(ny))!==null&&e!==void 0?e:[],this.$o=Bp(this.No()),this.Do=new CO(this.$o)}onConfigChange(){this.$o=Bp(this.No()),this.Do.setConfig(this.$o)}onRemoteConfig(t){var e,n,r;if("errorTracking"in t){var s=(e=(n=t.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],i=(r=t.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Lo=s,this._instance.persistence&&this._instance.persistence.register({[ny]:this.Lo,[ry]:i})}}get qo(){var t,e=!!this._instance.get_property(ry),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Ao.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.$o.enabled)try{if(!_t(t)||t.trim().length===0)return void Pi.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)=>kO.has(c)?(a.push(c),u):(u[c]=i[c],u)),{}),droppedKeys:a}})(this.jo(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&Pi.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Do.add(fe({[zp]:t,[Up]:new Date().toISOString()},r))}catch(i){Pi.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Ho(e)){if(this.Bo(e))return this.Uo("Exception dropped: matched a suppression rule"),void Pi.info("Skipping exception capture because a suppression rule matched");if(!this.qo&&this.zo(e))return this.Uo("Exception dropped: thrown by a browser extension"),void Pi.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Vo(e))return this.Uo("Exception dropped: thrown by the PostHog SDK"),void Pi.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.$o.enabled&&Xe(t.$exception_steps)?this.Wo(t):t;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",hn:!0});return r&&this.Do.clear(),r}catch(s){return Pi.error("Failed to capture exception event. Dropping this exception.",s),void this.Do.clear()}}catch(s){return void Pi.error("Failed to process exception event. Ignoring this exception.",s)}}Wo(t){try{var e=this.Do.getAttachable();return e.length===0?t:fe({},t,{$exception_steps:e})}catch(n){return Pi.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}Uo(t){this.$o.enabled&&this.Do.add({[zp]:t,[Up]:new Date().toISOString()})}jo(t){return Ot(t)?fe({},t):{}}No(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}Bo(t){if(t.length===0)return!1;var e=t.reduce(((n,r)=>{var s=r.type,i=r.value;return _t(s)&&s.length>0&&n.$exception_types.push(s),_t(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.Lo.some((n=>{var r=n.values.map((s=>{var i,a=H6[s.operator],u=et(s.value)?s.value:[s.value],c=(i=e[s.key])!==null&&i!==void 0?i:[];return u.length>0&&a(u,c)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}zo(t){return t.flatMap((e=>{var n,r;return(n=(r=e.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}Vo(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}Ho(t){return!Xe(t)&&et(t)}}},BD=fe({productTours:class{get ni(){return this._instance.persistence}constructor(t){this.Zo=null,this.Go=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if("productTours"in t){var e,n;if(this.ni&&this.ni.register({[n2]:!!t.productTours}),!Tv(this._instance))return!this.Zo&&Xe((e=this.ni)==null?void 0:e.props[sd])||Pv.info("product tours disabled; stopping and clearing cached tours"),(n=this.Zo)==null||n.stop(),this.Zo=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Zo&&Tv(this._instance)&&this.Ue((()=>this.Qo()))}Ue(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?Pv.error("Could not load product tours script",r):t()}))}Qo(){var t;!this.Zo&&(t=$e.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.Zo=$e.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!et(this.Go)||e){var n=this.ni;if(n){var r=n.props[sd];if(et(r)&&!e)return this.Go=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{if(Tv(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return Pv.error(a),void t([],{isLoaded:!1,error:a})}var u=et(s.json.product_tours)?s.json.product_tours:[];this.Go=u,n&&n.register({[sd]:u}),t(u,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Go,{isLoaded:!0})}getActiveProductTours(t){Xe(this.Zo)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Zo.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Zo)==null||e.showTourById(t)}previewTour(t){this.Zo?this.Zo.previewTour(t):this.Ue((()=>{var e;this.Qo(),(e=this.Zo)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.Zo)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Zo)==null||t.nextStep()}previousStep(){var t;(t=this.Zo)==null||t.previousStep()}clearCache(){var t;this.Go=null,(t=this.ni)==null||t.unregister(sd)}resetTour(t){var e;(e=this.Zo)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.Zo)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Zo)==null||e.cancelPendingTour(t)}}},$m),WD={siteApps:class{constructor(t){this.Jo=0,this._instance=t,this.Ko=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Yo(t,e){if(e){var n=this.globalsForEvent(e);this.Ko.push(n),this.Ko.length>1e3&&(this.Ko=this.Ko.slice(10))}}get siteAppLoaders(){var t;return(t=$e._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.Yo.bind(this));this.Xo=()=>{t(),this.Ko=[],this.Xo=void 0}}}globalsForEvent(t){var e,n,r,s,i,a,u;if(!t)throw new Error("Event payload is required");var c={},f=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(h)){var v=p[0];c[v]={id:f[v],type:v,properties:p[1]}}var y=t.$set_once,x=t.$set;return{event:fe({},m8(t,DD),{properties:fe({},t.properties,x?{$set:fe({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},x)}:{},y?{$set_once:fe({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},y)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(u=t.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}ta(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)||(Us.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)||(Us.error("prepare_external_dependency_script returned null"),null):t}ea(){var t,e,n,r,s,i,a,u;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var c=Se==null?void 0:Se.defaultView,f=c==null||(t=c.Node)==null?void 0:t.prototype;if(!c||!f)return()=>{};if(this.Jo++,this.ra)return this.ia();var h=[],p=this,v=new WeakSet,y=(b,E,C)=>{if(b!=null&&b[E]){var P=b[E];b[E]=C(P),h.push((()=>{b[E]=P}))}},x=b=>{if(v.has(b))return b;var E=p.ta(b);return E&&v.add(E),E},_=b=>b.map((E=>typeof E=="string"?E:x(E))).filter((E=>!or(E)));return y(f,"appendChild",(b=>function(E){var C=x(E);return C?b.call(this,C):E})),y(f,"insertBefore",(b=>function(E,C){var P=x(E);return P?b.call(this,P,C):E})),y(f,"replaceChild",(b=>function(E,C){var P=x(E);return P?b.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((b=>{y(b,"append",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(b,"prepend",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))}))})),[(s=c.Element)==null?void 0:s.prototype,(i=c.CharacterData)==null?void 0:i.prototype,(a=c.DocumentType)==null?void 0:a.prototype].forEach((b=>{y(b,"before",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(b,"after",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(b,"replaceWith",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];var R=_(P);return P.length&&!R.length?void 0:E.apply(this,R)}))})),y((u=c.Element)==null?void 0:u.prototype,"insertAdjacentElement",(b=>function(E,C){var P=x(C);return P?b.call(this,E,P):null})),this.ra=()=>{h.forEach((b=>b())),this.ra=void 0},this.ia()}ia(){var t=!1;return()=>{var e;t||(t=!0,this.Jo--,this.Jo===0&&((e=this.ra)==null||e.call(this)))}}na(t,e){e===void 0&&(e=!0);var n=this.ea();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.Ko.length&&(Us.info("Processing "+this.Ko.length+" events for site app with id "+t.id),this.Ko.forEach((u=>this.na((()=>e.processEvent==null?void 0:e.processEvent(u))))),e.processedBuffer=!0),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((a=this.Xo)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,Us.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var i=this.na((a=>t.init({posthog:this._instance,callback(u){a(),s(u)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(a){Us.error(CE+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){Us.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}sa(){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)}oa(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.na((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){Us.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.sa(),void this._instance.on("eventCaptured",(u=>this.oa(u)))):void Us.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Xo)==null||n.call(this),(r=t.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(){var u,c=a.id,f=a.url;$e["__$$ph_site_app_"+c]=s._instance,(u=$e.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,f,(h=>{if(h)return Us.error(CE+c,h)}))};for(var a of t.siteApps)i()}else Us.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},GD={tracingHeaders:class{constructor(t){this.aa=void 0,this.la=void 0,this.ua=void 0,this.Co=()=>{var e,n,r=this.ha();r?(_e(this.aa)&&(this.aa=(e=$e.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),_e(this.la)&&(this.la=(n=$e.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ro()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Ue(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return ND.error("failed to load script",r);t()}))}da(){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}ha(){var t=this.da();return et(t)?(et(this.ua)?this.ua.splice(0,this.ua.length,...t):this.ua=[...t],t.length>0?this.ua:void 0):(et(this.ua)&&this.ua.splice(0),this.ua=t||void 0,this.ua)}Ro(){var t,e;(t=this.aa)==null||t.call(this),(e=this.la)==null||e.call(this),this.aa=void 0,this.la=void 0}startIfEnabledOrStop(){this.ha()?this.Ue(this.Co):this.Ro()}}},KD=fe({surveys:class{get Se(){return this._instance.config}constructor(t){this.ca=void 0,this._surveyManager=null,this.va=!1,this.fa=[],this.pa=null,this.ga=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Se.disable_surveys){var e=t.surveys;if(Xe(e))return yt.warn("Flags not loaded yet. Not loading surveys.");var n=et(e);this.ca=n?e.length>0:e,yt.info("flags response received, isSurveysEnabled: "+this.ca),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(B6)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.va)yt.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)yt.info(PE);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())yt.info("Not loading surveys in cookieless mode without consent.");else{var t=$e==null?void 0:$e.__PosthogExtensions__;if(t){if(!_e(this.ca)||this.Se.advanced_enable_surveys){var e=this.ca||this.Se.advanced_enable_surveys;this.va=!0;try{var n=t.generateSurveys;if(n)return void this.ma(n,e);var r=t.loadExternalDependency;if(!r)return void this.ya(s2);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.ya("Could not load surveys script",s):this.ma(t.generateSurveys,e)}))}catch(s){throw this.ya("Error initializing surveys",s),s}finally{this.va=!1}}}else yt.error("PostHog Extensions not found.")}}ma(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new FD(this._instance),yt.info("Surveys loaded successfully"),this.ba({isLoaded:!0})}ya(t,e){yt.error(t,e),this.ba({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.fa.push(t),this._surveyManager&&this.ba({isLoaded:!0}),()=>{this.fa=this.fa.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Se.disable_surveys)return yt.info(PE),t([]);var n,r=this._instance.get_property(ly);if(r&&!e)return t(r,{isLoaded:!0}),void(this._a()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.pa?this.pa.then((s=>t(s.surveys,s.context))):(typeof Promise<"u"&&(this.pa=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:s=>{var i;this.pa=null;var a=s.statusCode;if(a!==200||!s.json){var u="Surveys API could not be loaded, status: "+a;yt.error(u),this.ga=Date.now();var c={isLoaded:!1,error:u};return t([],c),void(n==null||n({surveys:[],context:c}))}this.ga=null;var f,h=s.json.surveys||[],p=h.filter((y=>(function(x){return!(!x.start_date||x.end_date)})(y)&&(U6(y)||(function(x){var _;return!((_=x.conditions)==null||(_=_.actions)==null||(_=_.values)==null||!_.length)})(y))));p.length>0&&((f=this._surveyEventReceiver)==null||f.register(p)),(i=this._instance.persistence)==null||i.register({[ly]:h,[Gp]:Date.now()});var v={isLoaded:!0};t(h,v),n==null||n({surveys:h,context:v})}}))}_a(){return this.wa()&&!this.pa&&!this.xa()}wa(){var t=this._instance.get_property(Gp);return Fn(t)&&Date.now()-t>3e5}xa(){return Fn(this.ga)&&3e5>Date.now()-this.ga}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};W6(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}ba(t){for(var e of this.fa)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){yt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!Xe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);yt.warn("init was not called")}ka(t){var e=null;return this.getSurveys((n=>{var r;e=(r=n.find((s=>s.id===t)))!==null&&r!==void 0?r:null})),e}Sa(t){if(Xe(this._surveyManager))return{eligible:!1,reason:Rv};var e=typeof t=="string"?this.ka(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Xe(this._surveyManager))return yt.warn("init was not called"),{visible:!1,disabledReason:Rv};var e=this.Sa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Xe(this._surveyManager)?(yt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Rv})):new Promise((n=>{this.getSurveys((r=>{var s,i=(s=r.find((u=>u.id===t)))!==null&&s!==void 0?s:null;if(i){var a=this.Sa(i);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(Xe(this._surveyManager))yt.warn("init was not called");else{var s=typeof t=="string"?this.ka(t):t;if(s!=null&&s.id)if(ED.includes(s.type)){var i=Se==null?void 0:Se.querySelector(e);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(yt.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,u;yt.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.renderSurvey(s,i,n),yt.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);yt.warn("Survey element not found")}else yt.warn("Surveys of type "+s.type+" cannot be rendered in the app");else yt.warn("Survey not found")}}displaySurvey(t,e){var n;if(Xe(this._surveyManager))yt.warn("init was not called");else{var r=this.ka(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=fe({},r,{appearance:fe({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==_y.Popover&&e.initialResponses&&yt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.canRenderSurvey(r);if(!i.visible)return void yt.warn("Survey is not eligible to be displayed: ",i.disabledReason)}e.displayType!==_y.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else yt.warn("Survey not found")}}cancelPendingSurvey(t){Xe(this._surveyManager)?yt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},$m),qD={toolbar:class{constructor(t){this.instance=t}Ca(t){$e.ph_toolbar_state=t}Ia(){var t;return(t=$e.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),s6(this.instance.config)||!re||!Se)return!1;t=t??re.location,n=n??re.history;try{if(!e){try{re.localStorage.setItem("test","test"),re.localStorage.removeItem("test")}catch{return!1}e=re==null?void 0:re.localStorage}var r,s=VD||Jp(t.hash,"__posthog")||Jp(t.hash,"state"),i=s?KS((()=>JSON.parse(atob(decodeURIComponent(s)))))||KS((()=>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(TE)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Ta(t){var e=$e.ph_load_toolbar||$e.ph_load_editor;!Xe(e)&&Ps(e)?e(t,this.instance):RE.warn("No toolbar load function found")}loadToolbar(t){var e=!(Se==null||!Se.getElementById(e6));if(!re||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=fe({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(re.localStorage.setItem(TE,JSON.stringify(fe({},r,{source:void 0}))),this.Ia()===2)this.Ta(r);else if(this.Ia()===0){var s;this.Ca(1),(s=$e.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return RE.error("[Toolbar] Failed to load",i),void this.Ca(0);this.Ca(2),this.Ta(r)})),Ht(re,"turbolinks:load",(()=>{this.Ca(0),this.loadToolbar(r)}))}return!0}Ma(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)}}},ZD=fe({experiments:Gn},$m),YD={conversations:class{constructor(t){this.Ea=void 0,this._conversationsManager=null,this.Ra=!1,this.Pa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;Xe(e)||(ii(e)?this.Ea=e:(this.Ea=e.enabled,this.Pa=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ea=void 0,this.Pa=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ra||this._instance.config.disable_conversations||s6(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=$e==null?void 0:$e.__PosthogExtensions__;if(t&&!_e(this.Ea)&&this.Ea)if(this.Pa&&this.Pa.token){this.Ra=!0;try{var e=t.initConversations;if(e)return this.Oa(e),void(this.Ra=!1);var n=t.loadExternalDependency;if(!n)return void this.Fa(s2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.Fa("Could not load conversations script",r):this.Oa(t.initConversations),this.Ra=!1}))}catch(r){this.Fa("Error initializing conversations",r),this.Ra=!1}}else ns.error("Conversations enabled but missing token in remote config.")}}Oa(t){if(this.Pa)try{this._conversationsManager=t(this.Pa,this._instance),ns.info("Conversations loaded successfully")}catch(e){this.Fa("Error completing conversations initialization",e)}else ns.error("Cannot complete initialization: remote config is null")}Fa(t,e){ns.error(t,e),this._conversationsManager=null,this.Ra=!1}show(){this._conversationsManager?this._conversationsManager.show():ns.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ea===!0&&!or(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return tn((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(ns.warn(Ca),null)}))()}getMessages(t,e){var n=this;return tn((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(ns.warn(Ca),null)}))()}markAsRead(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(ns.warn(Ca),null)}))()}getTickets(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(ns.warn(Ca),null)}))()}requestRestoreLink(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(ns.warn(Ca),null)}))()}restoreFromToken(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(ns.warn(Ca),null)}))()}restoreFromUrlToken(){var t=this;return tn((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ns.warn(Ca),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}gn(){var t;(t=this._conversationsManager)==null||t.setIdentity()}mn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},XD={logs:class{constructor(t){var e;this.La=!1,this.Aa=!1,this.it=Lt("[logs]"),this.Ar=[],this.$a=[],this.ws=0,this.Na=()=>{var n,r;this.ws=0,(n=this.Da)==null||n.onReconnect(),(r=this.qa)==null||r.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.La=!0),re&&Ht(re,"online",this.Na)}ja(t,e,n,r){var s,i=(function(a,u){var c,f,h,p,v,y,x,_=(c=a==null?void 0:a.flushIntervalMs)!==null&&c!==void 0?c:3e3,b=(f=a==null?void 0:a.maxBufferSize)!==null&&f!==void 0?f:100,E=u!=null&&u.consoleCapture?void 0:(h=a==null?void 0:a.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,C=_e(E)?Math.max(b,2048):Math.max(b,E),P=a==null?void 0:a.resourceAttributes;return{serviceName:(p=(v=P==null?void 0:P["service.name"])!==null&&v!==void 0?v:a==null?void 0:a.serviceName)!==null&&p!==void 0?p:u==null?void 0:u.serviceNameDefault,serviceVersion:(y=P==null?void 0:P["service.version"])!==null&&y!==void 0?y:a==null?void 0:a.serviceVersion,environment:(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:_,maxBufferSize:b,maxQueueSize:C,maxBatchRecordsPerPost:100,rateCapWindowMs:_,maxLogsPerInterval:E,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new sO(this.Ha(t,e),i,this.it,(()=>this.Ba()),(a=>a()),void 0,r),i]}Ua(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Da||this.za!==e){var n;(n=this.Da)==null||n.reset(),this.za=e;var r=this.ja((()=>this.Ar),(s=>{this.Ar=s}));this.Da=r[0],this.Va=r[1]}return this.Da}Wa(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.qa||this.Za!==e){var n;(n=this.qa)==null||n.reset(),this.Za=e;var r=this.ja((()=>this.$a),(s=>{this.$a=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},NE);this.qa=r[0],this.Ga=r[1]}return this.qa}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,n=(e=t.logs)==null?void 0:e.captureConsoleLogs;!Xe(n)&&n&&(this.La=!0,this.loadIfEnabled())}reset(){var t,e;this.Ar=[],(t=this.Da)==null||t.reset(),this.$a=[],(e=this.qa)==null||e.reset(),this.ws=0}captureLog(t){this.Ua().captureLog(t)}le(t){this.Wa().captureLog(t)}get logger(){return this.Qa||(this.Qa={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.Qa}flushLogs(t){t?this.Ja(t):(this.Da&&this.Da.flush().catch((e=>this.it.error("PostHog logs flush failed:",e))),this.qa&&this.qa.flush().catch((e=>this.it.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.La&&!this.Aa){var t=$e==null?void 0:$e.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.it.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.Aa=!0)})):this.it.error(s2)}else this.it.error("PostHog Extensions not found.")}}Ha(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Li.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Li.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},At:r=>this.At(r),getLibraryId:()=>$t.LIB_NAME,getLibraryVersion:()=>$t.LIB_VERSION}}At(t){return new Promise((e=>{if(x6(this.ws,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout((()=>r({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.Ka(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this.Ya(a),a>=200&&300>a)r({kind:"ok"});else if(a===413)r({kind:"too-large"});else if(a!==0&&a!==429&&500>a)r({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var u;r({kind:"retry-later",error:(u=i.error)!==null&&u!==void 0?u:new Error("logs request failed with status "+a)})}}})}}))}Ya(t){(t!==0||this._instance.__loaded)&&(this.ws=w6(t,this.ws,3,(()=>this.it.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."))))}Ja(t){this.Ar.length>0&&this.Xa(t,this.Ar,this.Va,$t.LIB_NAME,(e=>{this.Ar=e})),this.$a.length>0&&this.Xa(t,this.$a,this.Ga,NE,(e=>{this.$a=e}))}Xa(t,e,n,r,s){if(e.length!==0){var i=e.map((u=>u.record));s([]);var a=B8(i,U8(n,$t.LIB_NAME,$t.LIB_VERSION),r,$t.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Ka(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Ka(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Ba(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,s=n.sessionStartTimestamp,i=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,Xe(s)||(e.sessionStartTimestamp=s),Xe(i)||(e.lastActivityTimestamp=i)}if($e!=null&&(t=$e.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Wo($e.location.href):$e.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},QD={metrics:class{constructor(t){this.it=Lt("[metrics]"),this._instance=t}initialize(){}Ua(){var t,e,n,r,s,i,a,u,c,f=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.Da&&this.za===f||((e=this.Da)==null||e.reset(),this.za=f,this.Da=new iO(this.Ha(),{serviceName:(r=(c=(n=f)==null?void 0:n.resourceAttributes)==null?void 0:c["service.name"])!==null&&r!==void 0?r:n==null?void 0:n.serviceName,serviceVersion:(s=c==null?void 0:c["service.version"])!==null&&s!==void 0?s:n==null?void 0:n.serviceVersion,environment:(i=c==null?void 0:c["deployment.environment"])!==null&&i!==void 0?i:n==null?void 0:n.environment,resourceAttributes:c,beforeSend:n==null?void 0:n.beforeSend,flushIntervalMs:(a=n==null?void 0:n.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(u=n==null?void 0:n.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3},this.it)),this.Da}count(t,e,n){e===void 0&&(e=1),this.Ua().count(t,e,n)}gauge(t,e,n){this.Ua().gauge(t,e,n)}histogram(t,e,n){this.Ua().histogram(t,e,n)}flush(t){if(!this.Da)return Promise.resolve();if(t){var e=this.Da.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.Da.flush().catch((n=>this.it.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.Da)==null||t.reset()}Ha(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:n=>e.Kt(n),getLibraryId:()=>$t.LIB_NAME,getLibraryVersion:()=>$t.LIB_VERSION}}Kt(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(fe({method:"POST",url:this.tl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(a){var u=a.statusCode;if(u>=200&&300>u)s({kind:"ok"});else if(u===413)s({kind:"too-large"});else if(u!==0&&u!==429&&500>u)s({kind:"fatal",error:new Error("metrics request failed with status "+u)});else{var c;s({kind:"retry-later",error:(c=a.error)!==null&&c!==void 0?c:new Error("metrics request failed with status "+u)})}}}))}))}tl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},JD=fe({},$m,HD,zD,UD,BD,WD,KD,GD,qD,ZD,YD,XD,QD);is.__defaultExtensionClasses=fe({},JD);var Pe=(function(){$t.SDK_DIST_CHANNEL="npm";var t=hd[Ql]=new is;return(function(){function e(){e.done||(e.done=!0,K6=!1,bt(hd,(function(n){n._dom_loaded()})))}Se!=null&&Se.addEventListener?Se.readyState==="complete"?e():Ht(Se,"DOMContentLoaded",e,{capture:!1}):re&&ye.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),q6;function eL(t){q6=t}function Ty(){return q6}var h2=g.createContext({get client(){return Ty()},bootstrap:void 0});function Z6(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)||!Z6(t[u],e[u],n))return!1}return!0}function tL(t){var e,n,r=t.children,s=t.client,i=t.apiKey,a=t.options,u=g.useRef(null),c=g.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var f=Ty();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),f},[s,i,JSON.stringify(a)]);return g.useEffect(function(){if(!(s||!i)){var f=Ty(),h=u.current;h?(i!==h.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!Z6(a,h.options)&&f.set_config(a),u.current={apiKey:i,options:a??{}}):(f.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),f.init(i,a),u.current={apiKey:i,options:a??{}})}},[s,i,JSON.stringify(a)]),ge.createElement(h2.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 Iv=function(t){return typeof t=="function"},nL=function(){var t=g.useContext(h2).client;return t},Ry=function(t,e){return Ry=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])},Ry(t,e)};function rL(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ry(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var sL={componentStack:null,exceptionEvent:null,error:null},iL={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},oL=(function(t){rL(e,t);function e(n){var r=t.call(this,n)||this;return r.state=sL,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Iv(s)?i=s(n):typeof s=="object"&&(i=s);var a=this.context.client,u=a.captureException(n,i),c=r.componentStack;this.setState({error:n,componentStack:c??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return Iv(r)?r():r;var a=Iv(s)?ge.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return ge.isValidElement(a)?a:(console.warn(iL.INVALID_FALLBACK),ge.createElement(ge.Fragment,null))},e.contextType=h2,e})(ge.Component);eL(Pe);var Lh={},Mv={exports:{}},vr={},Nv={exports:{}},Ov={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var OE;function aL(){return OE||(OE=1,(function(t){function e($,te){var H=$.length;$.push(te);e:for(;0<H;){var L=H-1>>>1,Z=$[L];if(0<s(Z,te))$[L]=te,$[H]=Z,H=L;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var te=$[0],H=$.pop();if(H!==te){$[0]=H;e:for(var L=0,Z=$.length,ne=Z>>>1;L<ne;){var ie=2*(L+1)-1,ae=$[ie],ue=ie+1,ke=$[ue];if(0>s(ae,H))ue<Z&&0>s(ke,ae)?($[L]=ke,$[ue]=H,L=ue):($[L]=ae,$[ie]=H,L=ie);else if(ue<Z&&0>s(ke,H))$[L]=ke,$[ue]=H,L=ue;else break e}}return te}function s($,te){var H=$.sortIndex-te.sortIndex;return H!==0?H:$.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var c=[],f=[],h=1,p=null,v=3,y=!1,x=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,E=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($){for(var te=n(f);te!==null;){if(te.callback===null)r(f);else if(te.startTime<=$)r(f),te.sortIndex=te.expirationTime,e(c,te);else break;te=n(f)}}function T($){if(_=!1,P($),!x)if(n(c)!==null)x=!0,B(R);else{var te=n(f);te!==null&&X(T,te.startTime-$)}}function R($,te){x=!1,_&&(_=!1,E(A),A=-1),y=!0;var H=v;try{for(P(te),p=n(c);p!==null&&(!(p.expirationTime>te)||$&&!j());){var L=p.callback;if(typeof L=="function"){p.callback=null,v=p.priorityLevel;var Z=L(p.expirationTime<=te);te=t.unstable_now(),typeof Z=="function"?p.callback=Z:p===n(c)&&r(c),P(te)}else r(c);p=n(c)}if(p!==null)var ne=!0;else{var ie=n(f);ie!==null&&X(T,ie.startTime-te),ne=!1}return ne}finally{p=null,v=H,y=!1}}var O=!1,M=null,A=-1,N=5,D=-1;function j(){return!(t.unstable_now()-D<N)}function V(){if(M!==null){var $=t.unstable_now();D=$;var te=!0;try{te=M(!0,$)}finally{te?W():(O=!1,M=null)}}else O=!1}var W;if(typeof C=="function")W=function(){C(V)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,K=Y.port2;Y.port1.onmessage=V,W=function(){K.postMessage(null)}}else W=function(){b(V,0)};function B($){M=$,O||(O=!0,W())}function X($,te){A=b(function(){$(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){x||y||(x=!0,B(R))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function($){switch(v){case 1:case 2:case 3:var te=3;break;default:te=v}var H=v;v=te;try{return $()}finally{v=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,te){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=v;v=$;try{return te()}finally{v=H}},t.unstable_scheduleCallback=function($,te,H){var L=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?L+H:L):H=L,$){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=H+Z,$={id:h++,callback:te,priorityLevel:$,startTime:H,expirationTime:Z,sortIndex:-1},H>L?($.sortIndex=H,e(f,$),n(c)===null&&$===n(f)&&(_?(E(A),A=-1):_=!0,X(T,H-L))):($.sortIndex=Z,e(c,$),x||y||(x=!0,B(R))),$},t.unstable_shouldYield=j,t.unstable_wrapCallback=function($){var te=v;return function(){var H=v;v=te;try{return $.apply(this,arguments)}finally{v=H}}}})(Ov)),Ov}var DE;function lL(){return DE||(DE=1,Nv.exports=aL()),Nv.exports}/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var LE;function uL(){if(LE)return vr;LE=1;var t=U_(),e=lL();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(o,l){a(o,l),a(o+"Capture",l)}function a(o,l){for(s[o]=l,o=0;o<l.length;o++)r.add(l[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function v(o){return c.call(p,o)?!0:c.call(h,o)?!1:f.test(o)?p[o]=!0:(h[o]=!0,!1)}function y(o,l,d,m){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return m?!1:d!==null?!d.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function x(o,l,d,m){if(l===null||typeof l>"u"||y(o,l,d,m))return!0;if(m)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function _(o,l,d,m,w,k,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=m,this.attributeNamespace=w,this.mustUseProperty=d,this.propertyName=o,this.type=l,this.sanitizeURL=k,this.removeEmptyString=I}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){b[o]=new _(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];b[l]=new _(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){b[o]=new _(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){b[o]=new _(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){b[o]=new _(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){b[o]=new _(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){b[o]=new _(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){b[o]=new _(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){b[o]=new _(o,5,!1,o.toLowerCase(),null,!1,!1)});var E=/[\-:]([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(E,C);b[l]=new _(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(E,C);b[l]=new _(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(E,C);b[l]=new _(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){b[o]=new _(o,1,!1,o.toLowerCase(),null,!1,!1)}),b.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){b[o]=new _(o,1,!1,o.toLowerCase(),null,!0,!0)});function P(o,l,d,m){var w=b.hasOwnProperty(l)?b[l]:null;(w!==null?w.type!==0:m||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(x(l,d,w,m)&&(d=null),m||w===null?v(l)&&(d===null?o.removeAttribute(l):o.setAttribute(l,""+d)):w.mustUseProperty?o[w.propertyName]=d===null?w.type===3?!1:"":d:(l=w.attributeName,m=w.attributeNamespace,d===null?o.removeAttribute(l):(w=w.type,d=w===3||w===4&&d===!0?"":""+d,m?o.setAttributeNS(m,l,d):o.setAttribute(l,d))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),O=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),j=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),$=Symbol.iterator;function te(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var H=Object.assign,L;function Z(o){if(L===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);L=l&&l[1]||""}return`
|
|
35
|
+
`+L+o}var ne=!1;function ie(o,l){if(!o||ne)return"";ne=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(se){var m=se}Reflect.construct(o,[],l)}else{try{l.call()}catch(se){m=se}o.call(l.prototype)}else{try{throw Error()}catch(se){m=se}o()}}catch(se){if(se&&m&&typeof se.stack=="string"){for(var w=se.stack.split(`
|
|
36
|
+
`),k=m.stack.split(`
|
|
37
|
+
`),I=w.length-1,F=k.length-1;1<=I&&0<=F&&w[I]!==k[F];)F--;for(;1<=I&&0<=F;I--,F--)if(w[I]!==k[F]){if(I!==1||F!==1)do if(I--,F--,0>F||w[I]!==k[F]){var U=`
|
|
38
|
+
`+w[I].replace(" at new "," at ");return o.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",o.displayName)),U}while(1<=I&&0<=F);break}}}finally{ne=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?Z(o):""}function ae(o){switch(o.tag){case 5:return Z(o.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return o=ie(o.type,!1),o;case 11:return o=ie(o.type.render,!1),o;case 1:return o=ie(o.type,!0),o;default:return""}}function ue(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case M:return"Fragment";case O:return"Portal";case N:return"Profiler";case A:return"StrictMode";case W:return"Suspense";case Y: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 V: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:ue(o.type)||"Memo";case B:l=o._payload,o=o._init;try{return ue(o(l))}catch{}}return null}function ke(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(l);case 8:return l===A?"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 ee(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function le(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function pe(o){var l=le(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),m=""+o[l];if(!o.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var w=d.get,k=d.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return w.call(this)},set:function(I){m=""+I,k.call(this,I)}}),Object.defineProperty(o,l,{enumerable:d.enumerable}),{getValue:function(){return m},setValue:function(I){m=""+I},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function we(o){o._valueTracker||(o._valueTracker=pe(o))}function Ie(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),m="";return o&&(m=le(o)?o.checked?"true":"false":o.value),o=m,o!==d?(l.setValue(o),!0):!1}function qe(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function it(o,l){var d=l.checked;return H({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??o._wrapperState.initialChecked})}function Ae(o,l){var d=l.defaultValue==null?"":l.defaultValue,m=l.checked!=null?l.checked:l.defaultChecked;d=ee(l.value!=null?l.value:d),o._wrapperState={initialChecked:m,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function at(o,l){l=l.checked,l!=null&&P(o,"checked",l,!1)}function At(o,l){at(o,l);var d=ee(l.value),m=l.type;if(d!=null)m==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+d):o.value!==""+d&&(o.value=""+d);else if(m==="submit"||m==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?je(o,l.type,d):l.hasOwnProperty("defaultValue")&&je(o,l.type,ee(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function mt(o,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var m=l.type;if(!(m!=="submit"&&m!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,d||l===o.value||(o.value=l),o.defaultValue=l}d=o.name,d!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,d!==""&&(o.name=d)}function je(o,l,d){(l!=="number"||qe(o.ownerDocument)!==o)&&(d==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+d&&(o.defaultValue=""+d))}var Ye=Array.isArray;function lt(o,l,d,m){if(o=o.options,l){l={};for(var w=0;w<d.length;w++)l["$"+d[w]]=!0;for(d=0;d<o.length;d++)w=l.hasOwnProperty("$"+o[d].value),o[d].selected!==w&&(o[d].selected=w),w&&m&&(o[d].defaultSelected=!0)}else{for(d=""+ee(d),l=null,w=0;w<o.length;w++){if(o[w].value===d){o[w].selected=!0,m&&(o[w].defaultSelected=!0);return}l!==null||o[w].disabled||(l=o[w])}l!==null&&(l.selected=!0)}}function Je(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function vt(o,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(n(92));if(Ye(d)){if(1<d.length)throw Error(n(93));d=d[0]}l=d}l==null&&(l=""),d=l}o._wrapperState={initialValue:ee(d)}}function xn(o,l){var d=ee(l.value),m=ee(l.defaultValue);d!=null&&(d=""+d,d!==o.value&&(o.value=d),l.defaultValue==null&&o.defaultValue!==d&&(o.defaultValue=d)),m!=null&&(o.defaultValue=""+m)}function Ut(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function Rn(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 Hn(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?Rn(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Ar,Yn=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,m,w){MSApp.execUnsafeLocalFunction(function(){return o(l,d,m,w)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(Ar=Ar||document.createElement("div"),Ar.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Ar.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function wn(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var Is={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},Ms=["Webkit","ms","Moz","O"];Object.keys(Is).forEach(function(o){Ms.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Is[l]=Is[o]})});function An(o,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||Is.hasOwnProperty(o)&&Is[o]?(""+l).trim():l+"px"}function fi(o,l){o=o.style;for(var d in l)if(l.hasOwnProperty(d)){var m=d.indexOf("--")===0,w=An(d,l[d],m);d==="float"&&(d="cssFloat"),m?o.setProperty(d,w):o[d]=w}}var hi=H({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fs(o,l){if(l){if(hi[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 Ns(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 lr=null;function Xn(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Os=null,Ds=null,Ir=null;function pi(o){if(o=xc(o)){if(typeof Os!="function")throw Error(n(280));var l=o.stateNode;l&&(l=Vf(l),Os(o.stateNode,o.type,l))}}function We(o){Ds?Ir?Ir.push(o):Ir=[o]:Ds=o}function Bt(){if(Ds){var o=Ds,l=Ir;if(Ir=Ds=null,pi(o),l)for(o=0;o<l.length;o++)pi(l[o])}}function jt(o,l){return o(l)}function bn(){}var Ls=!1;function Xt(o,l,d){if(Ls)return o(l,d);Ls=!0;try{return jt(o,l,d)}finally{Ls=!1,(Ds!==null||Ir!==null)&&(bn(),Bt())}}function rn(o,l){var d=o.stateNode;if(d===null)return null;var m=Vf(d);if(m===null)return null;d=m[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":(m=!m.disabled)||(o=o.type,m=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!m;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(n(231,l,typeof d));return d}var hs=!1;if(u)try{var ln={};Object.defineProperty(ln,"passive",{get:function(){hs=!0}}),window.addEventListener("test",ln,ln),window.removeEventListener("test",ln,ln)}catch{hs=!1}function Qn(o,l,d,m,w,k,I,F,U){var se=Array.prototype.slice.call(arguments,3);try{l.apply(d,se)}catch(de){this.onError(de)}}var js=!1,ur=null,to=!1,Qu=null,b0={onError:function(o){js=!0,ur=o}};function Ju(o,l,d,m,w,k,I,F,U){js=!1,ur=null,Qn.apply(b0,arguments)}function S0(o,l,d,m,w,k,I,F,U){if(Ju.apply(this,arguments),js){if(js){var se=ur;js=!1,ur=null}else throw Error(n(198));to||(to=!0,Qu=se)}}function mi(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function _f(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 xf(o){if(mi(o)!==o)throw Error(n(188))}function ec(o){var l=o.alternate;if(!l){if(l=mi(o),l===null)throw Error(n(188));return l!==o?null:o}for(var d=o,m=l;;){var w=d.return;if(w===null)break;var k=w.alternate;if(k===null){if(m=w.return,m!==null){d=m;continue}break}if(w.child===k.child){for(k=w.child;k;){if(k===d)return xf(w),o;if(k===m)return xf(w),l;k=k.sibling}throw Error(n(188))}if(d.return!==m.return)d=w,m=k;else{for(var I=!1,F=w.child;F;){if(F===d){I=!0,d=w,m=k;break}if(F===m){I=!0,m=w,d=k;break}F=F.sibling}if(!I){for(F=k.child;F;){if(F===d){I=!0,d=k,m=w;break}if(F===m){I=!0,m=k,d=w;break}F=F.sibling}if(!I)throw Error(n(189))}}if(d.alternate!==m)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?o:l}function gl(o){return o=ec(o),o!==null?tc(o):null}function tc(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=tc(o);if(l!==null)return l;o=o.sibling}return null}var wf=e.unstable_scheduleCallback,nc=e.unstable_cancelCallback,aa=e.unstable_shouldYield,bf=e.unstable_requestPaint,It=e.unstable_now,E0=e.unstable_getCurrentPriorityLevel,vl=e.unstable_ImmediatePriority,la=e.unstable_UserBlockingPriority,no=e.unstable_NormalPriority,Sf=e.unstable_LowPriority,rc=e.unstable_IdlePriority,ua=null,Mr=null;function z(o){if(Mr&&typeof Mr.onCommitFiberRoot=="function")try{Mr.onCommitFiberRoot(ua,o,void 0,(o.current.flags&128)===128)}catch{}}var oe=Math.clz32?Math.clz32:xe,Ee=Math.log,me=Math.LN2;function xe(o){return o>>>=0,o===0?32:31-(Ee(o)/me|0)|0}var Ce=64,Ge=4194304;function be(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 Sn(o,l){var d=o.pendingLanes;if(d===0)return 0;var m=0,w=o.suspendedLanes,k=o.pingedLanes,I=d&268435455;if(I!==0){var F=I&~w;F!==0?m=be(F):(k&=I,k!==0&&(m=be(k)))}else I=d&~w,I!==0?m=be(I):k!==0&&(m=be(k));if(m===0)return 0;if(l!==0&&l!==m&&(l&w)===0&&(w=m&-m,k=l&-l,w>=k||w===16&&(k&4194240)!==0))return l;if((m&4)!==0&&(m|=d&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=m;0<l;)d=31-oe(l),w=1<<d,m|=o[d],l&=~w;return m}function cr(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 Fs(o,l){for(var d=o.suspendedLanes,m=o.pingedLanes,w=o.expirationTimes,k=o.pendingLanes;0<k;){var I=31-oe(k),F=1<<I,U=w[I];U===-1?((F&d)===0||(F&m)!==0)&&(w[I]=cr(F,l)):U<=l&&(o.expiredLanes|=F),k&=~F}}function Zr(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function ps(){var o=Ce;return Ce<<=1,(Ce&4194240)===0&&(Ce=64),o}function pn(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function dr(o,l,d){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-oe(l),o[l]=d}function gi(o,l){var d=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var m=o.eventTimes;for(o=o.expirationTimes;0<d;){var w=31-oe(d),k=1<<w;l[w]=0,m[w]=-1,o[w]=-1,d&=~k}}function k0(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var m=31-oe(d),w=1<<m;w&l|o[m]&l&&(o[m]|=l),d&=~w}}var gt=0;function Wx(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Gx,C0,Kx,qx,Zx,P0=!1,Ef=[],ro=null,so=null,io=null,sc=new Map,ic=new Map,oo=[],fI="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 Yx(o,l){switch(o){case"focusin":case"focusout":ro=null;break;case"dragenter":case"dragleave":so=null;break;case"mouseover":case"mouseout":io=null;break;case"pointerover":case"pointerout":sc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ic.delete(l.pointerId)}}function oc(o,l,d,m,w,k){return o===null||o.nativeEvent!==k?(o={blockedOn:l,domEventName:d,eventSystemFlags:m,nativeEvent:k,targetContainers:[w]},l!==null&&(l=xc(l),l!==null&&C0(l)),o):(o.eventSystemFlags|=m,l=o.targetContainers,w!==null&&l.indexOf(w)===-1&&l.push(w),o)}function hI(o,l,d,m,w){switch(l){case"focusin":return ro=oc(ro,o,l,d,m,w),!0;case"dragenter":return so=oc(so,o,l,d,m,w),!0;case"mouseover":return io=oc(io,o,l,d,m,w),!0;case"pointerover":var k=w.pointerId;return sc.set(k,oc(sc.get(k)||null,o,l,d,m,w)),!0;case"gotpointercapture":return k=w.pointerId,ic.set(k,oc(ic.get(k)||null,o,l,d,m,w)),!0}return!1}function Xx(o){var l=ca(o.target);if(l!==null){var d=mi(l);if(d!==null){if(l=d.tag,l===13){if(l=_f(d),l!==null){o.blockedOn=l,Zx(o.priority,function(){Kx(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function kf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=R0(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(d===null){d=o.nativeEvent;var m=new d.constructor(d.type,d);lr=m,d.target.dispatchEvent(m),lr=null}else return l=xc(d),l!==null&&C0(l),o.blockedOn=d,!1;l.shift()}return!0}function Qx(o,l,d){kf(o)&&d.delete(l)}function pI(){P0=!1,ro!==null&&kf(ro)&&(ro=null),so!==null&&kf(so)&&(so=null),io!==null&&kf(io)&&(io=null),sc.forEach(Qx),ic.forEach(Qx)}function ac(o,l){o.blockedOn===l&&(o.blockedOn=null,P0||(P0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,pI)))}function lc(o){function l(w){return ac(w,o)}if(0<Ef.length){ac(Ef[0],o);for(var d=1;d<Ef.length;d++){var m=Ef[d];m.blockedOn===o&&(m.blockedOn=null)}}for(ro!==null&&ac(ro,o),so!==null&&ac(so,o),io!==null&&ac(io,o),sc.forEach(l),ic.forEach(l),d=0;d<oo.length;d++)m=oo[d],m.blockedOn===o&&(m.blockedOn=null);for(;0<oo.length&&(d=oo[0],d.blockedOn===null);)Xx(d),d.blockedOn===null&&oo.shift()}var yl=T.ReactCurrentBatchConfig,Cf=!0;function mI(o,l,d,m){var w=gt,k=yl.transition;yl.transition=null;try{gt=1,T0(o,l,d,m)}finally{gt=w,yl.transition=k}}function gI(o,l,d,m){var w=gt,k=yl.transition;yl.transition=null;try{gt=4,T0(o,l,d,m)}finally{gt=w,yl.transition=k}}function T0(o,l,d,m){if(Cf){var w=R0(o,l,d,m);if(w===null)G0(o,l,m,Pf,d),Yx(o,m);else if(hI(w,o,l,d,m))m.stopPropagation();else if(Yx(o,m),l&4&&-1<fI.indexOf(o)){for(;w!==null;){var k=xc(w);if(k!==null&&Gx(k),k=R0(o,l,d,m),k===null&&G0(o,l,m,Pf,d),k===w)break;w=k}w!==null&&m.stopPropagation()}else G0(o,l,m,null,d)}}var Pf=null;function R0(o,l,d,m){if(Pf=null,o=Xn(m),o=ca(o),o!==null)if(l=mi(o),l===null)o=null;else if(d=l.tag,d===13){if(o=_f(l),o!==null)return o;o=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Pf=o,null}function Jx(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(E0()){case vl:return 1;case la:return 4;case no:case Sf:return 16;case rc:return 536870912;default:return 16}default:return 16}}var ao=null,A0=null,Tf=null;function ew(){if(Tf)return Tf;var o,l=A0,d=l.length,m,w="value"in ao?ao.value:ao.textContent,k=w.length;for(o=0;o<d&&l[o]===w[o];o++);var I=d-o;for(m=1;m<=I&&l[d-m]===w[k-m];m++);return Tf=w.slice(o,1<m?1-m:void 0)}function Rf(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 Af(){return!0}function tw(){return!1}function Nr(o){function l(d,m,w,k,I){this._reactName=d,this._targetInst=w,this.type=m,this.nativeEvent=k,this.target=I,this.currentTarget=null;for(var F in o)o.hasOwnProperty(F)&&(d=o[F],this[F]=d?d(k):k[F]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Af:tw,this.isPropagationStopped=tw,this}return H(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Af)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Af)},persist:function(){},isPersistent:Af}),l}var _l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},I0=Nr(_l),uc=H({},_l,{view:0,detail:0}),vI=Nr(uc),M0,N0,cc,If=H({},uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:D0,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!==cc&&(cc&&o.type==="mousemove"?(M0=o.screenX-cc.screenX,N0=o.screenY-cc.screenY):N0=M0=0,cc=o),M0)},movementY:function(o){return"movementY"in o?o.movementY:N0}}),nw=Nr(If),yI=H({},If,{dataTransfer:0}),_I=Nr(yI),xI=H({},uc,{relatedTarget:0}),O0=Nr(xI),wI=H({},_l,{animationName:0,elapsedTime:0,pseudoElement:0}),bI=Nr(wI),SI=H({},_l,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),EI=Nr(SI),kI=H({},_l,{data:0}),rw=Nr(kI),CI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PI={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"},TI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RI(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=TI[o])?!!l[o]:!1}function D0(){return RI}var AI=H({},uc,{key:function(o){if(o.key){var l=CI[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Rf(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?PI[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:D0,charCode:function(o){return o.type==="keypress"?Rf(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Rf(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),II=Nr(AI),MI=H({},If,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sw=Nr(MI),NI=H({},uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:D0}),OI=Nr(NI),DI=H({},_l,{propertyName:0,elapsedTime:0,pseudoElement:0}),LI=Nr(DI),jI=H({},If,{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}),FI=Nr(jI),VI=[9,13,27,32],L0=u&&"CompositionEvent"in window,dc=null;u&&"documentMode"in document&&(dc=document.documentMode);var $I=u&&"TextEvent"in window&&!dc,iw=u&&(!L0||dc&&8<dc&&11>=dc),ow=" ",aw=!1;function lw(o,l){switch(o){case"keyup":return VI.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uw(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var xl=!1;function HI(o,l){switch(o){case"compositionend":return uw(l);case"keypress":return l.which!==32?null:(aw=!0,ow);case"textInput":return o=l.data,o===ow&&aw?null:o;default:return null}}function zI(o,l){if(xl)return o==="compositionend"||!L0&&lw(o,l)?(o=ew(),Tf=A0=ao=null,xl=!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 iw&&l.locale!=="ko"?null:l.data;default:return null}}var UI={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 cw(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!UI[o.type]:l==="textarea"}function dw(o,l,d,m){We(m),l=Lf(l,"onChange"),0<l.length&&(d=new I0("onChange","change",null,d,m),o.push({event:d,listeners:l}))}var fc=null,hc=null;function BI(o){Rw(o,0)}function Mf(o){var l=kl(o);if(Ie(l))return o}function WI(o,l){if(o==="change")return l}var fw=!1;if(u){var j0;if(u){var F0="oninput"in document;if(!F0){var hw=document.createElement("div");hw.setAttribute("oninput","return;"),F0=typeof hw.oninput=="function"}j0=F0}else j0=!1;fw=j0&&(!document.documentMode||9<document.documentMode)}function pw(){fc&&(fc.detachEvent("onpropertychange",mw),hc=fc=null)}function mw(o){if(o.propertyName==="value"&&Mf(hc)){var l=[];dw(l,hc,o,Xn(o)),Xt(BI,l)}}function GI(o,l,d){o==="focusin"?(pw(),fc=l,hc=d,fc.attachEvent("onpropertychange",mw)):o==="focusout"&&pw()}function KI(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Mf(hc)}function qI(o,l){if(o==="click")return Mf(l)}function ZI(o,l){if(o==="input"||o==="change")return Mf(l)}function YI(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var ms=typeof Object.is=="function"?Object.is:YI;function pc(o,l){if(ms(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),m=Object.keys(l);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var w=d[m];if(!c.call(l,w)||!ms(o[w],l[w]))return!1}return!0}function gw(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function vw(o,l){var d=gw(o);o=0;for(var m;d;){if(d.nodeType===3){if(m=o+d.textContent.length,o<=l&&m>=l)return{node:d,offset:l-o};o=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=gw(d)}}function yw(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?yw(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function _w(){for(var o=window,l=qe();l instanceof o.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)o=l.contentWindow;else break;l=qe(o.document)}return l}function V0(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 XI(o){var l=_w(),d=o.focusedElem,m=o.selectionRange;if(l!==d&&d&&d.ownerDocument&&yw(d.ownerDocument.documentElement,d)){if(m!==null&&V0(d)){if(l=m.start,o=m.end,o===void 0&&(o=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(o,d.value.length);else if(o=(l=d.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var w=d.textContent.length,k=Math.min(m.start,w);m=m.end===void 0?k:Math.min(m.end,w),!o.extend&&k>m&&(w=m,m=k,k=w),w=vw(d,k);var I=vw(d,m);w&&I&&(o.rangeCount!==1||o.anchorNode!==w.node||o.anchorOffset!==w.offset||o.focusNode!==I.node||o.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(w.node,w.offset),o.removeAllRanges(),k>m?(o.addRange(l),o.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),o.addRange(l)))}}for(l=[],o=d;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)o=l[d],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var QI=u&&"documentMode"in document&&11>=document.documentMode,wl=null,$0=null,mc=null,H0=!1;function xw(o,l,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;H0||wl==null||wl!==qe(m)||(m=wl,"selectionStart"in m&&V0(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),mc&&pc(mc,m)||(mc=m,m=Lf($0,"onSelect"),0<m.length&&(l=new I0("onSelect","select",null,l,d),o.push({event:l,listeners:m}),l.target=wl)))}function Nf(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var bl={animationend:Nf("Animation","AnimationEnd"),animationiteration:Nf("Animation","AnimationIteration"),animationstart:Nf("Animation","AnimationStart"),transitionend:Nf("Transition","TransitionEnd")},z0={},ww={};u&&(ww=document.createElement("div").style,"AnimationEvent"in window||(delete bl.animationend.animation,delete bl.animationiteration.animation,delete bl.animationstart.animation),"TransitionEvent"in window||delete bl.transitionend.transition);function Of(o){if(z0[o])return z0[o];if(!bl[o])return o;var l=bl[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in ww)return z0[o]=l[d];return o}var bw=Of("animationend"),Sw=Of("animationiteration"),Ew=Of("animationstart"),kw=Of("transitionend"),Cw=new Map,Pw="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 lo(o,l){Cw.set(o,l),i(l,[o])}for(var U0=0;U0<Pw.length;U0++){var B0=Pw[U0],JI=B0.toLowerCase(),eM=B0[0].toUpperCase()+B0.slice(1);lo(JI,"on"+eM)}lo(bw,"onAnimationEnd"),lo(Sw,"onAnimationIteration"),lo(Ew,"onAnimationStart"),lo("dblclick","onDoubleClick"),lo("focusin","onFocus"),lo("focusout","onBlur"),lo(kw,"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(" "),tM=new Set("cancel close invalid load scroll toggle".split(" ").concat(gc));function Tw(o,l,d){var m=o.type||"unknown-event";o.currentTarget=d,S0(m,l,void 0,o),o.currentTarget=null}function Rw(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var m=o[d],w=m.event;m=m.listeners;e:{var k=void 0;if(l)for(var I=m.length-1;0<=I;I--){var F=m[I],U=F.instance,se=F.currentTarget;if(F=F.listener,U!==k&&w.isPropagationStopped())break e;Tw(w,F,se),k=U}else for(I=0;I<m.length;I++){if(F=m[I],U=F.instance,se=F.currentTarget,F=F.listener,U!==k&&w.isPropagationStopped())break e;Tw(w,F,se),k=U}}}if(to)throw o=Qu,to=!1,Qu=null,o}function Mt(o,l){var d=l[Q0];d===void 0&&(d=l[Q0]=new Set);var m=o+"__bubble";d.has(m)||(Aw(l,o,2,!1),d.add(m))}function W0(o,l,d){var m=0;l&&(m|=4),Aw(d,o,m,l)}var Df="_reactListening"+Math.random().toString(36).slice(2);function vc(o){if(!o[Df]){o[Df]=!0,r.forEach(function(d){d!=="selectionchange"&&(tM.has(d)||W0(d,!1,o),W0(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Df]||(l[Df]=!0,W0("selectionchange",!1,l))}}function Aw(o,l,d,m){switch(Jx(l)){case 1:var w=mI;break;case 4:w=gI;break;default:w=T0}d=w.bind(null,l,d,o),w=void 0,!hs||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(w=!0),m?w!==void 0?o.addEventListener(l,d,{capture:!0,passive:w}):o.addEventListener(l,d,!0):w!==void 0?o.addEventListener(l,d,{passive:w}):o.addEventListener(l,d,!1)}function G0(o,l,d,m,w){var k=m;if((l&1)===0&&(l&2)===0&&m!==null)e:for(;;){if(m===null)return;var I=m.tag;if(I===3||I===4){var F=m.stateNode.containerInfo;if(F===w||F.nodeType===8&&F.parentNode===w)break;if(I===4)for(I=m.return;I!==null;){var U=I.tag;if((U===3||U===4)&&(U=I.stateNode.containerInfo,U===w||U.nodeType===8&&U.parentNode===w))return;I=I.return}for(;F!==null;){if(I=ca(F),I===null)return;if(U=I.tag,U===5||U===6){m=k=I;continue e}F=F.parentNode}}m=m.return}Xt(function(){var se=k,de=Xn(d),he=[];e:{var ce=Cw.get(o);if(ce!==void 0){var Te=I0,De=o;switch(o){case"keypress":if(Rf(d)===0)break e;case"keydown":case"keyup":Te=II;break;case"focusin":De="focus",Te=O0;break;case"focusout":De="blur",Te=O0;break;case"beforeblur":case"afterblur":Te=O0;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Te=nw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Te=_I;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Te=OI;break;case bw:case Sw:case Ew:Te=bI;break;case kw:Te=LI;break;case"scroll":Te=vI;break;case"wheel":Te=FI;break;case"copy":case"cut":case"paste":Te=EI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Te=sw}var Fe=(l&4)!==0,sn=!Fe&&o==="scroll",Q=Fe?ce!==null?ce+"Capture":null:ce;Fe=[];for(var q=se,J;q!==null;){J=q;var ve=J.stateNode;if(J.tag===5&&ve!==null&&(J=ve,Q!==null&&(ve=rn(q,Q),ve!=null&&Fe.push(yc(q,ve,J)))),sn)break;q=q.return}0<Fe.length&&(ce=new Te(ce,De,null,d,de),he.push({event:ce,listeners:Fe}))}}if((l&7)===0){e:{if(ce=o==="mouseover"||o==="pointerover",Te=o==="mouseout"||o==="pointerout",ce&&d!==lr&&(De=d.relatedTarget||d.fromElement)&&(ca(De)||De[vi]))break e;if((Te||ce)&&(ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,Te?(De=d.relatedTarget||d.toElement,Te=se,De=De?ca(De):null,De!==null&&(sn=mi(De),De!==sn||De.tag!==5&&De.tag!==6)&&(De=null)):(Te=null,De=se),Te!==De)){if(Fe=nw,ve="onMouseLeave",Q="onMouseEnter",q="mouse",(o==="pointerout"||o==="pointerover")&&(Fe=sw,ve="onPointerLeave",Q="onPointerEnter",q="pointer"),sn=Te==null?ce:kl(Te),J=De==null?ce:kl(De),ce=new Fe(ve,q+"leave",Te,d,de),ce.target=sn,ce.relatedTarget=J,ve=null,ca(de)===se&&(Fe=new Fe(Q,q+"enter",De,d,de),Fe.target=J,Fe.relatedTarget=sn,ve=Fe),sn=ve,Te&&De)t:{for(Fe=Te,Q=De,q=0,J=Fe;J;J=Sl(J))q++;for(J=0,ve=Q;ve;ve=Sl(ve))J++;for(;0<q-J;)Fe=Sl(Fe),q--;for(;0<J-q;)Q=Sl(Q),J--;for(;q--;){if(Fe===Q||Q!==null&&Fe===Q.alternate)break t;Fe=Sl(Fe),Q=Sl(Q)}Fe=null}else Fe=null;Te!==null&&Iw(he,ce,Te,Fe,!1),De!==null&&sn!==null&&Iw(he,sn,De,Fe,!0)}}e:{if(ce=se?kl(se):window,Te=ce.nodeName&&ce.nodeName.toLowerCase(),Te==="select"||Te==="input"&&ce.type==="file")var Ve=WI;else if(cw(ce))if(fw)Ve=ZI;else{Ve=KI;var He=GI}else(Te=ce.nodeName)&&Te.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&(Ve=qI);if(Ve&&(Ve=Ve(o,se))){dw(he,Ve,d,de);break e}He&&He(o,ce,se),o==="focusout"&&(He=ce._wrapperState)&&He.controlled&&ce.type==="number"&&je(ce,"number",ce.value)}switch(He=se?kl(se):window,o){case"focusin":(cw(He)||He.contentEditable==="true")&&(wl=He,$0=se,mc=null);break;case"focusout":mc=$0=wl=null;break;case"mousedown":H0=!0;break;case"contextmenu":case"mouseup":case"dragend":H0=!1,xw(he,d,de);break;case"selectionchange":if(QI)break;case"keydown":case"keyup":xw(he,d,de)}var ze;if(L0)e:{switch(o){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else xl?lw(o,d)&&(Ke="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Ke="onCompositionStart");Ke&&(iw&&d.locale!=="ko"&&(xl||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&xl&&(ze=ew()):(ao=de,A0="value"in ao?ao.value:ao.textContent,xl=!0)),He=Lf(se,Ke),0<He.length&&(Ke=new rw(Ke,o,null,d,de),he.push({event:Ke,listeners:He}),ze?Ke.data=ze:(ze=uw(d),ze!==null&&(Ke.data=ze)))),(ze=$I?HI(o,d):zI(o,d))&&(se=Lf(se,"onBeforeInput"),0<se.length&&(de=new rw("onBeforeInput","beforeinput",null,d,de),he.push({event:de,listeners:se}),de.data=ze))}Rw(he,l)})}function yc(o,l,d){return{instance:o,listener:l,currentTarget:d}}function Lf(o,l){for(var d=l+"Capture",m=[];o!==null;){var w=o,k=w.stateNode;w.tag===5&&k!==null&&(w=k,k=rn(o,d),k!=null&&m.unshift(yc(o,k,w)),k=rn(o,l),k!=null&&m.push(yc(o,k,w))),o=o.return}return m}function Sl(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function Iw(o,l,d,m,w){for(var k=l._reactName,I=[];d!==null&&d!==m;){var F=d,U=F.alternate,se=F.stateNode;if(U!==null&&U===m)break;F.tag===5&&se!==null&&(F=se,w?(U=rn(d,k),U!=null&&I.unshift(yc(d,U,F))):w||(U=rn(d,k),U!=null&&I.push(yc(d,U,F)))),d=d.return}I.length!==0&&o.push({event:l,listeners:I})}var nM=/\r\n?/g,rM=/\u0000|\uFFFD/g;function Mw(o){return(typeof o=="string"?o:""+o).replace(nM,`
|
|
39
|
+
`).replace(rM,"")}function jf(o,l,d){if(l=Mw(l),Mw(o)!==l&&d)throw Error(n(425))}function Ff(){}var K0=null,q0=null;function Z0(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 Y0=typeof setTimeout=="function"?setTimeout:void 0,sM=typeof clearTimeout=="function"?clearTimeout:void 0,Nw=typeof Promise=="function"?Promise:void 0,iM=typeof queueMicrotask=="function"?queueMicrotask:typeof Nw<"u"?function(o){return Nw.resolve(null).then(o).catch(oM)}:Y0;function oM(o){setTimeout(function(){throw o})}function X0(o,l){var d=l,m=0;do{var w=d.nextSibling;if(o.removeChild(d),w&&w.nodeType===8)if(d=w.data,d==="/$"){if(m===0){o.removeChild(w),lc(l);return}m--}else d!=="$"&&d!=="$?"&&d!=="$!"||m++;d=w}while(d);lc(l)}function uo(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 Ow(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return o;l--}else d==="/$"&&l++}o=o.previousSibling}return null}var El=Math.random().toString(36).slice(2),Vs="__reactFiber$"+El,_c="__reactProps$"+El,vi="__reactContainer$"+El,Q0="__reactEvents$"+El,aM="__reactListeners$"+El,lM="__reactHandles$"+El;function ca(o){var l=o[Vs];if(l)return l;for(var d=o.parentNode;d;){if(l=d[vi]||d[Vs]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=Ow(o);o!==null;){if(d=o[Vs])return d;o=Ow(o)}return l}o=d,d=o.parentNode}return null}function xc(o){return o=o[Vs]||o[vi],!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 Vf(o){return o[_c]||null}var J0=[],Cl=-1;function co(o){return{current:o}}function Nt(o){0>Cl||(o.current=J0[Cl],J0[Cl]=null,Cl--)}function Pt(o,l){Cl++,J0[Cl]=o.current,o.current=l}var fo={},zn=co(fo),fr=co(!1),da=fo;function Pl(o,l){var d=o.type.contextTypes;if(!d)return fo;var m=o.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===l)return m.__reactInternalMemoizedMaskedChildContext;var w={},k;for(k in d)w[k]=l[k];return m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=w),w}function hr(o){return o=o.childContextTypes,o!=null}function $f(){Nt(fr),Nt(zn)}function Dw(o,l,d){if(zn.current!==fo)throw Error(n(168));Pt(zn,l),Pt(fr,d)}function Lw(o,l,d){var m=o.stateNode;if(l=l.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var w in m)if(!(w in l))throw Error(n(108,ke(o)||"Unknown",w));return H({},d,m)}function Hf(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||fo,da=zn.current,Pt(zn,o),Pt(fr,fr.current),!0}function jw(o,l,d){var m=o.stateNode;if(!m)throw Error(n(169));d?(o=Lw(o,l,da),m.__reactInternalMemoizedMergedChildContext=o,Nt(fr),Nt(zn),Pt(zn,o)):Nt(fr),Pt(fr,d)}var yi=null,zf=!1,eg=!1;function Fw(o){yi===null?yi=[o]:yi.push(o)}function uM(o){zf=!0,Fw(o)}function ho(){if(!eg&&yi!==null){eg=!0;var o=0,l=gt;try{var d=yi;for(gt=1;o<d.length;o++){var m=d[o];do m=m(!0);while(m!==null)}yi=null,zf=!1}catch(w){throw yi!==null&&(yi=yi.slice(o+1)),wf(vl,ho),w}finally{gt=l,eg=!1}}return null}var Tl=[],Rl=0,Uf=null,Bf=0,Yr=[],Xr=0,fa=null,_i=1,xi="";function ha(o,l){Tl[Rl++]=Bf,Tl[Rl++]=Uf,Uf=o,Bf=l}function Vw(o,l,d){Yr[Xr++]=_i,Yr[Xr++]=xi,Yr[Xr++]=fa,fa=o;var m=_i;o=xi;var w=32-oe(m)-1;m&=~(1<<w),d+=1;var k=32-oe(l)+w;if(30<k){var I=w-w%5;k=(m&(1<<I)-1).toString(32),m>>=I,w-=I,_i=1<<32-oe(l)+w|d<<w|m,xi=k+o}else _i=1<<k|d<<w|m,xi=o}function tg(o){o.return!==null&&(ha(o,1),Vw(o,1,0))}function ng(o){for(;o===Uf;)Uf=Tl[--Rl],Tl[Rl]=null,Bf=Tl[--Rl],Tl[Rl]=null;for(;o===fa;)fa=Yr[--Xr],Yr[Xr]=null,xi=Yr[--Xr],Yr[Xr]=null,_i=Yr[--Xr],Yr[Xr]=null}var Or=null,Dr=null,Ft=!1,gs=null;function $w(o,l){var d=ts(5,null,null,0);d.elementType="DELETED",d.stateNode=l,d.return=o,l=o.deletions,l===null?(o.deletions=[d],o.flags|=16):l.push(d)}function Hw(o,l){switch(o.tag){case 5:var d=o.type;return l=l.nodeType!==1||d.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,Or=o,Dr=uo(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,Or=o,Dr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(d=fa!==null?{id:_i,overflow:xi}:null,o.memoizedState={dehydrated:l,treeContext:d,retryLane:1073741824},d=ts(18,null,null,0),d.stateNode=l,d.return=o,o.child=d,Or=o,Dr=null,!0):!1;default:return!1}}function rg(o){return(o.mode&1)!==0&&(o.flags&128)===0}function sg(o){if(Ft){var l=Dr;if(l){var d=l;if(!Hw(o,l)){if(rg(o))throw Error(n(418));l=uo(d.nextSibling);var m=Or;l&&Hw(o,l)?$w(m,d):(o.flags=o.flags&-4097|2,Ft=!1,Or=o)}}else{if(rg(o))throw Error(n(418));o.flags=o.flags&-4097|2,Ft=!1,Or=o}}}function zw(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Or=o}function Wf(o){if(o!==Or)return!1;if(!Ft)return zw(o),Ft=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!Z0(o.type,o.memoizedProps)),l&&(l=Dr)){if(rg(o))throw Uw(),Error(n(418));for(;l;)$w(o,l),l=uo(l.nextSibling)}if(zw(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"){if(l===0){Dr=uo(o.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++}o=o.nextSibling}Dr=null}}else Dr=Or?uo(o.stateNode.nextSibling):null;return!0}function Uw(){for(var o=Dr;o;)o=uo(o.nextSibling)}function Al(){Dr=Or=null,Ft=!1}function ig(o){gs===null?gs=[o]:gs.push(o)}var cM=T.ReactCurrentBatchConfig;function wc(o,l,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var m=d.stateNode}if(!m)throw Error(n(147,o));var w=m,k=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===k?l.ref:(l=function(I){var F=w.refs;I===null?delete F[k]:F[k]=I},l._stringRef=k,l)}if(typeof o!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,o))}return o}function Gf(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Bw(o){var l=o._init;return l(o._payload)}function Ww(o){function l(Q,q){if(o){var J=Q.deletions;J===null?(Q.deletions=[q],Q.flags|=16):J.push(q)}}function d(Q,q){if(!o)return null;for(;q!==null;)l(Q,q),q=q.sibling;return null}function m(Q,q){for(Q=new Map;q!==null;)q.key!==null?Q.set(q.key,q):Q.set(q.index,q),q=q.sibling;return Q}function w(Q,q){return Q=wo(Q,q),Q.index=0,Q.sibling=null,Q}function k(Q,q,J){return Q.index=J,o?(J=Q.alternate,J!==null?(J=J.index,J<q?(Q.flags|=2,q):J):(Q.flags|=2,q)):(Q.flags|=1048576,q)}function I(Q){return o&&Q.alternate===null&&(Q.flags|=2),Q}function F(Q,q,J,ve){return q===null||q.tag!==6?(q=Yg(J,Q.mode,ve),q.return=Q,q):(q=w(q,J),q.return=Q,q)}function U(Q,q,J,ve){var Ve=J.type;return Ve===M?de(Q,q,J.props.children,ve,J.key):q!==null&&(q.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===B&&Bw(Ve)===q.type)?(ve=w(q,J.props),ve.ref=wc(Q,q,J),ve.return=Q,ve):(ve=gh(J.type,J.key,J.props,null,Q.mode,ve),ve.ref=wc(Q,q,J),ve.return=Q,ve)}function se(Q,q,J,ve){return q===null||q.tag!==4||q.stateNode.containerInfo!==J.containerInfo||q.stateNode.implementation!==J.implementation?(q=Xg(J,Q.mode,ve),q.return=Q,q):(q=w(q,J.children||[]),q.return=Q,q)}function de(Q,q,J,ve,Ve){return q===null||q.tag!==7?(q=wa(J,Q.mode,ve,Ve),q.return=Q,q):(q=w(q,J),q.return=Q,q)}function he(Q,q,J){if(typeof q=="string"&&q!==""||typeof q=="number")return q=Yg(""+q,Q.mode,J),q.return=Q,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case R:return J=gh(q.type,q.key,q.props,null,Q.mode,J),J.ref=wc(Q,null,q),J.return=Q,J;case O:return q=Xg(q,Q.mode,J),q.return=Q,q;case B:var ve=q._init;return he(Q,ve(q._payload),J)}if(Ye(q)||te(q))return q=wa(q,Q.mode,J,null),q.return=Q,q;Gf(Q,q)}return null}function ce(Q,q,J,ve){var Ve=q!==null?q.key:null;if(typeof J=="string"&&J!==""||typeof J=="number")return Ve!==null?null:F(Q,q,""+J,ve);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case R:return J.key===Ve?U(Q,q,J,ve):null;case O:return J.key===Ve?se(Q,q,J,ve):null;case B:return Ve=J._init,ce(Q,q,Ve(J._payload),ve)}if(Ye(J)||te(J))return Ve!==null?null:de(Q,q,J,ve,null);Gf(Q,J)}return null}function Te(Q,q,J,ve,Ve){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return Q=Q.get(J)||null,F(q,Q,""+ve,Ve);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case R:return Q=Q.get(ve.key===null?J:ve.key)||null,U(q,Q,ve,Ve);case O:return Q=Q.get(ve.key===null?J:ve.key)||null,se(q,Q,ve,Ve);case B:var He=ve._init;return Te(Q,q,J,He(ve._payload),Ve)}if(Ye(ve)||te(ve))return Q=Q.get(J)||null,de(q,Q,ve,Ve,null);Gf(q,ve)}return null}function De(Q,q,J,ve){for(var Ve=null,He=null,ze=q,Ke=q=0,Cn=null;ze!==null&&Ke<J.length;Ke++){ze.index>Ke?(Cn=ze,ze=null):Cn=ze.sibling;var ft=ce(Q,ze,J[Ke],ve);if(ft===null){ze===null&&(ze=Cn);break}o&&ze&&ft.alternate===null&&l(Q,ze),q=k(ft,q,Ke),He===null?Ve=ft:He.sibling=ft,He=ft,ze=Cn}if(Ke===J.length)return d(Q,ze),Ft&&ha(Q,Ke),Ve;if(ze===null){for(;Ke<J.length;Ke++)ze=he(Q,J[Ke],ve),ze!==null&&(q=k(ze,q,Ke),He===null?Ve=ze:He.sibling=ze,He=ze);return Ft&&ha(Q,Ke),Ve}for(ze=m(Q,ze);Ke<J.length;Ke++)Cn=Te(ze,Q,Ke,J[Ke],ve),Cn!==null&&(o&&Cn.alternate!==null&&ze.delete(Cn.key===null?Ke:Cn.key),q=k(Cn,q,Ke),He===null?Ve=Cn:He.sibling=Cn,He=Cn);return o&&ze.forEach(function(bo){return l(Q,bo)}),Ft&&ha(Q,Ke),Ve}function Fe(Q,q,J,ve){var Ve=te(J);if(typeof Ve!="function")throw Error(n(150));if(J=Ve.call(J),J==null)throw Error(n(151));for(var He=Ve=null,ze=q,Ke=q=0,Cn=null,ft=J.next();ze!==null&&!ft.done;Ke++,ft=J.next()){ze.index>Ke?(Cn=ze,ze=null):Cn=ze.sibling;var bo=ce(Q,ze,ft.value,ve);if(bo===null){ze===null&&(ze=Cn);break}o&&ze&&bo.alternate===null&&l(Q,ze),q=k(bo,q,Ke),He===null?Ve=bo:He.sibling=bo,He=bo,ze=Cn}if(ft.done)return d(Q,ze),Ft&&ha(Q,Ke),Ve;if(ze===null){for(;!ft.done;Ke++,ft=J.next())ft=he(Q,ft.value,ve),ft!==null&&(q=k(ft,q,Ke),He===null?Ve=ft:He.sibling=ft,He=ft);return Ft&&ha(Q,Ke),Ve}for(ze=m(Q,ze);!ft.done;Ke++,ft=J.next())ft=Te(ze,Q,Ke,ft.value,ve),ft!==null&&(o&&ft.alternate!==null&&ze.delete(ft.key===null?Ke:ft.key),q=k(ft,q,Ke),He===null?Ve=ft:He.sibling=ft,He=ft);return o&&ze.forEach(function(UM){return l(Q,UM)}),Ft&&ha(Q,Ke),Ve}function sn(Q,q,J,ve){if(typeof J=="object"&&J!==null&&J.type===M&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case R:e:{for(var Ve=J.key,He=q;He!==null;){if(He.key===Ve){if(Ve=J.type,Ve===M){if(He.tag===7){d(Q,He.sibling),q=w(He,J.props.children),q.return=Q,Q=q;break e}}else if(He.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===B&&Bw(Ve)===He.type){d(Q,He.sibling),q=w(He,J.props),q.ref=wc(Q,He,J),q.return=Q,Q=q;break e}d(Q,He);break}else l(Q,He);He=He.sibling}J.type===M?(q=wa(J.props.children,Q.mode,ve,J.key),q.return=Q,Q=q):(ve=gh(J.type,J.key,J.props,null,Q.mode,ve),ve.ref=wc(Q,q,J),ve.return=Q,Q=ve)}return I(Q);case O:e:{for(He=J.key;q!==null;){if(q.key===He)if(q.tag===4&&q.stateNode.containerInfo===J.containerInfo&&q.stateNode.implementation===J.implementation){d(Q,q.sibling),q=w(q,J.children||[]),q.return=Q,Q=q;break e}else{d(Q,q);break}else l(Q,q);q=q.sibling}q=Xg(J,Q.mode,ve),q.return=Q,Q=q}return I(Q);case B:return He=J._init,sn(Q,q,He(J._payload),ve)}if(Ye(J))return De(Q,q,J,ve);if(te(J))return Fe(Q,q,J,ve);Gf(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,q!==null&&q.tag===6?(d(Q,q.sibling),q=w(q,J),q.return=Q,Q=q):(d(Q,q),q=Yg(J,Q.mode,ve),q.return=Q,Q=q),I(Q)):d(Q,q)}return sn}var Il=Ww(!0),Gw=Ww(!1),Kf=co(null),qf=null,Ml=null,og=null;function ag(){og=Ml=qf=null}function lg(o){var l=Kf.current;Nt(Kf),o._currentValue=l}function ug(o,l,d){for(;o!==null;){var m=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,m!==null&&(m.childLanes|=l)):m!==null&&(m.childLanes&l)!==l&&(m.childLanes|=l),o===d)break;o=o.return}}function Nl(o,l){qf=o,og=Ml=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(pr=!0),o.firstContext=null)}function Qr(o){var l=o._currentValue;if(og!==o)if(o={context:o,memoizedValue:l,next:null},Ml===null){if(qf===null)throw Error(n(308));Ml=o,qf.dependencies={lanes:0,firstContext:o}}else Ml=Ml.next=o;return l}var pa=null;function cg(o){pa===null?pa=[o]:pa.push(o)}function Kw(o,l,d,m){var w=l.interleaved;return w===null?(d.next=d,cg(l)):(d.next=w.next,w.next=d),l.interleaved=d,wi(o,m)}function wi(o,l){o.lanes|=l;var d=o.alternate;for(d!==null&&(d.lanes|=l),d=o,o=o.return;o!==null;)o.childLanes|=l,d=o.alternate,d!==null&&(d.childLanes|=l),d=o,o=o.return;return d.tag===3?d.stateNode:null}var po=!1;function dg(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qw(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 bi(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function mo(o,l,d){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,(dt&2)!==0){var w=m.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),m.pending=l,wi(o,d)}return w=m.interleaved,w===null?(l.next=l,cg(m)):(l.next=w.next,w.next=l),m.interleaved=l,wi(o,d)}function Zf(o,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194240)!==0)){var m=l.lanes;m&=o.pendingLanes,d|=m,l.lanes=d,k0(o,d)}}function Zw(o,l){var d=o.updateQueue,m=o.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var w=null,k=null;if(d=d.firstBaseUpdate,d!==null){do{var I={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};k===null?w=k=I:k=k.next=I,d=d.next}while(d!==null);k===null?w=k=l:k=k.next=l}else w=k=l;d={baseState:m.baseState,firstBaseUpdate:w,lastBaseUpdate:k,shared:m.shared,effects:m.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}function Yf(o,l,d,m){var w=o.updateQueue;po=!1;var k=w.firstBaseUpdate,I=w.lastBaseUpdate,F=w.shared.pending;if(F!==null){w.shared.pending=null;var U=F,se=U.next;U.next=null,I===null?k=se:I.next=se,I=U;var de=o.alternate;de!==null&&(de=de.updateQueue,F=de.lastBaseUpdate,F!==I&&(F===null?de.firstBaseUpdate=se:F.next=se,de.lastBaseUpdate=U))}if(k!==null){var he=w.baseState;I=0,de=se=U=null,F=k;do{var ce=F.lane,Te=F.eventTime;if((m&ce)===ce){de!==null&&(de=de.next={eventTime:Te,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var De=o,Fe=F;switch(ce=l,Te=d,Fe.tag){case 1:if(De=Fe.payload,typeof De=="function"){he=De.call(Te,he,ce);break e}he=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Fe.payload,ce=typeof De=="function"?De.call(Te,he,ce):De,ce==null)break e;he=H({},he,ce);break e;case 2:po=!0}}F.callback!==null&&F.lane!==0&&(o.flags|=64,ce=w.effects,ce===null?w.effects=[F]:ce.push(F))}else Te={eventTime:Te,lane:ce,tag:F.tag,payload:F.payload,callback:F.callback,next:null},de===null?(se=de=Te,U=he):de=de.next=Te,I|=ce;if(F=F.next,F===null){if(F=w.shared.pending,F===null)break;ce=F,F=ce.next,ce.next=null,w.lastBaseUpdate=ce,w.shared.pending=null}}while(!0);if(de===null&&(U=he),w.baseState=U,w.firstBaseUpdate=se,w.lastBaseUpdate=de,l=w.shared.interleaved,l!==null){w=l;do I|=w.lane,w=w.next;while(w!==l)}else k===null&&(w.shared.lanes=0);va|=I,o.lanes=I,o.memoizedState=he}}function Yw(o,l,d){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var m=o[l],w=m.callback;if(w!==null){if(m.callback=null,m=d,typeof w!="function")throw Error(n(191,w));w.call(m)}}}var bc={},$s=co(bc),Sc=co(bc),Ec=co(bc);function ma(o){if(o===bc)throw Error(n(174));return o}function fg(o,l){switch(Pt(Ec,l),Pt(Sc,o),Pt($s,bc),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Hn(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=Hn(l,o)}Nt($s),Pt($s,l)}function Ol(){Nt($s),Nt(Sc),Nt(Ec)}function Xw(o){ma(Ec.current);var l=ma($s.current),d=Hn(l,o.type);l!==d&&(Pt(Sc,o),Pt($s,d))}function hg(o){Sc.current===o&&(Nt($s),Nt(Sc))}var Wt=co(0);function Xf(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var pg=[];function mg(){for(var o=0;o<pg.length;o++)pg[o]._workInProgressVersionPrimary=null;pg.length=0}var Qf=T.ReactCurrentDispatcher,gg=T.ReactCurrentBatchConfig,ga=0,Gt=null,mn=null,En=null,Jf=!1,kc=!1,Cc=0,dM=0;function Un(){throw Error(n(321))}function vg(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!ms(o[d],l[d]))return!1;return!0}function yg(o,l,d,m,w,k){if(ga=k,Gt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Qf.current=o===null||o.memoizedState===null?mM:gM,o=d(m,w),kc){k=0;do{if(kc=!1,Cc=0,25<=k)throw Error(n(301));k+=1,En=mn=null,l.updateQueue=null,Qf.current=vM,o=d(m,w)}while(kc)}if(Qf.current=nh,l=mn!==null&&mn.next!==null,ga=0,En=mn=Gt=null,Jf=!1,l)throw Error(n(300));return o}function _g(){var o=Cc!==0;return Cc=0,o}function Hs(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return En===null?Gt.memoizedState=En=o:En=En.next=o,En}function Jr(){if(mn===null){var o=Gt.alternate;o=o!==null?o.memoizedState:null}else o=mn.next;var l=En===null?Gt.memoizedState:En.next;if(l!==null)En=l,mn=o;else{if(o===null)throw Error(n(310));mn=o,o={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},En===null?Gt.memoizedState=En=o:En=En.next=o}return En}function Pc(o,l){return typeof l=="function"?l(o):l}function xg(o){var l=Jr(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var m=mn,w=m.baseQueue,k=d.pending;if(k!==null){if(w!==null){var I=w.next;w.next=k.next,k.next=I}m.baseQueue=w=k,d.pending=null}if(w!==null){k=w.next,m=m.baseState;var F=I=null,U=null,se=k;do{var de=se.lane;if((ga&de)===de)U!==null&&(U=U.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),m=se.hasEagerState?se.eagerState:o(m,se.action);else{var he={lane:de,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};U===null?(F=U=he,I=m):U=U.next=he,Gt.lanes|=de,va|=de}se=se.next}while(se!==null&&se!==k);U===null?I=m:U.next=F,ms(m,l.memoizedState)||(pr=!0),l.memoizedState=m,l.baseState=I,l.baseQueue=U,d.lastRenderedState=m}if(o=d.interleaved,o!==null){w=o;do k=w.lane,Gt.lanes|=k,va|=k,w=w.next;while(w!==o)}else w===null&&(d.lanes=0);return[l.memoizedState,d.dispatch]}function wg(o){var l=Jr(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var m=d.dispatch,w=d.pending,k=l.memoizedState;if(w!==null){d.pending=null;var I=w=w.next;do k=o(k,I.action),I=I.next;while(I!==w);ms(k,l.memoizedState)||(pr=!0),l.memoizedState=k,l.baseQueue===null&&(l.baseState=k),d.lastRenderedState=k}return[k,m]}function Qw(){}function Jw(o,l){var d=Gt,m=Jr(),w=l(),k=!ms(m.memoizedState,w);if(k&&(m.memoizedState=w,pr=!0),m=m.queue,bg(nb.bind(null,d,m,o),[o]),m.getSnapshot!==l||k||En!==null&&En.memoizedState.tag&1){if(d.flags|=2048,Tc(9,tb.bind(null,d,m,w,l),void 0,null),kn===null)throw Error(n(349));(ga&30)!==0||eb(d,l,w)}return w}function eb(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=Gt.updateQueue,l===null?(l={lastEffect:null,stores:null},Gt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function tb(o,l,d,m){l.value=d,l.getSnapshot=m,rb(l)&&sb(o)}function nb(o,l,d){return d(function(){rb(l)&&sb(o)})}function rb(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!ms(o,d)}catch{return!0}}function sb(o){var l=wi(o,1);l!==null&&xs(l,o,1,-1)}function ib(o){var l=Hs();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pc,lastRenderedState:o},l.queue=o,o=o.dispatch=pM.bind(null,Gt,o),[l.memoizedState,o]}function Tc(o,l,d,m){return o={tag:o,create:l,destroy:d,deps:m,next:null},l=Gt.updateQueue,l===null?(l={lastEffect:null,stores:null},Gt.updateQueue=l,l.lastEffect=o.next=o):(d=l.lastEffect,d===null?l.lastEffect=o.next=o:(m=d.next,d.next=o,o.next=m,l.lastEffect=o)),o}function ob(){return Jr().memoizedState}function eh(o,l,d,m){var w=Hs();Gt.flags|=o,w.memoizedState=Tc(1|l,d,void 0,m===void 0?null:m)}function th(o,l,d,m){var w=Jr();m=m===void 0?null:m;var k=void 0;if(mn!==null){var I=mn.memoizedState;if(k=I.destroy,m!==null&&vg(m,I.deps)){w.memoizedState=Tc(l,d,k,m);return}}Gt.flags|=o,w.memoizedState=Tc(1|l,d,k,m)}function ab(o,l){return eh(8390656,8,o,l)}function bg(o,l){return th(2048,8,o,l)}function lb(o,l){return th(4,2,o,l)}function ub(o,l){return th(4,4,o,l)}function cb(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function db(o,l,d){return d=d!=null?d.concat([o]):null,th(4,4,cb.bind(null,l,o),d)}function Sg(){}function fb(o,l){var d=Jr();l=l===void 0?null:l;var m=d.memoizedState;return m!==null&&l!==null&&vg(l,m[1])?m[0]:(d.memoizedState=[o,l],o)}function hb(o,l){var d=Jr();l=l===void 0?null:l;var m=d.memoizedState;return m!==null&&l!==null&&vg(l,m[1])?m[0]:(o=o(),d.memoizedState=[o,l],o)}function pb(o,l,d){return(ga&21)===0?(o.baseState&&(o.baseState=!1,pr=!0),o.memoizedState=d):(ms(d,l)||(d=ps(),Gt.lanes|=d,va|=d,o.baseState=!0),l)}function fM(o,l){var d=gt;gt=d!==0&&4>d?d:4,o(!0);var m=gg.transition;gg.transition={};try{o(!1),l()}finally{gt=d,gg.transition=m}}function mb(){return Jr().memoizedState}function hM(o,l,d){var m=_o(o);if(d={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null},gb(o))vb(l,d);else if(d=Kw(o,l,d,m),d!==null){var w=er();xs(d,o,m,w),yb(d,l,m)}}function pM(o,l,d){var m=_o(o),w={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null};if(gb(o))vb(l,w);else{var k=o.alternate;if(o.lanes===0&&(k===null||k.lanes===0)&&(k=l.lastRenderedReducer,k!==null))try{var I=l.lastRenderedState,F=k(I,d);if(w.hasEagerState=!0,w.eagerState=F,ms(F,I)){var U=l.interleaved;U===null?(w.next=w,cg(l)):(w.next=U.next,U.next=w),l.interleaved=w;return}}catch{}finally{}d=Kw(o,l,w,m),d!==null&&(w=er(),xs(d,o,m,w),yb(d,l,m))}}function gb(o){var l=o.alternate;return o===Gt||l!==null&&l===Gt}function vb(o,l){kc=Jf=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function yb(o,l,d){if((d&4194240)!==0){var m=l.lanes;m&=o.pendingLanes,d|=m,l.lanes=d,k0(o,d)}}var nh={readContext:Qr,useCallback:Un,useContext:Un,useEffect:Un,useImperativeHandle:Un,useInsertionEffect:Un,useLayoutEffect:Un,useMemo:Un,useReducer:Un,useRef:Un,useState:Un,useDebugValue:Un,useDeferredValue:Un,useTransition:Un,useMutableSource:Un,useSyncExternalStore:Un,useId:Un,unstable_isNewReconciler:!1},mM={readContext:Qr,useCallback:function(o,l){return Hs().memoizedState=[o,l===void 0?null:l],o},useContext:Qr,useEffect:ab,useImperativeHandle:function(o,l,d){return d=d!=null?d.concat([o]):null,eh(4194308,4,cb.bind(null,l,o),d)},useLayoutEffect:function(o,l){return eh(4194308,4,o,l)},useInsertionEffect:function(o,l){return eh(4,2,o,l)},useMemo:function(o,l){var d=Hs();return l=l===void 0?null:l,o=o(),d.memoizedState=[o,l],o},useReducer:function(o,l,d){var m=Hs();return l=d!==void 0?d(l):l,m.memoizedState=m.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},m.queue=o,o=o.dispatch=hM.bind(null,Gt,o),[m.memoizedState,o]},useRef:function(o){var l=Hs();return o={current:o},l.memoizedState=o},useState:ib,useDebugValue:Sg,useDeferredValue:function(o){return Hs().memoizedState=o},useTransition:function(){var o=ib(!1),l=o[0];return o=fM.bind(null,o[1]),Hs().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,d){var m=Gt,w=Hs();if(Ft){if(d===void 0)throw Error(n(407));d=d()}else{if(d=l(),kn===null)throw Error(n(349));(ga&30)!==0||eb(m,l,d)}w.memoizedState=d;var k={value:d,getSnapshot:l};return w.queue=k,ab(nb.bind(null,m,k,o),[o]),m.flags|=2048,Tc(9,tb.bind(null,m,k,d,l),void 0,null),d},useId:function(){var o=Hs(),l=kn.identifierPrefix;if(Ft){var d=xi,m=_i;d=(m&~(1<<32-oe(m)-1)).toString(32)+d,l=":"+l+"R"+d,d=Cc++,0<d&&(l+="H"+d.toString(32)),l+=":"}else d=dM++,l=":"+l+"r"+d.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},gM={readContext:Qr,useCallback:fb,useContext:Qr,useEffect:bg,useImperativeHandle:db,useInsertionEffect:lb,useLayoutEffect:ub,useMemo:hb,useReducer:xg,useRef:ob,useState:function(){return xg(Pc)},useDebugValue:Sg,useDeferredValue:function(o){var l=Jr();return pb(l,mn.memoizedState,o)},useTransition:function(){var o=xg(Pc)[0],l=Jr().memoizedState;return[o,l]},useMutableSource:Qw,useSyncExternalStore:Jw,useId:mb,unstable_isNewReconciler:!1},vM={readContext:Qr,useCallback:fb,useContext:Qr,useEffect:bg,useImperativeHandle:db,useInsertionEffect:lb,useLayoutEffect:ub,useMemo:hb,useReducer:wg,useRef:ob,useState:function(){return wg(Pc)},useDebugValue:Sg,useDeferredValue:function(o){var l=Jr();return mn===null?l.memoizedState=o:pb(l,mn.memoizedState,o)},useTransition:function(){var o=wg(Pc)[0],l=Jr().memoizedState;return[o,l]},useMutableSource:Qw,useSyncExternalStore:Jw,useId:mb,unstable_isNewReconciler:!1};function vs(o,l){if(o&&o.defaultProps){l=H({},l),o=o.defaultProps;for(var d in o)l[d]===void 0&&(l[d]=o[d]);return l}return l}function Eg(o,l,d,m){l=o.memoizedState,d=d(m,l),d=d==null?l:H({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var rh={isMounted:function(o){return(o=o._reactInternals)?mi(o)===o:!1},enqueueSetState:function(o,l,d){o=o._reactInternals;var m=er(),w=_o(o),k=bi(m,w);k.payload=l,d!=null&&(k.callback=d),l=mo(o,k,w),l!==null&&(xs(l,o,w,m),Zf(l,o,w))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var m=er(),w=_o(o),k=bi(m,w);k.tag=1,k.payload=l,d!=null&&(k.callback=d),l=mo(o,k,w),l!==null&&(xs(l,o,w,m),Zf(l,o,w))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=er(),m=_o(o),w=bi(d,m);w.tag=2,l!=null&&(w.callback=l),l=mo(o,w,m),l!==null&&(xs(l,o,m,d),Zf(l,o,m))}};function _b(o,l,d,m,w,k,I){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,k,I):l.prototype&&l.prototype.isPureReactComponent?!pc(d,m)||!pc(w,k):!0}function xb(o,l,d){var m=!1,w=fo,k=l.contextType;return typeof k=="object"&&k!==null?k=Qr(k):(w=hr(l)?da:zn.current,m=l.contextTypes,k=(m=m!=null)?Pl(o,w):fo),l=new l(d,k),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=rh,o.stateNode=l,l._reactInternals=o,m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=w,o.__reactInternalMemoizedMaskedChildContext=k),l}function wb(o,l,d,m){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,m),l.state!==o&&rh.enqueueReplaceState(l,l.state,null)}function kg(o,l,d,m){var w=o.stateNode;w.props=d,w.state=o.memoizedState,w.refs={},dg(o);var k=l.contextType;typeof k=="object"&&k!==null?w.context=Qr(k):(k=hr(l)?da:zn.current,w.context=Pl(o,k)),w.state=o.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(Eg(o,l,k,d),w.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(l=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),l!==w.state&&rh.enqueueReplaceState(w,w.state,null),Yf(o,d,w,m),w.state=o.memoizedState),typeof w.componentDidMount=="function"&&(o.flags|=4194308)}function Dl(o,l){try{var d="",m=l;do d+=ae(m),m=m.return;while(m);var w=d}catch(k){w=`
|
|
40
|
+
Error generating stack: `+k.message+`
|
|
41
|
+
`+k.stack}return{value:o,source:l,stack:w,digest:null}}function Cg(o,l,d){return{value:o,source:null,stack:d??null,digest:l??null}}function Pg(o,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var yM=typeof WeakMap=="function"?WeakMap:Map;function bb(o,l,d){d=bi(-1,d),d.tag=3,d.payload={element:null};var m=l.value;return d.callback=function(){ch||(ch=!0,zg=m),Pg(o,l)},d}function Sb(o,l,d){d=bi(-1,d),d.tag=3;var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var w=l.value;d.payload=function(){return m(w)},d.callback=function(){Pg(o,l)}}var k=o.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(d.callback=function(){Pg(o,l),typeof m!="function"&&(vo===null?vo=new Set([this]):vo.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),d}function Eb(o,l,d){var m=o.pingCache;if(m===null){m=o.pingCache=new yM;var w=new Set;m.set(l,w)}else w=m.get(l),w===void 0&&(w=new Set,m.set(l,w));w.has(d)||(w.add(d),o=MM.bind(null,o,l,d),l.then(o,o))}function kb(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 Cb(o,l,d,m,w){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=bi(-1,1),l.tag=2,mo(d,l,1))),d.lanes|=1),o):(o.flags|=65536,o.lanes=w,o)}var _M=T.ReactCurrentOwner,pr=!1;function Jn(o,l,d,m){l.child=o===null?Gw(l,null,d,m):Il(l,o.child,d,m)}function Pb(o,l,d,m,w){d=d.render;var k=l.ref;return Nl(l,w),m=yg(o,l,d,m,k,w),d=_g(),o!==null&&!pr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~w,Si(o,l,w)):(Ft&&d&&tg(l),l.flags|=1,Jn(o,l,m,w),l.child)}function Tb(o,l,d,m,w){if(o===null){var k=d.type;return typeof k=="function"&&!Zg(k)&&k.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=k,Rb(o,l,k,m,w)):(o=gh(d.type,null,m,l,l.mode,w),o.ref=l.ref,o.return=l,l.child=o)}if(k=o.child,(o.lanes&w)===0){var I=k.memoizedProps;if(d=d.compare,d=d!==null?d:pc,d(I,m)&&o.ref===l.ref)return Si(o,l,w)}return l.flags|=1,o=wo(k,m),o.ref=l.ref,o.return=l,l.child=o}function Rb(o,l,d,m,w){if(o!==null){var k=o.memoizedProps;if(pc(k,m)&&o.ref===l.ref)if(pr=!1,l.pendingProps=m=k,(o.lanes&w)!==0)(o.flags&131072)!==0&&(pr=!0);else return l.lanes=o.lanes,Si(o,l,w)}return Tg(o,l,d,m,w)}function Ab(o,l,d){var m=l.pendingProps,w=m.children,k=o!==null?o.memoizedState:null;if(m.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pt(jl,Lr),Lr|=d;else{if((d&1073741824)===0)return o=k!==null?k.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Pt(jl,Lr),Lr|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=k!==null?k.baseLanes:d,Pt(jl,Lr),Lr|=m}else k!==null?(m=k.baseLanes|d,l.memoizedState=null):m=d,Pt(jl,Lr),Lr|=m;return Jn(o,l,w,d),l.child}function Ib(o,l){var d=l.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(l.flags|=512,l.flags|=2097152)}function Tg(o,l,d,m,w){var k=hr(d)?da:zn.current;return k=Pl(l,k),Nl(l,w),d=yg(o,l,d,m,k,w),m=_g(),o!==null&&!pr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~w,Si(o,l,w)):(Ft&&m&&tg(l),l.flags|=1,Jn(o,l,d,w),l.child)}function Mb(o,l,d,m,w){if(hr(d)){var k=!0;Hf(l)}else k=!1;if(Nl(l,w),l.stateNode===null)ih(o,l),xb(l,d,m),kg(l,d,m,w),m=!0;else if(o===null){var I=l.stateNode,F=l.memoizedProps;I.props=F;var U=I.context,se=d.contextType;typeof se=="object"&&se!==null?se=Qr(se):(se=hr(d)?da:zn.current,se=Pl(l,se));var de=d.getDerivedStateFromProps,he=typeof de=="function"||typeof I.getSnapshotBeforeUpdate=="function";he||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(F!==m||U!==se)&&wb(l,I,m,se),po=!1;var ce=l.memoizedState;I.state=ce,Yf(l,m,I,w),U=l.memoizedState,F!==m||ce!==U||fr.current||po?(typeof de=="function"&&(Eg(l,d,de,m),U=l.memoizedState),(F=po||_b(l,d,F,m,ce,U,se))?(he||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=U),I.props=m,I.state=U,I.context=se,m=F):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{I=l.stateNode,qw(o,l),F=l.memoizedProps,se=l.type===l.elementType?F:vs(l.type,F),I.props=se,he=l.pendingProps,ce=I.context,U=d.contextType,typeof U=="object"&&U!==null?U=Qr(U):(U=hr(d)?da:zn.current,U=Pl(l,U));var Te=d.getDerivedStateFromProps;(de=typeof Te=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(F!==he||ce!==U)&&wb(l,I,m,U),po=!1,ce=l.memoizedState,I.state=ce,Yf(l,m,I,w);var De=l.memoizedState;F!==he||ce!==De||fr.current||po?(typeof Te=="function"&&(Eg(l,d,Te,m),De=l.memoizedState),(se=po||_b(l,d,se,m,ce,De,U)||!1)?(de||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(m,De,U),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(m,De,U)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||F===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||F===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=De),I.props=m,I.state=De,I.context=U,m=se):(typeof I.componentDidUpdate!="function"||F===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||F===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),m=!1)}return Rg(o,l,d,m,k,w)}function Rg(o,l,d,m,w,k){Ib(o,l);var I=(l.flags&128)!==0;if(!m&&!I)return w&&jw(l,d,!1),Si(o,l,k);m=l.stateNode,_M.current=l;var F=I&&typeof d.getDerivedStateFromError!="function"?null:m.render();return l.flags|=1,o!==null&&I?(l.child=Il(l,o.child,null,k),l.child=Il(l,null,F,k)):Jn(o,l,F,k),l.memoizedState=m.state,w&&jw(l,d,!0),l.child}function Nb(o){var l=o.stateNode;l.pendingContext?Dw(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Dw(o,l.context,!1),fg(o,l.containerInfo)}function Ob(o,l,d,m,w){return Al(),ig(w),l.flags|=256,Jn(o,l,d,m),l.child}var Ag={dehydrated:null,treeContext:null,retryLane:0};function Ig(o){return{baseLanes:o,cachePool:null,transitions:null}}function Db(o,l,d){var m=l.pendingProps,w=Wt.current,k=!1,I=(l.flags&128)!==0,F;if((F=I)||(F=o!==null&&o.memoizedState===null?!1:(w&2)!==0),F?(k=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(w|=1),Pt(Wt,w&1),o===null)return sg(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((l.mode&1)===0?l.lanes=1:o.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(I=m.children,o=m.fallback,k?(m=l.mode,k=l.child,I={mode:"hidden",children:I},(m&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=I):k=vh(I,m,0,null),o=wa(o,m,d,null),k.return=l,o.return=l,k.sibling=o,l.child=k,l.child.memoizedState=Ig(d),l.memoizedState=Ag,o):Mg(l,I));if(w=o.memoizedState,w!==null&&(F=w.dehydrated,F!==null))return xM(o,l,I,m,F,w,d);if(k){k=m.fallback,I=l.mode,w=o.child,F=w.sibling;var U={mode:"hidden",children:m.children};return(I&1)===0&&l.child!==w?(m=l.child,m.childLanes=0,m.pendingProps=U,l.deletions=null):(m=wo(w,U),m.subtreeFlags=w.subtreeFlags&14680064),F!==null?k=wo(F,k):(k=wa(k,I,d,null),k.flags|=2),k.return=l,m.return=l,m.sibling=k,l.child=m,m=k,k=l.child,I=o.child.memoizedState,I=I===null?Ig(d):{baseLanes:I.baseLanes|d,cachePool:null,transitions:I.transitions},k.memoizedState=I,k.childLanes=o.childLanes&~d,l.memoizedState=Ag,m}return k=o.child,o=k.sibling,m=wo(k,{mode:"visible",children:m.children}),(l.mode&1)===0&&(m.lanes=d),m.return=l,m.sibling=null,o!==null&&(d=l.deletions,d===null?(l.deletions=[o],l.flags|=16):d.push(o)),l.child=m,l.memoizedState=null,m}function Mg(o,l){return l=vh({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function sh(o,l,d,m){return m!==null&&ig(m),Il(l,o.child,null,d),o=Mg(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function xM(o,l,d,m,w,k,I){if(d)return l.flags&256?(l.flags&=-257,m=Cg(Error(n(422))),sh(o,l,I,m)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(k=m.fallback,w=l.mode,m=vh({mode:"visible",children:m.children},w,0,null),k=wa(k,w,I,null),k.flags|=2,m.return=l,k.return=l,m.sibling=k,l.child=m,(l.mode&1)!==0&&Il(l,o.child,null,I),l.child.memoizedState=Ig(I),l.memoizedState=Ag,k);if((l.mode&1)===0)return sh(o,l,I,null);if(w.data==="$!"){if(m=w.nextSibling&&w.nextSibling.dataset,m)var F=m.dgst;return m=F,k=Error(n(419)),m=Cg(k,m,void 0),sh(o,l,I,m)}if(F=(I&o.childLanes)!==0,pr||F){if(m=kn,m!==null){switch(I&-I){case 4:w=2;break;case 16:w=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:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(m.suspendedLanes|I))!==0?0:w,w!==0&&w!==k.retryLane&&(k.retryLane=w,wi(o,w),xs(m,o,w,-1))}return qg(),m=Cg(Error(n(421))),sh(o,l,I,m)}return w.data==="$?"?(l.flags|=128,l.child=o.child,l=NM.bind(null,o),w._reactRetry=l,null):(o=k.treeContext,Dr=uo(w.nextSibling),Or=l,Ft=!0,gs=null,o!==null&&(Yr[Xr++]=_i,Yr[Xr++]=xi,Yr[Xr++]=fa,_i=o.id,xi=o.overflow,fa=l),l=Mg(l,m.children),l.flags|=4096,l)}function Lb(o,l,d){o.lanes|=l;var m=o.alternate;m!==null&&(m.lanes|=l),ug(o.return,l,d)}function Ng(o,l,d,m,w){var k=o.memoizedState;k===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:w}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=m,k.tail=d,k.tailMode=w)}function jb(o,l,d){var m=l.pendingProps,w=m.revealOrder,k=m.tail;if(Jn(o,l,m.children,d),m=Wt.current,(m&2)!==0)m=m&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&&Lb(o,d,l);else if(o.tag===19)Lb(o,d,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}m&=1}if(Pt(Wt,m),(l.mode&1)===0)l.memoizedState=null;else switch(w){case"forwards":for(d=l.child,w=null;d!==null;)o=d.alternate,o!==null&&Xf(o)===null&&(w=d),d=d.sibling;d=w,d===null?(w=l.child,l.child=null):(w=d.sibling,d.sibling=null),Ng(l,!1,w,d,k);break;case"backwards":for(d=null,w=l.child,l.child=null;w!==null;){if(o=w.alternate,o!==null&&Xf(o)===null){l.child=w;break}o=w.sibling,w.sibling=d,d=w,w=o}Ng(l,!0,d,null,k);break;case"together":Ng(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function ih(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function Si(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),va|=l.lanes,(d&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,d=wo(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=wo(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function wM(o,l,d){switch(l.tag){case 3:Nb(l),Al();break;case 5:Xw(l);break;case 1:hr(l.type)&&Hf(l);break;case 4:fg(l,l.stateNode.containerInfo);break;case 10:var m=l.type._context,w=l.memoizedProps.value;Pt(Kf,m._currentValue),m._currentValue=w;break;case 13:if(m=l.memoizedState,m!==null)return m.dehydrated!==null?(Pt(Wt,Wt.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?Db(o,l,d):(Pt(Wt,Wt.current&1),o=Si(o,l,d),o!==null?o.sibling:null);Pt(Wt,Wt.current&1);break;case 19:if(m=(d&l.childLanes)!==0,(o.flags&128)!==0){if(m)return jb(o,l,d);l.flags|=128}if(w=l.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),Pt(Wt,Wt.current),m)break;return null;case 22:case 23:return l.lanes=0,Ab(o,l,d)}return Si(o,l,d)}var Fb,Og,Vb,$b;Fb=function(o,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Og=function(){},Vb=function(o,l,d,m){var w=o.memoizedProps;if(w!==m){o=l.stateNode,ma($s.current);var k=null;switch(d){case"input":w=it(o,w),m=it(o,m),k=[];break;case"select":w=H({},w,{value:void 0}),m=H({},m,{value:void 0}),k=[];break;case"textarea":w=Je(o,w),m=Je(o,m),k=[];break;default:typeof w.onClick!="function"&&typeof m.onClick=="function"&&(o.onclick=Ff)}fs(d,m);var I;d=null;for(se in w)if(!m.hasOwnProperty(se)&&w.hasOwnProperty(se)&&w[se]!=null)if(se==="style"){var F=w[se];for(I in F)F.hasOwnProperty(I)&&(d||(d={}),d[I]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(s.hasOwnProperty(se)?k||(k=[]):(k=k||[]).push(se,null));for(se in m){var U=m[se];if(F=w!=null?w[se]:void 0,m.hasOwnProperty(se)&&U!==F&&(U!=null||F!=null))if(se==="style")if(F){for(I in F)!F.hasOwnProperty(I)||U&&U.hasOwnProperty(I)||(d||(d={}),d[I]="");for(I in U)U.hasOwnProperty(I)&&F[I]!==U[I]&&(d||(d={}),d[I]=U[I])}else d||(k||(k=[]),k.push(se,d)),d=U;else se==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,F=F?F.__html:void 0,U!=null&&F!==U&&(k=k||[]).push(se,U)):se==="children"?typeof U!="string"&&typeof U!="number"||(k=k||[]).push(se,""+U):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(s.hasOwnProperty(se)?(U!=null&&se==="onScroll"&&Mt("scroll",o),k||F===U||(k=[])):(k=k||[]).push(se,U))}d&&(k=k||[]).push("style",d);var se=k;(l.updateQueue=se)&&(l.flags|=4)}},$b=function(o,l,d,m){d!==m&&(l.flags|=4)};function Rc(o,l){if(!Ft)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function Bn(o){var l=o.alternate!==null&&o.alternate.child===o.child,d=0,m=0;if(l)for(var w=o.child;w!==null;)d|=w.lanes|w.childLanes,m|=w.subtreeFlags&14680064,m|=w.flags&14680064,w.return=o,w=w.sibling;else for(w=o.child;w!==null;)d|=w.lanes|w.childLanes,m|=w.subtreeFlags,m|=w.flags,w.return=o,w=w.sibling;return o.subtreeFlags|=m,o.childLanes=d,l}function bM(o,l,d){var m=l.pendingProps;switch(ng(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bn(l),null;case 1:return hr(l.type)&&$f(),Bn(l),null;case 3:return m=l.stateNode,Ol(),Nt(fr),Nt(zn),mg(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(o===null||o.child===null)&&(Wf(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,gs!==null&&(Wg(gs),gs=null))),Og(o,l),Bn(l),null;case 5:hg(l);var w=ma(Ec.current);if(d=l.type,o!==null&&l.stateNode!=null)Vb(o,l,d,m,w),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!m){if(l.stateNode===null)throw Error(n(166));return Bn(l),null}if(o=ma($s.current),Wf(l)){m=l.stateNode,d=l.type;var k=l.memoizedProps;switch(m[Vs]=l,m[_c]=k,o=(l.mode&1)!==0,d){case"dialog":Mt("cancel",m),Mt("close",m);break;case"iframe":case"object":case"embed":Mt("load",m);break;case"video":case"audio":for(w=0;w<gc.length;w++)Mt(gc[w],m);break;case"source":Mt("error",m);break;case"img":case"image":case"link":Mt("error",m),Mt("load",m);break;case"details":Mt("toggle",m);break;case"input":Ae(m,k),Mt("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!k.multiple},Mt("invalid",m);break;case"textarea":vt(m,k),Mt("invalid",m)}fs(d,k),w=null;for(var I in k)if(k.hasOwnProperty(I)){var F=k[I];I==="children"?typeof F=="string"?m.textContent!==F&&(k.suppressHydrationWarning!==!0&&jf(m.textContent,F,o),w=["children",F]):typeof F=="number"&&m.textContent!==""+F&&(k.suppressHydrationWarning!==!0&&jf(m.textContent,F,o),w=["children",""+F]):s.hasOwnProperty(I)&&F!=null&&I==="onScroll"&&Mt("scroll",m)}switch(d){case"input":we(m),mt(m,k,!0);break;case"textarea":we(m),Ut(m);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(m.onclick=Ff)}m=w,l.updateQueue=m,m!==null&&(l.flags|=4)}else{I=w.nodeType===9?w:w.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=Rn(d)),o==="http://www.w3.org/1999/xhtml"?d==="script"?(o=I.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof m.is=="string"?o=I.createElement(d,{is:m.is}):(o=I.createElement(d),d==="select"&&(I=o,m.multiple?I.multiple=!0:m.size&&(I.size=m.size))):o=I.createElementNS(o,d),o[Vs]=l,o[_c]=m,Fb(o,l,!1,!1),l.stateNode=o;e:{switch(I=Ns(d,m),d){case"dialog":Mt("cancel",o),Mt("close",o),w=m;break;case"iframe":case"object":case"embed":Mt("load",o),w=m;break;case"video":case"audio":for(w=0;w<gc.length;w++)Mt(gc[w],o);w=m;break;case"source":Mt("error",o),w=m;break;case"img":case"image":case"link":Mt("error",o),Mt("load",o),w=m;break;case"details":Mt("toggle",o),w=m;break;case"input":Ae(o,m),w=it(o,m),Mt("invalid",o);break;case"option":w=m;break;case"select":o._wrapperState={wasMultiple:!!m.multiple},w=H({},m,{value:void 0}),Mt("invalid",o);break;case"textarea":vt(o,m),w=Je(o,m),Mt("invalid",o);break;default:w=m}fs(d,w),F=w;for(k in F)if(F.hasOwnProperty(k)){var U=F[k];k==="style"?fi(o,U):k==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&Yn(o,U)):k==="children"?typeof U=="string"?(d!=="textarea"||U!=="")&&wn(o,U):typeof U=="number"&&wn(o,""+U):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(s.hasOwnProperty(k)?U!=null&&k==="onScroll"&&Mt("scroll",o):U!=null&&P(o,k,U,I))}switch(d){case"input":we(o),mt(o,m,!1);break;case"textarea":we(o),Ut(o);break;case"option":m.value!=null&&o.setAttribute("value",""+ee(m.value));break;case"select":o.multiple=!!m.multiple,k=m.value,k!=null?lt(o,!!m.multiple,k,!1):m.defaultValue!=null&<(o,!!m.multiple,m.defaultValue,!0);break;default:typeof w.onClick=="function"&&(o.onclick=Ff)}switch(d){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Bn(l),null;case 6:if(o&&l.stateNode!=null)$b(o,l,o.memoizedProps,m);else{if(typeof m!="string"&&l.stateNode===null)throw Error(n(166));if(d=ma(Ec.current),ma($s.current),Wf(l)){if(m=l.stateNode,d=l.memoizedProps,m[Vs]=l,(k=m.nodeValue!==d)&&(o=Or,o!==null))switch(o.tag){case 3:jf(m.nodeValue,d,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&jf(m.nodeValue,d,(o.mode&1)!==0)}k&&(l.flags|=4)}else m=(d.nodeType===9?d:d.ownerDocument).createTextNode(m),m[Vs]=l,l.stateNode=m}return Bn(l),null;case 13:if(Nt(Wt),m=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Ft&&Dr!==null&&(l.mode&1)!==0&&(l.flags&128)===0)Uw(),Al(),l.flags|=98560,k=!1;else if(k=Wf(l),m!==null&&m.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[Vs]=l}else Al(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Bn(l),k=!1}else gs!==null&&(Wg(gs),gs=null),k=!0;if(!k)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(m=m!==null,m!==(o!==null&&o.memoizedState!==null)&&m&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Wt.current&1)!==0?gn===0&&(gn=3):qg())),l.updateQueue!==null&&(l.flags|=4),Bn(l),null);case 4:return Ol(),Og(o,l),o===null&&vc(l.stateNode.containerInfo),Bn(l),null;case 10:return lg(l.type._context),Bn(l),null;case 17:return hr(l.type)&&$f(),Bn(l),null;case 19:if(Nt(Wt),k=l.memoizedState,k===null)return Bn(l),null;if(m=(l.flags&128)!==0,I=k.rendering,I===null)if(m)Rc(k,!1);else{if(gn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(I=Xf(o),I!==null){for(l.flags|=128,Rc(k,!1),m=I.updateQueue,m!==null&&(l.updateQueue=m,l.flags|=4),l.subtreeFlags=0,m=d,d=l.child;d!==null;)k=d,o=m,k.flags&=14680066,I=k.alternate,I===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=I.childLanes,k.lanes=I.lanes,k.child=I.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=I.memoizedProps,k.memoizedState=I.memoizedState,k.updateQueue=I.updateQueue,k.type=I.type,o=I.dependencies,k.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),d=d.sibling;return Pt(Wt,Wt.current&1|2),l.child}o=o.sibling}k.tail!==null&&It()>Fl&&(l.flags|=128,m=!0,Rc(k,!1),l.lanes=4194304)}else{if(!m)if(o=Xf(I),o!==null){if(l.flags|=128,m=!0,d=o.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),Rc(k,!0),k.tail===null&&k.tailMode==="hidden"&&!I.alternate&&!Ft)return Bn(l),null}else 2*It()-k.renderingStartTime>Fl&&d!==1073741824&&(l.flags|=128,m=!0,Rc(k,!1),l.lanes=4194304);k.isBackwards?(I.sibling=l.child,l.child=I):(d=k.last,d!==null?d.sibling=I:l.child=I,k.last=I)}return k.tail!==null?(l=k.tail,k.rendering=l,k.tail=l.sibling,k.renderingStartTime=It(),l.sibling=null,d=Wt.current,Pt(Wt,m?d&1|2:d&1),l):(Bn(l),null);case 22:case 23:return Kg(),m=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==m&&(l.flags|=8192),m&&(l.mode&1)!==0?(Lr&1073741824)!==0&&(Bn(l),l.subtreeFlags&6&&(l.flags|=8192)):Bn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function SM(o,l){switch(ng(l),l.tag){case 1:return hr(l.type)&&$f(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Ol(),Nt(fr),Nt(zn),mg(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return hg(l),null;case 13:if(Nt(Wt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Al()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Nt(Wt),null;case 4:return Ol(),null;case 10:return lg(l.type._context),null;case 22:case 23:return Kg(),null;case 24:return null;default:return null}}var oh=!1,Wn=!1,EM=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Ll(o,l){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(m){Qt(o,l,m)}else d.current=null}function Dg(o,l,d){try{d()}catch(m){Qt(o,l,m)}}var Hb=!1;function kM(o,l){if(K0=Cf,o=_w(),V0(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var w=m.anchorOffset,k=m.focusNode;m=m.focusOffset;try{d.nodeType,k.nodeType}catch{d=null;break e}var I=0,F=-1,U=-1,se=0,de=0,he=o,ce=null;t:for(;;){for(var Te;he!==d||w!==0&&he.nodeType!==3||(F=I+w),he!==k||m!==0&&he.nodeType!==3||(U=I+m),he.nodeType===3&&(I+=he.nodeValue.length),(Te=he.firstChild)!==null;)ce=he,he=Te;for(;;){if(he===o)break t;if(ce===d&&++se===w&&(F=I),ce===k&&++de===m&&(U=I),(Te=he.nextSibling)!==null)break;he=ce,ce=he.parentNode}he=Te}d=F===-1||U===-1?null:{start:F,end:U}}else d=null}d=d||{start:0,end:0}}else d=null;for(q0={focusedElem:o,selectionRange:d},Cf=!1,Ne=l;Ne!==null;)if(l=Ne,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Ne=o;else for(;Ne!==null;){l=Ne;try{var De=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(De!==null){var Fe=De.memoizedProps,sn=De.memoizedState,Q=l.stateNode,q=Q.getSnapshotBeforeUpdate(l.elementType===l.type?Fe:vs(l.type,Fe),sn);Q.__reactInternalSnapshotBeforeUpdate=q}break;case 3:var J=l.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ve){Qt(l,l.return,ve)}if(o=l.sibling,o!==null){o.return=l.return,Ne=o;break}Ne=l.return}return De=Hb,Hb=!1,De}function Ac(o,l,d){var m=l.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var w=m=m.next;do{if((w.tag&o)===o){var k=w.destroy;w.destroy=void 0,k!==void 0&&Dg(l,d,k)}w=w.next}while(w!==m)}}function ah(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&o)===o){var m=d.create;d.destroy=m()}d=d.next}while(d!==l)}}function Lg(o){var l=o.ref;if(l!==null){var d=o.stateNode;switch(o.tag){case 5:o=d;break;default:o=d}typeof l=="function"?l(o):l.current=o}}function zb(o){var l=o.alternate;l!==null&&(o.alternate=null,zb(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Vs],delete l[_c],delete l[Q0],delete l[aM],delete l[lM])),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 Ub(o){return o.tag===5||o.tag===3||o.tag===4}function Bb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Ub(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 jg(o,l,d){var m=o.tag;if(m===5||m===6)o=o.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(o,l):d.insertBefore(o,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(o,d)):(l=d,l.appendChild(o)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Ff));else if(m!==4&&(o=o.child,o!==null))for(jg(o,l,d),o=o.sibling;o!==null;)jg(o,l,d),o=o.sibling}function Fg(o,l,d){var m=o.tag;if(m===5||m===6)o=o.stateNode,l?d.insertBefore(o,l):d.appendChild(o);else if(m!==4&&(o=o.child,o!==null))for(Fg(o,l,d),o=o.sibling;o!==null;)Fg(o,l,d),o=o.sibling}var In=null,ys=!1;function go(o,l,d){for(d=d.child;d!==null;)Wb(o,l,d),d=d.sibling}function Wb(o,l,d){if(Mr&&typeof Mr.onCommitFiberUnmount=="function")try{Mr.onCommitFiberUnmount(ua,d)}catch{}switch(d.tag){case 5:Wn||Ll(d,l);case 6:var m=In,w=ys;In=null,go(o,l,d),In=m,ys=w,In!==null&&(ys?(o=In,d=d.stateNode,o.nodeType===8?o.parentNode.removeChild(d):o.removeChild(d)):In.removeChild(d.stateNode));break;case 18:In!==null&&(ys?(o=In,d=d.stateNode,o.nodeType===8?X0(o.parentNode,d):o.nodeType===1&&X0(o,d),lc(o)):X0(In,d.stateNode));break;case 4:m=In,w=ys,In=d.stateNode.containerInfo,ys=!0,go(o,l,d),In=m,ys=w;break;case 0:case 11:case 14:case 15:if(!Wn&&(m=d.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){w=m=m.next;do{var k=w,I=k.destroy;k=k.tag,I!==void 0&&((k&2)!==0||(k&4)!==0)&&Dg(d,l,I),w=w.next}while(w!==m)}go(o,l,d);break;case 1:if(!Wn&&(Ll(d,l),m=d.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=d.memoizedProps,m.state=d.memoizedState,m.componentWillUnmount()}catch(F){Qt(d,l,F)}go(o,l,d);break;case 21:go(o,l,d);break;case 22:d.mode&1?(Wn=(m=Wn)||d.memoizedState!==null,go(o,l,d),Wn=m):go(o,l,d);break;default:go(o,l,d)}}function Gb(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new EM),l.forEach(function(m){var w=OM.bind(null,o,m);d.has(m)||(d.add(m),m.then(w,w))})}}function _s(o,l){var d=l.deletions;if(d!==null)for(var m=0;m<d.length;m++){var w=d[m];try{var k=o,I=l,F=I;e:for(;F!==null;){switch(F.tag){case 5:In=F.stateNode,ys=!1;break e;case 3:In=F.stateNode.containerInfo,ys=!0;break e;case 4:In=F.stateNode.containerInfo,ys=!0;break e}F=F.return}if(In===null)throw Error(n(160));Wb(k,I,w),In=null,ys=!1;var U=w.alternate;U!==null&&(U.return=null),w.return=null}catch(se){Qt(w,l,se)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)Kb(l,o),l=l.sibling}function Kb(o,l){var d=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(_s(l,o),zs(o),m&4){try{Ac(3,o,o.return),ah(3,o)}catch(Fe){Qt(o,o.return,Fe)}try{Ac(5,o,o.return)}catch(Fe){Qt(o,o.return,Fe)}}break;case 1:_s(l,o),zs(o),m&512&&d!==null&&Ll(d,d.return);break;case 5:if(_s(l,o),zs(o),m&512&&d!==null&&Ll(d,d.return),o.flags&32){var w=o.stateNode;try{wn(w,"")}catch(Fe){Qt(o,o.return,Fe)}}if(m&4&&(w=o.stateNode,w!=null)){var k=o.memoizedProps,I=d!==null?d.memoizedProps:k,F=o.type,U=o.updateQueue;if(o.updateQueue=null,U!==null)try{F==="input"&&k.type==="radio"&&k.name!=null&&at(w,k),Ns(F,I);var se=Ns(F,k);for(I=0;I<U.length;I+=2){var de=U[I],he=U[I+1];de==="style"?fi(w,he):de==="dangerouslySetInnerHTML"?Yn(w,he):de==="children"?wn(w,he):P(w,de,he,se)}switch(F){case"input":At(w,k);break;case"textarea":xn(w,k);break;case"select":var ce=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!k.multiple;var Te=k.value;Te!=null?lt(w,!!k.multiple,Te,!1):ce!==!!k.multiple&&(k.defaultValue!=null?lt(w,!!k.multiple,k.defaultValue,!0):lt(w,!!k.multiple,k.multiple?[]:"",!1))}w[_c]=k}catch(Fe){Qt(o,o.return,Fe)}}break;case 6:if(_s(l,o),zs(o),m&4){if(o.stateNode===null)throw Error(n(162));w=o.stateNode,k=o.memoizedProps;try{w.nodeValue=k}catch(Fe){Qt(o,o.return,Fe)}}break;case 3:if(_s(l,o),zs(o),m&4&&d!==null&&d.memoizedState.isDehydrated)try{lc(l.containerInfo)}catch(Fe){Qt(o,o.return,Fe)}break;case 4:_s(l,o),zs(o);break;case 13:_s(l,o),zs(o),w=o.child,w.flags&8192&&(k=w.memoizedState!==null,w.stateNode.isHidden=k,!k||w.alternate!==null&&w.alternate.memoizedState!==null||(Hg=It())),m&4&&Gb(o);break;case 22:if(de=d!==null&&d.memoizedState!==null,o.mode&1?(Wn=(se=Wn)||de,_s(l,o),Wn=se):_s(l,o),zs(o),m&8192){if(se=o.memoizedState!==null,(o.stateNode.isHidden=se)&&!de&&(o.mode&1)!==0)for(Ne=o,de=o.child;de!==null;){for(he=Ne=de;Ne!==null;){switch(ce=Ne,Te=ce.child,ce.tag){case 0:case 11:case 14:case 15:Ac(4,ce,ce.return);break;case 1:Ll(ce,ce.return);var De=ce.stateNode;if(typeof De.componentWillUnmount=="function"){m=ce,d=ce.return;try{l=m,De.props=l.memoizedProps,De.state=l.memoizedState,De.componentWillUnmount()}catch(Fe){Qt(m,d,Fe)}}break;case 5:Ll(ce,ce.return);break;case 22:if(ce.memoizedState!==null){Yb(he);continue}}Te!==null?(Te.return=ce,Ne=Te):Yb(he)}de=de.sibling}e:for(de=null,he=o;;){if(he.tag===5){if(de===null){de=he;try{w=he.stateNode,se?(k=w.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(F=he.stateNode,U=he.memoizedProps.style,I=U!=null&&U.hasOwnProperty("display")?U.display:null,F.style.display=An("display",I))}catch(Fe){Qt(o,o.return,Fe)}}}else if(he.tag===6){if(de===null)try{he.stateNode.nodeValue=se?"":he.memoizedProps}catch(Fe){Qt(o,o.return,Fe)}}else if((he.tag!==22&&he.tag!==23||he.memoizedState===null||he===o)&&he.child!==null){he.child.return=he,he=he.child;continue}if(he===o)break e;for(;he.sibling===null;){if(he.return===null||he.return===o)break e;de===he&&(de=null),he=he.return}de===he&&(de=null),he.sibling.return=he.return,he=he.sibling}}break;case 19:_s(l,o),zs(o),m&4&&Gb(o);break;case 21:break;default:_s(l,o),zs(o)}}function zs(o){var l=o.flags;if(l&2){try{e:{for(var d=o.return;d!==null;){if(Ub(d)){var m=d;break e}d=d.return}throw Error(n(160))}switch(m.tag){case 5:var w=m.stateNode;m.flags&32&&(wn(w,""),m.flags&=-33);var k=Bb(o);Fg(o,k,w);break;case 3:case 4:var I=m.stateNode.containerInfo,F=Bb(o);jg(o,F,I);break;default:throw Error(n(161))}}catch(U){Qt(o,o.return,U)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function CM(o,l,d){Ne=o,qb(o)}function qb(o,l,d){for(var m=(o.mode&1)!==0;Ne!==null;){var w=Ne,k=w.child;if(w.tag===22&&m){var I=w.memoizedState!==null||oh;if(!I){var F=w.alternate,U=F!==null&&F.memoizedState!==null||Wn;F=oh;var se=Wn;if(oh=I,(Wn=U)&&!se)for(Ne=w;Ne!==null;)I=Ne,U=I.child,I.tag===22&&I.memoizedState!==null?Xb(w):U!==null?(U.return=I,Ne=U):Xb(w);for(;k!==null;)Ne=k,qb(k),k=k.sibling;Ne=w,oh=F,Wn=se}Zb(o)}else(w.subtreeFlags&8772)!==0&&k!==null?(k.return=w,Ne=k):Zb(o)}}function Zb(o){for(;Ne!==null;){var l=Ne;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Wn||ah(5,l);break;case 1:var m=l.stateNode;if(l.flags&4&&!Wn)if(d===null)m.componentDidMount();else{var w=l.elementType===l.type?d.memoizedProps:vs(l.type,d.memoizedProps);m.componentDidUpdate(w,d.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var k=l.updateQueue;k!==null&&Yw(l,k,m);break;case 3:var I=l.updateQueue;if(I!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}Yw(l,I,d)}break;case 5:var F=l.stateNode;if(d===null&&l.flags&4){d=F;var U=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&d.focus();break;case"img":U.src&&(d.src=U.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var se=l.alternate;if(se!==null){var de=se.memoizedState;if(de!==null){var he=de.dehydrated;he!==null&&lc(he)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Wn||l.flags&512&&Lg(l)}catch(ce){Qt(l,l.return,ce)}}if(l===o){Ne=null;break}if(d=l.sibling,d!==null){d.return=l.return,Ne=d;break}Ne=l.return}}function Yb(o){for(;Ne!==null;){var l=Ne;if(l===o){Ne=null;break}var d=l.sibling;if(d!==null){d.return=l.return,Ne=d;break}Ne=l.return}}function Xb(o){for(;Ne!==null;){var l=Ne;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{ah(4,l)}catch(U){Qt(l,d,U)}break;case 1:var m=l.stateNode;if(typeof m.componentDidMount=="function"){var w=l.return;try{m.componentDidMount()}catch(U){Qt(l,w,U)}}var k=l.return;try{Lg(l)}catch(U){Qt(l,k,U)}break;case 5:var I=l.return;try{Lg(l)}catch(U){Qt(l,I,U)}}}catch(U){Qt(l,l.return,U)}if(l===o){Ne=null;break}var F=l.sibling;if(F!==null){F.return=l.return,Ne=F;break}Ne=l.return}}var PM=Math.ceil,lh=T.ReactCurrentDispatcher,Vg=T.ReactCurrentOwner,es=T.ReactCurrentBatchConfig,dt=0,kn=null,un=null,Mn=0,Lr=0,jl=co(0),gn=0,Ic=null,va=0,uh=0,$g=0,Mc=null,mr=null,Hg=0,Fl=1/0,Ei=null,ch=!1,zg=null,vo=null,dh=!1,yo=null,fh=0,Nc=0,Ug=null,hh=-1,ph=0;function er(){return(dt&6)!==0?It():hh!==-1?hh:hh=It()}function _o(o){return(o.mode&1)===0?1:(dt&2)!==0&&Mn!==0?Mn&-Mn:cM.transition!==null?(ph===0&&(ph=ps()),ph):(o=gt,o!==0||(o=window.event,o=o===void 0?16:Jx(o.type)),o)}function xs(o,l,d,m){if(50<Nc)throw Nc=0,Ug=null,Error(n(185));dr(o,d,m),((dt&2)===0||o!==kn)&&(o===kn&&((dt&2)===0&&(uh|=d),gn===4&&xo(o,Mn)),gr(o,m),d===1&&dt===0&&(l.mode&1)===0&&(Fl=It()+500,zf&&ho()))}function gr(o,l){var d=o.callbackNode;Fs(o,l);var m=Sn(o,o===kn?Mn:0);if(m===0)d!==null&&nc(d),o.callbackNode=null,o.callbackPriority=0;else if(l=m&-m,o.callbackPriority!==l){if(d!=null&&nc(d),l===1)o.tag===0?uM(Jb.bind(null,o)):Fw(Jb.bind(null,o)),iM(function(){(dt&6)===0&&ho()}),d=null;else{switch(Wx(m)){case 1:d=vl;break;case 4:d=la;break;case 16:d=no;break;case 536870912:d=rc;break;default:d=no}d=aS(d,Qb.bind(null,o))}o.callbackPriority=l,o.callbackNode=d}}function Qb(o,l){if(hh=-1,ph=0,(dt&6)!==0)throw Error(n(327));var d=o.callbackNode;if(Vl()&&o.callbackNode!==d)return null;var m=Sn(o,o===kn?Mn:0);if(m===0)return null;if((m&30)!==0||(m&o.expiredLanes)!==0||l)l=mh(o,m);else{l=m;var w=dt;dt|=2;var k=tS();(kn!==o||Mn!==l)&&(Ei=null,Fl=It()+500,_a(o,l));do try{AM();break}catch(F){eS(o,F)}while(!0);ag(),lh.current=k,dt=w,un!==null?l=0:(kn=null,Mn=0,l=gn)}if(l!==0){if(l===2&&(w=Zr(o),w!==0&&(m=w,l=Bg(o,w))),l===1)throw d=Ic,_a(o,0),xo(o,m),gr(o,It()),d;if(l===6)xo(o,m);else{if(w=o.current.alternate,(m&30)===0&&!TM(w)&&(l=mh(o,m),l===2&&(k=Zr(o),k!==0&&(m=k,l=Bg(o,k))),l===1))throw d=Ic,_a(o,0),xo(o,m),gr(o,It()),d;switch(o.finishedWork=w,o.finishedLanes=m,l){case 0:case 1:throw Error(n(345));case 2:xa(o,mr,Ei);break;case 3:if(xo(o,m),(m&130023424)===m&&(l=Hg+500-It(),10<l)){if(Sn(o,0)!==0)break;if(w=o.suspendedLanes,(w&m)!==m){er(),o.pingedLanes|=o.suspendedLanes&w;break}o.timeoutHandle=Y0(xa.bind(null,o,mr,Ei),l);break}xa(o,mr,Ei);break;case 4:if(xo(o,m),(m&4194240)===m)break;for(l=o.eventTimes,w=-1;0<m;){var I=31-oe(m);k=1<<I,I=l[I],I>w&&(w=I),m&=~k}if(m=w,m=It()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*PM(m/1960))-m,10<m){o.timeoutHandle=Y0(xa.bind(null,o,mr,Ei),m);break}xa(o,mr,Ei);break;case 5:xa(o,mr,Ei);break;default:throw Error(n(329))}}}return gr(o,It()),o.callbackNode===d?Qb.bind(null,o):null}function Bg(o,l){var d=Mc;return o.current.memoizedState.isDehydrated&&(_a(o,l).flags|=256),o=mh(o,l),o!==2&&(l=mr,mr=d,l!==null&&Wg(l)),o}function Wg(o){mr===null?mr=o:mr.push.apply(mr,o)}function TM(o){for(var l=o;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var m=0;m<d.length;m++){var w=d[m],k=w.getSnapshot;w=w.value;try{if(!ms(k(),w))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function xo(o,l){for(l&=~$g,l&=~uh,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var d=31-oe(l),m=1<<d;o[d]=-1,l&=~m}}function Jb(o){if((dt&6)!==0)throw Error(n(327));Vl();var l=Sn(o,0);if((l&1)===0)return gr(o,It()),null;var d=mh(o,l);if(o.tag!==0&&d===2){var m=Zr(o);m!==0&&(l=m,d=Bg(o,m))}if(d===1)throw d=Ic,_a(o,0),xo(o,l),gr(o,It()),d;if(d===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,xa(o,mr,Ei),gr(o,It()),null}function Gg(o,l){var d=dt;dt|=1;try{return o(l)}finally{dt=d,dt===0&&(Fl=It()+500,zf&&ho())}}function ya(o){yo!==null&&yo.tag===0&&(dt&6)===0&&Vl();var l=dt;dt|=1;var d=es.transition,m=gt;try{if(es.transition=null,gt=1,o)return o()}finally{gt=m,es.transition=d,dt=l,(dt&6)===0&&ho()}}function Kg(){Lr=jl.current,Nt(jl)}function _a(o,l){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==-1&&(o.timeoutHandle=-1,sM(d)),un!==null)for(d=un.return;d!==null;){var m=d;switch(ng(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&$f();break;case 3:Ol(),Nt(fr),Nt(zn),mg();break;case 5:hg(m);break;case 4:Ol();break;case 13:Nt(Wt);break;case 19:Nt(Wt);break;case 10:lg(m.type._context);break;case 22:case 23:Kg()}d=d.return}if(kn=o,un=o=wo(o.current,null),Mn=Lr=l,gn=0,Ic=null,$g=uh=va=0,mr=Mc=null,pa!==null){for(l=0;l<pa.length;l++)if(d=pa[l],m=d.interleaved,m!==null){d.interleaved=null;var w=m.next,k=d.pending;if(k!==null){var I=k.next;k.next=w,m.next=I}d.pending=m}pa=null}return o}function eS(o,l){do{var d=un;try{if(ag(),Qf.current=nh,Jf){for(var m=Gt.memoizedState;m!==null;){var w=m.queue;w!==null&&(w.pending=null),m=m.next}Jf=!1}if(ga=0,En=mn=Gt=null,kc=!1,Cc=0,Vg.current=null,d===null||d.return===null){gn=1,Ic=l,un=null;break}e:{var k=o,I=d.return,F=d,U=l;if(l=Mn,F.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var se=U,de=F,he=de.tag;if((de.mode&1)===0&&(he===0||he===11||he===15)){var ce=de.alternate;ce?(de.updateQueue=ce.updateQueue,de.memoizedState=ce.memoizedState,de.lanes=ce.lanes):(de.updateQueue=null,de.memoizedState=null)}var Te=kb(I);if(Te!==null){Te.flags&=-257,Cb(Te,I,F,k,l),Te.mode&1&&Eb(k,se,l),l=Te,U=se;var De=l.updateQueue;if(De===null){var Fe=new Set;Fe.add(U),l.updateQueue=Fe}else De.add(U);break e}else{if((l&1)===0){Eb(k,se,l),qg();break e}U=Error(n(426))}}else if(Ft&&F.mode&1){var sn=kb(I);if(sn!==null){(sn.flags&65536)===0&&(sn.flags|=256),Cb(sn,I,F,k,l),ig(Dl(U,F));break e}}k=U=Dl(U,F),gn!==4&&(gn=2),Mc===null?Mc=[k]:Mc.push(k),k=I;do{switch(k.tag){case 3:k.flags|=65536,l&=-l,k.lanes|=l;var Q=bb(k,U,l);Zw(k,Q);break e;case 1:F=U;var q=k.type,J=k.stateNode;if((k.flags&128)===0&&(typeof q.getDerivedStateFromError=="function"||J!==null&&typeof J.componentDidCatch=="function"&&(vo===null||!vo.has(J)))){k.flags|=65536,l&=-l,k.lanes|=l;var ve=Sb(k,F,l);Zw(k,ve);break e}}k=k.return}while(k!==null)}rS(d)}catch(Ve){l=Ve,un===d&&d!==null&&(un=d=d.return);continue}break}while(!0)}function tS(){var o=lh.current;return lh.current=nh,o===null?nh:o}function qg(){(gn===0||gn===3||gn===2)&&(gn=4),kn===null||(va&268435455)===0&&(uh&268435455)===0||xo(kn,Mn)}function mh(o,l){var d=dt;dt|=2;var m=tS();(kn!==o||Mn!==l)&&(Ei=null,_a(o,l));do try{RM();break}catch(w){eS(o,w)}while(!0);if(ag(),dt=d,lh.current=m,un!==null)throw Error(n(261));return kn=null,Mn=0,gn}function RM(){for(;un!==null;)nS(un)}function AM(){for(;un!==null&&!aa();)nS(un)}function nS(o){var l=oS(o.alternate,o,Lr);o.memoizedProps=o.pendingProps,l===null?rS(o):un=l,Vg.current=null}function rS(o){var l=o;do{var d=l.alternate;if(o=l.return,(l.flags&32768)===0){if(d=bM(d,l,Lr),d!==null){un=d;return}}else{if(d=SM(d,l),d!==null){d.flags&=32767,un=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{gn=6,un=null;return}}if(l=l.sibling,l!==null){un=l;return}un=l=o}while(l!==null);gn===0&&(gn=5)}function xa(o,l,d){var m=gt,w=es.transition;try{es.transition=null,gt=1,IM(o,l,d,m)}finally{es.transition=w,gt=m}return null}function IM(o,l,d,m){do Vl();while(yo!==null);if((dt&6)!==0)throw Error(n(327));d=o.finishedWork;var w=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var k=d.lanes|d.childLanes;if(gi(o,k),o===kn&&(un=kn=null,Mn=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||dh||(dh=!0,aS(no,function(){return Vl(),null})),k=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||k){k=es.transition,es.transition=null;var I=gt;gt=1;var F=dt;dt|=4,Vg.current=null,kM(o,d),Kb(d,o),XI(q0),Cf=!!K0,q0=K0=null,o.current=d,CM(d),bf(),dt=F,gt=I,es.transition=k}else o.current=d;if(dh&&(dh=!1,yo=o,fh=w),k=o.pendingLanes,k===0&&(vo=null),z(d.stateNode),gr(o,It()),l!==null)for(m=o.onRecoverableError,d=0;d<l.length;d++)w=l[d],m(w.value,{componentStack:w.stack,digest:w.digest});if(ch)throw ch=!1,o=zg,zg=null,o;return(fh&1)!==0&&o.tag!==0&&Vl(),k=o.pendingLanes,(k&1)!==0?o===Ug?Nc++:(Nc=0,Ug=o):Nc=0,ho(),null}function Vl(){if(yo!==null){var o=Wx(fh),l=es.transition,d=gt;try{if(es.transition=null,gt=16>o?16:o,yo===null)var m=!1;else{if(o=yo,yo=null,fh=0,(dt&6)!==0)throw Error(n(331));var w=dt;for(dt|=4,Ne=o.current;Ne!==null;){var k=Ne,I=k.child;if((Ne.flags&16)!==0){var F=k.deletions;if(F!==null){for(var U=0;U<F.length;U++){var se=F[U];for(Ne=se;Ne!==null;){var de=Ne;switch(de.tag){case 0:case 11:case 15:Ac(8,de,k)}var he=de.child;if(he!==null)he.return=de,Ne=he;else for(;Ne!==null;){de=Ne;var ce=de.sibling,Te=de.return;if(zb(de),de===se){Ne=null;break}if(ce!==null){ce.return=Te,Ne=ce;break}Ne=Te}}}var De=k.alternate;if(De!==null){var Fe=De.child;if(Fe!==null){De.child=null;do{var sn=Fe.sibling;Fe.sibling=null,Fe=sn}while(Fe!==null)}}Ne=k}}if((k.subtreeFlags&2064)!==0&&I!==null)I.return=k,Ne=I;else e:for(;Ne!==null;){if(k=Ne,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:Ac(9,k,k.return)}var Q=k.sibling;if(Q!==null){Q.return=k.return,Ne=Q;break e}Ne=k.return}}var q=o.current;for(Ne=q;Ne!==null;){I=Ne;var J=I.child;if((I.subtreeFlags&2064)!==0&&J!==null)J.return=I,Ne=J;else e:for(I=q;Ne!==null;){if(F=Ne,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:ah(9,F)}}catch(Ve){Qt(F,F.return,Ve)}if(F===I){Ne=null;break e}var ve=F.sibling;if(ve!==null){ve.return=F.return,Ne=ve;break e}Ne=F.return}}if(dt=w,ho(),Mr&&typeof Mr.onPostCommitFiberRoot=="function")try{Mr.onPostCommitFiberRoot(ua,o)}catch{}m=!0}return m}finally{gt=d,es.transition=l}}return!1}function sS(o,l,d){l=Dl(d,l),l=bb(o,l,1),o=mo(o,l,1),l=er(),o!==null&&(dr(o,1,l),gr(o,l))}function Qt(o,l,d){if(o.tag===3)sS(o,o,d);else for(;l!==null;){if(l.tag===3){sS(l,o,d);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(vo===null||!vo.has(m))){o=Dl(d,o),o=Sb(l,o,1),l=mo(l,o,1),o=er(),l!==null&&(dr(l,1,o),gr(l,o));break}}l=l.return}}function MM(o,l,d){var m=o.pingCache;m!==null&&m.delete(l),l=er(),o.pingedLanes|=o.suspendedLanes&d,kn===o&&(Mn&d)===d&&(gn===4||gn===3&&(Mn&130023424)===Mn&&500>It()-Hg?_a(o,0):$g|=d),gr(o,l)}function iS(o,l){l===0&&((o.mode&1)===0?l=1:(l=Ge,Ge<<=1,(Ge&130023424)===0&&(Ge=4194304)));var d=er();o=wi(o,l),o!==null&&(dr(o,l,d),gr(o,d))}function NM(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),iS(o,d)}function OM(o,l){var d=0;switch(o.tag){case 13:var m=o.stateNode,w=o.memoizedState;w!==null&&(d=w.retryLane);break;case 19:m=o.stateNode;break;default:throw Error(n(314))}m!==null&&m.delete(l),iS(o,d)}var oS;oS=function(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps||fr.current)pr=!0;else{if((o.lanes&d)===0&&(l.flags&128)===0)return pr=!1,wM(o,l,d);pr=(o.flags&131072)!==0}else pr=!1,Ft&&(l.flags&1048576)!==0&&Vw(l,Bf,l.index);switch(l.lanes=0,l.tag){case 2:var m=l.type;ih(o,l),o=l.pendingProps;var w=Pl(l,zn.current);Nl(l,d),w=yg(null,l,m,o,w,d);var k=_g();return l.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,hr(m)?(k=!0,Hf(l)):k=!1,l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,dg(l),w.updater=rh,l.stateNode=w,w._reactInternals=l,kg(l,m,o,d),l=Rg(null,l,m,!0,k,d)):(l.tag=0,Ft&&k&&tg(l),Jn(null,l,w,d),l=l.child),l;case 16:m=l.elementType;e:{switch(ih(o,l),o=l.pendingProps,w=m._init,m=w(m._payload),l.type=m,w=l.tag=LM(m),o=vs(m,o),w){case 0:l=Tg(null,l,m,o,d);break e;case 1:l=Mb(null,l,m,o,d);break e;case 11:l=Pb(null,l,m,o,d);break e;case 14:l=Tb(null,l,m,vs(m.type,o),d);break e}throw Error(n(306,m,""))}return l;case 0:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:vs(m,w),Tg(o,l,m,w,d);case 1:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:vs(m,w),Mb(o,l,m,w,d);case 3:e:{if(Nb(l),o===null)throw Error(n(387));m=l.pendingProps,k=l.memoizedState,w=k.element,qw(o,l),Yf(l,m,null,d);var I=l.memoizedState;if(m=I.element,k.isDehydrated)if(k={element:m,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=k,l.memoizedState=k,l.flags&256){w=Dl(Error(n(423)),l),l=Ob(o,l,m,d,w);break e}else if(m!==w){w=Dl(Error(n(424)),l),l=Ob(o,l,m,d,w);break e}else for(Dr=uo(l.stateNode.containerInfo.firstChild),Or=l,Ft=!0,gs=null,d=Gw(l,null,m,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Al(),m===w){l=Si(o,l,d);break e}Jn(o,l,m,d)}l=l.child}return l;case 5:return Xw(l),o===null&&sg(l),m=l.type,w=l.pendingProps,k=o!==null?o.memoizedProps:null,I=w.children,Z0(m,w)?I=null:k!==null&&Z0(m,k)&&(l.flags|=32),Ib(o,l),Jn(o,l,I,d),l.child;case 6:return o===null&&sg(l),null;case 13:return Db(o,l,d);case 4:return fg(l,l.stateNode.containerInfo),m=l.pendingProps,o===null?l.child=Il(l,null,m,d):Jn(o,l,m,d),l.child;case 11:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:vs(m,w),Pb(o,l,m,w,d);case 7:return Jn(o,l,l.pendingProps,d),l.child;case 8:return Jn(o,l,l.pendingProps.children,d),l.child;case 12:return Jn(o,l,l.pendingProps.children,d),l.child;case 10:e:{if(m=l.type._context,w=l.pendingProps,k=l.memoizedProps,I=w.value,Pt(Kf,m._currentValue),m._currentValue=I,k!==null)if(ms(k.value,I)){if(k.children===w.children&&!fr.current){l=Si(o,l,d);break e}}else for(k=l.child,k!==null&&(k.return=l);k!==null;){var F=k.dependencies;if(F!==null){I=k.child;for(var U=F.firstContext;U!==null;){if(U.context===m){if(k.tag===1){U=bi(-1,d&-d),U.tag=2;var se=k.updateQueue;if(se!==null){se=se.shared;var de=se.pending;de===null?U.next=U:(U.next=de.next,de.next=U),se.pending=U}}k.lanes|=d,U=k.alternate,U!==null&&(U.lanes|=d),ug(k.return,d,l),F.lanes|=d;break}U=U.next}}else if(k.tag===10)I=k.type===l.type?null:k.child;else if(k.tag===18){if(I=k.return,I===null)throw Error(n(341));I.lanes|=d,F=I.alternate,F!==null&&(F.lanes|=d),ug(I,d,l),I=k.sibling}else I=k.child;if(I!==null)I.return=k;else for(I=k;I!==null;){if(I===l){I=null;break}if(k=I.sibling,k!==null){k.return=I.return,I=k;break}I=I.return}k=I}Jn(o,l,w.children,d),l=l.child}return l;case 9:return w=l.type,m=l.pendingProps.children,Nl(l,d),w=Qr(w),m=m(w),l.flags|=1,Jn(o,l,m,d),l.child;case 14:return m=l.type,w=vs(m,l.pendingProps),w=vs(m.type,w),Tb(o,l,m,w,d);case 15:return Rb(o,l,l.type,l.pendingProps,d);case 17:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:vs(m,w),ih(o,l),l.tag=1,hr(m)?(o=!0,Hf(l)):o=!1,Nl(l,d),xb(l,m,w),kg(l,m,w,d),Rg(null,l,m,!0,o,d);case 19:return jb(o,l,d);case 22:return Ab(o,l,d)}throw Error(n(156,l.tag))};function aS(o,l){return wf(o,l)}function DM(o,l,d,m){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ts(o,l,d,m){return new DM(o,l,d,m)}function Zg(o){return o=o.prototype,!(!o||!o.isReactComponent)}function LM(o){if(typeof o=="function")return Zg(o)?1:0;if(o!=null){if(o=o.$$typeof,o===V)return 11;if(o===K)return 14}return 2}function wo(o,l){var d=o.alternate;return d===null?(d=ts(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function gh(o,l,d,m,w,k){var I=2;if(m=o,typeof o=="function")Zg(o)&&(I=1);else if(typeof o=="string")I=5;else e:switch(o){case M:return wa(d.children,w,k,l);case A:I=8,w|=8;break;case N:return o=ts(12,d,l,w|2),o.elementType=N,o.lanes=k,o;case W:return o=ts(13,d,l,w),o.elementType=W,o.lanes=k,o;case Y:return o=ts(19,d,l,w),o.elementType=Y,o.lanes=k,o;case X:return vh(d,w,k,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case D:I=10;break e;case j:I=9;break e;case V:I=11;break e;case K:I=14;break e;case B:I=16,m=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=ts(I,d,l,w),l.elementType=o,l.type=m,l.lanes=k,l}function wa(o,l,d,m){return o=ts(7,o,m,l),o.lanes=d,o}function vh(o,l,d,m){return o=ts(22,o,m,l),o.elementType=X,o.lanes=d,o.stateNode={isHidden:!1},o}function Yg(o,l,d){return o=ts(6,o,null,l),o.lanes=d,o}function Xg(o,l,d){return l=ts(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function jM(o,l,d,m,w){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=pn(0),this.expirationTimes=pn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pn(0),this.identifierPrefix=m,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function Qg(o,l,d,m,w,k,I,F,U){return o=new jM(o,l,d,F,U),l===1?(l=1,k===!0&&(l|=8)):l=0,k=ts(3,null,null,l),o.current=k,k.stateNode=o,k.memoizedState={element:m,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},dg(k),o}function FM(o,l,d){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:m==null?null:""+m,children:o,containerInfo:l,implementation:d}}function lS(o){if(!o)return fo;o=o._reactInternals;e:{if(mi(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(hr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var d=o.type;if(hr(d))return Lw(o,d,l)}return l}function uS(o,l,d,m,w,k,I,F,U){return o=Qg(d,m,!0,o,w,k,I,F,U),o.context=lS(null),d=o.current,m=er(),w=_o(d),k=bi(m,w),k.callback=l??null,mo(d,k,w),o.current.lanes=w,dr(o,w,m),gr(o,m),o}function yh(o,l,d,m){var w=l.current,k=er(),I=_o(w);return d=lS(d),l.context===null?l.context=d:l.pendingContext=d,l=bi(k,I),l.payload={element:o},m=m===void 0?null:m,m!==null&&(l.callback=m),o=mo(w,l,I),o!==null&&(xs(o,w,I,k),Zf(o,w,I)),I}function _h(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function cS(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function Jg(o,l){cS(o,l),(o=o.alternate)&&cS(o,l)}function VM(){return null}var dS=typeof reportError=="function"?reportError:function(o){console.error(o)};function ev(o){this._internalRoot=o}xh.prototype.render=ev.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));yh(o,l,null,null)},xh.prototype.unmount=ev.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;ya(function(){yh(null,o,null,null)}),l[vi]=null}};function xh(o){this._internalRoot=o}xh.prototype.unstable_scheduleHydration=function(o){if(o){var l=qx();o={blockedOn:null,target:o,priority:l};for(var d=0;d<oo.length&&l!==0&&l<oo[d].priority;d++);oo.splice(d,0,o),d===0&&Xx(o)}};function tv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function wh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function fS(){}function $M(o,l,d,m,w){if(w){if(typeof m=="function"){var k=m;m=function(){var se=_h(I);k.call(se)}}var I=uS(l,m,o,0,null,!1,!1,"",fS);return o._reactRootContainer=I,o[vi]=I.current,vc(o.nodeType===8?o.parentNode:o),ya(),I}for(;w=o.lastChild;)o.removeChild(w);if(typeof m=="function"){var F=m;m=function(){var se=_h(U);F.call(se)}}var U=Qg(o,0,!1,null,null,!1,!1,"",fS);return o._reactRootContainer=U,o[vi]=U.current,vc(o.nodeType===8?o.parentNode:o),ya(function(){yh(l,U,d,m)}),U}function bh(o,l,d,m,w){var k=d._reactRootContainer;if(k){var I=k;if(typeof w=="function"){var F=w;w=function(){var U=_h(I);F.call(U)}}yh(l,I,o,w)}else I=$M(d,l,o,w,m);return _h(I)}Gx=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var d=be(l.pendingLanes);d!==0&&(k0(l,d|1),gr(l,It()),(dt&6)===0&&(Fl=It()+500,ho()))}break;case 13:ya(function(){var m=wi(o,1);if(m!==null){var w=er();xs(m,o,1,w)}}),Jg(o,1)}},C0=function(o){if(o.tag===13){var l=wi(o,134217728);if(l!==null){var d=er();xs(l,o,134217728,d)}Jg(o,134217728)}},Kx=function(o){if(o.tag===13){var l=_o(o),d=wi(o,l);if(d!==null){var m=er();xs(d,o,l,m)}Jg(o,l)}},qx=function(){return gt},Zx=function(o,l){var d=gt;try{return gt=o,l()}finally{gt=d}},Os=function(o,l,d){switch(l){case"input":if(At(o,d),l=d.name,d.type==="radio"&&l!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var m=d[l];if(m!==o&&m.form===o.form){var w=Vf(m);if(!w)throw Error(n(90));Ie(m),At(m,w)}}}break;case"textarea":xn(o,d);break;case"select":l=d.value,l!=null&<(o,!!d.multiple,l,!1)}},jt=Gg,bn=ya;var HM={usingClientEntryPoint:!1,Events:[xc,kl,Vf,We,Bt,Gg]},Oc={findFiberByHostInstance:ca,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zM={bundleType:Oc.bundleType,version:Oc.version,rendererPackageName:Oc.rendererPackageName,rendererConfig:Oc.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=gl(o),o===null?null:o.stateNode},findFiberByHostInstance:Oc.findFiberByHostInstance||VM,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 Sh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sh.isDisabled&&Sh.supportsFiber)try{ua=Sh.inject(zM),Mr=Sh}catch{}}return vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=HM,vr.createPortal=function(o,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tv(l))throw Error(n(200));return FM(o,l,null,d)},vr.createRoot=function(o,l){if(!tv(o))throw Error(n(299));var d=!1,m="",w=dS;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onRecoverableError!==void 0&&(w=l.onRecoverableError)),l=Qg(o,1,!1,null,null,d,!1,m,w),o[vi]=l.current,vc(o.nodeType===8?o.parentNode:o),new ev(l)},vr.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=gl(l),o=o===null?null:o.stateNode,o},vr.flushSync=function(o){return ya(o)},vr.hydrate=function(o,l,d){if(!wh(l))throw Error(n(200));return bh(null,o,l,!0,d)},vr.hydrateRoot=function(o,l,d){if(!tv(o))throw Error(n(405));var m=d!=null&&d.hydratedSources||null,w=!1,k="",I=dS;if(d!=null&&(d.unstable_strictMode===!0&&(w=!0),d.identifierPrefix!==void 0&&(k=d.identifierPrefix),d.onRecoverableError!==void 0&&(I=d.onRecoverableError)),l=uS(l,null,o,1,d??null,w,!1,k,I),o[vi]=l.current,vc(o),m)for(o=0;o<m.length;o++)d=m[o],w=d._getVersion,w=w(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,w]:l.mutableSourceEagerHydrationData.push(d,w);return new xh(l)},vr.render=function(o,l,d){if(!wh(l))throw Error(n(200));return bh(null,o,l,!1,d)},vr.unmountComponentAtNode=function(o){if(!wh(o))throw Error(n(40));return o._reactRootContainer?(ya(function(){bh(null,null,o,!1,function(){o._reactRootContainer=null,o[vi]=null})}),!0):!1},vr.unstable_batchedUpdates=Gg,vr.unstable_renderSubtreeIntoContainer=function(o,l,d,m){if(!wh(d))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return bh(o,l,d,!1,m)},vr.version="18.3.1-next-f1338f8080-20240426",vr}var jE;function Y6(){if(jE)return Mv.exports;jE=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(),Mv.exports=uL(),Mv.exports}var FE;function cL(){if(FE)return Lh;FE=1;var t=Y6();return Lh.createRoot=t.createRoot,Lh.hydrateRoot=t.hydrateRoot,Lh}var dL=cL();const fL=jm(dL),Bi={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function X6(t){return"init"in t}function Ay(t){return typeof t.write=="function"}function hL(t){return!!t.onMount}function VE(t){return"v"in t||"e"in t}function sm(t){if("e"in t)throw t.e;if((Bi?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function im(t){return typeof(t==null?void 0:t.then)=="function"}function pL(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 Q6(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function J6(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 mL(t){return!!t.INTERNAL_onInit}const gL=(t,e,n,...r)=>n.read(...r),vL=(t,e,n,...r)=>n.write(...r),yL=(t,e,n)=>n.INTERNAL_onInit(e),_L=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},xL=(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),mL(n)&&u(t,e,n)}return i},wL=(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 f=[],h=p=>{try{p()}catch(v){f.push(v)}};do{u.f&&h(u.f);const p=new Set;for(const v of s){const y=(n=r.get(v))==null?void 0:n.l;if(y)for(const x of y)p.add(x)}s.clear();for(const v of a)p.add(v);a.clear();for(const v of i)p.add(v);i.clear();for(const v of p)h(v);s.size&&c(t,e)}while(s.size||a.size||i.size);if(f.length)throw new AggregateError(f)},bL=(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=[],f=[],h=new WeakSet,p=new WeakSet,v=[],y=[];for(const x of s)v.push(x),y.push(i(t,e,x));for(;v.length;){const x=v.length-1,_=v[x],b=y[x];if(p.has(_)){v.pop(),y.pop();continue}if(h.has(_)){if(r.get(_)===b.n)c.push(_),f.push(b);else if((Bi?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),v.pop(),y.pop();continue}h.add(_);for(const E of J6(_,b,n))h.has(E)||(v.push(E),y.push(i(t,e,E)))}for(let x=c.length-1;x>=0;--x){const _=c[x],b=f[x];let E=!1;for(const C of b.d.keys())if(C!==_&&s.has(C)){E=!0;break}E&&(r.set(_,b.n),a(t,e,_),u(t,e,_)),r.delete(_)}},Iy=new WeakSet,SL=(t,e,n)=>{var r,s;const i=t[1],a=t[2],u=t[3],c=t[6],f=t[7],h=t[11],p=t[12],v=t[13],y=t[14],x=t[16],_=t[17],b=t[20],E=t[26],C=t[28],P=h(t,e,n),T=C[0];if(VE(P)){if(i.has(n)&&a.get(n)!==P.n||P.m===T)return P.m=T,P;let K=!1;for(const[B,X]of P.d)if(y(t,e,B).n!==X){K=!0;break}if(!K)return P.m=T,P}let R=!0;const O=new Set(P.d.keys()),M=()=>{for(const K of O)P.d.delete(K)},A=()=>{if(i.has(n)){const K=!u.size;_(t,e,n),K&&(v(t,e),p(t,e))}},N=K=>{var B;if(K===n){const $=h(t,e,K);if(!VE($))if(X6(K))b(t,e,K,K.init);else throw new Error("no atom init");return sm($)}const X=y(t,e,K);try{return sm(X)}finally{O.delete(K),P.d.set(K,X.n),im(P.v)&&Q6(n,P.v,X),i.has(n)&&((B=i.get(K))==null||B.t.add(n)),R||A()}};let D,j;const V={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(Bi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Bi?"production":void 0)!=="production"&&!Ay(n)&&console.warn("setSelf function cannot be used with read-only atom"),!j&&Ay(n)&&(j=(...K)=>{if((Bi?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)try{return x(t,e,n,K)}finally{v(t,e),p(t,e)}}),j}},W=P.n,Y=a.get(n)===W;try{(Bi?"production":void 0)!=="production"&&Iy.delete(e);const K=f(t,e,n,N,V);if((Bi?"production":void 0)!=="production"&&Iy.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),b(t,e,n,K),im(K)){E(t,e,K,()=>D==null?void 0:D.abort());const B=()=>{M(),A()};K.then(B,B)}else M();return(r=c.r)==null||r.call(c,n),P.m=T,P}catch(K){if(pL(K))throw K;return delete P.v,P.e=K,++P.n,P.m=T,P}finally{R=!1,P.n!==W&&Y&&(a.set(n,P.n),u.add(n),(s=c.c)==null||s.call(c,n))}},EL=(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 f of J6(u,c,r)){const h=i(t,e,f);s.get(f)!==h.n&&(s.set(f,h.n),a.push(f))}}},kL=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],u=t[11],c=t[12],f=t[13],h=t[14],p=t[15],v=t[16],y=t[17],x=t[20],_=t[28];let b=!0;const E=P=>sm(h(t,e,P)),C=(P,...T)=>{var R;const O=u(t,e,P);try{if(P===n){if(!X6(P))throw new Error("atom not writable");(Bi?"production":void 0)!=="production"&&Iy.add(e);const M=O.n,A=T[0];x(t,e,P,A),y(t,e,P),M!==O.n&&(++_[0],s.add(P),p(t,e,P),(R=i.c)==null||R.call(i,P));return}else return v(t,e,P,T)}finally{b||(f(t,e),c(t,e))}};try{return a(t,e,n,E,C,...r)}finally{b=!1}},CL=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],u=t[11],c=t[15],f=t[18],h=t[19],p=u(t,e,n),v=s.get(n);if(v&&p.d.size>0){for(const[y,x]of p.d)if(!v.d.has(y)){const _=u(t,e,y);f(t,e,y).t.add(n),v.d.add(y),x!==_.n&&(i.add(y),c(t,e,y),(r=a.c)==null||r.call(a,y))}for(const y of v.d)if(!p.d.has(y)){v.d.delete(y);const x=h(t,e,y);x==null||x.t.delete(n)}}},PL=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],u=t[10],c=t[11],f=t[12],h=t[13],p=t[14],v=t[16],y=t[18],x=c(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const b of x.d.keys())y(t,e,b).t.add(n);if(_={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,_),Ay(n)&&hL(n)){const b=()=>{let E=!0;const C=(...P)=>{try{return v(t,e,n,P)}finally{E||(h(t,e),f(t,e))}};try{const P=u(t,e,n,C);P&&(_.u=()=>{E=!0;try{P()}finally{E=!1}})}finally{E=!1}};i.add(b)}(r=a.m)==null||r.call(a,n)}return _},TL=(t,e,n)=>{var r,s;const i=t[1],a=t[5],u=t[6],c=t[11],f=t[19],h=c(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let v=!1;for(const y of p.t)if((r=i.get(y))!=null&&r.d.has(n)){v=!0;break}if(!v){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const y of h.d.keys()){const x=f(t,e,y);x==null||x.t.delete(n)}(s=u.u)==null||s.call(u,n);return}return p},RL=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),u="v"in a,c=a.v;if(im(r))for(const f of a.d.keys())Q6(n,r,s(t,e,f));a.v=r,delete a.e,(!u||!Object.is(c,a.v))&&(++a.n,im(c)&&i(t,e,c))},AL=(t,e,n)=>{const r=t[14];return sm(r(t,e,n))},IL=(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))}},ML=(t,e,n,r)=>{const s=t[12],i=t[13],a=t[18],u=t[19],f=a(t,e,n).l;return f.add(r),i(t,e),s(t,e),()=>{f.delete(r),u(t,e,n),i(t,e),s(t,e)}},NL=(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)},OL=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},eP=new WeakMap;function DL(t){const e=eP.get(t);if((Bi?"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 LL(...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,{},gL,vL,yL,_L,xL,wL,bL,SL,EL,kL,CL,PL,TL,RL,AL,IL,ML,void 0,new WeakMap,NL,OL,[0]].map((a,u)=>t[u]||a);eP.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const tP={};let jL=0;function tt(t,e){const n=`atom${++jL}`,r={toString(){return(tP?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=FL,r.write=VL),e&&(r.write=e),r}function FL(t){return t(this)}function VL(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function $L(){return LL()}let Gc;function HL(){return Gc||(Gc=$L(),(tP?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Gc),globalThis.__JOTAI_DEFAULT_STORE__!==Gc&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Gc}const zL={},UL=g.createContext(void 0);function p2(t){return g.useContext(UL)||HL()}const My=t=>typeof(t==null?void 0:t.then)=="function",Ny=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},BL=ge.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Ny(t),t)}),Dv=new WeakMap,$E=(t,e,n)=>{const r=DL(t),s=r[26];let i=Dv.get(e);return i||(i=new Promise((a,u)=>{let c=e;const f=v=>y=>{c===v&&a(y)},h=v=>y=>{c===v&&u(y)},p=()=>{try{const v=n();My(v)?(Dv.set(v,i),c=v,v.then(f(v),h(v)),s(r,t,v,p)):a(v)}catch(v){u(v)}};e.then(f(e),h(e)),s(r,t,e,p)}),Dv.set(e,i)),i};function Qe(t,e){const{delay:n,unstable_promiseStatus:r=!ge.use}={},s=p2(),[[i,a,u],c]=g.useReducer(h=>{const p=s.get(t);return Object.is(h[0],p)&&h[1]===s&&h[2]===t?h:[p,s,t]},void 0,()=>[s.get(t),s,t]);let f=i;if((a!==s||u!==t)&&(c(),f=s.get(t)),g.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);My(p)&&Ny($E(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
|
|
42
|
+
|
|
43
|
+
Migration guide:
|
|
44
|
+
|
|
45
|
+
Create a custom hook like the following.
|
|
46
|
+
|
|
47
|
+
function useAtomValueWithDelay<Value>(
|
|
48
|
+
atom: Atom<Value>,
|
|
49
|
+
options: { delay: number },
|
|
50
|
+
): Value {
|
|
51
|
+
const { delay } = options
|
|
52
|
+
const store = useStore(options)
|
|
53
|
+
const [value, setValue] = useState(() => store.get(atom))
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const unsub = store.sub(atom, () => {
|
|
56
|
+
setTimeout(() => setValue(store.get(atom)), delay)
|
|
57
|
+
})
|
|
58
|
+
return unsub
|
|
59
|
+
}, [store, atom, delay])
|
|
60
|
+
return value
|
|
61
|
+
}
|
|
62
|
+
`),setTimeout(c,n);return}c()});return c(),h},[s,t,n,r]),g.useDebugValue(f),My(f)){const h=$E(s,f,()=>s.get(t));return r&&Ny(h),BL(h)}return f}function st(t,e){const n=p2();return g.useCallback((...s)=>{if((zL?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function nP(t,e){return[Qe(t),st(t)]}const m2=g.createContext({});function g2(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const WL=typeof window<"u",v2=WL?g.useLayoutEffect:g.useEffect,Hm=g.createContext(null);function y2(t,e){t.indexOf(e)===-1&&t.push(e)}function om(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const li=(t,e,n)=>n>e?e:n<t?t:n;let _2=()=>{};const Ko={},rP=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),sP=t=>typeof t=="object"&&t!==null,iP=t=>/^0[^.\s]+$/u.test(t);function oP(t){let e;return()=>(e===void 0&&(e=t()),e)}const cs=t=>t,uf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Nd=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class x2{constructor(){this.subscriptions=[]}add(e){return y2(this.subscriptions,e),()=>om(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 Wr=t=>t*1e3,os=t=>t/1e3,aP=(t,e)=>e?t*(1e3/e):0,lP=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,GL=1e-7,KL=12;function qL(t,e,n,r,s){let i,a,u=0;do a=e+(n-e)/2,i=lP(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>GL&&++u<KL);return a}function cf(t,e,n,r){if(t===e&&n===r)return cs;const s=i=>qL(i,0,1,t,n);return i=>i===0||i===1?i:lP(s(i),e,r)}const uP=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,cP=t=>e=>1-t(1-e),dP=cf(.33,1.53,.69,.99),w2=cP(dP),fP=uP(w2),hP=t=>t>=1?1:(t*=2)<1?.5*w2(t):.5*(2-Math.pow(2,-10*(t-1))),b2=t=>1-Math.sin(Math.acos(t)),pP=cP(b2),mP=uP(b2),ZL=cf(.42,0,1,1),YL=cf(0,0,.58,1),gP=cf(.42,0,.58,1),XL=t=>Array.isArray(t)&&typeof t[0]!="number",vP=t=>Array.isArray(t)&&typeof t[0]=="number",QL={linear:cs,easeIn:ZL,easeInOut:gP,easeOut:YL,circIn:b2,circInOut:mP,circOut:pP,backIn:w2,backInOut:fP,backOut:dP,anticipate:hP},JL=t=>typeof t=="string",HE=t=>{if(vP(t)){_2(t.length===4);const[e,n,r,s]=t;return cf(e,n,r,s)}else if(JL(t))return QL[t];return t},jh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function e9(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(f){i.has(f)&&(c.schedule(f),t()),f(a)}const c={schedule:(f,h=!1,p=!1)=>{const y=p&&r?e:n;return h&&i.add(f),y.add(f),f},cancel:f=>{n.delete(f),i.delete(f)},process:f=>{if(a=f,r){s=!0;return}r=!0;const h=e;e=n,n=h,e.forEach(u),e.clear(),r=!1,s&&(s=!1,c.process(f))}};return c}const t9=40;function yP(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=jh.reduce((P,T)=>(P[T]=e9(i),P),{}),{setup:u,read:c,resolveKeyframes:f,preUpdate:h,update:p,preRender:v,render:y,postRender:x}=a,_=()=>{const P=Ko.useManualTiming,T=P?s.timestamp:performance.now();n=!1,P||(s.delta=r?1e3/60:Math.max(Math.min(T-s.timestamp,t9),1)),s.timestamp=T,s.isProcessing=!0,u.process(s),c.process(s),f.process(s),h.process(s),p.process(s),v.process(s),y.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},b=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:jh.reduce((P,T)=>{const R=a[T];return P[T]=(O,M=!1,A=!1)=>(n||b(),R.schedule(O,M,A)),P},{}),cancel:P=>{for(let T=0;T<jh.length;T++)a[jh[T]].cancel(P)},state:s,steps:a}}const{schedule:Ct,cancel:qo,state:On,steps:Lv}=yP(typeof requestAnimationFrame<"u"?requestAnimationFrame:cs,!0);let dp;function n9(){dp=void 0}const sr={now:()=>(dp===void 0&&sr.set(On.isProcessing||Ko.useManualTiming?On.timestamp:performance.now()),dp),set:t=>{dp=t,queueMicrotask(n9)}},_P=t=>e=>typeof e=="string"&&e.startsWith(t),xP=_P("--"),r9=_P("var(--"),S2=t=>r9(t)?s9.test(t.split("/*")[0].trim()):!1,s9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function zE(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Gu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Od={...Gu,transform:t=>li(0,1,t)},Fh={...Gu,default:1},pd=t=>Math.round(t*1e5)/1e5,E2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function i9(t){return t==null}const o9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,k2=(t,e)=>n=>!!(typeof n=="string"&&o9.test(n)&&n.startsWith(t)||e&&!i9(n)&&Object.prototype.hasOwnProperty.call(n,e)),wP=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,u]=r.match(E2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}},a9=t=>li(0,255,t),jv={...Gu,transform:t=>Math.round(a9(t))},Ua={test:k2("rgb","red"),parse:wP("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+jv.transform(t)+", "+jv.transform(e)+", "+jv.transform(n)+", "+pd(Od.transform(r))+")"};function l9(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 Oy={test:k2("#"),parse:l9,transform:Ua.transform},df=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Di=df("deg"),oi=df("%"),Le=df("px"),u9=df("vh"),c9=df("vw"),UE={...oi,parse:t=>oi.parse(t)/100,transform:t=>oi.transform(t*100)},nu={test:k2("hsl","hue"),parse:wP("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+oi.transform(pd(e))+", "+oi.transform(pd(n))+", "+pd(Od.transform(r))+")"},fn={test:t=>Ua.test(t)||Oy.test(t)||nu.test(t),parse:t=>Ua.test(t)?Ua.parse(t):nu.test(t)?nu.parse(t):Oy.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ua.transform(t):nu.transform(t),getAnimatableNone:t=>{const e=fn.parse(t);return e.alpha=0,fn.transform(e)}},d9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function f9(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(E2))==null?void 0:e.length)||0)+(((n=t.match(d9))==null?void 0:n.length)||0)>0}const bP="number",SP="color",h9="var",p9="var(",BE="${}",m9=/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 Du(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const u=e.replace(m9,c=>(fn.test(c)?(r.color.push(i),s.push(SP),n.push(fn.parse(c))):c.startsWith(p9)?(r.var.push(i),s.push(h9),n.push(c)):(r.number.push(i),s.push(bP),n.push(parseFloat(c))),++i,BE)).split(BE);return{values:n,split:u,indexes:r,types:s}}function g9(t){return Du(t).values}function EP({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===bP?s+=pd(r[i]):a===SP?s+=fn.transform(r[i]):s+=r[i]}return s}}function v9(t){return EP(Du(t))}const y9=t=>typeof t=="number"?0:fn.test(t)?fn.getAnimatableNone(t):t,_9=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:y9(t);function x9(t){const e=Du(t);return EP(e)(e.values.map((r,s)=>_9(r,e.split[s])))}const Ts={test:f9,parse:g9,createTransformer:v9,getAnimatableNone:x9};function Fv(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 w9({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=Fv(c,u,t+1/3),i=Fv(c,u,t),a=Fv(c,u,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function am(t,e){return n=>n>0?e:t}const kt=(t,e,n)=>t+(e-t)*n,Vv=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},b9=[Oy,Ua,nu],S9=t=>b9.find(e=>e.test(t));function WE(t){const e=S9(t);if(!e)return!1;let n=e.parse(t);return e===nu&&(n=w9(n)),n}const GE=(t,e)=>{const n=WE(t),r=WE(e);if(!n||!r)return am(t,e);const s={...n};return i=>(s.red=Vv(n.red,r.red,i),s.green=Vv(n.green,r.green,i),s.blue=Vv(n.blue,r.blue,i),s.alpha=kt(n.alpha,r.alpha,i),Ua.transform(s))},Dy=new Set(["none","hidden"]);function E9(t,e){return Dy.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function k9(t,e){return n=>kt(t,e,n)}function C2(t){return typeof t=="number"?k9:typeof t=="string"?S2(t)?am:fn.test(t)?GE:T9:Array.isArray(t)?kP:typeof t=="object"?fn.test(t)?GE:C9:am}function kP(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>C2(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function C9(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=C2(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function P9(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 T9=(t,e)=>{const n=Ts.createTransformer(e),r=Du(t),s=Du(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?Dy.has(t)&&!s.values.length||Dy.has(e)&&!r.values.length?E9(t,e):uf(kP(P9(r,s),s.values),n):am(t,e)};function CP(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?kt(t,e,n):C2(t)(t,e)}const R9=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Ct.update(e,n),stop:()=>qo(e),now:()=>On.isProcessing?On.timestamp:sr.now()}},PP=(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)})`},lm=2e4;function P2(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<lm;)e+=n,r=t.next(e);return e>=lm?1/0:e}function A9(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(P2(r),lm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:os(s)}}const en={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ly(t,e){return t*Math.sqrt(1-e*e)}const I9=12;function M9(t,e,n){let r=n;for(let s=1;s<I9;s++)r=r-t(r)/e(r);return r}const $v=.001;function N9({duration:t=en.duration,bounce:e=en.bounce,velocity:n=en.velocity,mass:r=en.mass}){let s,i,a=1-e;a=li(en.minDamping,en.maxDamping,a),t=li(en.minDuration,en.maxDuration,os(t)),a<1?(s=f=>{const h=f*a,p=h*t,v=h-n,y=Ly(f,a),x=Math.exp(-p);return $v-v/y*x},i=f=>{const p=f*a*t,v=p*n+n,y=Math.pow(a,2)*Math.pow(f,2)*t,x=Math.exp(-p),_=Ly(Math.pow(f,2),a);return(-s(f)+$v>0?-1:1)*((v-y)*x)/_}):(s=f=>{const h=Math.exp(-f*t),p=(f-n)*t+1;return-$v+h*p},i=f=>{const h=Math.exp(-f*t),p=(n-f)*(t*t);return h*p});const u=5/t,c=M9(s,i,u);if(t=Wr(t),isNaN(c))return{stiffness:en.stiffness,damping:en.damping,duration:t};{const f=Math.pow(c,2)*r;return{stiffness:f,damping:a*2*Math.sqrt(r*f),duration:t}}}const O9=["duration","bounce"],D9=["stiffness","damping","mass"];function KE(t,e){return e.some(n=>t[n]!==void 0)}function L9(t){let e={velocity:en.velocity,stiffness:en.stiffness,damping:en.damping,mass:en.mass,isResolvedFromDuration:!1,...t};if(!KE(t,D9)&&KE(t,O9))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*li(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:en.mass,stiffness:s,damping:i}}else{const n=N9({...t,velocity:0});e={...e,...n,mass:en.mass},e.isResolvedFromDuration=!0}return e}function um(t=en.visualDuration,e=en.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:i},{stiffness:c,damping:f,mass:h,duration:p,velocity:v,isResolvedFromDuration:y}=L9({...n,velocity:-os(n.velocity||0)}),x=v||0,_=f/(2*Math.sqrt(c*h)),b=a-i,E=os(Math.sqrt(c/h)),C=Math.abs(b)<5;r||(r=C?en.restSpeed.granular:en.restSpeed.default),s||(s=C?en.restDelta.granular:en.restDelta.default);let P,T,R,O,M,A;if(_<1)R=Ly(E,_),O=(x+_*E*b)/R,P=D=>{const j=Math.exp(-_*E*D);return a-j*(O*Math.sin(R*D)+b*Math.cos(R*D))},M=_*E*O+b*R,A=_*E*b-O*R,T=D=>Math.exp(-_*E*D)*(M*Math.sin(R*D)+A*Math.cos(R*D));else if(_===1){P=j=>a-Math.exp(-E*j)*(b+(x+E*b)*j);const D=x+E*b;T=j=>Math.exp(-E*j)*(E*D*j-x)}else{const D=E*Math.sqrt(_*_-1);P=Y=>{const K=Math.exp(-_*E*Y),B=Math.min(D*Y,300);return a-K*((x+_*E*b)*Math.sinh(B)+D*b*Math.cosh(B))/D};const j=(x+_*E*b)/D,V=_*E*j-b*D,W=_*E*b-j*D;T=Y=>{const K=Math.exp(-_*E*Y),B=Math.min(D*Y,300);return K*(V*Math.sinh(B)+W*Math.cosh(B))}}const N={calculatedDuration:y&&p||null,velocity:D=>Wr(T(D)),next:D=>{if(!y&&_<1){const V=Math.exp(-_*E*D),W=Math.sin(R*D),Y=Math.cos(R*D),K=a-V*(O*W+b*Y),B=Wr(V*(M*W+A*Y));return u.done=Math.abs(B)<=r&&Math.abs(a-K)<=s,u.value=u.done?a:K,u}const j=P(D);if(y)u.done=D>=p;else{const V=Wr(T(D));u.done=Math.abs(V)<=r&&Math.abs(a-j)<=s}return u.value=u.done?a:j,u},toString:()=>{const D=Math.min(P2(N),lm),j=PP(V=>N.next(D*V).value,D,30);return D+"ms "+j},toTransition:()=>{}};return N}um.applyToOptions=t=>{const e=A9(t,100,um);return t.ease=e.ease,t.duration=Wr(e.duration),t.type="keyframes",t};const j9=5;function TP(t,e,n){const r=Math.max(e-j9,0);return aP(n-t(r),e-r)}function jy({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:u,max:c,restDelta:f=.5,restSpeed:h}){const p=t[0],v={done:!1,value:p},y=A=>u!==void 0&&A<u||c!==void 0&&A>c,x=A=>u===void 0?c:c===void 0||Math.abs(u-A)<Math.abs(c-A)?u:c;let _=n*e;const b=p+_,E=a===void 0?b:a(b);E!==b&&(_=E-p);const C=A=>-_*Math.exp(-A/r),P=A=>E+C(A),T=A=>{const N=C(A),D=P(A);v.done=Math.abs(N)<=f,v.value=v.done?E:D};let R,O;const M=A=>{y(v.value)&&(R=A,O=um({keyframes:[v.value,x(v.value)],velocity:TP(P,A,v.value),damping:s,stiffness:i,restDelta:f,restSpeed:h}))};return M(0),{calculatedDuration:null,next:A=>{let N=!1;return!O&&R===void 0&&(N=!0,T(A),M(A)),R!==void 0&&A>=R?O.next(A-R):(!N&&T(A),v)}}}function F9(t,e,n){const r=[],s=n||Ko.mix||CP,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]||cs:e;u=uf(c,u)}r.push(u)}return r}function V9(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(_2(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=F9(e,r,s),c=u.length,f=h=>{if(a&&h<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(h<t[p+1]);p++);const v=Nd(t[p],t[p+1],h);return u[p](v)};return n?h=>f(li(t[0],t[i-1],h)):f}function $9(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Nd(0,e,r);t.push(kt(n,1,s))}}function H9(t){const e=[0];return $9(e,t.length-1),e}function z9(t,e){return t.map(n=>n*e)}function U9(t,e){return t.map(()=>e||gP).splice(0,t.length-1)}function md({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=XL(r)?r.map(HE):HE(r),i={done:!1,value:e[0]},a=z9(n&&n.length===e.length?n:H9(e),t),u=V9(a,e,{ease:Array.isArray(s)?s:U9(e,s)});return{calculatedDuration:t,next:c=>(i.value=u(c),i.done=c>=t,i)}}const B9=t=>t!==null;function zm(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(B9),u=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!u||r===void 0?i[u]:r}const W9={decay:jy,inertia:jy,tween:md,keyframes:md,spring:um};function RP(t){typeof t.type=="string"&&(t.type=W9[t.type])}class T2{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 G9=t=>t/100;class cm extends T2{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;RP(e);const{type:n=md,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:u}=e;const c=n||md;c!==md&&typeof u[0]!="number"&&(this.mixKeyframes=uf(G9,CP(u[0],u[1])),u=[0,100]);const f=c({...e,keyframes:u});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...u].reverse(),velocity:-a})),f.calculatedDuration===null&&(f.calculatedDuration=P2(f));const{calculatedDuration:h}=f;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=f}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:u,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:h,repeat:p,repeatType:v,repeatDelay:y,type:x,onUpdate:_,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const E=this.currentTime-f*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,T=r;if(p){const A=Math.min(this.currentTime,s)/u;let N=Math.floor(A),D=A%1;!D&&A>=1&&(D=1),D===1&&N--,N=Math.min(N,p+1),!!(N%2)&&(v==="reverse"?(D=1-D,y&&(D-=y/u)):v==="mirror"&&(T=a)),P=li(0,1,D)*u}let R;C?(this.delayState.value=h[0],R=this.delayState):R=T.next(P),i&&!C&&(R.value=i(R.value));let{done:O}=R;!C&&c!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return M&&x!==jy&&(R.value=zm(h,this.options,b,this.speed)),_&&_(R.value),M&&this.finish(),R}then(e,n){return this.finished.then(e,n)}get duration(){return os(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+os(e)}get time(){return os(this.currentTime)}set time(e){e=Wr(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 TP(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=os(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=R9,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 K9(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ba=t=>t*180/Math.PI,Fy=t=>{const e=Ba(Math.atan2(t[1],t[0]));return Vy(e)},q9={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Fy,rotateZ:Fy,skewX:t=>Ba(Math.atan(t[1])),skewY:t=>Ba(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Vy=t=>(t=t%360,t<0&&(t+=360),t),qE=Fy,ZE=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),YE=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Z9={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ZE,scaleY:YE,scale:t=>(ZE(t)+YE(t))/2,rotateX:t=>Vy(Ba(Math.atan2(t[6],t[5]))),rotateY:t=>Vy(Ba(Math.atan2(-t[2],t[0]))),rotateZ:qE,rotate:qE,skewX:t=>Ba(Math.atan(t[4])),skewY:t=>Ba(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function $y(t){return t.includes("scale")?1:0}function Hy(t,e){if(!t||t==="none")return $y(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Z9,s=n;else{const u=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=q9,s=u}if(!s)return $y(e);const i=r[e],a=s[1].split(",").map(X9);return typeof i=="function"?i(a):a[i]}const Y9=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Hy(n,e)};function X9(t){return parseFloat(t.trim())}const Ku=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],qu=new Set([...Ku,"pathRotation"]),XE=t=>t===Gu||t===Le,Q9=new Set(["x","y","z"]),J9=Ku.filter(t=>!Q9.has(t));function e7(t){const e=[];return J9.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const jo={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})=>Hy(e,"x"),y:(t,{transform:e})=>Hy(e,"y")};jo.translateX=jo.x;jo.translateY=jo.y;const nl=new Set;let zy=!1,Uy=!1,By=!1;function AP(){if(Uy){const t=Array.from(nl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=e7(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)})}Uy=!1,zy=!1,nl.forEach(t=>t.complete(By)),nl.clear()}function IP(){nl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Uy=!0)})}function t7(){By=!0,IP(),AP(),By=!1}class R2{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?(nl.add(this),zy||(zy=!0,Ct.read(IP),Ct.resolveKeyframes(AP))):(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])}K9(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),nl.delete(this)}cancel(){this.state==="scheduled"&&(nl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const n7=t=>t.startsWith("--");function MP(t,e,n){n7(e)?t.style.setProperty(e,n):t.style[e]=n}const r7={};function NP(t,e){const n=oP(t);return()=>r7[e]??n()}const s7=NP(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),OP=NP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),id=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,QE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:id([0,.65,.55,1]),circOut:id([.55,0,1,.45]),backIn:id([.31,.01,.66,-.59]),backOut:id([.33,1.53,.69,.99])};function DP(t,e){if(t)return typeof t=="function"?OP()?PP(t,e):"ease-out":vP(t)?id(t):Array.isArray(t)?t.map(n=>DP(n,e)||QE.easeOut):QE[t]}function i7(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:u="easeOut",times:c}={},f=void 0){const h={[e]:n};c&&(h.offset=c);const p=DP(u,s);Array.isArray(p)&&(h.easing=p);const v={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return f&&(v.pseudoElement=f),t.animate(h,v)}function LP(t){return typeof t=="function"&&"applyToOptions"in t}function o7({type:t,...e}){return LP(t)&&OP()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class jP extends T2{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,_2(typeof e.type!="string");const f=o7(e);this.animation=i7(n,r,s,f,i),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=zm(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(h),MP(n,r,h),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return os(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+os(e)}get time(){return os(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Wr(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&&s7()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),cs):s(this)}}const FP={anticipate:hP,backInOut:fP,circInOut:mP};function a7(t){return t in FP}function l7(t){typeof t.ease=="string"&&a7(t.ease)&&(t.ease=FP[t.ease])}const Hv=10;class u7 extends jP{constructor(e){l7(e),RP(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 cm({...a,autoplay:!1}),c=Math.max(Hv,sr.now()-this.startTime),f=li(0,Hv,c-Hv),h=u.sample(c).value,{name:p}=this.options;i&&p&&MP(i,p,h),n.setWithVelocity(u.sample(Math.max(0,c-f)).value,h,f),u.stop()}}const JE=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ts.test(t)||t==="0")&&!t.startsWith("url("));function c7(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 d7(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=JE(s,e),u=JE(i,e);return!a||!u?!1:c7(t)||(n==="spring"||LP(n))&&r}function Wy(t){t.duration=0,t.type="keyframes"}const VP=new Set(["opacity","clipPath","filter","transform"]),f7=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function h7(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&f7.test(t[e]))return!0;return!1}const p7=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),m7=oP(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function g7(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:u}=t;if(!(((p=e==null?void 0:e.owner)==null?void 0:p.current)instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:h}=e.owner.getProps();return m7()&&n&&(VP.has(n)||p7.has(n)&&h7(u))&&(n!=="transform"||!h)&&!f&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const v7=40;class y7 extends T2{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:u,name:c,motionValue:f,element:h,...p}){var x;super(),this.stop=()=>{var _,b;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=sr.now();const v={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:c,motionValue:f,element:h,...p},y=(h==null?void 0:h.KeyframeResolver)||R2;this.keyframeResolver=new y(u,(_,b,E)=>this.onKeyframesResolved(_,b,v,!E),c,f,h),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,n,r,s){var E,C;this.keyframeResolver=void 0;const{name:i,type:a,velocity:u,delay:c,isHandoff:f,onUpdate:h}=r;this.resolvedAt=sr.now();let p=!0;d7(e,i,a,u)||(p=!1,(Ko.instantAnimations||!c)&&(h==null||h(zm(e,r,n))),e[0]=e[e.length-1],Wy(r),r.repeat=0);const y={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>v7?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=p&&!f&&g7(y),_=(C=(E=y.motionValue)==null?void 0:E.owner)==null?void 0:C.current;let b;if(x)try{b=new u7({...y,element:_})}catch{b=new cm(y)}else b=new cm(y);b.finished.then(()=>{this.notifyFinished()}).catch(cs),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}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(),t7()),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 $P(t,e,n,r=0,s=1){const i=Array.from(t).sort((f,h)=>f.sortNodePosition(h)).indexOf(e),a=t.size,u=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:u-i*r}const e4=30,_7=t=>!isNaN(parseFloat(t));class x7{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=_7(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 x2);const r=this.events[e].add(n);return e==="change"?()=>{r(),Ct.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>e4)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,e4);return aP(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 Lu(t,e){return new x7(t,e)}function HP(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function A2(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?HP(n,t):n}const w7={type:"spring",stiffness:500,damping:25,restSpeed:10},b7=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),S7={type:"keyframes",duration:.8},E7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},k7=(t,{keyframes:e})=>e.length>2?S7:qu.has(t)?t.startsWith("scale")?b7(e[1]):w7:E7,C7=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function P7(t){for(const e in t)if(!C7.has(e))return!0;return!1}const I2=(t,e,n,r={},s,i)=>a=>{const u=A2(r,t)||{},c=u.delay||r.delay||0;let{elapsed:f=0}=r;f=f-Wr(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-f,onUpdate:v=>{e.set(v),u.onUpdate&&u.onUpdate(v)},onComplete:()=>{a(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:i?void 0:s};P7(u)||Object.assign(h,k7(t,h)),h.duration&&(h.duration=Wr(h.duration)),h.repeatDelay&&(h.repeatDelay=Wr(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(Wy(h),h.delay===0&&(p=!0)),(Ko.instantAnimations||Ko.skipAnimations||s!=null&&s.shouldSkipAnimations||u.skipAnimations)&&(p=!0,Wy(h),h.delay=0),h.allowFlatten=!u.type&&!u.ease,p&&!i&&e.get()!==void 0){const v=zm(h.keyframes,u);if(v!==void 0){Ct.update(()=>{h.onUpdate(v),h.onComplete()});return}}return u.isSync?new cm(h):new y7(h)},T7=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function R7(t){const e=T7.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function zP(t,e,n=1){const[r,s]=R7(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return rP(a)?parseFloat(a):a}return S2(s)?zP(s,e,n+1):s}function t4(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function M2(t,e,n,r){if(typeof e=="function"){const[s,i]=t4(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]=t4(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function rl(t,e,n){const r=t.getProps();return M2(r,e,n!==void 0?n:r.custom,t)}const UP=new Set(["width","height","top","left","right","bottom",...Ku]),Gy=t=>Array.isArray(t);function A7(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Lu(n))}function I7(t){return Gy(t)?t[t.length-1]||0:t}function M7(t,e){const n=rl(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const u=I7(i[a]);A7(t,a,u)}}const jn=t=>!!(t&&t.getVelocity);function N7(t){return!!(jn(t)&&t.add)}function Ky(t,e){const n=t.getValue("willChange");if(N7(n))return n.add(e);if(!n&&Ko.WillChange){const r=new Ko.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function N2(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const O7="framerAppearId",BP="data-"+N2(O7);function WP(t){return t.props[BP]}function D7({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function GP(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...u}=e;const c=t.getDefaultTransition();i=i?HP(i,c):c;const f=i==null?void 0:i.reduceMotion,h=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],v=s&&t.animationState&&t.animationState.getState()[s],y=i==null?void 0:i.path;y&&y.animateVisualElement(t,u,i,n,p);for(const x in u){const _=t.getValue(x,t.latestValues[x]??null),b=u[x];if(b===void 0||v&&D7(v,x))continue;const E={delay:n,...A2(i||{},x)};h&&(E.skipAnimations=!0);const C=_.get();if(C!==void 0&&!_.isAnimating()&&!Array.isArray(b)&&b===C&&!E.velocity){Ct.update(()=>_.set(b));continue}let P=!1;if(window.MotionHandoffAnimation){const O=WP(t);if(O){const M=window.MotionHandoffAnimation(O,x,Ct);M!==null&&(E.startTime=M,P=!0)}}Ky(t,x);const T=f??t.shouldReduceMotion;_.start(I2(x,_,b,T&&UP.has(x)?{type:!1}:E,t,P));const R=_.animation;R&&p.push(R)}if(a){const x=()=>Ct.update(()=>{a&&M7(t,a)});p.length?Promise.all(p).then(x):x()}return p}function qy(t,e,n={}){var c;const r=rl(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(GP(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:v}=s;return L7(t,e,f,h,p,v,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[f,h]=u==="beforeChildren"?[i,a]:[a,i];return f().then(()=>h())}else return Promise.all([i(),a(n.delay)])}function L7(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(qy(c,e,{...a,delay:n+(typeof r=="function"?0:r)+$P(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(u)}function j7(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>qy(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=qy(t,e,n);else{const s=typeof e=="function"?rl(t,e,n.custom):e;r=Promise.all(GP(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const F7={test:t=>t==="auto",parse:t=>t},KP=t=>e=>e.test(t),qP=[Gu,Le,oi,Di,c9,u9,F7],n4=t=>qP.find(KP(t));function V7(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||iP(t):!0}const $7=new Set(["brightness","contrast","saturate","opacity"]);function H7(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(E2)||[];if(!r)return t;const s=n.replace(r,"");let i=$7.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const z7=/\b([a-z-]*)\(.*?\)/gu,Zy={...Ts,getAnimatableNone:t=>{const e=t.match(z7);return e?e.map(H7).join(" "):t}},Yy={...Ts,getAnimatableNone:t=>{const e=Ts.parse(t);return Ts.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},r4={...Gu,transform:Math.round},U7={rotate:Di,pathRotation:Di,rotateX:Di,rotateY:Di,rotateZ:Di,scale:Fh,scaleX:Fh,scaleY:Fh,scaleZ:Fh,skew:Di,skewX:Di,skewY:Di,distance:Le,translateX:Le,translateY:Le,translateZ:Le,x:Le,y:Le,z:Le,perspective:Le,transformPerspective:Le,opacity:Od,originX:UE,originY:UE,originZ:Le},dm={borderWidth:Le,borderTopWidth:Le,borderRightWidth:Le,borderBottomWidth:Le,borderLeftWidth:Le,borderRadius:Le,borderTopLeftRadius:Le,borderTopRightRadius:Le,borderBottomRightRadius:Le,borderBottomLeftRadius:Le,width:Le,maxWidth:Le,height:Le,maxHeight:Le,top:Le,right:Le,bottom:Le,left:Le,inset:Le,insetBlock:Le,insetBlockStart:Le,insetBlockEnd:Le,insetInline:Le,insetInlineStart:Le,insetInlineEnd:Le,padding:Le,paddingTop:Le,paddingRight:Le,paddingBottom:Le,paddingLeft:Le,paddingBlock:Le,paddingBlockStart:Le,paddingBlockEnd:Le,paddingInline:Le,paddingInlineStart:Le,paddingInlineEnd:Le,margin:Le,marginTop:Le,marginRight:Le,marginBottom:Le,marginLeft:Le,marginBlock:Le,marginBlockStart:Le,marginBlockEnd:Le,marginInline:Le,marginInlineStart:Le,marginInlineEnd:Le,fontSize:Le,backgroundPositionX:Le,backgroundPositionY:Le,...U7,zIndex:r4,fillOpacity:Od,strokeOpacity:Od,numOctaves:r4},B7={...dm,color:fn,backgroundColor:fn,outlineColor:fn,fill:fn,stroke:fn,borderColor:fn,borderTopColor:fn,borderRightColor:fn,borderBottomColor:fn,borderLeftColor:fn,filter:Zy,WebkitFilter:Zy,mask:Yy,WebkitMask:Yy},ZP=t=>B7[t],W7=new Set([Zy,Yy]);function YP(t,e){let n=ZP(t);return W7.has(n)||(n=Ts),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const G7=new Set(["auto","none","0"]);function K7(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!G7.has(i)&&Du(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=YP(n,s)}class q7 extends R2{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),S2(p))){const v=zP(p,n.current);v!==void 0&&(e[h]=v),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!UP.has(r)||e.length!==2)return;const[s,i]=e,a=n4(s),u=n4(i),c=zE(s),f=zE(i);if(c!==f&&jo[r]){this.needsMeasurement=!0;return}if(a!==u)if(XE(a)&&XE(u))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else jo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||V7(e[s]))&&r.push(s);r.length&&K7(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=jo[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]=jo[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,f])=>{e.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const O2=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function XP(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 Xy=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function fp(t){return sP(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:D2}=yP(queueMicrotask,!1),Es={x:!1,y:!1};function QP(){return Es.x||Es.y}function Z7(t){return t==="x"||t==="y"?Es[t]?null:(Es[t]=!0,()=>{Es[t]=!1}):Es.x||Es.y?null:(Es.x=Es.y=!0,()=>{Es.x=Es.y=!1})}function JP(t,e){const n=XP(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function Y7(t){return!(t.pointerType==="touch"||QP())}function X7(t,e,n={}){const[r,s,i]=JP(t,n);return r.forEach(a=>{let u=!1,c=!1,f;const h=()=>{a.removeEventListener("pointerleave",x)},p=b=>{f&&(f(b),f=void 0),h()},v=b=>{u=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),c&&(c=!1,p(b))},y=()=>{u=!0,window.addEventListener("pointerup",v,s),window.addEventListener("pointercancel",v,s)},x=b=>{if(b.pointerType!=="touch"){if(u){c=!0;return}p(b)}},_=b=>{if(!Y7(b))return;c=!1;const E=e(a,b);typeof E=="function"&&(f=E,a.addEventListener("pointerleave",x,s))};a.addEventListener("pointerenter",_,s),a.addEventListener("pointerdown",y,s)}),i}const e3=(t,e)=>e?t===e?!0:e3(t,e.parentElement):!1,L2=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Q7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function J7(t){return Q7.has(t.tagName)||t.isContentEditable===!0}const ej=new Set(["INPUT","SELECT","TEXTAREA"]);function tj(t){return ej.has(t.tagName)||t.isContentEditable===!0}const hp=new WeakSet;function s4(t){return e=>{e.key==="Enter"&&t(e)}}function zv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const nj=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=s4(()=>{if(hp.has(n))return;zv(n,"down");const s=s4(()=>{zv(n,"up")}),i=()=>zv(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 i4(t){return L2(t)&&!QP()}const o4=new WeakSet;function rj(t,e,n={}){const[r,s,i]=JP(t,n),a=u=>{const c=u.currentTarget;if(!i4(u)||o4.has(u))return;hp.add(c),n.stopPropagation&&o4.add(u);const f=e(c,u),h={...s,capture:!0},p=(x,_)=>{window.removeEventListener("pointerup",v,h),window.removeEventListener("pointercancel",y,h),hp.has(c)&&hp.delete(c),i4(x)&&typeof f=="function"&&f(x,{success:_})},v=x=>{p(x,c===window||c===document||n.useGlobalTarget||e3(c,x.target))},y=x=>{p(x,!1)};window.addEventListener("pointerup",v,h),window.addEventListener("pointercancel",y,h)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",a,s),fp(u)&&(u.addEventListener("focus",f=>nj(f,s)),!J7(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),i}function j2(t){return sP(t)&&"ownerSVGElement"in t}const pp=new WeakMap;let Co;const t3=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:j2(r)&&"getBBox"in r?r.getBBox()[e]:r[n],sj=t3("inline","width","offsetWidth"),ij=t3("block","height","offsetHeight");function oj({target:t,borderBoxSize:e}){var n;(n=pp.get(t))==null||n.forEach(r=>{r(t,{get width(){return sj(t,e)},get height(){return ij(t,e)}})})}function aj(t){t.forEach(oj)}function lj(){typeof ResizeObserver>"u"||(Co=new ResizeObserver(aj))}function uj(t,e){Co||lj();const n=XP(t);return n.forEach(r=>{let s=pp.get(r);s||(s=new Set,pp.set(r,s)),s.add(e),Co==null||Co.observe(r)}),()=>{n.forEach(r=>{const s=pp.get(r);s==null||s.delete(e),s!=null&&s.size||Co==null||Co.unobserve(r)})}}const mp=new Set;let ru;function cj(){ru=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};mp.forEach(e=>e(t))},window.addEventListener("resize",ru)}function dj(t){return mp.add(t),ru||cj(),()=>{mp.delete(t),!mp.size&&typeof ru=="function"&&(window.removeEventListener("resize",ru),ru=void 0)}}function a4(t,e){return typeof t=="function"?dj(t):uj(t,e)}function fj(t){return j2(t)&&t.tagName==="svg"}const hj=[...qP,fn,Ts],pj=t=>hj.find(KP(t)),l4=()=>({translate:0,scale:1,origin:0,originPoint:0}),su=()=>({x:l4(),y:l4()}),u4=()=>({min:0,max:0}),yn=()=>({x:u4(),y:u4()}),mj=new WeakMap;function Um(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Dd(t){return typeof t=="string"||Array.isArray(t)}const F2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],V2=["initial",...F2];function Bm(t){return Um(t.animate)||V2.some(e=>Dd(t[e]))}function n3(t){return!!(Bm(t)||t.variants)}function gj(t,e,n){for(const r in e){const s=e[r],i=n[r];if(jn(s))t.addValue(r,s);else if(jn(i))t.addValue(r,Lu(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,Lu(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const fm={current:null},$2={current:!1},vj=typeof window<"u";function r3(){if($2.current=!0,!!vj)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>fm.current=t.matches;t.addEventListener("change",e),e()}else fm.current=!1}const c4=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let hm={};function s3(t){hm=t}function yj(){return hm}class _j{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=R2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=sr.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,Ct.render(this.render,!1,!0))};const{latestValues:f,renderState:h}=u;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!a,this.isControllingVariants=Bm(n),this.isVariantNode=n3(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in v){const x=v[y];f[y]!==void 0&&jn(x)&&x.set(f[y])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,mj.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:($2.current||r3(),this.shouldReduceMotion=fm.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(),qo(this.notifyUpdate),qo(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&&VP.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:u,times:c,ease:f,duration:h}=n.accelerate,p=new jP({element:this.current,name:e,keyframes:u,times:c,ease:f,duration:Wr(h)}),v=a(p);this.valueSubscriptions.set(e,()=>{v(),p.cancel()});return}const r=qu.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Ct.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 hm){const n=hm[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):yn()}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<c4.length;r++){const s=c4[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=gj(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=Lu(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"&&(rP(r)||iP(r))?r=parseFloat(r):!pj(r)&&Ts.test(n)&&(r=YP(e,n)),this.setBaseTarget(e,jn(r)?r.get():r)),jn(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=M2(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&&!jn(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 x2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){D2.render(this.render)}}class i3 extends _j{constructor(){super(...arguments),this.KeyframeResolver=q7}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;jn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ta{constructor(e){this.isMounted=!1,this.node=e}update(){}}function o3({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function xj({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function wj(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 Uv(t){return t===void 0||t===1}function Qy({scale:t,scaleX:e,scaleY:n}){return!Uv(t)||!Uv(e)||!Uv(n)}function ja(t){return Qy(t)||a3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function a3(t){return d4(t.x)||d4(t.y)}function d4(t){return t&&t!=="0%"}function pm(t,e,n){const r=t-n,s=e*r;return n+s}function f4(t,e,n,r,s){return s!==void 0&&(t=pm(t,s,r)),pm(t,n,r)+e}function Jy(t,e=0,n=1,r,s){t.min=f4(t.min,e,n,r,s),t.max=f4(t.max,e,n,r,s)}function l3(t,{x:e,y:n}){Jy(t.x,e.translate,e.scale,e.originPoint),Jy(t.y,n.translate,n.scale,n.originPoint)}const h4=.999999999999,p4=1.0000000000001;function bj(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:f}=i.options;f&&f.props.style&&f.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Qs(t.x,-i.scroll.offset.x),Qs(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,l3(t,a)),r&&ja(i.latestValues)&&gp(t,i.latestValues,(u=i.layout)==null?void 0:u.layoutBox))}e.x<p4&&e.x>h4&&(e.x=1),e.y<p4&&e.y>h4&&(e.y=1)}function Qs(t,e){t.min+=e,t.max+=e}function m4(t,e,n,r,s=.5){const i=kt(t.min,t.max,s);Jy(t,e,n,i,r)}function g4(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function gp(t,e,n){const r=n??t;m4(t.x,g4(e.x,r.x),e.scaleX,e.scale,e.originX),m4(t.y,g4(e.y,r.y),e.scaleY,e.scale,e.originY)}function u3(t,e){return o3(wj(t.getBoundingClientRect(),e))}function Sj(t,e,n){const r=u3(t,n),{scroll:s}=e;return s&&(Qs(r.x,s.offset.x),Qs(r.y,s.offset.y)),r}const Ej={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},kj=Ku.length;function Cj(t,e,n){let r="",s=!0;for(let a=0;a<kj;a++){const u=Ku[a],c=t[u];if(c===void 0)continue;let f=!0;if(typeof c=="number")f=c===(u.startsWith("scale")?1:0);else{const h=parseFloat(c);f=u.startsWith("scale")?h===1:h===0}if(!f||n){const h=Xy(c,dm[u]);if(!f){s=!1;const p=Ej[u]||u;r+=`${p}(${h}) `}n&&(e[u]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${Xy(i,dm.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function H2(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,u=!1;for(const c in e){const f=e[c];if(qu.has(c)){a=!0;continue}else if(xP(c)){s[c]=f;continue}else{const h=Xy(f,dm[c]);c.startsWith("origin")?(u=!0,i[c]=h):r[c]=h}}if(e.transform||(a||n?r.transform=Cj(e,t.transform,n):r.transform&&(r.transform="none")),u){const{originX:c="50%",originY:f="50%",originZ:h=0}=i;r.transformOrigin=`${c} ${f} ${h}`}}function c3(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 v4(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Kc={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Le.test(t))t=parseFloat(t);else return t;const n=v4(t,e.target.x),r=v4(t,e.target.y);return`${n}% ${r}%`}},Pj={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Ts.parse(t);if(s.length>5)return r;const i=Ts.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 f=kt(u,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=f),typeof s[3+a]=="number"&&(s[3+a]/=f),i(s)}},e_={borderRadius:{...Kc,applyTo:[...O2]},borderTopLeftRadius:Kc,borderTopRightRadius:Kc,borderBottomLeftRadius:Kc,borderBottomRightRadius:Kc,boxShadow:Pj};function d3(t,{layout:e,layoutId:n}){return qu.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!e_[t]||t==="opacity")}function z2(t,e,n){var a;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const u in r)(jn(r[u])||s&&jn(s[u])||d3(u,t)||((a=n==null?void 0:n.getValue(u))==null?void 0:a.liveStyle)!==void 0)&&(i[u]=r[u]);return i}function Tj(t){return window.getComputedStyle(t)}class Rj extends i3{constructor(){super(...arguments),this.type="html",this.renderInstance=c3}readValueFromInstance(e,n){var r;if(qu.has(n))return(r=this.projection)!=null&&r.isProjecting?$y(n):Y9(e,n);{const s=Tj(e),i=(xP(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return u3(e,n)}build(e,n,r){H2(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return z2(e,n,r)}}const Aj={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ij={offset:"strokeDashoffset",array:"strokeDasharray"};function Mj(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?Aj:Ij;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const Nj=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function f3(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...u},c,f,h){if(H2(t,u,f),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:v}=t;p.transform&&(v.transform=p.transform,delete p.transform),(v.transform||p.transformOrigin)&&(v.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),v.transform&&(v.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete p.transformBox);for(const y of Nj)p[y]!==void 0&&(v[y]=p[y],delete p[y]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&Mj(p,s,i,a,!1)}const h3=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"]),p3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Oj(t,e,n,r){c3(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(h3.has(s)?s:N2(s),e.attrs[s])}function m3(t,e,n){const r=z2(t,e,n);for(const s in t)if(jn(t[s])||jn(e[s])){const i=Ku.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class Dj extends i3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(qu.has(n)){const r=ZP(n);return r&&r.default||0}return n=h3.has(n)?n:N2(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return m3(e,n,r)}build(e,n,r){f3(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){Oj(e,n,r,s)}mount(e){this.isSVGTag=p3(e.tagName),super.mount(e)}}const Lj=V2.length;function g3(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?g3(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Lj;n++){const r=V2[n],s=t.props[r];(Dd(s)||s===!1)&&(e[r]=s)}return e}function v3(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 jj=[...F2].reverse(),Fj=F2.length;function Vj(t){return e=>Promise.all(e.map(({animation:n,options:r})=>j7(t,n,r)))}function $j(t){let e=Vj(t),n=y4(),r=!0,s=!1;const i=f=>(h,p)=>{var y;const v=rl(t,p,f==="exit"?(y=t.presenceContext)==null?void 0:y.custom:void 0);if(v){const{transition:x,transitionEnd:_,...b}=v;h={...h,...b,..._}}return h};function a(f){e=f(t)}function u(f){const{props:h}=t,p=g3(t.parent)||{},v=[],y=new Set;let x={},_=1/0;for(let E=0;E<Fj;E++){const C=jj[E],P=n[C],T=h[C]!==void 0?h[C]:p[C],R=Dd(T),O=C===f?P.isActive:null;O===!1&&(_=E);let M=T===p[C]&&T!==h[C]&&R;if(M&&(r||s)&&t.manuallyAnimateOnMount&&(M=!1),P.protectedKeys={...x},!P.isActive&&O===null||!T&&!P.prevProp||Um(T)||typeof T=="boolean")continue;if(C==="exit"&&P.isActive&&O!==!0){P.prevResolvedValues&&(x={...x,...P.prevResolvedValues});continue}const A=Hj(P.prevProp,T);let N=A||C===f&&P.isActive&&!M&&R||E>_&&R,D=!1;const j=Array.isArray(T)?T:[T];let V=j.reduce(i(C),{});O===!1&&(V={});const{prevResolvedValues:W={}}=P,Y={...W,...V},K=$=>{N=!0,y.has($)&&(D=!0,y.delete($)),P.needsAnimating[$]=!0;const te=t.getValue($);te&&(te.liveStyle=!1)};for(const $ in Y){const te=V[$],H=W[$];if(x.hasOwnProperty($))continue;let L=!1;Gy(te)&&Gy(H)?L=!v3(te,H)||A:L=te!==H,L?te!=null?K($):y.add($):te!==void 0&&y.has($)?K($):P.protectedKeys[$]=!0}P.prevProp=T,P.prevResolvedValues=V,P.isActive&&(x={...x,...V}),(r||s)&&t.blockInitialAnimation&&(N=!1);const B=M&&A;N&&(!B||D)&&v.push(...j.map($=>{const te={type:C};if(typeof $=="string"&&(r||s)&&!B&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,L=rl(H,$);if(H.enteringChildren&&L){const{delayChildren:Z}=L.transition||{};te.delay=$P(H.enteringChildren,t,Z)}}return{animation:$,options:te}}))}if(y.size){const E={};if(typeof h.initial!="boolean"){const C=rl(t,Array.isArray(h.initial)?h.initial[0]:h.initial);C&&C.transition&&(E.transition=C.transition)}y.forEach(C=>{const P=t.getBaseTarget(C),T=t.getValue(C);T&&(T.liveStyle=!0),E[C]=P??null}),v.push({animation:E})}let b=!!v.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(b=!1),r=!1,s=!1,b?e(v):Promise.resolve()}function c(f,h){var v;if(n[f].isActive===h)return Promise.resolve();(v=t.variantChildren)==null||v.forEach(y=>{var x;return(x=y.animationState)==null?void 0:x.setActive(f,h)}),n[f].isActive=h;const p=u(f);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:u,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=y4(),s=!0}}}function Hj(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!v3(e,t):!1}function Pa(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function y4(){return{animate:Pa(!0),whileInView:Pa(),whileHover:Pa(),whileTap:Pa(),whileDrag:Pa(),whileFocus:Pa(),exit:Pa()}}function t_(t,e){t.min=e.min,t.max=e.max}function ws(t,e){t_(t.x,e.x),t_(t.y,e.y)}function _4(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const y3=1e-4,zj=1-y3,Uj=1+y3,_3=.01,Bj=0-_3,Wj=0+_3;function ir(t){return t.max-t.min}function Gj(t,e,n){return Math.abs(t-e)<=n}function x4(t,e,n,r=.5){t.origin=r,t.originPoint=kt(e.min,e.max,t.origin),t.scale=ir(n)/ir(e),t.translate=kt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=zj&&t.scale<=Uj||isNaN(t.scale))&&(t.scale=1),(t.translate>=Bj&&t.translate<=Wj||isNaN(t.translate))&&(t.translate=0)}function gd(t,e,n,r){x4(t.x,e.x,n.x,r?r.originX:void 0),x4(t.y,e.y,n.y,r?r.originY:void 0)}function w4(t,e,n,r=0){const s=r?kt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+ir(e)}function Kj(t,e,n,r){w4(t.x,e.x,n.x,r==null?void 0:r.x),w4(t.y,e.y,n.y,r==null?void 0:r.y)}function b4(t,e,n,r=0){const s=r?kt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+ir(e)}function mm(t,e,n,r){b4(t.x,e.x,n.x,r==null?void 0:r.x),b4(t.y,e.y,n.y,r==null?void 0:r.y)}function S4(t,e,n,r,s){return t-=e,t=pm(t,1/n,r),s!==void 0&&(t=pm(t,1/s,r)),t}function qj(t,e=0,n=1,r=.5,s,i=t,a=t){if(oi.test(e)&&(e=parseFloat(e),e=kt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let u=kt(i.min,i.max,r);t===i&&(u-=e),t.min=S4(t.min,e,n,u,s),t.max=S4(t.max,e,n,u,s)}function E4(t,e,[n,r,s],i,a){qj(t,e[n],e[r],e[s],e.scale,i,a)}const Zj=["x","scaleX","originX"],Yj=["y","scaleY","originY"];function k4(t,e,n,r){E4(t.x,e,Zj,n?n.x:void 0,r?r.x:void 0),E4(t.y,e,Yj,n?n.y:void 0,r?r.y:void 0)}function C4(t){return t.translate===0&&t.scale===1}function x3(t){return C4(t.x)&&C4(t.y)}function P4(t,e){return t.min===e.min&&t.max===e.max}function Xj(t,e){return P4(t.x,e.x)&&P4(t.y,e.y)}function T4(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function w3(t,e){return T4(t.x,e.x)&&T4(t.y,e.y)}function R4(t){return ir(t.x)/ir(t.y)}function A4(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ks(t){return[t("x"),t("y")]}function Qj(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:f,rotate:h,pathRotation:p,rotateX:v,rotateY:y,skewX:x,skewY:_}=n;f&&(r=`perspective(${f}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),v&&(r+=`rotateX(${v}deg) `),y&&(r+=`rotateY(${y}deg) `),x&&(r+=`skewX(${x}deg) `),_&&(r+=`skewY(${_}deg) `)}const u=t.x.scale*e.x,c=t.y.scale*e.y;return(u!==1||c!==1)&&(r+=`scale(${u}, ${c})`),r||"none"}const Jj=O2.length,I4=t=>typeof t=="string"?parseFloat(t):t,M4=t=>typeof t=="number"||Le.test(t);function eF(t,e,n,r,s,i){s?(t.opacity=kt(0,n.opacity??1,tF(r)),t.opacityExit=kt(e.opacity??1,0,nF(r))):i&&(t.opacity=kt(e.opacity??1,n.opacity??1,r));for(let a=0;a<Jj;a++){const u=O2[a];let c=N4(e,u),f=N4(n,u);if(c===void 0&&f===void 0)continue;c||(c=0),f||(f=0),c===0||f===0||M4(c)===M4(f)?(t[u]=Math.max(kt(I4(c),I4(f),r),0),(oi.test(f)||oi.test(c))&&(t[u]+="%")):t[u]=f}(e.rotate||n.rotate)&&(t.rotate=kt(e.rotate||0,n.rotate||0,r))}function N4(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const tF=b3(0,.5,pP),nF=b3(.5,.95,cs);function b3(t,e,n){return r=>r<t?0:r>e?1:n(Nd(t,e,r))}function rF(t,e,n){const r=jn(t)?t:Lu(t);return r.start(I2("",r,e,n)),r.animation}function Ld(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const sF=(t,e)=>t.depth-e.depth;class iF{constructor(){this.children=[],this.isDirty=!1}add(e){y2(this.children,e),this.isDirty=!0}remove(e){om(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(sF),this.isDirty=!1,this.children.forEach(e)}}function oF(t,e){const n=sr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(qo(r),t(i-e))};return Ct.setup(r,!0),()=>qo(r)}function vp(t){return jn(t)?t.get():t}class aF{constructor(){this.members=[]}add(e){y2(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&&(om(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(om(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 yp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Bv=["","X","Y","Z"],lF=1e3;let uF=0;function Wv(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function S3(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=WP(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Ct,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&S3(r)}function E3({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},u=e==null?void 0:e()){this.id=uF++,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(fF),this.nodes.forEach(yF),this.nodes.forEach(_F),this.nodes.forEach(hF)},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 iF)}addEventListener(a,u){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new x2),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=j2(a)&&!fj(a),this.instance=a;const{layoutId:u,layout:c,visualElement:f}=this.options;if(f&&!f.current&&f.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||u)&&(this.isLayoutDirty=!0),t){let h,p=0;const v=()=>this.root.updateBlockedByResize=!1;Ct.read(()=>{p=window.innerWidth}),t(a,()=>{const y=window.innerWidth;y!==p&&(p=y,this.root.updateBlockedByResize=!0,h&&h(),h=oF(v,250),yp.hasAnimatedSinceResize&&(yp.hasAnimatedSinceResize=!1,this.nodes.forEach(L4)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:v,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||EF,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=f.getProps(),E=!this.targetLayout||!w3(this.targetLayout,y),C=!p&&v;if(this.options.layoutRoot||this.resumeFrom||C||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...A2(x,"layout"),onPlay:_,onComplete:b};(f.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(h,C,P.path)}else p||L4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qo(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(xF),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&&S3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const p=this.path[h];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:u,layout:c}=this.options;if(u===void 0&&!c)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(mF),this.nodes.forEach(O4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(D4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(gF),this.nodes.forEach(vF),this.nodes.forEach(cF),this.nodes.forEach(dF)):this.nodes.forEach(D4),this.clearAllSnapshots();const u=sr.now();On.delta=li(0,1e3/60,u-On.timestamp),On.timestamp=u,On.isProcessing=!0,Lv.update.process(On),Lv.preRender.process(On),Lv.render.process(On),On.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,D2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(pF),this.sharedNodes.forEach(wF)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ir(this.snapshot.measuredBox.x)&&!ir(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=yn()),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&&!x3(this.projectionDelta),c=this.getTransformTemplate(),f=c?c(this.latestValues,""):void 0,h=f!==this.prevTransformTemplateValue;a&&this.instance&&(u||ja(this.latestValues)||h)&&(s(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const u=this.measurePageBox();let c=this.removeElementScroll(u);return a&&(c=this.removeTransform(c)),kF(c),{animationId:this.root.animationId,measuredBox:u,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:a}=this.options;if(!a)return yn();const u=a.measureViewportBox();if(!(((f=this.scroll)==null?void 0:f.wasRoot)||this.path.some(CF))){const{scroll:h}=this.root;h&&(Qs(u.x,h.offset.x),Qs(u.y,h.offset.y))}return u}removeElementScroll(a){var c;const u=yn();if(ws(u,a),(c=this.scroll)!=null&&c.wasRoot)return u;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:p,options:v}=h;h!==this.root&&p&&v.layoutScroll&&(p.wasRoot&&ws(u,a),Qs(u.x,p.offset.x),Qs(u.y,p.offset.y))}return u}applyTransform(a,u=!1,c){var h,p;const f=c||yn();ws(f,a);for(let v=0;v<this.path.length;v++){const y=this.path[v];!u&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(Qs(f.x,-y.scroll.offset.x),Qs(f.y,-y.scroll.offset.y)),ja(y.latestValues)&&gp(f,y.latestValues,(h=y.layout)==null?void 0:h.layoutBox)}return ja(this.latestValues)&&gp(f,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),f}removeTransform(a){var c;const u=yn();ws(u,a);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!ja(h.latestValues))continue;let p;h.instance&&(Qy(h.latestValues)&&h.updateSnapshot(),p=yn(),ws(p,h.measurePageBox())),k4(u,h.latestValues,(c=h.snapshot)==null?void 0:c.layoutBox,p)}return ja(this.latestValues)&&k4(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!==On.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var y;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==u;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=On.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=yn(),this.targetWithTransforms=yn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Kj(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ws(this.target,this.layout.layoutBox),l3(this.target,this.targetDelta)):ws(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Qy(this.parent.latestValues)||a3(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=yn(),this.relativeTargetOrigin=yn(),mm(this.relativeTargetOrigin,u,c,this.options.layoutAnchor||void 0),ws(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===On.timestamp&&(c=!1),c)return;const{layout:f,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||h))return;ws(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,v=this.treeScale.y;bj(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=yn());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_4(this.prevProjectionDelta.x,this.projectionDelta.x),_4(this.prevProjectionDelta.y,this.projectionDelta.y)),gd(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==v||!A4(this.projectionDelta.x,this.prevProjectionDelta.x)||!A4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var u;if((u=this.options.visualElement)==null||u.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=su(),this.projectionDelta=su(),this.projectionDeltaWithTransform=su()}setAnimationOrigin(a,u=!1,c){const f=this.snapshot,h=f?f.latestValues:{},p={...this.latestValues},v=su();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const y=yn(),x=f?f.source:void 0,_=this.layout?this.layout.source:void 0,b=x!==_,E=this.getStack(),C=!E||E.members.length<=1,P=!!(b&&!C&&this.options.crossfade===!0&&!this.path.some(SF));this.animationProgress=0;let T;const R=c==null?void 0:c.interpolateProjection(a);this.mixTargetDelta=O=>{const M=O/1e3,A=R==null?void 0:R(M);A?(v.x.translate=A.x,v.x.scale=kt(a.x.scale,1,M),v.x.origin=a.x.origin,v.x.originPoint=a.x.originPoint,v.y.translate=A.y,v.y.scale=kt(a.y.scale,1,M),v.y.origin=a.y.origin,v.y.originPoint=a.y.originPoint):(j4(v.x,a.x,M),j4(v.y,a.y,M)),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mm(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),bF(this.relativeTarget,this.relativeTargetOrigin,y,M),T&&Xj(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=yn()),ws(T,this.relativeTarget)),b&&(this.animationValues=p,eF(p,h,this.latestValues,M,P,C)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var u,c,f;this.notifyListeners("animationStart"),(u=this.currentAnimation)==null||u.stop(),(f=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||f.stop(),this.pendingAnimation&&(qo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ct.update(()=>{yp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Lu(0)),this.motionValue.jump(0,!1),this.currentAnimation=rF(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(lF),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:u,target:c,layout:f,latestValues:h}=a;if(!(!u||!c||!f)){if(this!==a&&this.layout&&f&&k3(this.options.animationType,this.layout.layoutBox,f.layoutBox)){c=this.target||yn();const p=ir(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+p;const v=ir(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+v}ws(u,c),gp(u,h),gd(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(a,u){this.sharedNodes.has(a)||this.sharedNodes.set(a,new aF),this.sharedNodes.get(a).add(u);const f=u.options.initialPromotionConfig;u.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.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 f=this.getStack();f&&f.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 f={};c.z&&Wv("z",a,f,this.animationValues);for(let h=0;h<Bv.length;h++)Wv(`rotate${Bv[h]}`,a,f,this.animationValues),Wv(`skew${Bv[h]}`,a,f,this.animationValues);a.render();for(const h in f)a.setStaticValue(h,f[h]),this.animationValues&&(this.animationValues[h]=f[h]);a.scheduleRender()}applyProjectionStyles(a,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=vp(u==null?void 0:u.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=vp(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!ja(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=f.animationValues||f.latestValues;this.applyTransformsToTarget();let p=Qj(this.projectionDeltaWithTransform,this.treeScale,h);c&&(p=c(h,p)),a.transform=p;const{x:v,y}=this.projectionDelta;a.transformOrigin=`${v.origin*100}% ${y.origin*100}% 0`,f.animationValues?a.opacity=f===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in e_){if(h[x]===void 0)continue;const{correct:_,applyTo:b,isCSSVariable:E}=e_[x],C=p==="none"?h[x]:_(h[x],f);if(b){const P=b.length;for(let T=0;T<P;T++)a[b[T]]=C}else E?this.options.visualElement.renderState.vars[x]=C:a[x]=C}this.options.layoutId&&(a.pointerEvents=f===this?vp(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(O4),this.root.sharedNodes.clear()}}}function cF(t){t.updateLayout()}function dF(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")Ks(p=>{const v=a?e.measuredBox[p]:e.layoutBox[p],y=ir(v);v.min=r[p].min,v.max=v.min+y});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";t_(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else k3(i,e.layoutBox,r)&&Ks(p=>{const v=a?e.measuredBox[p]:e.layoutBox[p],y=ir(r[p]);v.max=v.min+y,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+y)});const u=su();gd(u,r,e.layoutBox);const c=su();a?gd(c,t.applyTransform(s,!0),e.measuredBox):gd(c,r,e.layoutBox);const f=!x3(u);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:v,layout:y}=p;if(v&&y){const x=t.options.layoutAnchor||void 0,_=yn();mm(_,e.layoutBox,v.layoutBox,x);const b=yn();mm(b,r,y.layoutBox,x),w3(_,b)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function fF(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 hF(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function pF(t){t.clearSnapshot()}function O4(t){t.clearMeasurements()}function mF(t){t.isLayoutDirty=!0,t.updateLayout()}function D4(t){t.isLayoutDirty=!1}function gF(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function vF(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function L4(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function yF(t){t.resolveTargetDelta()}function _F(t){t.calcProjection()}function xF(t){t.resetSkewAndRotation()}function wF(t){t.removeLeadSnapshot()}function j4(t,e,n){t.translate=kt(e.translate,0,n),t.scale=kt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function F4(t,e,n,r){t.min=kt(e.min,n.min,r),t.max=kt(e.max,n.max,r)}function bF(t,e,n,r){F4(t.x,e.x,n.x,r),F4(t.y,e.y,n.y,r)}function SF(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const EF={duration:.45,ease:[.4,0,.1,1]},V4=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),$4=V4("applewebkit/")&&!V4("chrome/")?Math.round:cs;function H4(t){t.min=$4(t.min),t.max=$4(t.max)}function kF(t){H4(t.x),H4(t.y)}function k3(t,e,n){return t==="position"||t==="preserve-aspect"&&!Gj(R4(e),R4(n),.2)}function CF(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const PF=E3({attachResizeListener:(t,e)=>Ld(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}),Gv={current:void 0},C3=E3({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Gv.current){const t=new PF({});t.mount(window),t.setOptions({layoutScroll:!0}),Gv.current=t}return Gv.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),U2=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function z4(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function TF(...t){return e=>{let n=!1;const r=t.map(s=>{const i=z4(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():z4(t[s],null)}}}}function RF(...t){return g.useCallback(TF(...t),t)}class AF extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(fp(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=fp(r)&&r.offsetWidth||0,i=fp(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 IF({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var v;const a=g.useId(),u=g.useRef(null),c=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:f}=g.useContext(U2),h=((v=t.props)==null?void 0:v.ref)??(t==null?void 0:t.ref),p=RF(u,h);return g.useInsertionEffect(()=>{const{width:y,height:x,top:_,left:b,right:E,bottom:C,direction:P}=c.current;if(e||i===!1||!u.current||!y||!x)return;const T=P==="rtl",R=n==="left"?T?`right: ${E}`:`left: ${b}`:T?`left: ${b}`:`right: ${E}`,O=r==="bottom"?`bottom: ${C}`:`top: ${_}`;u.current.dataset.motionPopId=a;const M=document.createElement("style");f&&(M.nonce=f);const A=s??document.head;return A.appendChild(M),M.sheet&&M.sheet.insertRule(`
|
|
63
|
+
[data-motion-pop-id="${a}"] {
|
|
64
|
+
position: absolute !important;
|
|
65
|
+
width: ${y}px !important;
|
|
66
|
+
height: ${x}px !important;
|
|
67
|
+
${R}px !important;
|
|
68
|
+
${O}px !important;
|
|
69
|
+
}
|
|
70
|
+
`),()=>{var N;(N=u.current)==null||N.removeAttribute("data-motion-pop-id"),A.contains(M)&&A.removeChild(M)}},[e]),S.jsx(AF,{isPresent:e,childRef:u,sizeRef:c,pop:i,children:i===!1?t:g.cloneElement(t,{ref:p})})}const MF=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:u,anchorY:c,root:f})=>{const h=g2(NF),p=g.useId(),v=g.useRef(n),y=g.useRef(r);v2(()=>{v.current=n,y.current=r});let x=!0,_=g.useMemo(()=>(x=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:b=>{h.set(b,!0);for(const E of h.values())if(!E)return;r&&r()},register:b=>(h.set(b,!1),()=>{var E;h.delete(b),!v.current&&!h.size&&((E=y.current)==null||E.call(y))})}),[n,h,r]);return i&&x&&(_={..._}),g.useMemo(()=>{h.forEach((b,E)=>h.set(E,!1))},[n]),g.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=S.jsx(IF,{pop:a==="popLayout",isPresent:n,anchorX:u,anchorY:c,root:f,children:t}),S.jsx(Hm.Provider,{value:_,children:t})};function NF(){return new Map}function P3(t=!0){const e=g.useContext(Hm);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=g.useId();g.useEffect(()=>{if(t)return s(i)},[t]);const a=g.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,a]:[!0]}const Vh=t=>t.key||"";function U4(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const Gi=({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:f})=>{const[h,p]=P3(a),v=g.useMemo(()=>U4(t),[t]),y=a&&!h?[]:v.map(Vh),x=g.useRef(!0),_=g.useRef(v),b=g2(()=>new Map),E=g.useRef(new Set),[C,P]=g.useState(v),[T,R]=g.useState(v);v2(()=>{x.current=!1,_.current=v;for(let A=0;A<T.length;A++){const N=Vh(T[A]);y.includes(N)?(b.delete(N),E.current.delete(N)):b.get(N)!==!0&&b.set(N,!1)}},[T,y.length,y.join("-")]);const O=[];if(v!==C){let A=[...v];for(let N=0;N<T.length;N++){const D=T[N],j=Vh(D);y.includes(j)||(A.splice(N,0,D),O.push(D))}return i==="wait"&&O.length&&(A=O),R(U4(A)),P(v),null}const{forceRender:M}=g.useContext(m2);return S.jsx(S.Fragment,{children:T.map(A=>{const N=Vh(A),D=a&&!h?!1:v===T||y.includes(N),j=()=>{if(E.current.has(N))return;if(b.has(N))E.current.add(N),b.set(N,!0);else return;let V=!0;b.forEach(W=>{W||(V=!1)}),V&&(M==null||M(),R(_.current),a&&(p==null||p()),r&&r())};return S.jsx(MF,{isPresent:D,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:f,onExitComplete:D?void 0:j,anchorX:u,anchorY:c,children:A},N)})})},T3=g.createContext({strict:!1}),B4={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 W4=!1;function OF(){if(W4)return;const t={};for(const e in B4)t[e]={isEnabled:n=>B4[e].some(r=>!!n[r])};s3(t),W4=!0}function R3(){return OF(),yj()}function DF(t){const e=R3();for(const n in t)e[n]={...e[n],...t[n]};s3(e)}const LF=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 gm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||LF.has(t)}let A3=t=>!gm(t);function jF(t){typeof t=="function"&&(A3=e=>e.startsWith("on")?!gm(e):t(e))}try{jF(require("@emotion/is-prop-valid").default)}catch{}function FF(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||jn(t[s])||(A3(s)||n===!0&&gm(s)||!e&&!gm(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Wm=g.createContext({});function VF(t,e){if(Bm(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Dd(n)?n:void 0,animate:Dd(r)?r:void 0}}return t.inherit!==!1?e:{}}function $F(t){const{initial:e,animate:n}=VF(t,g.useContext(Wm));return g.useMemo(()=>({initial:e,animate:n}),[G4(e),G4(n)])}function G4(t){return Array.isArray(t)?t.join(" "):t}const B2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function I3(t,e,n){for(const r in e)!jn(e[r])&&!d3(r,n)&&(t[r]=e[r])}function HF({transformTemplate:t},e){return g.useMemo(()=>{const n=B2();return H2(n,e,t),Object.assign({},n.vars,n.style)},[e])}function zF(t,e){const n=t.style||{},r={};return I3(r,n,t),Object.assign(r,HF(t,e)),r}function UF(t,e){const n={},r=zF(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 M3=()=>({...B2(),attrs:{}});function BF(t,e,n,r){const s=g.useMemo(()=>{const i=M3();return f3(i,e,p3(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};I3(i,t.style,t),s.style={...i,...s.style}}return s}const WF=["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 W2(t){return typeof t!="string"||t.includes("-")?!1:!!(WF.indexOf(t)>-1||/[A-Z]/u.test(t))}function GF(t,e,n,{latestValues:r},s,i=!1,a){const c=(a??W2(t)?BF:UF)(e,r,s,t),f=FF(e,typeof t=="string",i),h=t!==g.Fragment?{...f,...c,ref:n}:{},{children:p}=e,v=g.useMemo(()=>jn(p)?p.get():p,[p]);return g.createElement(t,{...h,children:v})}function KF({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:qF(n,r,s,t),renderState:e()}}function qF(t,e,n,r){const s={},i=r(t,{});for(const v in i)s[v]=vp(i[v]);let{initial:a,animate:u}=t;const c=Bm(t),f=n3(t);e&&f&&!c&&t.inherit!==!1&&(a===void 0&&(a=e.initial),u===void 0&&(u=e.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const p=h?u:a;if(p&&typeof p!="boolean"&&!Um(p)){const v=Array.isArray(p)?p:[p];for(let y=0;y<v.length;y++){const x=M2(t,v[y]);if(x){const{transitionEnd:_,transition:b,...E}=x;for(const C in E){let P=E[C];if(Array.isArray(P)){const T=h?P.length-1:0;P=P[T]}P!==null&&(s[C]=P)}for(const C in _)s[C]=_[C]}}}return s}const N3=t=>(e,n)=>{const r=g.useContext(Wm),s=g.useContext(Hm),i=()=>KF(t,e,r,s);return n?i():g2(i)},ZF=N3({scrapeMotionValuesFromProps:z2,createRenderState:B2}),YF=N3({scrapeMotionValuesFromProps:m3,createRenderState:M3}),XF=Symbol.for("motionComponentSymbol");function QF(t,e,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.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 O3=g.createContext({});function Jl(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function JF(t,e,n,r,s,i){var P,T;const{visualElement:a}=g.useContext(Wm),u=g.useContext(T3),c=g.useContext(Hm),f=g.useContext(U2),h=f.reducedMotion,p=f.skipAnimations,v=g.useRef(null),y=g.useRef(!1);r=r||u.renderer,!v.current&&r&&(v.current=r(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:i}),y.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const x=v.current,_=g.useContext(O3);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&eV(v.current,n,s,_);const b=g.useRef(!1);g.useInsertionEffect(()=>{x&&b.current&&x.update(n,c)});const E=n[BP],C=g.useRef(!!E&&typeof window<"u"&&!((P=window.MotionHandoffIsComplete)!=null&&P.call(window,E))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,E)));return v2(()=>{y.current=!0,x&&(b.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),C.current&&x.animationState&&x.animationState.animateChanges())}),g.useEffect(()=>{x&&(!C.current&&x.animationState&&x.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,E)}),C.current=!1),x.enteringChildren=void 0)}),x}function eV(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:u,layoutScroll:c,layoutRoot:f,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:D3(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||u&&Jl(u),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:f,layoutAnchor:h})}function D3(t){if(t)return t.options.allowProjection!==!1?t.projection:D3(t.parent)}function Kv(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&DF(r);const i=n?n==="svg":W2(t),a=i?YF:ZF;function u(f,h){let p;const v={...g.useContext(U2),...f,layoutId:tV(f)},{isStatic:y}=v,x=$F(f),_=a(f,y);if(!y&&typeof window<"u"){nV();const b=rV(v);p=b.MeasureLayout,x.visualElement=JF(t,_,v,s,b.ProjectionNode,i)}return S.jsxs(Wm.Provider,{value:x,children:[p&&x.visualElement?S.jsx(p,{visualElement:x.visualElement,...v}):null,GF(t,f,QF(_,x.visualElement,h),_,y,e,i)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=g.forwardRef(u);return c[XF]=t,c}function tV({layoutId:t}){const e=g.useContext(m2).id;return e&&t!==void 0?e+"-"+t:t}function nV(t,e){g.useContext(T3).strict}function rV(t){const e=R3(),{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 sV(t,e){if(typeof Proxy>"u")return Kv;const n=new Map,r=(i,a)=>Kv(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,Kv(a,void 0,t,e)),n.get(a))})}const iV=(t,e)=>e.isSVG??W2(t)?new Dj(e):new Rj(e,{allowProjection:t!==g.Fragment});class oV extends ta{constructor(e){super(e),e.animationState||(e.animationState=$j(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Um(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 aV=0;class lV extends ta{constructor(){super(...arguments),this.id=aV++,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=rl(this.node,a,u);if(c){const{transition:f,transitionEnd:h,...p}=c;for(const v in p)(i=this.node.getValue(v))==null||i.jump(p[v])}}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 uV={animation:{Feature:oV},exit:{Feature:lV}};function ff(t){return{point:{x:t.pageX,y:t.pageY}}}const cV=t=>e=>L2(e)&&t(e,ff(e));function vd(t,e,n,r){return Ld(t,e,cV(n),r)}const L3=({current:t})=>t?t.ownerDocument.defaultView:null,K4=(t,e)=>Math.abs(t-e);function dV(t,e){const n=K4(t.x,e.x),r=K4(t.y,e.y);return Math.sqrt(n**2+r**2)}const q4=new Set(["auto","scroll"]);class j3{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=$h(this.lastRawMoveEventInfo,this.transformPagePoint));const x=qv(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,b=dV(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!b)return;const{point:E}=x,{timestamp:C}=On;this.history.push({...E,timestamp:C});const{onStart:P,onMove:T}=this.handlers;_||(P&&P(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,x)},this.handlePointerMove=(x,_)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=$h(_,this.transformPagePoint),Ct.update(this.updatePoint,!0)},this.handlePointerUp=(x,_)=>{this.end();const{onEnd:b,onSessionEnd:E,resumeAnimation:C}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=qv(x.type==="pointercancel"?this.lastMoveEventInfo:$h(_,this.transformPagePoint),this.history);this.startEvent&&b&&b(x,P),E&&E(x,P)},!L2(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const c=ff(e),f=$h(c,this.transformPagePoint),{point:h}=f,{timestamp:p}=On;this.history=[{...h,timestamp:p}];const{onSessionStart:v}=n;v&&v(e,qv(f,this.history));const y={passive:!0,capture:!0};this.removeListeners=uf(vd(this.contextWindow,"pointermove",this.handlePointerMove,y),vd(this.contextWindow,"pointerup",this.handlePointerUp,y),vd(this.contextWindow,"pointercancel",this.handlePointerUp,y)),u&&this.startScrollTracking(u)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(q4.has(r.overflowX)||q4.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),Ct.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qo(this.updatePoint)}}function $h(t,e){return e?{point:e(t.point)}:t}function Z4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qv({point:t},e){return{point:t,delta:Z4(t,F3(e)),offset:Z4(t,fV(e)),velocity:hV(e,.1)}}function fV(t){return t[0]}function F3(t){return t[t.length-1]}function hV(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=F3(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Wr(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Wr(e)*2&&(r=t[1]);const i=os(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 pV(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?kt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?kt(n,t,r.max):Math.min(t,n)),t}function Y4(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 mV(t,{top:e,left:n,bottom:r,right:s}){return{x:Y4(t.x,n,s),y:Y4(t.y,e,r)}}function X4(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 gV(t,e){return{x:X4(t.x,e.x),y:X4(t.y,e.y)}}function vV(t,e){let n=.5;const r=ir(t),s=ir(e);return s>r?n=Nd(e.min,e.max-r,t.min):r>s&&(n=Nd(t.min,t.max-s,e.min)),li(0,1,n)}function yV(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 n_=.35;function _V(t=n_){return t===!1?t=0:t===!0&&(t=n_),{x:Q4(t,"left","right"),y:Q4(t,"top","bottom")}}function Q4(t,e,n){return{min:J4(t,e),max:J4(t,n)}}function J4(t,e){return typeof t=="number"?t:t[e]||0}const xV=new WeakMap;class wV{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=yn(),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(ff(p).point),this.stopAnimation()},a=(p,v)=>{const{drag:y,dragPropagation:x,onDragStart:_}=this.getProps();if(y&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Z7(y),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ks(E=>{let C=this.getAxisMotionValue(E).get()||0;if(oi.test(C)){const{projection:P}=this.visualElement;if(P&&P.layout){const T=P.layout.layoutBox[E];T&&(C=ir(T)*(parseFloat(C)/100))}}this.originPoint[E]=C}),_&&Ct.update(()=>_(p,v),!1,!0),Ky(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},u=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v;const{dragPropagation:y,dragDirectionLock:x,onDirectionLock:_,onDrag:b}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:E}=v;if(x&&this.currentDirection===null){this.currentDirection=SV(E),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",v.point,E),this.updateAxis("y",v.point,E),this.visualElement.render(),b&&Ct.update(()=>b(p,v),!1,!0)},c=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v,this.stop(p,v),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new j3(e,{onSessionStart:i,onStart:a,onMove:u,onSessionEnd:c,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:L3(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&&Ct.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||!Hh(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=pV(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&&Jl(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=mV(r.layoutBox,e):this.constraints=!1,this.elastic=_V(n),s!==this.constraints&&!Jl(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ks(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=yV(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Jl(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=Sj(r,s.root,this.visualElement.getTransformPagePoint());let a=gV(s.layout.layoutBox,i);if(n){const u=n(xj(a));this.hasMutatedConstraints=!!u,u&&(a=o3(u))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:u}=this.getProps(),c=this.constraints||{},f=Ks(h=>{if(!Hh(h,n,this.currentDirection))return;let p=c&&c[h]||{};(a===!0||a===h)&&(p={min:0,max:0});const v=s?200:1e6,y=s?40:1e7,x={type:"inertia",velocity:r?e[h]:0,bounceStiffness:v,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,x)});return Promise.all(f).then(u)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Ky(this.visualElement,e),r.start(I2(e,r,0,n,this.visualElement,!1))}stopAnimation(){Ks(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){Ks(n=>{const{drag:r}=this.getProps();if(!Hh(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:u}=s.layout.layoutBox[n],c=i.get()||0;i.set(e[n]-kt(a,u,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Jl(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ks(a=>{const u=this.getAxisMotionValue(a);if(u&&this.constraints!==!1){const c=u.get();s[a]=vV({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(),Ks(a=>{if(!Hh(a,e,null))return;const u=this.getAxisMotionValue(a),{min:c,max:f}=this.constraints[a];u.set(kt(c,f,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;xV.set(this.visualElement,this);const e=this.visualElement.current,n=vd(e,"pointerdown",f=>{const{drag:h,dragListener:p=!0}=this.getProps(),v=f.target,y=v!==e&&tj(v);h&&p&&!y&&this.start(f)});let r;const s=()=>{const{dragConstraints:f}=this.getProps();Jl(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),r||(r=bV(e,f.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ct.read(s);const u=Ld(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:h})=>{this.isDragging&&h&&(Ks(p=>{const v=this.getAxisMotionValue(p);v&&(this.originPoint[p]+=f[p].translate,v.set(v.get()+f[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=n_,dragMomentum:u=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:u}}}function ek(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function bV(t,e,n){const r=a4(t,ek(n)),s=a4(e,ek(n));return()=>{r(),s()}}function Hh(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function SV(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class EV extends ta{constructor(e){super(e),this.removeGroupControls=cs,this.removeListeners=cs,this.controls=new wV(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cs}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 Zv=t=>(e,n)=>{t&&Ct.update(()=>t(e,n),!1,!0)};class kV extends ta{constructor(){super(...arguments),this.removePointerDownListener=cs}onPointerDown(e){this.session=new j3(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:L3(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Zv(e),onStart:Zv(n),onMove:Zv(r),onEnd:(i,a)=>{delete this.session,s&&Ct.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=vd(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 Yv=!1;class CV extends g.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),Yv&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),yp.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}),Yv=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Ct.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(),D2.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;Yv=!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 V3(t){const[e,n]=P3(),r=g.useContext(m2);return S.jsx(CV,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(O3),isPresent:e,safeToRemove:n})}const PV={pan:{Feature:kV},drag:{Feature:EV,ProjectionNode:C3,MeasureLayout:V3}};function tk(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&&Ct.postRender(()=>i(e,ff(e)))}class TV extends ta{mount(){const{current:e}=this.node;e&&(this.unmount=X7(e,(n,r)=>(tk(this.node,r,"Start"),s=>tk(this.node,s,"End"))))}unmount(){}}class RV extends ta{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=uf(Ld(this.node.current,"focus",()=>this.onFocus()),Ld(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function nk(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&&Ct.postRender(()=>i(e,ff(e)))}class AV extends ta{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=rj(e,(s,i)=>(nk(this.node,i,"Start"),(a,{success:u})=>nk(this.node,a,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const r_=new WeakMap,Xv=new WeakMap,IV=t=>{const e=r_.get(t.target);e&&e(t)},MV=t=>{t.forEach(IV)};function NV({root:t,...e}){const n=t||document;Xv.has(n)||Xv.set(n,{});const r=Xv.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(MV,{root:t,...e})),r[s]}function OV(t,e,n){const r=NV(e);return r_.set(t,n),r.observe(t),()=>{r_.delete(t),r.unobserve(t)}}const DV={some:0,all:1};class LV extends ta{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:DV[s]},u=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,i&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:v}=this.node.getProps(),y=h?p:v;y&&y(f)};this.stopObserver=OV(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(jV(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function jV({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const FV={inView:{Feature:LV},tap:{Feature:AV},focus:{Feature:RV},hover:{Feature:TV}},VV={layout:{ProjectionNode:C3,MeasureLayout:V3}},$V={...uV,...FV,...PV,...VV},Ki=sV($V,iV);function HV(){!$2.current&&r3();const[t]=g.useState(fm.current);return t}const sl=Ki;var Gm=Y6();const zV=jm(Gm);function UV(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 BV=t=>{switch(t){case"success":return KV;case"info":return ZV;case"warning":return qV;case"error":return YV;default:return null}},WV=Array(12).fill(0),GV=({visible:t,className:e})=>ge.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ge.createElement("div",{className:"sonner-spinner"},WV.map((n,r)=>ge.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),KV=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.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"})),qV=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ge.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"})),ZV=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.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"})),YV=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.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"})),XV=ge.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"},ge.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ge.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),QV=()=>{const[t,e]=ge.useState(document.hidden);return ge.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let s_=1;class JV{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:s_++,a=this.toasts.find(c=>c.id===i),u=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...e,id:i,title:r}),{...c,...e,id:i,dismissible:u,title:r}):c):this.addToast({title:r,...s,dismissible:u,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,a;const u=s.then(async f=>{if(a=["resolve",f],ge.isValidElement(f))i=!1,this.create({id:r,type:"default",message:f});else if(t$(f)&&!f.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,x=typeof p=="object"&&!ge.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...x})}else if(f instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(f):n.error,v=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!ge.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...x})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(f):n.success,v=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!ge.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:v,...x})}}).catch(async f=>{if(a=["reject",f],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,y=typeof h=="object"&&!ge.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((f,h)=>u.then(()=>a[0]==="reject"?h(a[1]):f(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||s_++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const xr=new JV,e$=(t,e)=>{const n=(e==null?void 0:e.id)||s_++;return xr.addToast({title:t,...e,id:n}),n},t$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",n$=e$,r$=()=>xr.toasts,s$=()=>xr.getActiveToasts(),ht=Object.assign(n$,{success:xr.success,info:xr.info,warning:xr.warning,error:xr.error,custom:xr.custom,message:xr.message,promise:xr.promise,dismiss:xr.dismiss,loading:xr.loading},{getHistory:r$,getToasts:s$});UV("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function zh(t){return t.label!==void 0}const i$=3,o$="24px",a$="16px",rk=4e3,l$=356,u$=14,c$=45,d$=200;function Bs(...t){return t.filter(Boolean).join(" ")}function f$(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const h$=t=>{var e,n,r,s,i,a,u,c,f;const{invert:h,toast:p,unstyled:v,interacting:y,setHeights:x,visibleToasts:_,heights:b,index:E,toasts:C,expanded:P,removeToast:T,defaultRichColors:R,closeButton:O,style:M,cancelButtonStyle:A,actionButtonStyle:N,className:D="",descriptionClassName:j="",duration:V,position:W,gap:Y,expandByDefault:K,classNames:B,icons:X,closeButtonAriaLabel:$="Close toast"}=t,[te,H]=ge.useState(null),[L,Z]=ge.useState(null),[ne,ie]=ge.useState(!1),[ae,ue]=ge.useState(!1),[ke,ee]=ge.useState(!1),[le,pe]=ge.useState(!1),[we,Ie]=ge.useState(!1),[qe,it]=ge.useState(0),[Ae,at]=ge.useState(0),At=ge.useRef(p.duration||V||rk),mt=ge.useRef(null),je=ge.useRef(null),Ye=E===0,lt=E+1<=_,Je=p.type,vt=p.dismissible!==!1,xn=p.className||"",Ut=p.descriptionClassName||"",Rn=ge.useMemo(()=>b.findIndex(We=>We.toastId===p.id)||0,[b,p.id]),Hn=ge.useMemo(()=>{var We;return(We=p.closeButton)!=null?We:O},[p.closeButton,O]),Ar=ge.useMemo(()=>p.duration||V||rk,[p.duration,V]),Yn=ge.useRef(0),wn=ge.useRef(0),Is=ge.useRef(0),Ms=ge.useRef(null),[An,fi]=W.split("-"),hi=ge.useMemo(()=>b.reduce((We,Bt,jt)=>jt>=Rn?We:We+Bt.height,0),[b,Rn]),fs=QV(),Ns=p.invert||h,lr=Je==="loading";wn.current=ge.useMemo(()=>Rn*Y+hi,[Rn,hi]),ge.useEffect(()=>{At.current=Ar},[Ar]),ge.useEffect(()=>{ie(!0)},[]),ge.useEffect(()=>{const We=je.current;if(We){const Bt=We.getBoundingClientRect().height;return at(Bt),x(jt=>[{toastId:p.id,height:Bt,position:p.position},...jt]),()=>x(jt=>jt.filter(bn=>bn.toastId!==p.id))}},[x,p.id]),ge.useLayoutEffect(()=>{if(!ne)return;const We=je.current,Bt=We.style.height;We.style.height="auto";const jt=We.getBoundingClientRect().height;We.style.height=Bt,at(jt),x(bn=>bn.find(Xt=>Xt.toastId===p.id)?bn.map(Xt=>Xt.toastId===p.id?{...Xt,height:jt}:Xt):[{toastId:p.id,height:jt,position:p.position},...bn])},[ne,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const Xn=ge.useCallback(()=>{ue(!0),it(wn.current),x(We=>We.filter(Bt=>Bt.toastId!==p.id)),setTimeout(()=>{T(p)},d$)},[p,T,x,wn]);ge.useEffect(()=>{if(p.promise&&Je==="loading"||p.duration===1/0||p.type==="loading")return;let We;return P||y||fs?(()=>{if(Is.current<Yn.current){const bn=new Date().getTime()-Yn.current;At.current=At.current-bn}Is.current=new Date().getTime()})():(()=>{At.current!==1/0&&(Yn.current=new Date().getTime(),We=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Xn()},At.current))})(),()=>clearTimeout(We)},[P,y,p,Je,fs,Xn]),ge.useEffect(()=>{p.delete&&(Xn(),p.onDismiss==null||p.onDismiss.call(p,p))},[Xn,p.delete]);function Os(){var We;if(X!=null&&X.loading){var Bt;return ge.createElement("div",{className:Bs(B==null?void 0:B.loader,p==null||(Bt=p.classNames)==null?void 0:Bt.loader,"sonner-loader"),"data-visible":Je==="loading"},X.loading)}return ge.createElement(GV,{className:Bs(B==null?void 0:B.loader,p==null||(We=p.classNames)==null?void 0:We.loader),visible:Je==="loading"})}const Ds=p.icon||(X==null?void 0:X[Je])||BV(Je);var Ir,pi;return ge.createElement("li",{tabIndex:0,ref:je,className:Bs(D,xn,B==null?void 0:B.toast,p==null||(e=p.classNames)==null?void 0:e.toast,B==null?void 0:B.default,B==null?void 0:B[Je],p==null||(n=p.classNames)==null?void 0:n[Je]),"data-sonner-toast":"","data-rich-colors":(Ir=p.richColors)!=null?Ir:R,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":ne,"data-promise":!!p.promise,"data-swiped":we,"data-removed":ae,"data-visible":lt,"data-y-position":An,"data-x-position":fi,"data-index":E,"data-front":Ye,"data-swiping":ke,"data-dismissible":vt,"data-type":Je,"data-invert":Ns,"data-swipe-out":le,"data-swipe-direction":L,"data-expanded":!!(P||K&&ne),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":C.length-E,"--offset":`${ae?qe:wn.current}px`,"--initial-height":K?"auto":`${Ae}px`,...M,...p.style},onDragEnd:()=>{ee(!1),H(null),Ms.current=null},onPointerDown:We=>{We.button!==2&&(lr||!vt||(mt.current=new Date,it(wn.current),We.target.setPointerCapture(We.pointerId),We.target.tagName!=="BUTTON"&&(ee(!0),Ms.current={x:We.clientX,y:We.clientY})))},onPointerUp:()=>{var We,Bt,jt;if(le||!vt)return;Ms.current=null;const bn=Number(((We=je.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ls=Number(((Bt=je.current)==null?void 0:Bt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xt=new Date().getTime()-((jt=mt.current)==null?void 0:jt.getTime()),rn=te==="x"?bn:Ls,hs=Math.abs(rn)/Xt;if(Math.abs(rn)>=c$||hs>.11){it(wn.current),p.onDismiss==null||p.onDismiss.call(p,p),Z(te==="x"?bn>0?"right":"left":Ls>0?"down":"up"),Xn(),pe(!0);return}else{var ln,Qn;(ln=je.current)==null||ln.style.setProperty("--swipe-amount-x","0px"),(Qn=je.current)==null||Qn.style.setProperty("--swipe-amount-y","0px")}Ie(!1),ee(!1),H(null)},onPointerMove:We=>{var Bt,jt,bn;if(!Ms.current||!vt||((Bt=window.getSelection())==null?void 0:Bt.toString().length)>0)return;const Xt=We.clientY-Ms.current.y,rn=We.clientX-Ms.current.x;var hs;const ln=(hs=t.swipeDirections)!=null?hs:f$(W);!te&&(Math.abs(rn)>1||Math.abs(Xt)>1)&&H(Math.abs(rn)>Math.abs(Xt)?"x":"y");let Qn={x:0,y:0};const js=ur=>1/(1.5+Math.abs(ur)/20);if(te==="y"){if(ln.includes("top")||ln.includes("bottom"))if(ln.includes("top")&&Xt<0||ln.includes("bottom")&&Xt>0)Qn.y=Xt;else{const ur=Xt*js(Xt);Qn.y=Math.abs(ur)<Math.abs(Xt)?ur:Xt}}else if(te==="x"&&(ln.includes("left")||ln.includes("right")))if(ln.includes("left")&&rn<0||ln.includes("right")&&rn>0)Qn.x=rn;else{const ur=rn*js(rn);Qn.x=Math.abs(ur)<Math.abs(rn)?ur:rn}(Math.abs(Qn.x)>0||Math.abs(Qn.y)>0)&&Ie(!0),(jt=je.current)==null||jt.style.setProperty("--swipe-amount-x",`${Qn.x}px`),(bn=je.current)==null||bn.style.setProperty("--swipe-amount-y",`${Qn.y}px`)}},Hn&&!p.jsx&&Je!=="loading"?ge.createElement("button",{"aria-label":$,"data-disabled":lr,"data-close-button":!0,onClick:lr||!vt?()=>{}:()=>{Xn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Bs(B==null?void 0:B.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(pi=X==null?void 0:X.close)!=null?pi:XV):null,(Je||p.icon||p.promise)&&p.icon!==null&&((X==null?void 0:X[Je])!==null||p.icon)?ge.createElement("div",{"data-icon":"",className:Bs(B==null?void 0:B.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Os():null,p.type!=="loading"?Ds:null):null,ge.createElement("div",{"data-content":"",className:Bs(B==null?void 0:B.content,p==null||(i=p.classNames)==null?void 0:i.content)},ge.createElement("div",{"data-title":"",className:Bs(B==null?void 0:B.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?ge.createElement("div",{"data-description":"",className:Bs(j,Ut,B==null?void 0:B.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),ge.isValidElement(p.cancel)?p.cancel:p.cancel&&zh(p.cancel)?ge.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:We=>{zh(p.cancel)&&vt&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,We),Xn())},className:Bs(B==null?void 0:B.cancelButton,p==null||(c=p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,ge.isValidElement(p.action)?p.action:p.action&&zh(p.action)?ge.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||N,onClick:We=>{zh(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,We),!We.defaultPrevented&&Xn())},className:Bs(B==null?void 0:B.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function sk(){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 p$(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",u=i?a$:o$;function c(f){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${a}-${f}`]=u:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(u)}),n}const m$=ge.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:c,className:f,offset:h,mobileOffset:p,theme:v="light",richColors:y,duration:x,style:_,visibleToasts:b=i$,toastOptions:E,dir:C=sk(),gap:P=u$,icons:T,containerAriaLabel:R="Notifications"}=e,[O,M]=ge.useState([]),A=ge.useMemo(()=>r?O.filter(ne=>ne.toasterId===r):O.filter(ne=>!ne.toasterId),[O,r]),N=ge.useMemo(()=>Array.from(new Set([i].concat(A.filter(ne=>ne.position).map(ne=>ne.position)))),[A,i]),[D,j]=ge.useState([]),[V,W]=ge.useState(!1),[Y,K]=ge.useState(!1),[B,X]=ge.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ge.useRef(null),te=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=ge.useRef(null),L=ge.useRef(!1),Z=ge.useCallback(ne=>{M(ie=>{var ae;return(ae=ie.find(ue=>ue.id===ne.id))!=null&&ae.delete||xr.dismiss(ne.id),ie.filter(({id:ue})=>ue!==ne.id)})},[]);return ge.useEffect(()=>xr.subscribe(ne=>{if(ne.dismiss){requestAnimationFrame(()=>{M(ie=>ie.map(ae=>ae.id===ne.id?{...ae,delete:!0}:ae))});return}setTimeout(()=>{zV.flushSync(()=>{M(ie=>{const ae=ie.findIndex(ue=>ue.id===ne.id);return ae!==-1?[...ie.slice(0,ae),{...ie[ae],...ne},...ie.slice(ae+1)]:[ne,...ie]})})})}),[O]),ge.useEffect(()=>{if(v!=="system"){X(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:ie})=>{X(ie?"dark":"light")})}catch{ne.addListener(({matches:ae})=>{try{X(ae?"dark":"light")}catch(ue){console.error(ue)}})}},[v]),ge.useEffect(()=>{O.length<=1&&W(!1)},[O]),ge.useEffect(()=>{const ne=ie=>{var ae;if(a.every(ee=>ie[ee]||ie.code===ee)){var ke;W(!0),(ke=$.current)==null||ke.focus()}ie.code==="Escape"&&(document.activeElement===$.current||(ae=$.current)!=null&&ae.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[a]),ge.useEffect(()=>{if($.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,L.current=!1)}},[$.current]),ge.createElement("section",{ref:n,"aria-label":`${R} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((ne,ie)=>{var ae;const[ue,ke]=ne.split("-");return A.length?ge.createElement("ol",{key:ne,dir:C==="auto"?sk():C,tabIndex:-1,ref:$,className:f,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":ue,"data-x-position":ke,style:{"--front-toast-height":`${((ae=D[0])==null?void 0:ae.height)||0}px`,"--width":`${l$}px`,"--gap":`${P}px`,..._,...p$(h,p)},onBlur:ee=>{L.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(L.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||L.current||(L.current=!0,H.current=ee.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{Y||W(!1)},onDragEnd:()=>W(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},A.filter(ee=>!ee.position&&ie===0||ee.position===ne).map((ee,le)=>{var pe,we;return ge.createElement(h$,{key:ee.id,icons:T,index:le,toast:ee,defaultRichColors:y,duration:(pe=E==null?void 0:E.duration)!=null?pe:x,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:s,visibleToasts:b,closeButton:(we=E==null?void 0:E.closeButton)!=null?we:c,interacting:Y,position:ne,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:Z,toasts:A.filter(Ie=>Ie.position==ee.position),heights:D.filter(Ie=>Ie.position==ee.position),setHeights:j,expandByDefault:u,gap:P,expanded:V,swipeDirections:e.swipeDirections})})):null}))});function Et(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)}}function ik(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function g$(...t){return e=>{let n=!1;const r=t.map(s=>{const i=ik(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():ik(t[s],null)}}}}function Yt(...t){return g.useCallback(g$(...t),t)}function na(t,e=[]){let n=[];function r(i,a){const u=g.createContext(a);u.displayName=i+"Context";const c=n.length;n=[...n,a];const f=p=>{var E;const{scope:v,children:y,...x}=p,_=((E=v==null?void 0:v[t])==null?void 0:E[c])||u,b=g.useMemo(()=>x,Object.values(x));return S.jsx(_.Provider,{value:b,children:y})};f.displayName=i+"Provider";function h(p,v,y={}){var E;const{optional:x=!1}=y,_=((E=v==null?void 0:v[t])==null?void 0:E[c])||u,b=g.useContext(_);if(b)return b;if(a!==void 0)return a;if(!x)throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const s=()=>{const i=n.map(a=>g.createContext(a));return function(u){const c=(u==null?void 0:u[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...u,[t]:c}}),[u,c])}};return s.scopeName=t,[r,v$(s,...e)]}function v$(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((u,{useScope:c,scopeName:f})=>{const p=c(i)[`__scope${f}`];return{...u,...p}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var ai=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},y$=B_[" useId ".trim().toString()]||(()=>{}),_$=0;function il(t){const[e,n]=g.useState(y$());return ai(()=>{n(r=>r??String(_$++))},[t]),e?`radix-${e}`:""}var x$=B_[" useInsertionEffect ".trim().toString()]||ai;function hl({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,a]=w$({defaultProp:e,onChange:n}),u=t!==void 0,c=u?t:s;{const h=g.useRef(t!==void 0);g.useEffect(()=>{const p=h.current;p!==u&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,r])}const f=g.useCallback(h=>{var p;if(u){const v=b$(h)?h(t):h;v!==t&&((p=a.current)==null||p.call(a,v))}else i(h)},[u,t,i,a]);return[c,f]}function w$({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return x$(()=>{i.current=e},[e]),g.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}function b$(t){return typeof t=="function"}function jd(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,u=!1;const c=[];ok(s)&&typeof Uh=="function"&&(s=Uh(s._payload)),g.Children.forEach(s,v=>{var y;if(P$(v)){u=!0;const x=v;let _="child"in x.props?x.props.child:x.props.children;ok(_)&&typeof Uh=="function"&&(_=Uh(_._payload)),a=E$(x,_),c.push((y=a==null?void 0:a.props)==null?void 0:y.children)}else c.push(v)}),a?a=g.cloneElement(a,void 0,c):!u&&g.Children.count(s)===1&&g.isValidElement(s)&&(a=s);const f=a?C$(a):void 0,h=Yt(r,f);if(!a){if(s||s===0)throw new Error(u?I$(t):A$(t));return s}const p=k$(i,a.props??{});return a.type!==g.Fragment&&(p.ref=r?h:f),g.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}var $3=Symbol.for("radix.slottable");function S$(t){const e=n=>"child"in n?n.children(n.child):n.children;return e.displayName=`${t}.Slottable`,e.__radixId=$3,e}var E$=(t,e)=>{if("child"in t.props){const n=t.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,t.props.children(n.props.children)):null}return g.isValidElement(e)?e:null};function k$(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const c=i(...u);return s(...u),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function C$(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function P$(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===$3}var T$=Symbol.for("react.lazy");function ok(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===T$&&"_payload"in t&&R$(t._payload)}function R$(t){return typeof t=="object"&&t!==null&&"then"in t}var A$=t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,I$=t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Uh=B_[" use ".trim().toString()],M$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rt=M$.reduce((t,e)=>{const n=jd(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:a,...u}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...u,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function N$(t,e){t&&Gm.flushSync(()=>t.dispatchEvent(e))}function ju(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}var O$="DismissableLayer",i_="dismissableLayer.update",D$="dismissableLayer.pointerDownOutside",L$="dismissableLayer.focusOutside",ak,G2=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Km=g.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:u,onDismiss:c,...f}=t,h=g.useContext(G2),[p,v]=g.useState(null),y=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=g.useState({}),_=Yt(e,v),b=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=E?b.indexOf(E):-1,P=p?b.indexOf(p):-1,T=h.layersWithOutsidePointerEventsDisabled.size>0,R=P>=C,O=g.useRef(!1),M=H$(j=>{i==null||i(j),u==null||u(j),j.defaultPrevented||c==null||c()},{ownerDocument:y,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(j=>{if(!(j instanceof Node))return!1;const V=[...h.branches].some(W=>W.contains(j));return R&&!V},[h.branches,R])}),A=z$(j=>{if(r&&O.current)return;const V=j.target;[...h.branches].some(Y=>Y.contains(V))||(a==null||a(j),u==null||u(j),j.defaultPrevented||c==null||c())},y),N=p?P===b.length-1:!1,D=ju(j=>{j.key==="Escape"&&(s==null||s(j),!j.defaultPrevented&&c&&(j.preventDefault(),c()))});return g.useEffect(()=>{if(N)return y.addEventListener("keydown",D,{capture:!0}),()=>y.removeEventListener("keydown",D,{capture:!0})},[y,N,D]),g.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(ak=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),lk(),()=>{n&&(h.layersWithOutsidePointerEventsDisabled.delete(p),h.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=ak))}},[p,y,n,h]),g.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),lk())},[p,h]),g.useEffect(()=>{const j=()=>x({});return document.addEventListener(i_,j),()=>document.removeEventListener(i_,j)},[]),S.jsx(Rt.div,{...f,ref:_,style:{pointerEvents:T?R?"auto":"none":void 0,...t.style},onFocusCapture:Et(t.onFocusCapture,A.onFocusCapture),onBlurCapture:Et(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Et(t.onPointerDownCapture,M.onPointerDownCapture)})});Km.displayName=O$;var j$="DismissableLayerBranch",F$=g.forwardRef((t,e)=>{const n=g.useContext(G2),r=g.useRef(null),s=Yt(e,r);return g.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),S.jsx(Rt.div,{...t,ref:s})});F$.displayName=j$;function V$(){const t=g.useContext(G2),[e,n]=g.useState(null);return g.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}var $$=()=>!0;function H$(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=$$}=e,u=ju(t),c=g.useRef(!1),f=g.useRef(!1),h=g.useRef(new Map),p=g.useRef(()=>{});return g.useEffect(()=>{function v(){f.current=!1,s.current=!1,h.current.clear()}function y(){return Array.from(h.current.values()).some(Boolean)}function x(P){if(!f.current)return;const T=P.target;T instanceof Node&&[...i].some(O=>O.contains(T))||h.current.set(P.type,!0),P.type==="click"&&window.setTimeout(()=>{f.current&&p.current()},0)}function _(P){f.current&&h.current.set(P.type,!1)}const b=P=>{if(P.target&&!c.current){let T=function(){n.removeEventListener("click",p.current);const O=y();v(),O||H3(D$,u,R,{discrete:!0})};if(!a(P.target)){n.removeEventListener("click",p.current),v(),c.current=!1;return}const R={originalEvent:P};f.current=!0,s.current=r&&P.button===0,h.current.clear(),!r||P.button!==0?T():(n.removeEventListener("click",p.current),p.current=T,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),v();c.current=!1},E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const P of E)n.addEventListener(P,x,!0),n.addEventListener(P,_);const C=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(C),n.removeEventListener("pointerdown",b),n.removeEventListener("click",p.current);for(const P of E)n.removeEventListener(P,x,!0),n.removeEventListener(P,_)}},[n,u,r,s,i,a]),{onPointerDownCapture:()=>c.current=!0}}function z$(t,e=globalThis==null?void 0:globalThis.document){const n=ju(t),r=g.useRef(!1);return g.useEffect(()=>{const s=i=>{i.target&&!r.current&&H3(L$,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lk(){const t=new CustomEvent(i_);document.dispatchEvent(t)}function H3(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?N$(s,i):s.dispatchEvent(i)}var Qv="focusScope.autoFocusOnMount",Jv="focusScope.autoFocusOnUnmount",uk={bubbles:!1,cancelable:!0},U$="FocusScope",K2=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[u,c]=g.useState(null),f=ju(s),h=ju(i),p=g.useRef(null),v=Yt(e,c),y=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let _=function(P){if(y.paused||!u)return;const T=P.target;u.contains(T)?p.current=T:Po(p.current,{select:!0})},b=function(P){if(y.paused||!u)return;const T=P.relatedTarget;T!==null&&(u.contains(T)||Po(p.current,{select:!0}))},E=function(P){if(document.activeElement===document.body)for(const R of P)R.removedNodes.length>0&&Po(u)};document.addEventListener("focusin",_),document.addEventListener("focusout",b);const C=new MutationObserver(E);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",b),C.disconnect()}}},[r,u,y.paused]),g.useEffect(()=>{if(u){dk.add(y);const _=document.activeElement;if(!u.contains(_)){const E=new CustomEvent(Qv,uk);u.addEventListener(Qv,f),u.dispatchEvent(E),E.defaultPrevented||(B$(Z$(z3(u)),{select:!0}),document.activeElement===_&&Po(u))}return()=>{u.removeEventListener(Qv,f),setTimeout(()=>{const E=new CustomEvent(Jv,uk);u.addEventListener(Jv,h),u.dispatchEvent(E),E.defaultPrevented||Po(_??document.body,{select:!0}),u.removeEventListener(Jv,h),dk.remove(y)},0)}}},[u,f,h,y]);const x=g.useCallback(_=>{if(!n&&!r||y.paused)return;const b=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,E=document.activeElement;if(b&&E){const C=_.currentTarget,[P,T]=W$(C);P&&T?!_.shiftKey&&E===T?(_.preventDefault(),n&&Po(P,{select:!0})):_.shiftKey&&E===P&&(_.preventDefault(),n&&Po(T,{select:!0})):E===C&&_.preventDefault()}},[n,r,y.paused]);return S.jsx(Rt.div,{tabIndex:-1,...a,ref:v,onKeyDown:x})});K2.displayName=U$;function B$(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Po(r,{select:e}),document.activeElement!==n)return}function W$(t){const e=z3(t),n=ck(e,t),r=ck(e.reverse(),t);return[n,r]}function z3(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)e.push(n.currentNode);return e}function ck(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):G$(r,{upTo:e})))return r}function G$(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}function K$(t){return t instanceof HTMLInputElement&&"select"in t}function Po(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&K$(t)&&e&&t.select()}}var dk=q$();function q$(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=fk(t,e),t.unshift(e)},remove(e){var n;t=fk(t,e),(n=t[0])==null||n.resume()}}}function fk(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Z$(t){return t.filter(e=>e.tagName!=="A")}var Y$="Portal",qm=g.forwardRef((t,e)=>{var u;const{container:n,...r}=t,[s,i]=g.useState(!1);ai(()=>i(!0),[]);const a=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return a?Gm.createPortal(S.jsx(Rt.div,{...r,ref:e}),a):null});qm.displayName=Y$;function X$(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}var Ji=t=>{const{present:e,children:n}=t,r=Q$(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=J$(r.ref,eH(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null};Ji.displayName="Presence";function Q$(t){const[e,n]=g.useState(),r=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),a=g.useRef(void 0),u=t?"mounted":"unmounted",[c,f]=X$(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{c==="mounted"?(i.current=a.current??qc(r.current),a.current=void 0):i.current="none"},[c]),ai(()=>{const h=r.current,p=s.current;if(p!==t){const y=i.current,x=qc(h);t?(a.current=x,f("MOUNT")):x==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(p&&y!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,f]),ai(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,v=x=>{const b=qc(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&b&&(f("ANIMATION_END"),!s.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},y=x=>{x.target===e&&(i.current=qc(r.current))};return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",v),e.addEventListener("animationend",v),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",v),e.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,a.current=qc(p)}else r.current=null;n(h)},[])}}function hk(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function J$(...t){const e=g.useRef(t);return e.current=t,g.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(a=>{const u=hk(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():hk(r[a],null)}}},[])}function qc(t){return(t==null?void 0:t.animationName)||"none"}function eH(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)}var Bh=0,Ws=null;function U3(){g.useEffect(()=>{Ws||(Ws={start:pk(),end:pk()});const{start:t,end:e}=Ws;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Bh++,()=>{Bh===1&&(Ws==null||Ws.start.remove(),Ws==null||Ws.end.remove(),Ws=null),Bh=Math.max(0,Bh-1)}},[])}function pk(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var 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 B3(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 tH(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 _p="right-scroll-bar-position",xp="width-before-scroll-bar",nH="with-scroll-bars-hidden",rH="--removed-body-scroll-bar-size";function e1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function sH(t,e){var n=g.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 iH=typeof window<"u"?g.useLayoutEffect:g.useEffect,mk=new WeakMap;function oH(t,e){var n=sH(null,function(r){return t.forEach(function(s){return e1(s,r)})});return iH(function(){var r=mk.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(u){i.has(u)||e1(u,null)}),i.forEach(function(u){s.has(u)||e1(u,a)})}mk.set(n,t)},[t]),n}function aH(t){return t}function lH(t,e){e===void 0&&(e=aH);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var a=e(i,r);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(i),a=n}var c=function(){var h=a;a=[],h.forEach(i)},f=function(){return Promise.resolve().then(c)};f(),n={push:function(h){a.push(h),f()},filter:function(h){return a=a.filter(h),n}}}};return s}function uH(t){t===void 0&&(t={});var e=lH(null);return e.options=ei({async:!0,ssr:!1},t),e}var W3=function(t){var e=t.sideCar,n=B3(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 g.createElement(r,ei({},n))};W3.isSideCarExport=!0;function cH(t,e){return t.useMedium(e),W3}var G3=uH(),t1=function(){},Zm=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:t1,onWheelCapture:t1,onTouchMoveCapture:t1}),s=r[0],i=r[1],a=t.forwardProps,u=t.children,c=t.className,f=t.removeScrollBar,h=t.enabled,p=t.shards,v=t.sideCar,y=t.noRelative,x=t.noIsolation,_=t.inert,b=t.allowPinchZoom,E=t.as,C=E===void 0?"div":E,P=t.gapMode,T=B3(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=v,O=oH([n,e]),M=ei(ei({},T),s);return g.createElement(g.Fragment,null,h&&g.createElement(R,{sideCar:G3,removeScrollBar:f,shards:p,noRelative:y,noIsolation:x,inert:_,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:P}),a?g.cloneElement(g.Children.only(u),ei(ei({},M),{ref:O})):g.createElement(C,ei({},M,{className:c,ref:O}),u))});Zm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zm.classNames={fullWidth:xp,zeroRight:_p};var dH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fH(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=dH();return e&&t.setAttribute("nonce",e),t}function hH(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function pH(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var mH=function(){var t=0,e=null;return{add:function(n){t==0&&(e=fH())&&(hH(e,n),pH(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},gH=function(){var t=mH();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},K3=function(){var t=gH(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},vH={left:0,top:0,right:0,gap:0},n1=function(t){return parseInt(t||"",10)||0},yH=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)]},_H=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return vH;var e=yH(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])}},xH=K3(),uu="data-scroll-locked",wH=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,u=t.gap;return n===void 0&&(n="margin"),`
|
|
71
|
+
.`.concat(nH,` {
|
|
72
|
+
overflow: hidden `).concat(r,`;
|
|
73
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
74
|
+
}
|
|
75
|
+
body[`).concat(uu,`] {
|
|
76
|
+
overflow: hidden `).concat(r,`;
|
|
77
|
+
overscroll-behavior: contain;
|
|
78
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
79
|
+
padding-left: `.concat(s,`px;
|
|
80
|
+
padding-top: `).concat(i,`px;
|
|
81
|
+
padding-right: `).concat(a,`px;
|
|
82
|
+
margin-left:0;
|
|
83
|
+
margin-top:0;
|
|
84
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
85
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.`).concat(_p,` {
|
|
89
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.`).concat(xp,` {
|
|
93
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.`).concat(_p," .").concat(_p,` {
|
|
97
|
+
right: 0 `).concat(r,`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.`).concat(xp," .").concat(xp,` {
|
|
101
|
+
margin-right: 0 `).concat(r,`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
body[`).concat(uu,`] {
|
|
105
|
+
`).concat(rH,": ").concat(u,`px;
|
|
106
|
+
}
|
|
107
|
+
`)},gk=function(){var t=parseInt(document.body.getAttribute(uu)||"0",10);return isFinite(t)?t:0},bH=function(){g.useEffect(function(){return document.body.setAttribute(uu,(gk()+1).toString()),function(){var t=gk()-1;t<=0?document.body.removeAttribute(uu):document.body.setAttribute(uu,t.toString())}},[])},SH=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;bH();var i=g.useMemo(function(){return _H(s)},[s]);return g.createElement(xH,{styles:wH(i,!e,s,n?"":"!important")})},o_=!1;if(typeof window<"u")try{var Wh=Object.defineProperty({},"passive",{get:function(){return o_=!0,!0}});window.addEventListener("test",Wh,Wh),window.removeEventListener("test",Wh,Wh)}catch{o_=!1}var Wl=o_?{passive:!1}:!1,EH=function(t){return t.tagName==="TEXTAREA"},q3=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!EH(t)&&n[e]==="visible")},kH=function(t){return q3(t,"overflowY")},CH=function(t){return q3(t,"overflowX")},vk=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Z3(t,r);if(s){var i=Y3(t,r),a=i[1],u=i[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},PH=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},TH=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Z3=function(t,e){return t==="v"?kH(e):CH(e)},Y3=function(t,e){return t==="v"?PH(e):TH(e)},RH=function(t,e){return t==="h"&&e==="rtl"?-1:1},AH=function(t,e,n,r,s){var i=RH(t,window.getComputedStyle(e).direction),a=i*r,u=n.target,c=e.contains(u),f=!1,h=a>0,p=0,v=0;do{if(!u)break;var y=Y3(t,u),x=y[0],_=y[1],b=y[2],E=_-b-i*x;(x||E)&&Z3(t,u)&&(p+=E,v+=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(h&&Math.abs(p)<1||!h&&Math.abs(v)<1)&&(f=!0),f},Gh=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},yk=function(t){return[t.deltaX,t.deltaY]},_k=function(t){return t&&"current"in t?t.current:t},IH=function(t,e){return t[0]===e[0]&&t[1]===e[1]},MH=function(t){return`
|
|
108
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
109
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
110
|
+
`)},NH=0,Gl=[];function OH(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(NH++)[0],i=g.useState(K3)[0],a=g.useRef(t);g.useEffect(function(){a.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=tH([t.lockRef.current],(t.shards||[]).map(_k),!0).filter(Boolean);return _.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var u=g.useCallback(function(_,b){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!a.current.allowPinchZoom;var E=Gh(_),C=n.current,P="deltaX"in _?_.deltaX:C[0]-E[0],T="deltaY"in _?_.deltaY:C[1]-E[1],R,O=_.target,M=Math.abs(P)>Math.abs(T)?"h":"v";if("touches"in _&&M==="h"&&O.type==="range")return!1;var A=window.getSelection(),N=A&&A.anchorNode,D=N?N===O||N.contains(O):!1;if(D)return!1;var j=vk(M,O);if(!j)return!0;if(j?R=M:(R=M==="v"?"h":"v",j=vk(M,O)),!j)return!1;if(!r.current&&"changedTouches"in _&&(P||T)&&(r.current=R),!R)return!0;var V=r.current||R;return AH(V,b,_,V==="h"?P:T)},[]),c=g.useCallback(function(_){var b=_;if(!(!Gl.length||Gl[Gl.length-1]!==i)){var E="deltaY"in b?yk(b):Gh(b),C=e.current.filter(function(R){return R.name===b.type&&(R.target===b.target||b.target===R.shadowParent)&&IH(R.delta,E)})[0];if(C&&C.should){b.cancelable&&b.preventDefault();return}if(!C){var P=(a.current.shards||[]).map(_k).filter(Boolean).filter(function(R){return R.contains(b.target)}),T=P.length>0?u(b,P[0]):!a.current.noIsolation;T&&b.cancelable&&b.preventDefault()}}},[]),f=g.useCallback(function(_,b,E,C){var P={name:_,delta:b,target:E,should:C,shadowParent:DH(E)};e.current.push(P),setTimeout(function(){e.current=e.current.filter(function(T){return T!==P})},1)},[]),h=g.useCallback(function(_){n.current=Gh(_),r.current=void 0},[]),p=g.useCallback(function(_){f(_.type,yk(_),_.target,u(_,t.lockRef.current))},[]),v=g.useCallback(function(_){f(_.type,Gh(_),_.target,u(_,t.lockRef.current))},[]);g.useEffect(function(){return Gl.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Wl),document.addEventListener("touchmove",c,Wl),document.addEventListener("touchstart",h,Wl),function(){Gl=Gl.filter(function(_){return _!==i}),document.removeEventListener("wheel",c,Wl),document.removeEventListener("touchmove",c,Wl),document.removeEventListener("touchstart",h,Wl)}},[]);var y=t.removeScrollBar,x=t.inert;return g.createElement(g.Fragment,null,x?g.createElement(i,{styles:MH(s)}):null,y?g.createElement(SH,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function DH(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const LH=cH(G3,OH);var q2=g.forwardRef(function(t,e){return g.createElement(Zm,ei({},t,{ref:e,sideCar:LH}))});q2.classNames=Zm.classNames;var jH=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Kl=new WeakMap,Kh=new WeakMap,qh={},r1=0,X3=function(t){return t&&(t.host||X3(t.parentNode))},FH=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=X3(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})},VH=function(t,e,n,r){var s=FH(e,Array.isArray(t)?t:[t]);qh[n]||(qh[n]=new WeakMap);var i=qh[n],a=[],u=new Set,c=new Set(s),f=function(p){!p||u.has(p)||(u.add(p),f(p.parentNode))};s.forEach(f);var h=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))h(v);else try{var y=v.getAttribute(r),x=y!==null&&y!=="false",_=(Kl.get(v)||0)+1,b=(i.get(v)||0)+1;Kl.set(v,_),i.set(v,b),a.push(v),_===1&&x&&Kh.set(v,!0),b===1&&v.setAttribute(n,"true"),x||v.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return h(e),u.clear(),r1++,function(){a.forEach(function(p){var v=Kl.get(p)-1,y=i.get(p)-1;Kl.set(p,v),i.set(p,y),v||(Kh.has(p)||p.removeAttribute(r),Kh.delete(p)),y||p.removeAttribute(n)}),r1--,r1||(Kl=new WeakMap,Kl=new WeakMap,Kh=new WeakMap,qh={})}},Q3=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=jH(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),VH(r,s,n,"aria-hidden")):function(){return null}},Ym="Dialog",[J3]=na(Ym),[$H,Rs]=J3(Ym),Xm=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,u=g.useRef(null),c=g.useRef(null),[f,h]=hl({prop:r,defaultProp:s??!1,onChange:i,caller:Ym});return S.jsx($H,{scope:e,triggerRef:u,contentRef:c,contentId:il(),titleId:il(),descriptionId:il(),open:f,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(p=>!p),[h]),modal:a,children:n})};Xm.displayName=Ym;var eT="DialogTrigger",HH=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Rs(eT,n),i=Yt(e,s.triggerRef);return S.jsx(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Y2(s.open),...r,ref:i,onClick:Et(t.onClick,s.onOpenToggle)})});HH.displayName=eT;var Z2="DialogPortal",[zH,tT]=J3(Z2,{forceMount:void 0}),Qm=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Rs(Z2,e);return S.jsx(zH,{scope:e,forceMount:n,children:g.Children.map(r,a=>S.jsx(Ji,{present:n||i.open,children:S.jsx(qm,{asChild:!0,container:s,children:a})}))})};Qm.displayName=Z2;var vm="DialogOverlay",Jm=g.forwardRef((t,e)=>{const n=tT(vm,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Rs(vm,t.__scopeDialog);return i.modal?S.jsx(Ji,{present:r||i.open,children:S.jsx(BH,{...s,ref:e})}):null});Jm.displayName=vm;var UH=jd("DialogOverlay.RemoveScroll"),BH=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Rs(vm,n),i=V$(),a=Yt(e,i);return S.jsx(q2,{as:UH,allowPinchZoom:!0,shards:[s.contentRef],children:S.jsx(Rt.div,{"data-state":Y2(s.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})}),Fu="DialogContent",e0=g.forwardRef((t,e)=>{const n=tT(Fu,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Rs(Fu,t.__scopeDialog);return S.jsx(Ji,{present:r||i.open,children:i.modal?S.jsx(WH,{...s,ref:e}):S.jsx(GH,{...s,ref:e})})});e0.displayName=Fu;var WH=g.forwardRef((t,e)=>{const n=Rs(Fu,t.__scopeDialog),r=g.useRef(null),s=Yt(e,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return Q3(i)},[]),S.jsx(nT,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Et(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Et(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&i.preventDefault()}),onFocusOutside:Et(t.onFocusOutside,i=>i.preventDefault())})}),GH=g.forwardRef((t,e)=>{const n=Rs(Fu,t.__scopeDialog),r=g.useRef(!1),s=g.useRef(!1);return S.jsx(nT,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,u;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,f;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),nT=g.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,u=Rs(Fu,n);return U3(),S.jsx(S.Fragment,{children:S.jsx(K2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:S.jsx(Km,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Y2(u.open),...a,ref:e,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})}),rT="DialogTitle",t0=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Rs(rT,n);return S.jsx(Rt.h2,{id:s.titleId,...r,ref:e})});t0.displayName=rT;var sT="DialogDescription",n0=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Rs(sT,n);return S.jsx(Rt.p,{id:s.descriptionId,...r,ref:e})});n0.displayName=sT;var iT="DialogClose",KH=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Rs(iT,n);return S.jsx(Rt.button,{type:"button",...r,ref:e,onClick:Et(t.onClick,()=>s.onOpenChange(!1))})});KH.displayName=iT;function Y2(t){return t?"open":"closed"}const qH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),ZH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),YH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),XH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),QH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),JH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),ez=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),tz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),nz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),rz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),sz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),iz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),oz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),az=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),lz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),uz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),cz=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),$n=g.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:u,weights:c,...f}=t,{color:h="currentColor",size:p,weight:v="regular",mirrored:y=!1,...x}=g.useContext(cz);return g.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??h,viewBox:"0 0 256 256",transform:a||y?"scale(-1, 1)":void 0,...x,...f},!!n&&g.createElement("title",null,n),u,c.get(i??v))});$n.displayName="IconBase";const oT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:qH}));oT.displayName="ArrowLeftIcon";const dz=oT,aT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:ZH}));aT.displayName="ArrowSquareOutIcon";const fz=aT,lT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:YH}));lT.displayName="ArrowUpIcon";const hz=lT,uT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:XH}));uT.displayName="CaretDownIcon";const pz=uT,cT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:QH}));cT.displayName="ChatCircleIcon";const mz=cT,dT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:JH}));dT.displayName="CheckIcon";const fT=dT,hT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:ez}));hT.displayName="CircleNotchIcon";const r0=hT,pT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:tz}));pT.displayName="CopyIcon";const Fd=pT,mT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:nz}));mT.displayName="MagnifyingGlassIcon";const gz=mT,gT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:rz}));gT.displayName="PencilSimpleIcon";const vz=gT,vT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:sz}));vT.displayName="SidebarSimpleIcon";const yz=vT,yT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:iz}));yT.displayName="SignOutIcon";const _z=yT,_T=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:oz}));_T.displayName="SparkleIcon";const s1=_T,xT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:az}));xT.displayName="SwatchesIcon";const wT=xT,bT=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:lz}));bT.displayName="TrashIcon";const xz=bT,ST=g.forwardRef((t,e)=>g.createElement($n,{ref:e,...t,weights:uz}));ST.displayName="XIcon";const ET=ST;function kT(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=kT(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function wz(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=kT(t))&&(r&&(r+=" "),r+=e);return r}const bz=(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},Sz=(t,e)=>({classGroupId:t,validator:e}),CT=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),ym="-",xk=[],Ez="arbitrary..",kz=t=>{const e=Pz(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Cz(a);const u=a.split(ym),c=u[0]===""&&u.length>1?1:0;return PT(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],f=n[a];return c?f?bz(f,c):c:f||xk}return n[a]||xk}}},PT=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const f=PT(t,e+1,i);if(f)return f}const a=n.validators;if(a===null)return;const u=e===0?t.join(ym):t.slice(e).join(ym),c=a.length;for(let f=0;f<c;f++){const h=a[f];if(h.validator(u))return h.classGroupId}},Cz=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?Ez+r:void 0})(),Pz=t=>{const{theme:e,classGroups:n}=t;return Tz(n,e)},Tz=(t,e)=>{const n=CT();for(const r in t){const s=t[r];X2(s,n,r,e)}return n},X2=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];Rz(a,e,n,r)}},Rz=(t,e,n,r)=>{if(typeof t=="string"){Az(t,e,n);return}if(typeof t=="function"){Iz(t,e,n,r);return}Mz(t,e,n,r)},Az=(t,e,n)=>{const r=t===""?e:TT(e,t);r.classGroupId=n},Iz=(t,e,n,r)=>{if(Nz(t)){X2(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Sz(n,t))},Mz=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[u,c]=s[a];X2(c,TT(e,u),n,r)}},TT=(t,e)=>{let n=t;const r=e.split(ym),s=r.length;for(let i=0;i<s;i++){const a=r[i];let u=n.nextPart.get(a);u||(u=CT(),n.nextPart.set(a,u)),n=u}return n},Nz=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Oz=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},a_="!",wk=":",Dz=[],bk=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Lz=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,u=0,c=0,f;const h=s.length;for(let _=0;_<h;_++){const b=s[_];if(a===0&&u===0){if(b===wk){i.push(s.slice(c,_)),c=_+1;continue}if(b==="/"){f=_;continue}}b==="["?a++:b==="]"?a--:b==="("?u++:b===")"&&u--}const p=i.length===0?s:s.slice(c);let v=p,y=!1;p.endsWith(a_)?(v=p.slice(0,-1),y=!0):p.startsWith(a_)&&(v=p.slice(1),y=!0);const x=f&&f>c?f-c:void 0;return bk(i,y,v,x)};if(e){const s=e+wk,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):bk(Dz,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},jz=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}},Fz=t=>({cache:Oz(t.cacheSize),parseClassName:Lz(t),sortModifiers:jz(t),postfixLookupClassGroupIds:Vz(t),...kz(t)}),Vz=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},$z=/\s+/,Hz=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,u=[],c=t.trim().split($z);let f="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:v,modifiers:y,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:b}=n(p);if(v){f=p+(f.length>0?" "+f:f);continue}let E=!!b,C;if(E){const M=_.substring(0,b);C=r(M);const A=C&&a[C]?r(_):void 0;A&&A!==C&&(C=A,E=!1)}else C=r(_);if(!C){if(!E){f=p+(f.length>0?" "+f:f);continue}if(C=r(_),!C){f=p+(f.length>0?" "+f:f);continue}E=!1}const P=y.length===0?"":y.length===1?y[0]:i(y).join(":"),T=x?P+a_:P,R=T+C;if(u.indexOf(R)>-1)continue;u.push(R);const O=s(C,E);for(let M=0;M<O.length;++M){const A=O[M];u.push(T+A)}f=p+(f.length>0?" "+f:f)}return f},zz=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=RT(n))&&(s&&(s+=" "),s+=r);return s},RT=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=RT(t[r]))&&(n&&(n+=" "),n+=e);return n},Uz=(t,...e)=>{let n,r,s,i;const a=c=>{const f=e.reduce((h,p)=>p(h),t());return n=Fz(f),r=n.cache.get,s=n.cache.set,i=u,u(c)},u=c=>{const f=r(c);if(f)return f;const h=Hz(c,n);return s(c,h),h};return i=a,(...c)=>i(zz(...c))},Bz=[],vn=t=>{const e=n=>n[t]||Bz;return e.isThemeGetter=!0,e},AT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,IT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Wz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Gz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kz=/\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$/,qz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Zz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Yz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Eo=t=>Wz.test(t),nt=t=>!!t&&!Number.isNaN(Number(t)),Gs=t=>!!t&&Number.isInteger(Number(t)),i1=t=>t.endsWith("%")&&nt(t.slice(0,-1)),Ti=t=>Gz.test(t),MT=()=>!0,Xz=t=>Kz.test(t)&&!qz.test(t),Q2=()=>!1,Qz=t=>Zz.test(t),Jz=t=>Yz.test(t),eU=t=>!Me(t)&&!Oe(t),tU=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)),nU=t=>ra(t,DT,Q2),Me=t=>AT.test(t),Ta=t=>ra(t,LT,Xz),Sk=t=>ra(t,cU,nt),rU=t=>ra(t,FT,MT),sU=t=>ra(t,jT,Q2),Ek=t=>ra(t,NT,Q2),iU=t=>ra(t,OT,Jz),Zh=t=>ra(t,VT,Qz),Oe=t=>IT.test(t),Zc=t=>pl(t,LT),oU=t=>pl(t,jT),kk=t=>pl(t,NT),aU=t=>pl(t,DT),lU=t=>pl(t,OT),Yh=t=>pl(t,VT,!0),uU=t=>pl(t,FT,!0),ra=(t,e,n)=>{const r=AT.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},pl=(t,e,n=!1)=>{const r=IT.exec(t);return r?r[1]?e(r[1]):n:!1},NT=t=>t==="position"||t==="percentage",OT=t=>t==="image"||t==="url",DT=t=>t==="length"||t==="size"||t==="bg-size",LT=t=>t==="length",cU=t=>t==="number",jT=t=>t==="family-name",FT=t=>t==="number"||t==="weight",VT=t=>t==="shadow",dU=()=>{const t=vn("color"),e=vn("font"),n=vn("text"),r=vn("font-weight"),s=vn("tracking"),i=vn("leading"),a=vn("breakpoint"),u=vn("container"),c=vn("spacing"),f=vn("radius"),h=vn("shadow"),p=vn("inset-shadow"),v=vn("text-shadow"),y=vn("drop-shadow"),x=vn("blur"),_=vn("perspective"),b=vn("aspect"),E=vn("ease"),C=vn("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"],R=()=>[...T(),Oe,Me],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],A=()=>[Oe,Me,c],N=()=>[Eo,"full","auto",...A()],D=()=>[Gs,"none","subgrid",Oe,Me],j=()=>["auto",{span:["full",Gs,Oe,Me]},Gs,Oe,Me],V=()=>[Gs,"auto",Oe,Me],W=()=>["auto","min","max","fr",Oe,Me],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...A()],X=()=>[Eo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[Eo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],te=()=>[Eo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],H=()=>[t,Oe,Me],L=()=>[...T(),kk,Ek,{position:[Oe,Me]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",aU,nU,{size:[Oe,Me]}],ie=()=>[i1,Zc,Ta],ae=()=>["","none","full",f,Oe,Me],ue=()=>["",nt,Zc,Ta],ke=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[nt,i1,kk,Ek],pe=()=>["","none",x,Oe,Me],we=()=>["none",nt,Oe,Me],Ie=()=>["none",nt,Oe,Me],qe=()=>[nt,Oe,Me],it=()=>[Eo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ti],breakpoint:[Ti],color:[MT],container:[Ti],"drop-shadow":[Ti],ease:["in","out","in-out"],font:[eU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ti],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ti],shadow:[Ti],spacing:["px",nt],text:[Ti],"text-shadow":[Ti],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Eo,Me,Oe,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Oe,Me]}],"container-named":[tU],columns:[{columns:[nt,Me,Oe,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:R()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[Gs,"auto",Oe,Me]}],basis:[{basis:[Eo,"full","auto",u,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,Eo,"auto","initial","none",Me]}],grow:[{grow:["",nt,Oe,Me]}],shrink:[{shrink:["",nt,Oe,Me]}],order:[{order:[Gs,"first","last","none",Oe,Me]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[u,"screen",...X()]}],"min-w":[{"min-w":[u,"screen","none",...X()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,Zc,Ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,uU,rU]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",i1,Me]}],"font-family":[{font:[oU,sU,e]}],"font-features":[{"font-features":[Me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Oe,Me]}],"line-clamp":[{"line-clamp":[nt,"none",Oe,Sk]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",Oe,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",Oe,Ta]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[nt,"auto",Oe,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[Gs,Oe,Me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe,Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Oe,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Gs,Oe,Me],radial:["",Oe,Me],conic:[Gs,Oe,Me]},lU,iU]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ke(),"hidden","none"]}],"divide-style":[{divide:[...ke(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...ke(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,Oe,Me]}],"outline-w":[{outline:["",nt,Zc,Ta]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",h,Yh,Zh]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,Yh,Zh]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[nt,Ta]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",v,Yh,Zh]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[nt,Oe,Me]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Oe,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,Me]}],filter:[{filter:["","none",Oe,Me]}],blur:[{blur:pe()}],brightness:[{brightness:[nt,Oe,Me]}],contrast:[{contrast:[nt,Oe,Me]}],"drop-shadow":[{"drop-shadow":["","none",y,Yh,Zh]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",nt,Oe,Me]}],"hue-rotate":[{"hue-rotate":[nt,Oe,Me]}],invert:[{invert:["",nt,Oe,Me]}],saturate:[{saturate:[nt,Oe,Me]}],sepia:[{sepia:["",nt,Oe,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,Me]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[nt,Oe,Me]}],"backdrop-contrast":[{"backdrop-contrast":[nt,Oe,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,Oe,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,Oe,Me]}],"backdrop-invert":[{"backdrop-invert":["",nt,Oe,Me]}],"backdrop-opacity":[{"backdrop-opacity":[nt,Oe,Me]}],"backdrop-saturate":[{"backdrop-saturate":[nt,Oe,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,Oe,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Oe,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",Oe,Me]}],ease:[{ease:["linear","initial",E,Oe,Me]}],delay:[{delay:[nt,Oe,Me]}],animate:[{animate:["none",C,Oe,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Oe,Me]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:Ie()}],"scale-x":[{"scale-x":Ie()}],"scale-y":[{"scale-y":Ie()}],"scale-z":[{"scale-z":Ie()}],"scale-3d":["scale-3d"],skew:[{skew:qe()}],"skew-x":[{"skew-x":qe()}],"skew-y":[{"skew-y":qe()}],transform:[{transform:[Oe,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],zoom:[{zoom:[Gs,Oe,Me]}],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Oe,Me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":H()}],"scrollbar-track-color":[{"scrollbar-track":H()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Oe,Me]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[nt,Zc,Ta,Sk]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},fU=Uz(dU);function ar(...t){return fU(wz(t))}const Vd={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},Ck=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function $T(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=Ck[Math.abs(e)%Ck.length];return{color:n,backgroundColor:`${n}22`}}function HT(t,e={}){const{axis:n="y"}=e,r=g.useRef(new Map),[s,i]=g.useState(null),[a,u]=g.useState([]),c=g.useRef([]),f=g.useRef(0),h=g.useRef(null),p=g.useRef(null),v=g.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]),y=g.useCallback((E,C)=>{C?r.current.set(E,C):r.current.delete(E),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,v()})},[v]),x=g.useCallback(E=>{const C=E.clientX,P=E.clientY;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const T=t.current;if(!T)return;const R=T.getBoundingClientRect(),O=n==="x"?C:P;let M=null,A=1/0,N=null;const D=c.current,j=n==="x"?T.scrollLeft:T.scrollTop,V=n==="x"?T.clientLeft:T.clientTop,W=n==="x"?R.left:R.top,Y=n==="x"?T.offsetWidth:T.offsetHeight,K=n==="x"?R.width:R.height,B=Y>0?K/Y:1;for(let X=0;X<D.length;X++){const $=D[X];if(!$)continue;const te=n==="x"?$.left:$.top,H=W+(V+te-j)*B,L=(n==="x"?$.width:$.height)*B,Z=H+L;O>=H&&O<=Z&&(N=X);const ne=H+L/2,ie=Math.abs(O-ne);ie<A&&(A=ie,M=X)}i(N??M)})},[n,t]),_=g.useCallback(()=>{f.current+=1,v()},[v]),b=g.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i(null)},[]);return g.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),p.current!==null&&cancelAnimationFrame(p.current)},[]),{activeIndex:s,setActiveIndex:i,itemRects:a,sessionRef:f,handlers:{onMouseMove:x,onMouseEnter:_,onMouseLeave:b},registerItem:y,measureItems:v}}function hU(t,e,n){g.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const zT=(t,e)=>`style:${t}:${e}`,UT=t=>`text:${t}`,BT=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"]},WT=t=>BT(t)[0],Xh=(t,e)=>BT(t).includes(e),pU=t=>{const e=WT(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${zT(e,t.property)}${n}`:`${UT(e)}${n}`},Nn=[];for(let t=0;t<256;++t)Nn.push((t+256).toString(16).slice(1));function mU(t,e=0){return(Nn[t[e+0]]+Nn[t[e+1]]+Nn[t[e+2]]+Nn[t[e+3]]+"-"+Nn[t[e+4]]+Nn[t[e+5]]+"-"+Nn[t[e+6]]+Nn[t[e+7]]+"-"+Nn[t[e+8]]+Nn[t[e+9]]+"-"+Nn[t[e+10]]+Nn[t[e+11]]+Nn[t[e+12]]+Nn[t[e+13]]+Nn[t[e+14]]+Nn[t[e+15]]).toLowerCase()}const gU=new Uint8Array(16);function vU(){return crypto.getRandomValues(gU)}function Pk(t,e,n){return crypto.randomUUID?crypto.randomUUID():yU(t)}function yU(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??vU();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,mU(r)}const _U=300;class xU{constructor(){So(this,"history",{current:new Map,past:[],future:[]});So(this,"pendingChanges",new Map);So(this,"currentBatchId",null);So(this,"debounceTimer",null);So(this,"onChangeCallbacks",[]);So(this,"stateBeforePending",null);So(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=Pk(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=WT(e.elementId),r=e.type==="style"?zT(n,e.property):UT(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=pU(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},_U),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"&&Xh(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"&&Xh(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>Xh(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>Xh(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=Pk(),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 _m={kind:"base"};function $d(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function wU(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const bU={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}},GT=Object.fromEntries(Object.entries(bU).map(([t,e])=>[t,{isEnabled:e.default}]));tt("view");const KT=tt(!0),qT=tt(null),SU=tt("chat"),ZT=tt(0),YT=tt({name:null,email:null}),Tk=tt(_m);tt(null);const Hd=new Map,EU=t=>{const e=$d(t);let n=Hd.get(e);return n||(n=new xU,Hd.set(e,n)),n};tt(t=>EU(t(Tk)),(t,e,n)=>{Hd.set($d(t(Tk)),n)});const kU=t=>{for(const e of[...Hd.keys()])e==="base"||t.has(e)||Hd.delete(e)},zd=tt(new Map),Rk=tt(null);tt(null);const l_=tt(0),xm=tt(null),u_=tt(!1),c_=tt(null),XT=tt(!1),QT=tt(!1),d_=tt(null),f_=tt(null),Ud=tt(null),J2=tt(null),Zo=tt(null),hf=tt({active:!1}),JT=tt([]),Ak=tt(null),CU=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&wU(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},PU=tt(null,(t,e,n)=>{const r=c=>{const f=c??_m;return f.kind==="variant"&&!n.has($d(f))},s=t(zd);let i=null;for(const[c,f]of s)r(f.target)&&(i??(i=new Set)).add(c);if(i){const c=new Map(s);for(const f of i)c.delete(f);e(zd,c)}const a=t(Rk);a&&r(a.target)&&(e(Rk,null),e(IU,!1));const u=t(Ak);u&&(i!=null&&i.has(u.commentId))&&e(Ak,null),kU(n)}),h_=tt(GT),TU=tt(!1),e5=tt(null),pf=tt(!0),t5=tt(!1),n5=tt(!1),r5=tt(!1),s5=tt(null),RU=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},s0=tt(RU()),AU=tt(null),IU=tt(!1);tt(0);tt(0);var wp={exports:{}},MU=wp.exports,Ik;function NU(){return Ik||(Ik=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(MU,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(_,b){var E=_[b];if(typeof E.bind=="function")return E.bind(_);try{return Function.prototype.bind.call(E,_)}catch{return function(){return Function.prototype.apply.apply(E,[_,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function f(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?c:console[_]!==void 0?u(console,_):console.log!==void 0?u(console,"log"):e}function h(){for(var _=this.getLevel(),b=0;b<s.length;b++){var E=s[b];this[E]=b<_?e:this.methodFactory(E,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function p(_){return function(){typeof console!==n&&(h.call(this),this[_].apply(this,arguments))}}function v(_,b,E){return f(_)||p.apply(this,arguments)}function y(_,b){var E=this,C,P,T,R="loglevel";typeof _=="string"?R+=":"+_:typeof _=="symbol"&&(R=void 0);function O(j){var V=(s[j]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=V;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+V+";"}catch{}}}function M(){var j;if(!(typeof window===n||!R)){try{j=window.localStorage[R]}catch{}if(typeof j===n)try{var V=window.document.cookie,W=encodeURIComponent(R),Y=V.indexOf(W+"=");Y!==-1&&(j=/^([^;]+)/.exec(V.slice(Y+W.length+1))[1])}catch{}return E.levels[j]===void 0&&(j=void 0),j}}function A(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function N(j){var V=j;if(typeof V=="string"&&E.levels[V.toUpperCase()]!==void 0&&(V=E.levels[V.toUpperCase()]),typeof V=="number"&&V>=0&&V<=E.levels.SILENT)return V;throw new TypeError("log.setLevel() called with invalid level: "+j)}E.name=_,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=b||v,E.getLevel=function(){return T??P??C},E.setLevel=function(j,V){return T=N(j),V!==!1&&O(T),h.call(E)},E.setDefaultLevel=function(j){P=N(j),M()||E.setLevel(j,!1)},E.resetLevel=function(){T=null,A(),h.call(E)},E.enableAll=function(j){E.setLevel(E.levels.TRACE,j)},E.disableAll=function(j){E.setLevel(E.levels.SILENT,j)},E.rebuild=function(){if(a!==E&&(C=N(a.getLevel())),h.call(E),a===E)for(var j in i)i[j].rebuild()},C=N(a?a.getLevel():"WARN");var D=M();D!=null&&(T=N(D)),h.call(E)}a=new y,a.getLogger=function(b){if(typeof b!="symbol"&&typeof b!="string"||b==="")throw new TypeError("You must supply a name when creating a logger.");var E=i[b];return E||(E=i[b]=new y(b,a.methodFactory)),E};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})})(wp)),wp.exports}var OU=NU();const ks=jm(OU),DU="INFO",LU=DU.toUpperCase();ks.setLevel(ks.levels[LU]||ks.levels.INFO);const ds=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>ks.trace(`${e}${n}`,...r),debug:(n,...r)=>ks.debug(`${e}${n}`,...r),info:(n,...r)=>ks.info(`${e}${n}`,...r),warn:(n,...r)=>ks.warn(`${e}${n}`,...r),error:(n,...r)=>{ks.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}:{}};Pe.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>ks.info(`${e}API: ${n}`,...r),hook:(n,...r)=>ks.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>ks.debug(`${e}Mount: ${n}`,...r)}};let bp=0;const jU=()=>{bp+=1;let t=!1;return()=>{t||(t=!0,bp=Math.max(0,bp-1))}},FU=()=>bp>0;function VU(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const $U=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],ex=({className:t,"data-testid":e}={})=>S.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:S.jsx("div",{className:"rivet-sparkle-strip",children:$U.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),HU=["top","right","bottom","left"],Yo=Math.min,qi=Math.max,wm=Math.round,Qh=Math.floor,Zi=t=>({x:t,y:t}),zU={left:"right",right:"left",bottom:"top",top:"bottom"};function i5(t,e,n){return qi(t,Yo(e,n))}function Yi(t,e){return typeof t=="function"?t(e):t}function Xo(t){return t.split("-")[0]}function Zu(t){return t.split("-")[1]}function tx(t){return t==="x"?"y":"x"}function nx(t){return t==="y"?"height":"width"}function ri(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function rx(t){return tx(ri(t))}function UU(t,e,n){n===void 0&&(n=!1);const r=Zu(t),s=rx(t),i=nx(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=bm(a)),[a,bm(a)]}function BU(t){const e=bm(t);return[p_(t),e,p_(e)]}function p_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Mk=["left","right"],Nk=["right","left"],WU=["top","bottom"],GU=["bottom","top"];function KU(t,e,n){switch(t){case"top":case"bottom":return n?e?Nk:Mk:e?Mk:Nk;case"left":case"right":return e?WU:GU;default:return[]}}function qU(t,e,n,r){const s=Zu(t);let i=KU(Xo(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(p_)))),i}function bm(t){const e=Xo(t);return zU[e]+t.slice(e.length)}function ZU(t){var e,n,r,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(s=t.left)!=null?s:0}}function o5(t){return typeof t!="number"?ZU(t):{top:t,right:t,bottom:t,left:t}}function Sm(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 Ok(t,e,n){let{reference:r,floating:s}=t;const i=ri(e),a=rx(e),u=nx(a),c=Xo(e),f=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,v=r[u]/2-s[u]/2;let y;switch(c){case"top":y={x:h,y:r.y-s.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-s.width,y:p};break;default:y={x:r.x,y:r.y}}const x=Zu(e);return x&&(y[a]+=v*(x==="end"?1:-1)*(n&&f?-1:1)),y}async function YU(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:u,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:v=!1,padding:y=0}=Yi(e,t),x=o5(y),b=u[v?p==="floating"?"reference":"floating":p],E=Sm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:f,rootBoundary:h,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},R=Sm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:C,offsetParent:P,strategy:c}):C);return{top:(E.top-R.top+x.top)/T.y,bottom:(R.bottom-E.bottom+x.bottom)/T.y,left:(E.left-R.left+x.left)/T.x,right:(R.right-E.right+x.right)/T.x}}const XU=50,QU=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:YU},c=await(a.isRTL==null?void 0:a.isRTL(e));let f=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=Ok(f,r,c),v=r,y=0;const x={};for(let _=0;_<i.length;_++){const b=i[_];if(!b)continue;const{name:E,fn:C}=b,{x:P,y:T,data:R,reset:O}=await C({x:h,y:p,initialPlacement:r,placement:v,strategy:s,middlewareData:x,rects:f,platform:u,elements:{reference:t,floating:e}});h=P??h,p=T??p,x[E]={...x[E],...R},O&&y<XU&&(y++,typeof O=="object"&&(O.placement&&(v=O.placement),O.rects&&(f=O.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):O.rects),{x:h,y:p}=Ok(f,v,c)),_=-1)}return{x:h,y:p,placement:v,strategy:s,middlewareData:x}},JU=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:f,padding:h=0}=Yi(t,e)||{};if(f==null)return{};const p=o5(h),v={x:n,y:r},y=rx(s),x=nx(y),_=await a.getDimensions(f),b=y==="y",E=b?"top":"left",C=b?"bottom":"right",P=b?"clientHeight":"clientWidth",T=i.reference[x]+i.reference[y]-v[y]-i.floating[x],R=v[y]-i.reference[y],O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let M=O?O[P]:0;(!M||!await(a.isElement==null?void 0:a.isElement(O)))&&(M=u.floating[P]||i.floating[x]);const A=T/2-R/2,N=M/2-_[x]/2-1,D=Yo(p[E],N),j=Yo(p[C],N),V=M-_[x]-j,W=M/2-_[x]/2+A,Y=i5(D,W,V),K=!c.arrow&&Zu(s)!=null&&W!==Y&&i.reference[x]/2-(W<D?D:j)-_[x]/2<0,B=K?W<D?W-D:W-V:0;return{[y]:v[y]+B,data:{[y]:Y,centerOffset:W-Y-B,...K&&{alignmentOffset:B}},reset:K}}}),eB=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:f}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:_=!0,...b}=Yi(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const E=Xo(s),C=ri(u),P=Xo(u)===u,T=await(c.isRTL==null?void 0:c.isRTL(f.floating)),R=v||(P||!_?[bm(u)]:BU(u)),O=x!=="none";!v&&O&&R.push(...qU(u,_,x,T));const M=[u,...R],A=await c.detectOverflow(e,b),N=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&N.push(A[E]),p){const Y=UU(s,a,T);N.push(A[Y[0]],A[Y[1]])}if(D=[...D,{placement:s,overflows:N}],!N.every(Y=>Y<=0)){var j,V;const Y=(((j=i.flip)==null?void 0:j.index)||0)+1,K=M[Y];if(K&&(!(p==="alignment"?C!==ri(K):!1)||D.every($=>ri($.placement)===C?$.overflows[0]>0:!0)))return{data:{index:Y,overflows:D},reset:{placement:K}};let B=(V=D.filter(X=>X.overflows[0]<=0).sort((X,$)=>X.overflows[1]-$.overflows[1])[0])==null?void 0:V.placement;if(!B)switch(y){case"bestFit":{var W;const X=(W=D.filter($=>{if(O){const te=ri($.placement);return te===C||te==="y"}return!0}).map($=>[$.placement,$.overflows.filter(te=>te>0).reduce((te,H)=>te+H,0)]).sort(($,te)=>$[1]-te[1])[0])==null?void 0:W[0];X&&(B=X);break}case"initialPlacement":B=u;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function Dk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Lk(t){return HU.some(e=>t[e]>=0)}const tB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=Yi(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),u=Dk(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Lk(u)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),u=Dk(a,n.floating);return{data:{escapedOffsets:u,escaped:Lk(u)}}}default:return{}}}}},a5=new Set(["left","top"]);async function nB(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Xo(n),u=Zu(n),c=ri(n)==="y",f=a5.has(a)?-1:1,h=i&&c?-1:1,p=Yi(e,t);let{mainAxis:v,crossAxis:y,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"&&(y=u==="end"?x*-1:x),c?{x:y*h,y:v*f}:{x:v*f,y:y*h}}const rB=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 nB(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}}}}},sB=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}}},...f}=Yi(t,e),h={x:n,y:r},p=await i.detectOverflow(e,f),v=ri(s),y=tx(v);let x=h[y],_=h[v];const b=(C,P)=>i5(P+p[C==="y"?"top":"left"],P,P-p[C==="y"?"bottom":"right"]);a&&(x=b(y,x)),u&&(_=b(v,_));const E=c.fn({...e,[y]:x,[v]:_});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[y]:a,[v]:u}}}}}},iB=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:f=0,mainAxis:h=!0,crossAxis:p=!0}=Yi(t,e),v={x:s,y:i},y=ri(a),x=tx(y);let _=v[x],b=v[y];const E=Yi(f,e),C=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(n=E.mainAxis)!=null?n:0,crossAxis:(r=E.crossAxis)!=null?r:0};if(h){const R=x==="y"?"height":"width",O=u.reference[x]-u.floating[R]+C.mainAxis,M=u.reference[x]+u.reference[R]-C.mainAxis;_<O?_=O:_>M&&(_=M)}if(p){var P,T;const R=x==="y"?"width":"height",O=a5.has(Xo(a)),M=u.reference[y]-u.floating[R]+(O&&((P=c.offset)==null?void 0:P[y])||0)+(O?0:C.crossAxis),A=u.reference[y]+u.reference[R]+(O?0:((T=c.offset)==null?void 0:T[y])||0)-(O?C.crossAxis:0);b<M?b=M:b>A&&(b=A)}return{[x]:_,[y]:b}}}},oB=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}=Yi(t,e),c=await s.detectOverflow(e,u),f=Xo(n),h=Zu(n),p=ri(n)==="y",{width:v,height:y}=r.floating;let x,_;f==="top"||f==="bottom"?(x=f,_=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=f,x=h==="end"?"top":"bottom");const b=y-c.top-c.bottom,E=v-c.left-c.right,C=Yo(y-c[x],b),P=Yo(v-c[_],E),T=e.middlewareData.shift,R=!T;let O=C,M=P;T!=null&&T.enabled.x&&(M=E),T!=null&&T.enabled.y&&(O=b),R&&!h&&(p?M=v-2*qi(c.left,c.right):O=y-2*qi(c.top,c.bottom)),await a({...e,availableWidth:M,availableHeight:O});const A=await s.getDimensions(i.floating);return v!==A.width||y!==A.height?{reset:{rects:!0}}:{}}}};function i0(){return typeof window<"u"}function Yu(t){return l5(t)?(t.nodeName||"").toLowerCase():"#document"}function Er(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function eo(t){var e;return(e=(l5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function l5(t){return i0()?t instanceof Node||t instanceof Er(t).Node:!1}function ui(t){return i0()?t instanceof Element||t instanceof Er(t).Element:!1}function sa(t){return i0()?t instanceof HTMLElement||t instanceof Er(t).HTMLElement:!1}function jk(t){return!i0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Er(t).ShadowRoot}function o0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=ci(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function aB(t){return/^(table|td|th)$/.test(Yu(t))}function a0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const lB=/transform|translate|scale|rotate|perspective|filter/,uB=/paint|layout|strict|content/,Ra=t=>!!t&&t!=="none";let o1;function sx(t){const e=ui(t)?ci(t):t;return Ra(e.transform)||Ra(e.translate)||Ra(e.scale)||Ra(e.rotate)||Ra(e.perspective)||!ix()&&(Ra(e.backdropFilter)||Ra(e.filter))||lB.test(e.willChange||"")||uB.test(e.contain||"")}function cB(t){let e=dl(t);for(;sa(e)&&!Bd(e);){if(sx(e))return e;if(a0(e))return null;e=dl(e)}return null}function ix(){return o1==null&&(o1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),o1}function Bd(t){return/^(html|body|#document)$/.test(Yu(t))}function ci(t){return Er(t).getComputedStyle(t)}function l0(t){return ui(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function dl(t){if(Yu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||jk(t)&&t.host||eo(t);return jk(e)?e.host:e}function u5(t){const e=dl(t);return Bd(e)?(t.ownerDocument||t).body:sa(e)&&o0(e)?e:u5(e)}function Wd(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=u5(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Er(s);if(i){const u=m_(a);return e.concat(a,a.visualViewport||[],o0(s)?s:[],u&&n?Wd(u):[])}else return e.concat(s,Wd(s,[],n))}function m_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function c5(t){const e=ci(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=sa(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,u=wm(n)!==i||wm(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function ox(t){return ui(t)?t:t.contextElement}function cu(t){const e=ox(t);if(!sa(e))return Zi(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=c5(e);let a=(i?wm(n.width):n.width)/r,u=(i?wm(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const dB=Zi(0);function d5(t){const e=Er(t);return!ix()||!e.visualViewport?dB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function fB(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Er(t)}function fl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=ox(t);let a=Zi(1);e&&(r?ui(r)&&(a=cu(r)):a=cu(t));const u=fB(i,n,r)?d5(i):Zi(0);let c=(s.left+u.x)/a.x,f=(s.top+u.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(i&&r){const v=Er(i),y=ui(r)?Er(r):r;let x=v,_=m_(x);for(;_&&y!==x;){const b=cu(_),E=_.getBoundingClientRect(),C=ci(_),P=E.left+(_.clientLeft+parseFloat(C.paddingLeft))*b.x,T=E.top+(_.clientTop+parseFloat(C.paddingTop))*b.y;c*=b.x,f*=b.y,h*=b.x,p*=b.y,c+=P,f+=T,x=Er(_),_=m_(x)}}return Sm({width:h,height:p,x:c,y:f})}function u0(t,e){const n=l0(t).scrollLeft;return e?e.left+n:fl(eo(t)).left+n}function f5(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-u0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function hB(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=eo(r),u=e?a0(e.floating):!1;if(r===a||u&&i)return n;let c={scrollLeft:0,scrollTop:0},f=Zi(1);const h=Zi(0),p=sa(r);if((p||!i)&&((Yu(r)!=="body"||o0(a))&&(c=l0(r)),p)){const y=fl(r);f=cu(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const v=a&&!p&&!i?f5(a,c):Zi(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+h.x+v.x,y:n.y*f.y-c.scrollTop*f.y+h.y+v.y}}function pB(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function mB(t){const e=l0(t),n=t.ownerDocument.body,r=qi(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=qi(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+u0(t);const a=-e.scrollTop;return ci(n).direction==="rtl"&&(i+=qi(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:a}}const gB=25;function vB(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Er(t),i=eo(t),a=s.visualViewport;let u=i.clientWidth,c=i.clientHeight,f=0,h=0;if(a){const v=!ix()||e==="fixed";r?v||(f=-a.offsetLeft,h=-a.offsetTop):(u=a.width,c=a.height,v&&(f=a.offsetLeft,h=a.offsetTop))}if(u0(i)<=0){const v=i.ownerDocument,y=v.body,x=getComputedStyle(y),_=v.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,b=Math.abs(i.clientWidth-y.clientWidth-_),E=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;E<=gB&&(u-=E)}return{width:u,height:c,x:f,y:h}}function yB(t,e){const n=fl(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=cu(t),a=t.clientWidth*i.x,u=t.clientHeight*i.y,c=s*i.x,f=r*i.y;return{width:a,height:u,x:c,y:f}}function Fk(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=vB(t,n,e);else if(e==="document")r=mB(eo(t));else if(ui(e))r=yB(e,n);else{const s=d5(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Sm(r)}function _B(t,e){const n=e.get(t);if(n)return n;let r=Wd(t,[],!1).filter(u=>ui(u)&&Yu(u)!=="body"),s=null;const i=ci(t).position==="fixed";let a=i?dl(t):t;for(;ui(a)&&!Bd(a);){const u=ci(a),c=sx(a),f=s?s.position:i?"fixed":"";!c&&(f==="fixed"||f==="absolute"&&u.position==="static")?r=r.filter(p=>p!==a):s=u,a=dl(a)}return e.set(t,r),r}function xB(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?a0(e)?[]:_B(e,this._c):[].concat(n),r],u=Fk(e,a[0],s);let c=u.top,f=u.right,h=u.bottom,p=u.left;for(let v=1;v<a.length;v++){const y=Fk(e,a[v],s);c=qi(y.top,c),f=Yo(y.right,f),h=Yo(y.bottom,h),p=qi(y.left,p)}return{width:f-p,height:h-c,x:p,y:c}}function wB(t){const{width:e,height:n}=c5(t);return{width:e,height:n}}function bB(t,e,n){const r=sa(e),s=eo(e),i=n==="fixed",a=fl(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const c=Zi(0);if((r||!i)&&((Yu(e)!=="body"||o0(s))&&(u=l0(e)),r)){const v=fl(e,!0,i,e);c.x=v.x+e.clientLeft,c.y=v.y+e.clientTop}!r&&s&&(c.x=u0(s));const f=s&&!r&&!i?f5(s,u):Zi(0),h=a.left+u.scrollLeft-c.x-f.x,p=a.top+u.scrollTop-c.y-f.y;return{x:h,y:p,width:a.width,height:a.height}}function a1(t){return ci(t).position==="static"}function Vk(t,e){if(!sa(t)||ci(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return eo(t)===n&&(n=n.ownerDocument.body),n}function h5(t,e){const n=Er(t);if(a0(t))return n;if(!sa(t)){let s=dl(t);for(;s&&!Bd(s);){if(ui(s)&&!a1(s))return s;s=dl(s)}return n}let r=Vk(t,e);for(;r&&aB(r)&&a1(r);)r=Vk(r,e);return r&&Bd(r)&&a1(r)&&!sx(r)?n:r||cB(t)||n}const SB=async function(t){const e=this.getOffsetParent||h5,n=this.getDimensions,r=await n(t.floating);return{reference:bB(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function EB(t){return ci(t).direction==="rtl"}const kB={convertOffsetParentRelativeRectToViewportRelativeRect:hB,getDocumentElement:eo,getClippingRect:xB,getOffsetParent:h5,getElementRects:SB,getClientRects:pB,getDimensions:wB,getScale:cu,isElement:ui,isRTL:EB};function p5(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function CB(t,e,n){let r=null,s;const i=eo(t);function a(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function u(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),a();const v=t.getBoundingClientRect(),{left:y,top:x,width:_,height:b}=v;if(h||e(),!_||!b)return;const E=Qh(x),C=Qh(i.clientWidth-(y+_)),P=Qh(i.clientHeight-(x+b)),T=Qh(y),O={rootMargin:-E+"px "+-C+"px "+-P+"px "+-T+"px",threshold:qi(0,Yo(1,p))||1};let M=!0;function A(N){const D=N[0].intersectionRatio;if(!p5(v,t.getBoundingClientRect()))return u();if(D!==p){if(!M)return u();D?u(!1,D):s=setTimeout(()=>{u(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(A,{...O,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,O)}r.observe(t)}const c=Er(t),f=()=>u(n);return c.addEventListener("resize",f),u(!0),()=>{c.removeEventListener("resize",f),a()}}function PB(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,f=ox(t),h=s||i?[...f?Wd(f):[],...e?Wd(e):[]]:[];h.forEach(E=>{s&&E.addEventListener("scroll",n),i&&E.addEventListener("resize",n)});const p=f&&u?CB(f,n,i):null;let v=-1,y=null;a&&(y=new ResizeObserver(E=>{let[C]=E;C&&C.target===f&&y&&e&&(y.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var P;(P=y)==null||P.observe(e)})),n()}),f&&!c&&y.observe(f),e&&y.observe(e));let x,_=c?fl(t):null;c&&b();function b(){const E=fl(t);_&&!p5(_,E)&&n(),_=E,x=requestAnimationFrame(b)}return n(),()=>{var E;h.forEach(C=>{s&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),p==null||p(),(E=y)==null||E.disconnect(),y=null,c&&cancelAnimationFrame(x)}}const TB=rB,RB=sB,AB=eB,IB=oB,MB=tB,$k=JU,NB=iB,OB=(t,e,n)=>{const r=new Map,s=n??{},i={...kB,...s.platform,_c:r};return QU(t,e,{...s,platform:i})};var DB=typeof document<"u",LB=function(){},Sp=DB?g.useLayoutEffect:LB;function Em(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(!Em(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)&&!Em(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function m5(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Hk(t,e){const n=m5(t);return Math.round(e*n)/n}function l1(t){const e=g.useRef(t);return Sp(()=>{e.current=t}),e}function jB(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:f}=t,[h,p]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,y]=g.useState(r);Em(v,r)||y(r);const[x,_]=g.useState(null),[b,E]=g.useState(null),C=g.useCallback($=>{$!==O.current&&(O.current=$,_($))},[]),P=g.useCallback($=>{$!==M.current&&(M.current=$,E($))},[]),T=i||x,R=a||b,O=g.useRef(null),M=g.useRef(null),A=g.useRef(h),N=c!=null,D=l1(c),j=l1(s),V=l1(f),W=g.useCallback(()=>{if(!O.current||!M.current)return;const $={placement:e,strategy:n,middleware:v};j.current&&($.platform=j.current),OB(O.current,M.current,$).then(te=>{const H={...te,isPositioned:V.current!==!1};Y.current&&!Em(A.current,H)&&(A.current=H,Gm.flushSync(()=>{p(H)}))})},[v,e,n,j,V]);Sp(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[f]);const Y=g.useRef(!1);Sp(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Sp(()=>{if(T&&(O.current=T),R&&(M.current=R),T&&R){if(D.current)return D.current(T,R,W);W()}},[T,R,W,D,N]);const K=g.useMemo(()=>({reference:O,floating:M,setReference:C,setFloating:P}),[C,P]),B=g.useMemo(()=>({reference:T,floating:R}),[T,R]),X=g.useMemo(()=>{const $={position:n,left:0,top:0};if(!B.floating)return $;const te=Hk(B.floating,h.x),H=Hk(B.floating,h.y);return u?{...$,transform:"translate("+te+"px, "+H+"px)",...m5(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:H}},[n,u,B.floating,h.x,h.y]);return g.useMemo(()=>({...h,update:W,refs:K,elements:B,floatingStyles:X}),[h,W,K,B,X])}const FB=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?$k({element:r.current,padding:s}).fn(n):{}:r?$k({element:r,padding:s}).fn(n):{}}}},VB=(t,e)=>{const n=TB(t);return{name:n.name,fn:n.fn,options:[t,e]}},$B=(t,e)=>{const n=RB(t);return{name:n.name,fn:n.fn,options:[t,e]}},HB=(t,e)=>({fn:NB(t).fn,options:[t,e]}),zB=(t,e)=>{const n=AB(t);return{name:n.name,fn:n.fn,options:[t,e]}},UB=(t,e)=>{const n=IB(t);return{name:n.name,fn:n.fn,options:[t,e]}},BB=(t,e)=>{const n=MB(t);return{name:n.name,fn:n.fn,options:[t,e]}},WB=(t,e)=>{const n=FB(t);return{name:n.name,fn:n.fn,options:[t,e]}};var GB="Arrow",g5=g.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return S.jsx(Rt.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});g5.displayName=GB;var KB=g5;function v5(t){const[e,n]=g.useState(void 0);return ai(()=>{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,f=Array.isArray(c)?c[0]:c;a=f.inlineSize,u=f.blockSize}else a=t.offsetWidth,u=t.offsetHeight;n({width:a,height:u})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var ax="Popper",[y5,c0]=na(ax),[qB,_5]=y5(ax),x5=t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null),[i,a]=g.useState(void 0);return S.jsx(qB,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})};x5.displayName=ax;var w5="PopperAnchor",b5=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=_5(w5,n),a=g.useRef(null),u=i.onAnchorChange,c=g.useCallback(x=>{a.current=x,x&&u(x)},[u]),f=Yt(e,c),h=g.useRef(null);g.useEffect(()=>{if(!r)return;const x=h.current;h.current=r.current,x!==h.current&&u(h.current)});const p=i.placementState&&ux(i.placementState),v=p==null?void 0:p[0],y=p==null?void 0:p[1];return r?null:S.jsx(Rt.div,{"data-radix-popper-side":v,"data-radix-popper-align":y,...s,ref:f})});b5.displayName=w5;var lx="PopperContent",[ZB,YB]=y5(lx),S5=g.forwardRef((t,e)=>{var ee,le,pe,we,Ie,qe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:x,..._}=t,b=_5(lx,n),[E,C]=g.useState(null),P=Yt(e,C),[T,R]=g.useState(null),O=v5(T),M=(O==null?void 0:O.width)??0,A=(O==null?void 0:O.height)??0,N=r+(i!=="center"?"-"+i:""),D=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},j=Array.isArray(f)?f:[f],V=j.length>0,W={padding:D,boundary:j.filter(QB),altBoundary:V},{refs:Y,floatingStyles:K,placement:B,isPositioned:X,middlewareData:$}=jB({strategy:"fixed",placement:N,whileElementsMounted:(...it)=>PB(...it,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[VB({mainAxis:s+A,alignmentAxis:a}),c&&$B({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?HB():void 0,...W}),c&&zB({...W}),UB({...W,apply:({elements:it,rects:Ae,availableWidth:at,availableHeight:At})=>{const{width:mt,height:je}=Ae.reference,Ye=it.floating.style;Ye.setProperty("--radix-popper-available-width",`${at}px`),Ye.setProperty("--radix-popper-available-height",`${At}px`),Ye.setProperty("--radix-popper-anchor-width",`${mt}px`),Ye.setProperty("--radix-popper-anchor-height",`${je}px`)}}),T&&WB({element:T,padding:u}),JB({arrowWidth:M,arrowHeight:A}),v&&BB({strategy:"referenceHidden",...W,boundary:V?W.boundary:void 0})]}),te=b.setPlacementState;ai(()=>(te(B),()=>{te(void 0)}),[B,te]);const[H,L]=ux(B),Z=ju(x);ai(()=>{X&&(Z==null||Z())},[X,Z]);const ne=(ee=$.arrow)==null?void 0:ee.x,ie=(le=$.arrow)==null?void 0:le.y,ae=((pe=$.arrow)==null?void 0:pe.centerOffset)!==0,[ue,ke]=g.useState();return ai(()=>{E&&ke(window.getComputedStyle(E).zIndex)},[E]),S.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:X?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(we=$.transformOrigin)==null?void 0:we.x,(Ie=$.transformOrigin)==null?void 0:Ie.y].join(" "),...((qe=$.hide)==null?void 0:qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:S.jsx(ZB,{scope:n,placedSide:H,placedAlign:L,onArrowChange:R,arrowX:ne,arrowY:ie,shouldHideArrow:ae,children:S.jsx(Rt.div,{"data-side":H,"data-align":L,..._,ref:P,style:{..._.style,animation:X?void 0:"none"}})})})});S5.displayName=lx;var E5="PopperArrow",XB={top:"bottom",right:"left",bottom:"top",left:"right"},k5=g.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=YB(E5,r),a=XB[i.placedSide];return S.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:S.jsx(KB,{...s,ref:n,style:{...s.style,display:"block"}})})});k5.displayName=E5;function QB(t){return t!==null}var JB=t=>({name:"transformOrigin",options:t,fn(e){var b,E,C;const{placement:n,rects:r,middlewareData:s}=e,a=((b=s.arrow)==null?void 0:b.centerOffset)!==0,u=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[f,h]=ux(n),p={start:"0%",center:"50%",end:"100%"}[h],v=(((E=s.arrow)==null?void 0:E.x)??0)+u/2,y=(((C=s.arrow)==null?void 0:C.y)??0)+c/2;let x="",_="";return f==="bottom"?(x=a?p:`${v}px`,_=`${-c}px`):f==="top"?(x=a?p:`${v}px`,_=`${r.floating.height+c}px`):f==="right"?(x=`${-c}px`,_=a?p:`${y}px`):f==="left"&&(x=`${r.floating.width+c}px`,_=a?p:`${y}px`),{data:{x,y:_}}}});function ux(t){const[e,n="center"]=t.split("-");return[e,n]}var C5=x5,cx=b5,P5=S5,T5=k5,d0="Popover",[R5]=na(d0,[c0]),mf=c0(),[eW,ia]=R5(d0),A5=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,u=mf(e),c=g.useRef(null),[f,h]=g.useState(!1),[p,v]=hl({prop:r,defaultProp:s??!1,onChange:i,caller:d0});return S.jsx(C5,{...u,children:S.jsx(eW,{scope:e,contentId:il(),triggerRef:c,open:p,onOpenChange:v,onOpenToggle:g.useCallback(()=>v(y=>!y),[v]),hasCustomAnchor:f,onCustomAnchorAdd:g.useCallback(()=>h(!0),[]),onCustomAnchorRemove:g.useCallback(()=>h(!1),[]),modal:a,children:n})})};A5.displayName=d0;var I5="PopoverAnchor",tW=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=ia(I5,n),i=mf(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:u}=s;return g.useEffect(()=>(a(),()=>u()),[a,u]),S.jsx(cx,{...i,...r,ref:e})});tW.displayName=I5;var M5="PopoverTrigger",N5=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=ia(M5,n),i=mf(n),a=Yt(e,s.triggerRef),u=S.jsx(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":F5(s.open),...r,ref:a,onClick:Et(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:S.jsx(cx,{asChild:!0,...i,children:u})});N5.displayName=M5;var dx="PopoverPortal",[nW,rW]=R5(dx,{forceMount:void 0}),O5=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=ia(dx,e);return S.jsx(nW,{scope:e,forceMount:n,children:S.jsx(Ji,{present:n||i.open,children:S.jsx(qm,{asChild:!0,container:s,children:r})})})};O5.displayName=dx;var Vu="PopoverContent",D5=g.forwardRef((t,e)=>{const n=rW(Vu,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=ia(Vu,t.__scopePopover);return S.jsx(Ji,{present:r||i.open,children:i.modal?S.jsx(iW,{...s,ref:e}):S.jsx(oW,{...s,ref:e})})});D5.displayName=Vu;var sW=jd("PopoverContent.RemoveScroll"),iW=g.forwardRef((t,e)=>{const n=ia(Vu,t.__scopePopover),r=g.useRef(null),s=Yt(e,r),i=g.useRef(!1);return g.useEffect(()=>{const a=r.current;if(a)return Q3(a)},[]),S.jsx(q2,{as:sW,allowPinchZoom:!0,children:S.jsx(L5,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Et(t.onCloseAutoFocus,a=>{var u;a.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Et(t.onPointerDownOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Et(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),oW=g.forwardRef((t,e)=>{const n=ia(Vu,t.__scopePopover),r=g.useRef(!1),s=g.useRef(!1);return S.jsx(L5,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,u;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,f;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),L5=g.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:h,...p}=t,v=ia(Vu,n),y=mf(n);return U3(),S.jsx(K2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:S.jsx(Km,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onDismiss:()=>v.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(P5,{"data-state":F5(v.open),role:"dialog",id:v.contentId,...y,...p,ref:e,style:{...p.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)"}})})})}),j5="PopoverClose",aW=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=ia(j5,n);return S.jsx(Rt.button,{type:"button",...r,ref:e,onClick:Et(t.onClick,()=>s.onOpenChange(!1))})});aW.displayName=j5;var lW="PopoverArrow",uW=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=mf(n);return S.jsx(T5,{...s,...r,ref:e})});uW.displayName=lW;function F5(t){return t?"open":"closed"}var V5=A5,$5=N5,H5=O5,z5=D5;const U5=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:a,dropdownAriaLabel:u="More actions",dropdownItems:c})=>{const[f,h]=g.useState(!1),p=i?a??t:t,v=c.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${v?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),v?S.jsxs(V5,{open:f,onOpenChange:h,children:[S.jsx($5,{asChild:!0,children:S.jsx("button",{"aria-label":u,disabled:s||i,title:u,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(pz,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(H5,{children:S.jsx(z5,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(y=>{const x=y.icon;return S.jsxs("button",{onClick:()=>{y.isDisabled||(y.onClick(),h(!1))},disabled:y.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[x?S.jsx(x,{className:"h-3.5 w-3.5",weight:"bold"}):null,y.label]},y.label)})})})]}):null]})};var cW=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"}),dW="VisuallyHidden",B5=g.forwardRef((t,e)=>S.jsx(Rt.span,{...t,ref:e,style:{...cW,...t.style}}));B5.displayName=dW;var fW=B5,[f0]=na("Tooltip",[c0]),h0=c0(),W5="TooltipProvider",hW=700,g_="tooltip.open",[pW,fx]=f0(W5),G5=t=>{const{__scopeTooltip:e,delayDuration:n=hW,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=g.useRef(!0),u=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),S.jsx(pW,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:g.useCallback(f=>{u.current=f},[]),disableHoverableContent:s,children:i})};G5.displayName=W5;var Gd="Tooltip",[mW,gf]=f0(Gd),K5=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=t,c=fx(Gd,t.__scopeTooltip),f=h0(e),[h,p]=g.useState(null),v=il(),y=g.useRef(0),x=a??c.disableHoverableContent,_=u??c.delayDuration,b=g.useRef(!1),[E,C]=hl({prop:r,defaultProp:s??!1,onChange:M=>{M?(c.onOpen(),document.dispatchEvent(new CustomEvent(g_))):c.onClose(),i==null||i(M)},caller:Gd}),P=g.useMemo(()=>E?b.current?"delayed-open":"instant-open":"closed",[E]),T=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,b.current=!1,C(!0)},[C]),R=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C(!1)},[C]),O=g.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{b.current=!0,C(!0),y.current=0},_)},[_,C]);return g.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),S.jsx(C5,{...f,children:S.jsx(mW,{scope:e,contentId:v,open:E,stateAttribute:P,trigger:h,onTriggerChange:p,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?O():T()},[c.isOpenDelayedRef,O,T]),onTriggerLeave:g.useCallback(()=>{x?R():(window.clearTimeout(y.current),y.current=0)},[R,x]),onOpen:T,onClose:R,disableHoverableContent:x,children:n})})};K5.displayName=Gd;var v_="TooltipTrigger",q5=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=gf(v_,n),i=fx(v_,n),a=h0(n),u=g.useRef(null),c=Yt(e,u,s.onTriggerChange),f=g.useRef(!1),h=g.useRef(!1),p=g.useCallback(()=>f.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),S.jsx(cx,{asChild:!0,...a,children:S.jsx(Rt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Et(t.onPointerMove,v=>{v.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Et(t.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Et(t.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Et(t.onFocus,()=>{f.current||s.onOpen()}),onBlur:Et(t.onBlur,s.onClose),onClick:Et(t.onClick,s.onClose)})})});q5.displayName=v_;var hx="TooltipPortal",[gW,vW]=f0(hx,{forceMount:void 0}),Z5=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=gf(hx,e);return S.jsx(gW,{scope:e,forceMount:n,children:S.jsx(Ji,{present:n||i.open,children:S.jsx(qm,{asChild:!0,container:s,children:r})})})};Z5.displayName=hx;var $u="TooltipContent",Y5=g.forwardRef((t,e)=>{const n=vW($u,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=gf($u,t.__scopeTooltip);return S.jsx(Ji,{present:r||a.open,children:a.disableHoverableContent?S.jsx(X5,{side:s,...i,ref:e}):S.jsx(yW,{side:s,...i,ref:e})})}),yW=g.forwardRef((t,e)=>{const n=gf($u,t.__scopeTooltip),r=fx($u,t.__scopeTooltip),s=g.useRef(null),i=Yt(e,s),[a,u]=g.useState(null),{trigger:c,onClose:f}=n,h=s.current,{onPointerInTransitChange:p}=r,v=g.useCallback(()=>{u(null),p(!1)},[p]),y=g.useCallback((x,_)=>{const b=x.currentTarget,E={x:x.clientX,y:x.clientY},C=SW(E,b.getBoundingClientRect()),P=EW(E,C),T=kW(_.getBoundingClientRect()),R=PW([...P,...T]);u(R),p(!0)},[p]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(c&&h){const x=b=>y(b,h),_=b=>y(b,c);return c.addEventListener("pointerleave",x),h.addEventListener("pointerleave",_),()=>{c.removeEventListener("pointerleave",x),h.removeEventListener("pointerleave",_)}}},[c,h,y,v]),g.useEffect(()=>{if(a){const x=_=>{const b=_.target,E={x:_.clientX,y:_.clientY},C=(c==null?void 0:c.contains(b))||(h==null?void 0:h.contains(b)),P=!CW(E,a);C?v():P&&(v(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,h,a,f,v]),S.jsx(X5,{...t,ref:i})}),[_W,xW]=f0(Gd,{isInside:!1}),wW=S$("TooltipContent"),X5=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...u}=t,c=gf($u,n),f=h0(n),{onClose:h}=c;return g.useEffect(()=>(document.addEventListener(g_,h),()=>document.removeEventListener(g_,h)),[h]),g.useEffect(()=>{if(c.trigger){const p=v=>{v.target instanceof Node&&v.target.contains(c.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,h]),S.jsx(Km,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:S.jsxs(P5,{"data-state":c.stateAttribute,...f,...u,ref:e,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(wW,{children:r}),S.jsx(_W,{scope:n,isInside:!0,children:S.jsx(fW,{id:c.contentId,role:"tooltip",children:s||r})})]})})});Y5.displayName=$u;var Q5="TooltipArrow",bW=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=h0(n);return xW(Q5,n).isInside?null:S.jsx(T5,{...s,...r,ref:e})});bW.displayName=Q5;function SW(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")}}function EW(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}function kW(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}]}function CW(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],f=u.x,h=u.y,p=c.x,v=c.y;h>r!=v>r&&n<(p-f)*(r-h)/(v-h)+f&&(s=!s)}return s}function PW(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),TW(e)}function TW(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)}var RW=G5,AW=K5,IW=q5,MW=Z5,NW=Y5;const yd={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},J5={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"}},eR=g.createContext(null);function p0(){const t=g.useContext(eR);return t?t.classes:J5.pill}function OW(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function DW({children:t,defaultShape:e="pill"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{OW(()=>r(i))},[]);return S.jsx(eR.Provider,{value:{shape:n,setShape:s,classes:J5[n]},children:t})}const tR=g.createContext(null);function nR({value:t,children:e}){return S.jsx(tR.Provider,{value:t,children:e})}function LW(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function px({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:a,onOpenChange:u}){const[c,f]=g.useState(!1),h=a!==void 0?a:c,[p,v]=g.useState(!1),y=p0(),x=g.useContext(tR);g.useEffect(()=>{h&&v(!0)},[h]);const _=()=>{h||v(!1)},b=LW(n);return S.jsx(RW,{delayDuration:s,children:S.jsxs(AW,{open:h,onOpenChange:E=>{f(E),u==null||u(E)},children:[S.jsx(IW,{asChild:!0,children:e}),p&&S.jsx(MW,{forceMount:!0,container:x??void 0,children:S.jsx(NW,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(Ki.div,{className:ar("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",y.bg,i),style:{fontVariationSettings:yd.medium},initial:{opacity:0,scale:.8,...b},animate:{opacity:h?1:0,scale:h?1:.9,x:0,y:0},transition:h?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const Fo=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:a})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(px,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),m0="/__rivet/preview",zk=`${m0}/variant/`,Uk=`${m0}/history/`,rR=t=>t?t.startsWith("/")?t:`/${t}`:"/",jW=t=>`${m0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${rR(t.routePath)}`,FW=t=>`${m0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${rR(t.routePath)}`,VW=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(zk)||e.pathname.startsWith(Uk)}catch{return t.startsWith(zk)||t.startsWith(Uk)}},Bk=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")?jW({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},Wk="/rivet/",sR=t=>{if(!t.startsWith(Wk))return null;const e=t.slice(Wk.length);return!e||e==="/"?null:`/${e}`},Kd=(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(()=>{})},$W=(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),Kd(r,e))}},Gk=6,y_="original",mx="Original",gx="The original state of your app before any variants were generated.",Kk=200,dn=ds("AgentVariantsPanel"),u1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},HW=t=>t?t.kind==="active"?t.variant.workItemId:`${t.entry.sessionId}:${t.entry.variantId}`:null,Yc=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},zW=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function du(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}async function Ri(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 UW=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},$a=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")},iR=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},oR=t=>t.status==="succeeded"&&!$a(t)&&(!t.previewUnavailable||iR(t)),c1=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"},qk=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},BW=t=>{var e;return UW(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},Zk=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),WW=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,a;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.label===s.label&&n.brief===s.brief&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((a=s.serve)==null?void 0:a.kind)&&n.hasTree===s.hasTree}),GW=()=>{var Sf,rc,ua,Mr;const t=Qe(hf),e=Qe(JT),n=Qe(e5),r=Qe(pf),s=Qe(h_),i=((Sf=s.deployPrototype)==null?void 0:Sf.isEnabled)??!1,a=((rc=s.canvasShare)==null?void 0:rc.isEnabled)??!1,u=((ua=s.variantSend)==null?void 0:ua.isEnabled)??!1,c=((Mr=s.designContextViewer)==null?void 0:Mr.isEnabled)??!1,f=Qe(r5),h=Qe(s5),p=st(l_),v=st(xm),y=st(u_),x=st(c_),_=st(XT),b=st(QT),E=st(Ud),C=st(J2),P=st(qT);g.useEffect(()=>(P("Directions"),()=>P(null)),[P]);const T=Qe(Zo),R=st(Zo),O=g.useCallback(()=>{$W(T),R(null)},[R,T]),M=Qe(d_),A=st(d_),N=Qe(f_),D=st(f_),j=N?`${N.sessionId}:${N.variantId}`:null,[V,W]=g.useState(""),[Y,K]=g.useState(null),[B,X]=g.useState(null),[$,te]=g.useState({}),[H,L]=g.useState(null),[Z,ne]=g.useState({}),[ie,ae]=g.useState(null),[ue,ke]=g.useState([]),ee=g.useRef([]);ee.current=ue;const[le,pe]=g.useState(!1),we=g.useMemo(()=>t.active?t.variants:[],[t]),Ie=g.useMemo(()=>we.filter(BW),[we]),qe=g.useMemo(()=>Zk(Ie,$),[Ie,$]),it=(H==null?void 0:H.key)===qe?H.shareUrl:null,Ae=t.active?t.sessionId:null,at=g.useMemo(()=>{const z=new Set;for(const oe of ue){const Ee=oe.parentVariant;Ee&&Ee.sessionId!==oe.sessionId&&z.add(Ee.sessionId)}return z},[ue]),At=g.useMemo(()=>{var oe;const z=new Set;for(const Ee of we)(oe=Ee.adoptedSource)!=null&&oe.sessionId&&z.add(Ee.adoptedSource.sessionId);return z},[we]),mt=g.useMemo(()=>[...ue.filter(oe=>oe.sessionId!==Ae&&!at.has(oe.sessionId)&&!At.has(oe.sessionId))].sort((oe,Ee)=>{const me=new Date(oe.createdAt).getTime(),xe=new Date(Ee.createdAt).getTime();return(Number.isNaN(xe)?0:xe)-(Number.isNaN(me)?0:me)}),[ue,Ae,at,At]),je=g.useMemo(()=>N?we.find(z=>{var oe,Ee;return((oe=z.adoptedSource)==null?void 0:oe.sessionId)===N.sessionId&&((Ee=z.adoptedSource)==null?void 0:Ee.variantId)===N.variantId})??null:null,[N,we]),Ye=g.useMemo(()=>N?mt.find(z=>z.sessionId===N.sessionId&&z.variantId===N.variantId)??null:null,[N,mt]),lt=t.active?t.projectContext:null,Je=(lt==null?void 0:lt.kind)==="fresh"?lt.workspacePath:n,vt=!t.active&&mt.length>0&&mt.every(z=>z.projectKind==="fresh"),xn=t.active?zW(lt):!!n&&!vt,Ut=g.useMemo(()=>Je?`?projectPath=${encodeURIComponent(Je)}`:"",[Je]),Rn=g.useRef(null),Hn=g.useRef(null),Ar=typeof window>"u"?"/":sR(window.location.pathname)??"/",Yn=g.useRef(null),wn=g.useRef(!1),Is=g.useCallback((z,oe)=>{oe.button!==0&&oe.pointerType==="mouse"||(oe.preventDefault(),u1(),Yn.current={kind:"live",variantId:z,startX:oe.clientX,startY:oe.clientY,committed:!1})},[]),Ms=g.useCallback((z,oe)=>{oe.button!==0&&oe.pointerType==="mouse"||(oe.preventDefault(),u1(),Yn.current={kind:"past",entry:z,startX:oe.clientX,startY:oe.clientY,committed:!1})},[]);g.useEffect(()=>{const z=me=>{const xe=Yn.current;if(!xe)return;const Ce=me.clientX-xe.startX,Ge=me.clientY-xe.startY;if(!xe.committed){if(Ce*Ce+Ge*Ge<Gk*Gk)return;if(u1(),xe.kind==="live"){const be=we.find(cr=>cr.workItemId===xe.variantId);if(!be||be.status!=="succeeded"){Yn.current=null;return}const Sn=Bk({sessionId:Ae,variant:be,projectContext:lt,routePath:Ar});E({sessionId:Ae??"",variantId:be.workItemId,label:be.label||"Direction",url:Sn,source:"live",runLabel:be.runLabel,description:be.description})}else{const{entry:be}=xe,Sn=Yc(be),cr=Sn?FW({sessionId:be.sessionId,variantId:be.variantId,routePath:Ar}):`/api/variants/history/${encodeURIComponent(be.sessionId)}/${encodeURIComponent(be.variantId)}/preview${Ut}`;if(E({sessionId:be.sessionId,variantId:be.variantId,label:be.label||"Direction",url:cr,source:Sn?"history-dev-server":"history-static",runLabel:be.runLabel,description:be.brief}),Sn){const Fs=qk(`/api/variants/history/${encodeURIComponent(be.sessionId)}/${encodeURIComponent(be.variantId)}/run${Ut}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Fs,{method:"POST"})).ok)return;const ps=qk(cr,"replay",String(Date.now()));E(pn=>!pn||pn.sessionId!==be.sessionId||pn.variantId!==be.variantId||pn.source!=="history-dev-server"?pn:{...pn,url:ps}),R(pn=>{if(!pn)return pn;const dr=gi=>!gi||gi.sessionId!==be.sessionId||gi.variantId!==be.variantId?gi:{...gi,url:ps};return{...pn,left:dr(pn.left),right:dr(pn.right)}})}catch(Zr){dn.warn("history replay drag boot failed",Zr)}})()}}xe.committed=!0}C({x:me.clientX,y:me.clientY})},oe=()=>{const me=Yn.current;me!=null&&me.committed&&(wn.current=!0),Yn.current=null,C(null)},Ee=me=>{if(me.key!=="Escape")return;const xe=Yn.current;xe!=null&&xe.committed&&(xe.kind==="past"&&Yc(xe.entry)&&Kd({sessionId:xe.entry.sessionId,variantId:xe.entry.variantId,source:"history-dev-server"}),Yn.current=null,E(null),C(null))};return window.addEventListener("pointermove",z),window.addEventListener("pointerup",oe),window.addEventListener("pointercancel",oe),window.addEventListener("keydown",Ee),()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",oe),window.removeEventListener("pointercancel",oe),window.removeEventListener("keydown",Ee)}},[we,Ae,lt,Ar,Ut,E,C,R]);const An=g.useMemo(()=>{var oe;if(le||j)return null;const z=M?we.find(Ee=>Ee.workItemId===M):null;return M&&!z?null:z?$a(z)?z.workItemId:null:t.active?((oe=we.find(Ee=>{var me,xe;return $a(Ee)&&(((me=Ee.preview)==null?void 0:me.kind)==="static_artifact"||((xe=Ee.preview)==null?void 0:xe.kind)==="dev_server")}))==null?void 0:oe.workItemId)??null:null},[M,j,le,t,we]),fi=g.useCallback(async z=>{var Ee,me,xe,Ce;if(!Ae)return;const oe=(z==null?void 0:z.workItemId)??null;K({kind:"switch",variantId:oe??void 0});try{if(((Ee=z==null?void 0:z.preview)==null?void 0:Ee.kind)==="static_artifact"){if(y(!1),x(null),((me=z.refinement)==null?void 0:me.status)==="succeeded"){const be=z.preview.url.includes("?")?"&":"?";v(`${z.preview.url}${be}refinement=${encodeURIComponent(z.refinement.workItemId)}`)}else v(z.preview.url);p(be=>be+1);return}if(oe&&Ae&&t.active&&t.projectContext.kind==="fresh"&&((xe=t.projectContext.executionPlan)==null?void 0:xe.mode)!=="vite_app"&&((Ce=z==null?void 0:z.preview)==null?void 0:Ce.kind)!=="dev_server"){y(!1),x(null),v(`/api/variants/${Ae}/static/${oe}`),p(be=>be+1);return}const Ge=z&&oe?Bk({sessionId:Ae,variant:z,projectContext:t.active?t.projectContext:null,routePath:Ar}):null;if(Ge){y(!1),x(null),v(Ge),p(be=>be+1);return}Pe.capture("variants_panel.preview_display_failed",{sessionId:Ae,variantId:oe,previewKind:z?c1(z):"none",hasPreview:!!(z!=null&&z.preview),hasPort:typeof(z==null?void 0:z.port)=="number",errorMessage:"No addressable dev-server preview URL"}),y(!1),x(null)}catch(Ge){dn.warn("preview display failed",Ge),Pe.capture("variants_panel.preview_display_failed",{sessionId:Ae,variantId:oe,previewKind:z?c1(z):"none",hasPreview:!!(z!=null&&z.preview),hasPort:typeof(z==null?void 0:z.port)=="number",errorMessage:Ge instanceof Error?Ge.message:String(Ge)}),y(!1),x(null)}finally{K(null)}},[Ae,t,Ar,p,v,y,x]),hi=g.useRef(!1),fs=g.useRef(null),Ns=g.useRef(0),lr=g.useCallback(()=>{if(Ns.current++,_(!1),b(!1),!hi.current)return;const z=fs.current;hi.current=!1,fs.current=null;const oe=z?new URLSearchParams({sessionId:z.sessionId,variantId:z.variantId}):null,Ee=oe?`/api/variants/history/replay/stop?${oe.toString()}`:"/api/variants/history/replay/stop";fetch(Ee,{method:"POST"}).catch(me=>dn.warn("history replay stop failed",me))},[_,b]),Xn=g.useCallback(async z=>{if(Ae){K({kind:"switch",variantId:z.workItemId});try{const oe=await fetch(`/api/variants/${Ae}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:z.workItemId})});if(!oe.ok){const Ee=await Ri(oe);throw new Error(Ee.message??`Preview restoration failed (${oe.status})`)}}catch(oe){dn.warn("preview restoration failed",oe),Pe.capture("variants_panel.preview_display_failed",{sessionId:Ae,variantId:z.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:oe instanceof Error?oe.message:String(oe)})}finally{K(null)}}},[Ae]),Os=g.useCallback(z=>{var Ce,Ge,be,Sn,cr;if(wn.current){wn.current=!1;return}const oe=$a(z),Ee=z.status==="pending"||z.status==="running"||oR(z);if(!oe&&!Ee)return;lr();const me=c1(z),xe=we.find(Fs=>Fs.workItemId===M);Pe.capture("variants_panel.preview_requested",{sessionId:Ae,fromVariantId:xe==null?void 0:xe.workItemId,toVariantId:z.workItemId,variantStatus:z.status,isPreviewReady:oe,isArmed:Ee,previewKind:me,hasPreview:!!z.preview,hasPort:typeof z.port=="number",viewEnabled:((Ge=(Ce=z.actions)==null?void 0:Ce.view)==null?void 0:Ge.enabled)??null,previewUnavailableReason:((be=z.previewUnavailable)==null?void 0:be.reason)??null}),A(z.workItemId),D(null),oe?(Hn.current=z.workItemId,pe(!1),O(),fi(z)):(Hn.current=null,pe(!1),v(null),y(!1),Pe.capture("variants_panel.preview_armed",{sessionId:Ae,fromVariantId:xe==null?void 0:xe.workItemId,toVariantId:z.workItemId,variantStatus:z.status,previewKind:me,hasPreview:!!z.preview,hasPort:typeof z.port=="number",viewEnabled:((cr=(Sn=z.actions)==null?void 0:Sn.view)==null?void 0:cr.enabled)??null}),iR(z)&&Xn(z)),Pe.capture("variants_panel.preview_switched",{sessionId:Ae,fromVariantId:xe==null?void 0:xe.workItemId,toVariantId:z.workItemId,armed:Ee})},[M,Ae,O,A,D,lr,Xn,fi,we,v,y]),Ds=t.active?`${t.sessionId}:${t.stage}`:"inactive";g.useEffect(()=>{if(r)return;let z=!1;return(async()=>{try{const oe=await fetch(`/api/variants/history${Ut}`,{credentials:"same-origin"});if(!oe.ok)return;const Ee=await oe.json();if(z)return;const me=(Ee.variants??[]).filter(xe=>{var Ce,Ge;return((Ce=xe.preview)==null?void 0:Ce.kind)==="static"||((Ge=xe.serve)==null?void 0:Ge.kind)==="static"||Yc(xe)});if(WW(ee.current,me))return;ee.current=me,ke(me)}catch(oe){dn.warn("Failed to load past variants",oe)}})(),()=>{z=!0}},[r,Ds,Ut]);const Ir=g.useCallback(()=>{hi.current=!1,fs.current=null,_(!1),b(!1),D(null),A(null),pe(!0),y(!1),x(null),v(null),p(z=>z+1)},[A,_,b,p,v,x,D,y]),pi=g.useCallback(z=>{if(wn.current){wn.current=!1;return}if(O(),D({sessionId:z.sessionId,variantId:z.variantId,previewKind:Yc(z)?"dev_server":"static"}),A(null),pe(!1),Yc(z)){const oe=++Ns.current;hi.current=!0,fs.current={sessionId:z.sessionId,variantId:z.variantId},_(!0),b(!0),(async()=>{K({kind:"switch"}),Pe.capture("variants_panel.history_replay_started",{sessionId:z.sessionId,variantId:z.variantId});const Ee=me=>Pe.capture("variants_panel.history_replay_failed",{sessionId:z.sessionId,variantId:z.variantId,...me});try{const me=await fetch(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/run${Ut}`,{method:"POST"});if(oe!==Ns.current)return;if(!me.ok){const{errorCode:xe}=await Ri(me);dn.warn(`history replay failed: HTTP ${me.status} ${xe??""}`),Ee({httpStatus:me.status,errorCode:xe}),Ir();return}b(!1),y(!0),x(null),v(null),p(xe=>xe+1),Pe.capture("variants_panel.history_replay_ready",{sessionId:z.sessionId,variantId:z.variantId})}catch(me){if(oe!==Ns.current)return;dn.warn("history replay failed",me),Ee({errorMessage:me instanceof Error?me.message:String(me)}),Ir()}finally{K(null)}})();return}lr(),y(!1),x(null),v(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/preview${Ut}`)},[Ir,K,_,b,p,D,A,v,x,O,y,lr,Ut]),We=g.useCallback(async()=>{lr();const z=()=>{O(),A(null),D(null),pe(!0),Hn.current=null,y(!1),x(null),v(null),p(oe=>oe+1)};if(!Ae){z();return}K({kind:"switch"});try{const oe=await fetch(`/api/variants/${Ae}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!oe.ok){dn.warn(`switch to original failed: HTTP ${oe.status}`);return}z(),y(!0),Pe.capture("variants_panel.preview_switched",{sessionId:Ae,fromVariantId:M,toVariantId:null,target:"original",armed:!1})}catch(oe){dn.warn("preview-port original switch failed",oe)}finally{K(null)}},[M,Ae,A,D,p,v,x,O,y,lr]),Bt=g.useCallback(async z=>{var Ee,me;const oe=((me=(Ee=z.actions)==null?void 0:Ee.commit)==null?void 0:me.enabled)??z.status==="succeeded";if(!(!Ae||!oe)){Pe.capture("variants_panel.commit_clicked",{sessionId:Ae,variantId:z.workItemId,variantLabel:z.label}),K({kind:"commit",variantId:z.workItemId});try{const xe=await fetch(`/api/variants/${Ae}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:z.workItemId})});if(!xe.ok){const{message:Ge,errorCode:be}=await Ri(xe);dn.warn(`commit failed: HTTP ${xe.status} ${be??""} ${Ge??""}`),Pe.capture("variants_panel.commit_failed",{sessionId:Ae,variantId:z.workItemId,httpStatus:xe.status,errorCode:be??null,errorMessage:Ge??null}),ht.error("Couldn't send direction",{description:Ge??`The server rejected the request (HTTP ${xe.status}). Try again, or pick a different direction.`});return}const Ce=await xe.json().catch(()=>null);Pe.capture("variants_panel.commit_succeeded",{sessionId:Ae,variantId:z.workItemId,payloadKind:(Ce==null?void 0:Ce.payloadKind)??null,duplicate:(Ce==null?void 0:Ce.duplicate)??!1}),ht.success(`Sent "${z.label}" to your project`,{description:(Ce==null?void 0:Ce.payloadKind)==="project-created"?`Project created at ${(Ce==null?void 0:Ce.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Ce==null?void 0:Ce.payloadKind)!=="project-created"&&(v(null),y(!1),p(Ge=>Ge+1))}catch(xe){dn.warn("commit failed",xe),Pe.capture("variants_panel.commit_failed",{sessionId:Ae,variantId:z.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:xe instanceof Error?xe.message:String(xe)}),ht.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{K(null)}}},[Ae,p,v,y]),jt=g.useCallback(async(z,oe,Ee)=>{Pe.capture("variants_panel.deploy_clicked",{sessionId:z,variantId:oe,variantLabel:Ee});try{const me=await fetch(`/api/variants/${z}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:oe,...n?{projectPath:n}:{}})});if(!me.ok){const{message:Ge,errorCode:be}=await Ri(me);return dn.warn(`deploy failed: HTTP ${me.status} ${be??""} ${Ge??""}`),Pe.capture("variants_panel.deploy_failed",{sessionId:z,variantId:oe,httpStatus:me.status,errorCode:be??null,errorMessage:Ge??null}),ht.error("Couldn't deploy this direction",{description:Ge??`The server rejected the request (HTTP ${me.status}). Try again.`}),null}const xe=await me.json().catch(()=>null),Ce=xe==null?void 0:xe.shareUrl;return Ce?(await navigator.clipboard.writeText(Ce).catch(()=>{}),Pe.capture("variants_panel.deploy_succeeded",{sessionId:z,variantId:oe}),ht.success(`"${Ee}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Ce,"_blank","noopener")}}),Ce):(ht.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(me){return dn.warn("deploy failed",me),Pe.capture("variants_panel.deploy_failed",{sessionId:z,variantId:oe,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:me instanceof Error?me.message:String(me)}),ht.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),bn=g.useCallback(async z=>{if(!Ae)return;const oe=$[z.workItemId];if(oe){await navigator.clipboard.writeText(oe).catch(()=>{}),ht.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(oe,"_blank","noopener")}});return}K({kind:"deploy",variantId:z.workItemId});try{const Ee=await jt(Ae,z.workItemId,z.label);Ee&&te(me=>({...me,[z.workItemId]:Ee}))}finally{K(null)}},[Ae,$,jt]),Ls=g.useCallback(async()=>{if(!(!Ae||Ie.length===0)){if(it){await navigator.clipboard.writeText(it).catch(()=>{}),ht.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(it,"_blank","noopener")}});return}Pe.capture("variants_panel.deploy_clicked",{sessionId:Ae,variantId:"canvas",variantLabel:"Canvas",variantCount:Ie.length}),K({kind:"deploy-canvas"});try{const z=await fetch(`/api/variants/${Ae}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Ie.map(Ce=>Ce.workItemId),...n?{projectPath:n}:{}})});if(!z.ok){const{message:Ce,errorCode:Ge}=await Ri(z);dn.warn(`canvas deploy failed: HTTP ${z.status} ${Ge??""} ${Ce??""}`),Pe.capture("variants_panel.deploy_failed",{sessionId:Ae,variantId:"canvas",httpStatus:z.status,errorCode:Ge??null,errorMessage:Ce??null,variantCount:Ie.length}),ht.error("Couldn't share this canvas",{description:Ce??`The server rejected the request (HTTP ${z.status}). Try again.`});return}const oe=await z.json().catch(()=>null),Ee=oe==null?void 0:oe.shareUrl;if(!Ee){ht.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const me=Object.fromEntries(((oe==null?void 0:oe.variants)??[]).filter(Ce=>typeof Ce.variantId=="string"&&typeof Ce.shareUrl=="string").map(Ce=>[Ce.variantId,Ce.shareUrl])),xe=Object.keys(me).length>0?{...$,...me}:$;xe!==$&&te(xe),await navigator.clipboard.writeText(Ee).catch(()=>{}),L({key:Zk(Ie,xe),shareUrl:Ee}),Pe.capture("variants_panel.deploy_succeeded",{sessionId:Ae,variantId:"canvas",variantCount:Ie.length}),ht.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Ee,"_blank","noopener")}})}catch(z){dn.warn("canvas deploy failed",z),Pe.capture("variants_panel.deploy_failed",{sessionId:Ae,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:z instanceof Error?z.message:String(z),variantCount:Ie.length}),ht.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{K(null)}}},[it,Ie,$,n,Ae]),Xt=g.useCallback(async z=>{const oe=`${z.sessionId}:${z.variantId}`,Ee=Z[oe];if(Ee){await navigator.clipboard.writeText(Ee).catch(()=>{}),ht.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Ee,"_blank","noopener")}});return}ae(oe);try{const me=await jt(z.sessionId,z.variantId,z.label);me&&ne(xe=>({...xe,[oe]:me}))}finally{ae(null)}},[Z,jt]),rn=g.useCallback(async z=>{if(Ae){Pe.capture("variants_panel.remove_clicked",{sessionId:Ae,variantId:z.workItemId,variantLabelLength:z.label.length}),K({kind:"remove",variantId:z.workItemId});try{const oe=await fetch(`/api/variants/${Ae}/${z.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!oe.ok){const{message:Ee}=await Ri(oe);dn.warn(`remove failed: HTTP ${oe.status} ${Ee??""}`),ht.error("Couldn't remove direction",{description:Ee??`The server rejected the request (HTTP ${oe.status}). Try again.`});return}(z.workItemId===An||z.workItemId===M)&&(A(null),v(null),y(!1),p(Ee=>Ee+1))}catch(oe){dn.warn("remove failed",oe),ht.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{K(null)}}},[Ae,M,An,A,v,y,p]),hs=g.useCallback(async z=>{if(!Je){ht.error("Couldn't remove direction",{description:"No project path available."});return}Pe.capture("variants_panel.remove_past_clicked",{sessionId:z.sessionId,variantId:z.variantId});const oe=`${z.sessionId}:${z.variantId}`,Ee=me=>me.sessionId===z.sessionId&&me.variantId===z.variantId;K({kind:"remove",variantId:oe}),ke(me=>me.filter(xe=>!Ee(xe))),j===oe&&(D(null),v(null),y(!1),p(me=>me+1));try{const me=await fetch(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:Je})});if(!me.ok){const{message:xe}=await Ri(me);ke(Ce=>Ce.some(Ee)?Ce:[...Ce,z]),ht.error("Couldn't remove direction",{description:xe??`The server rejected the request (HTTP ${me.status}). Try again.`})}}catch(me){dn.warn("remove past failed",me),ke(xe=>xe.some(Ee)?xe:[...xe,z]),ht.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{K(null)}},[Je,j,D,v,y,p]),ln=g.useCallback(z=>{X(z)},[]),Qn=g.useCallback(async()=>{if(B)try{B.kind==="active"?await rn(B.variant):await hs(B.entry)}finally{X(null)}},[B,rn,hs]),js=HW(B),ur=(Y==null?void 0:Y.kind)==="remove"&&Y.variantId===js,[to,Qu]=g.useState(null),[b0,Ju]=g.useState(null),S0=g.useCallback(z=>{Ju(z)},[]),mi=g.useCallback(()=>{Ju(null)},[]),_f=g.useCallback(async z=>{const oe=z.trim();if(oe)try{await navigator.clipboard.writeText(oe),ht.success("Copied")}catch{ht.error("Couldn't copy")}},[]),xf=g.useCallback(async(z,oe)=>{Ju(null);const Ee=oe.trim();if(!Ee||z.kind==="original")return;if(z.kind==="active"){if(!Ae||Ee===z.variant.label)return;Pe.capture("variants_panel.rename",{sessionId:Ae,variantId:z.variant.workItemId,labelLength:Ee.length,past:!1});try{const Ce=await fetch(`/api/variants/${Ae}/${z.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ee})});if(!Ce.ok){const{message:Ge}=await Ri(Ce);ht.error("Couldn't rename direction",{description:Ge??`The server rejected the request (HTTP ${Ce.status}). Try again.`})}}catch(Ce){dn.warn("rename failed",Ce),ht.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:me}=z;if(Ee===me.label.trim())return;if(!Je){ht.error("Couldn't rename direction",{description:"No project path available."});return}Pe.capture("variants_panel.rename",{sessionId:me.sessionId,variantId:me.variantId,labelLength:Ee.length,past:!0});const xe=Ce=>Ce.sessionId===me.sessionId&&Ce.variantId===me.variantId;ke(Ce=>Ce.map(Ge=>xe(Ge)?{...Ge,label:Ee}:Ge));try{const Ce=await fetch(`/api/variants/history/${encodeURIComponent(me.sessionId)}/${encodeURIComponent(me.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ee,projectPath:Je})});if(!Ce.ok){const{message:Ge}=await Ri(Ce);ke(be=>be.map(Sn=>xe(Sn)?{...Sn,label:me.label}:Sn)),ht.error("Couldn't rename direction",{description:Ge??`The server rejected the request (HTTP ${Ce.status}). Try again.`})}}catch(Ce){dn.warn("rename failed",Ce),ke(Ge=>Ge.map(be=>xe(be)?{...be,label:me.label}:be)),ht.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Ae,Je]);g.useEffect(()=>{if(Rn.current!==Ae){const oe=Rn.current===null;if(Rn.current=Ae,Hn.current=null,L(null),v(null),y(!1),x(null),O(),A(null),D(null),pe(!1),!oe)return}if(j||le||!An||t.active!==!0||Hn.current===An)return;const z=we.find(oe=>oe.workItemId===An);z&&(Hn.current=An,O(),fi(z))},[Ae,j,le,An,t,we,fi,O,A,D,v,x,y]),g.useEffect(()=>{!N||!je||(Hn.current=null,D(null),A(je.workItemId),pe(!1))},[je,N,Ae,A,D]),g.useEffect(()=>{!N||je||Ye||D(null)},[je,N,Ye,Ae,D,mt]),g.useEffect(()=>{const z=V.trim().toLowerCase(),oe=we.filter(be=>$a(be)&&du(z,be.label,be.runLabel)),Ee=mt.filter(be=>du(z,be.label,be.runLabel,be.brief)),me=xn&&du(z,mx,gx);if(oe.length===0&&Ee.length===0&&!me)return;const xe=[...oe.map(be=>({source:"live",variant:be})),...Ee.map(be=>({source:"past",entry:be})),...me?[{source:"original"}]:[]],Ce=be=>be.source==="live"?`live:${be.variant.workItemId}`:be.source==="past"?`past:${be.entry.sessionId}:${be.entry.variantId}`:y_,Ge=be=>{if(FU())return;if(be.key==="Enter"){const dr=we.find(gi=>gi.workItemId===to);dr&&$a(dr)&&(be.preventDefault(),Os(dr));return}if(be.key!=="ArrowUp"&&be.key!=="ArrowDown")return;be.preventDefault();let cr=An?`live:${An}`:null;j?cr=`past:${j}`:le&&(cr=y_);const Fs=cr?xe.findIndex(dr=>Ce(dr)===cr):-1;let Zr;if(Fs===-1?Zr=be.key==="ArrowDown"?0:xe.length-1:be.key==="ArrowDown"?Zr=Math.min(Fs+1,xe.length-1):Zr=Math.max(Fs-1,0),Zr===Fs)return;const ps=xe[Zr];ps.source==="live"?Os(ps.variant):ps.source==="past"?pi(ps.entry):We();const pn=document.querySelector(`[data-variant-key="${Ce(ps)}"]`);pn instanceof HTMLElement&&pn.focus({preventScroll:!0})};return window.addEventListener("keydown",Ge),()=>window.removeEventListener("keydown",Ge)},[we,mt,V,xn,j,le,An,to,Os,pi,We]);const ec=we.find(z=>z.workItemId===An)??null,gl=j?mt.find(z=>`${z.sessionId}:${z.variantId}`===j)??null:null,tc=!!gl,wf=t.active?t.artifacts??[]:[],nc=t.active?we.filter(z=>z.status!=="cancelled"):[],aa=[...nc.map(z=>({kind:"active",variant:z})),...mt.map(z=>({kind:"past",entry:z})),...xn?[{kind:"original"}]:[]],bf=V.trim().toLowerCase(),It=bf?aa.filter(z=>YW(z,bf)):aa,E0=new Set(we.map(z=>z.requestId).filter(Boolean)),vl=e.filter(z=>!E0.has(z.requestId)),la=vl.length>0,no=r&&!la&&aa.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[aa.length>0?S.jsx("div",{className:"px-3 pt-2 pb-1",children:S.jsxs("div",{className:"relative",children:[S.jsx(gz,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),S.jsx("input",{type:"text",value:V,onChange:z=>W(z.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[la?S.jsx(cG,{groups:vl}):null,no?S.jsx(dG,{}):null,t.active&&nc.length===0&&!la&&!no?S.jsx(fG,{}):null,!t.active&&!la&&!no&&mt.length===0&&!xn?S.jsx(hG,{isMCPSession:f,mcpEditor:h}):null,aa.length>0&&It.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",V.trim(),"”."]}):null,It.length>0?S.jsx(eG,{rows:It,activeVariantId:M??An,activePastKey:j,isOriginalSelected:le,busy:Y,editingKey:b0,onSelectActive:Os,onSelectPast:pi,onSelectOriginal:We,onActivePointerDown:Is,onPastPointerDown:Ms,onHover:Qu,onRemove:z=>ln({kind:"active",variant:z}),onRemovePast:z=>ln({kind:"past",entry:z}),onStartRename:S0,onCommitRename:xf,onCancelRename:mi,onCopyVariantContext:_f,activeSessionId:t.active?t.sessionId:null}):null,t.active&&c?S.jsx(oG,{artifacts:wf}):null]}),tc&&gl?S.jsx(rG,{entry:gl,deploying:ie===j,deployedUrl:j?Z[j]??null:null,onDeploy:Xt,isDeployDisabled:!i}):null,!tc&&t.active?S.jsx(uG,{selectedVariant:ec,busy:Y,onSend:Bt,onDeploy:bn,onDeployCanvas:Ls,canDeploy:i&&(lt==null?void 0:lt.kind)==="fresh",canDeployCanvas:i&&a&&(lt==null?void 0:lt.kind)==="fresh",canSendToAgent:u,canvasVariantCount:Ie.length,canvasDeployedUrl:it,deployedUrl:ec?$[ec.workItemId]??null:null}):null,S.jsx(qW,{target:B,isConfirming:ur,onCancel:()=>X(null),onConfirm:Qn})]})},KW=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.entry.label.trim()||"this direction",qW=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=KW(t);return S.jsx(Xm,{open:!0,onOpenChange:i=>{!i&&!e&&n()},children:S.jsxs(Qm,{children:[S.jsx(Jm,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(e0,{className:"fixed left-1/2 top-1/2 z-max w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(t0,{className:"text-base font-medium text-content",children:"Remove direction?"}),S.jsxs(n0,{className:"text-sm leading-5 text-content-subtle",children:['This removes "',s,'" from the directions list.']}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"rounded-md px-3 py-1.5 text-sm font-medium text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":"Remove direction"})]})]})})]})})},ZW=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:y_,YW=(t,e)=>t.kind==="active"?du(e,t.variant.label,t.variant.runLabel):t.kind==="past"?du(e,t.entry.label,t.entry.runLabel,t.entry.brief):du(e,mx,gx),XW=t=>t.length<=Kk?t:`${t.slice(0,Kk-1)}…`,QW=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,JW=t=>{var r;const e=[t.label.trim(),(r=t.description)==null?void 0:r.trim()].filter(s=>!!s).join(`
|
|
111
|
+
`);if(!t.reference)return e;const n=`Rivet variant: ${t.reference}
|
|
112
|
+
Inspect: rivet variants get ${t.reference}`;return e?`${e}
|
|
113
|
+
|
|
114
|
+
${n}`:n},eG=({rows:t,activeVariantId:e,activePastKey:n,isOriginalSelected:r,busy:s,editingKey:i,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:f,onPastPointerDown:h,onHover:p,onRemove:v,onRemovePast:y,onStartRename:x,onCommitRename:_,onCancelRename:b,onCopyVariantContext:E,activeSessionId:C})=>{const P=g.useRef(null),{activeIndex:T,itemRects:R,sessionRef:O,handlers:M,registerItem:A}=HT(P),N=(s==null?void 0:s.kind)==="switch",D=T!==null?R[T]:null;return S.jsxs("div",{ref:P,className:"relative",onMouseEnter:M.onMouseEnter,onMouseMove:M.onMouseMove,onMouseLeave:M.onMouseLeave,children:[S.jsx(Gi,{children:D&&S.jsx(sl.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:D.top,left:D.left,width:D.width,height:D.height},animate:{opacity:1,top:D.top,left:D.left,width:D.width,height:D.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Vd.fast,opacity:{duration:.08}}},O.current)}),S.jsx("ul",{className:"relative",children:t.map((j,V)=>{const W=ZW(j);let Y=!1;return j.kind==="active"?Y=j.variant.workItemId===e:j.kind==="past"?Y=`${j.entry.sessionId}:${j.entry.variantId}`===n:Y=r,S.jsx(tG,{rowKey:W,row:j,index:V,isSelected:Y,isEditing:i===W,isSwitchInFlight:N,busy:s,registerItem:A,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:f,onPastPointerDown:h,onHover:p,onRemove:v,onRemovePast:y,onStartRename:x,onCommitRename:_,onCancelRename:b,onCopyVariantContext:E,activeSessionId:C},W)})})]})},tG=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isSwitchInFlight:i,busy:a,registerItem:u,onSelectActive:c,onSelectPast:f,onSelectOriginal:h,onActivePointerDown:p,onPastPointerDown:v,onHover:y,onRemove:x,onRemovePast:_,onStartRename:b,onCommitRename:E,onCancelRename:C,onCopyVariantContext:P,activeSessionId:T})=>{var ue,ke;const R=g.useRef(null);hU(u,n,R);const O=e.kind==="active",M=e.kind==="original",A=e.kind==="active"?e.variant:null,N=e.kind==="past"?e.entry:null,D=O?A.status==="succeeded":!0,j=O?$a(A):!0,V=O?oR(A):!1,W=O&&(A.status==="pending"||A.status==="running"),Y=O?D&&(j||V)||W:!0,K=O&&A.status==="failed",B=O&&A.status==="cancelled",X=O&&(!Y||i),$=O&&(a==null?void 0:a.kind)==="remove"&&a.variantId===A.workItemId,te=O&&(((ue=A.refinement)==null?void 0:ue.status)==="pending"||((ke=A.refinement)==null?void 0:ke.status)==="running");let H=mx;O?H=A.label||`Direction ${n+1}`:N&&(H=N.label.trim()||"Untitled direction");let L;O?L=A.runLabel:N&&(L=N.runLabel);let Z=gx;O?Z=A.description:N&&(Z=N.brief);const ne=Z?XW(Z):null,ie=QW(e,T),ae=ie?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:R,"data-proximity-index":n,className:"group relative z-10",children:S.jsx("div",{className:"bg-main-input flex w-full items-start gap-2 rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(nG,{initial:H,onCommit:ee=>E(e,ee),onCancel:C}),ne&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:ne})]})})}):S.jsxs("li",{ref:R,"data-proximity-index":n,className:"group relative z-10",children:[S.jsx("div",{role:"button",tabIndex:Y?0:-1,"data-variant-id":O?A.workItemId:void 0,"data-variant-key":t,onClick:()=>{if(X)return;const ee=window.getSelection();ee&&!ee.isCollapsed||(e.kind==="active"?c(e.variant):e.kind==="past"?f(e.entry):h())},onKeyDown:ee=>{X||(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),ee.stopPropagation(),e.kind==="active"?c(e.variant):e.kind==="past"?f(e.entry):h())},onPointerDown:ee=>{X||(e.kind==="active"?D&&p(e.variant.workItemId,ee):e.kind==="past"&&v(e.entry,ee))},"aria-pressed":Y?r:void 0,"aria-disabled":O?!Y:void 0,"aria-busy":W||te,onMouseEnter:O?()=>y(A.workItemId):void 0,onMouseLeave:O?()=>y(null):void 0,className:ar("focus-visible:ring-content-muted/40 flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors focus:outline-none focus-visible:ring-1",r&&"bg-main-input ring-content-muted/40 ring-1 ring-inset",D&&j&&"cursor-grab active:cursor-grabbing",(W||V)&&"cursor-pointer",!D&&!W&&!V&&"cursor-not-allowed opacity-60",X&&"cursor-not-allowed opacity-50"),style:D?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[(W||te)&&S.jsx(ex,{className:"text-content-muted shrink-0 text-sm","data-testid":te&&!W?"variant-refining":void 0}),S.jsx(Fo,{label:"Double-click to rename",disabled:M,children:S.jsx("span",{onDoubleClick:ee=>{ee.stopPropagation(),M||b(t)},className:ar("min-w-0 flex-1 truncate text-sm font-medium select-text",M?"cursor-default":"cursor-text",D||r?"text-content":"text-content-muted"),children:H})}),K&&S.jsx(Yk,{label:"Failed"}),B&&S.jsx(Yk,{label:"Cancelled"}),L&&S.jsx("span",{className:"ml-auto max-w-[8rem] shrink-0 truncate rounded px-1.5 py-0.5 text-[10px] font-medium opacity-100 transition-opacity duration-150 group-hover:opacity-0 group-has-[:focus-visible]:opacity-0",style:$T(L),children:L})]}),ne&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:ne})]})}),S.jsxs("div",{className:ar("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:[Z||ie?S.jsx(Fo,{label:ae,children:S.jsx("button",{type:"button","aria-label":ae,onClick:ee=>{ee.stopPropagation(),P(JW({label:H,description:Z,reference:ie}))},onPointerDown:ee=>ee.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(Fd,{size:13,weight:"bold"})})}):null,!M&&S.jsx(Fo,{label:"Rename",children:S.jsx("button",{type:"button","aria-label":"Rename direction",onClick:ee=>{ee.stopPropagation(),b(t)},onPointerDown:ee=>ee.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(vz,{size:13,weight:"bold"})})}),!M&&S.jsx(Fo,{label:"Remove",children:S.jsx("button",{type:"button","data-variant-remove-id":e.kind==="active"?e.variant.workItemId:void 0,"aria-label":"Remove direction",disabled:$,onClick:ee=>{ee.stopPropagation(),e.kind==="active"?x(e.variant):_(e.entry)},onPointerDown:ee=>ee.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 ml-1 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(xz,{size:13,weight:"bold"})})})]})]})},nG=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=g.useState(t),i=g.useRef(!1),a=g.useCallback(c=>{c&&(c.focus(),c.select())},[]),u=c=>{i.current||(i.current=!0,c?e(r):n())};return S.jsx("input",{ref:a,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:c=>s(c.target.value),onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"?(c.preventDefault(),u(!0)):c.key==="Escape"&&(c.preventDefault(),u(!1))},onBlur:()=>u(!0),onClick:c=>c.stopPropagation(),onPointerDown:c=>c.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},Yk=({label:t})=>S.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),rG=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const a=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?S.jsx(Fd,{size:12,weight:"bold"}):null,a]})]})},sG={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},iG={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},oG=({artifacts:t})=>{const[e,n]=g.useState(null),r=g.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(a=>a===i?null:i)};return S.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[S.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),S.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>S.jsx(aG,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},aG=({artifact:t,isExpanded:e,onToggle:n})=>{const r=iG[t.kind],s=t.source?sG[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),a=t.kind==="design_context"&&!!t.viewUrl,u=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return a?S.jsx("li",{className:"border-main-border rounded-md border",children:S.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer","aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:S.jsx(fz,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):S.jsxs("li",{className:"border-main-border rounded-md border",children:[S.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":u,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?S.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:S.jsx(lG,{artifact:t})}):null]})},lG=({artifact:t})=>S.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?S.jsx("p",{children:t.summary}):null,t.path?S.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?S.jsx("p",{children:"No inline content available for this artifact."}):null]}),uG=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:u,canvasVariantCount:c,canvasDeployedUrl:f,deployedUrl:h})=>{var M,A,N,D;const p=t?((A=(M=t.actions)==null?void 0:M.commit)==null?void 0:A.enabled)??t.status==="succeeded":!1,v=p&&e===null,y=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),x=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",b=!i||!p||e!==null,E=a&&c>0,P=x?"Deploying…":h?"Copy link":"Share",R=_?"Sharing…":f?"Copy canvas link":"Share canvas",O=y?"Applying…":"Apply to project";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),h?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[S.jsx(U5,{primaryLabel:P,primaryIcon:h&&!x?Fd:void 0,primaryAction:()=>{t&&r(t)},isDisabled:b,isDropdownDisabled:e!==null,isLoading:x,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:E?[{label:R,icon:f&&!_?Fd:void 0,onClick:s,isDisabled:e!==null}]:[]}),u?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!v,title:(D=(N=t==null?void 0:t.actions)==null?void 0:N.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:O}):null]})]})},aR=()=>S.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx(ex,{className:"text-content-muted shrink-0 text-sm"}),S.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),S.jsx("span",{className:"mt-1.5 flex",children:S.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),cG=({groups:t})=>S.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>S.jsx(aR,{},`${e.requestId}-${r}`)))}),dG=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(aR,{},e))}),fG=()=>S.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[S.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),S.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),Xk="Try different ways to create a dropdown that feels fluid and dynamic",hG=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=g.useState(!1),s=VU(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(Xk).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return S.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),S.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),S.jsxs("div",{className:"w-full",children:[S.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),S.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[S.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",Xk,"”"]}),S.jsx("button",{type:"button",onClick:a,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?S.jsx(fT,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(Fd,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},pG=({onClose:t})=>{const e=Qe(qT);return t?S.jsxs("div",{className:"z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b border-main-border bg-main-light px-2.5 py-2.5",children:[e?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):S.jsx("span",{}),S.jsx(Fo,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 text-content-subtle transition-colors hover:bg-main-input hover:text-content",children:S.jsx(yz,{className:"h-4 w-4",weight:"bold"})})})]}):null},mG='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',gG=({itemSelector:t=mG,loop:e=!1}={})=>{const n=g.useRef(null),r=g.useRef(null),s=g.useCallback(a=>{var u;n.current=a,a?r.current=jU():((u=r.current)==null||u.call(r),r.current=null)},[]),i=g.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 f=Array.from(c.querySelectorAll(t));if(f.length===0)return;a.preventDefault(),a.stopPropagation();const h=f.indexOf(document.activeElement),p=f.length-1,v=_=>{if(h===-1)return _===1?0:p;const b=h+_;return e?(b+f.length)%f.length:Math.min(Math.max(b,0),p)};let y;u==="Home"?y=0:u==="End"?y=p:u==="ArrowDown"?y=v(1):y=v(-1),(x=f[y])==null||x.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},Qk="/assets/arena-Db0j1set.png",vG=ds("useIntegrations"),Jk=["integrations"],yG="rivet:connect-result",_G=t=>typeof t=="object"&&t!==null&&t.type===yG,xG=tt(null),wG=()=>{const t=f8(),[e,n]=nP(xG),r=z1({queryKey:Jk,queryFn:async()=>{const u=await fetch("/api/integrations");if(!u.ok)throw new Error(`Failed to load integrations (${u.status})`);return(await u.json()).integrations??[]},staleTime:1e4}),s=g.useCallback(()=>t.invalidateQueries({queryKey:Jk}),[t]),i=g.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 f=await fetch(`/api/integrations/${u}/connect`,{method:"POST"}),h=await f.json().catch(()=>({}));if(!f.ok||!h.authUrl)throw c.close(),new Error(h.error||`Could not connect ${u}`);c.location.href=h.authUrl,await new Promise(p=>{const v=()=>{window.removeEventListener("message",y),clearInterval(x),s(),p()},y=_=>{_G(_.data)&&_.data.provider===u&&(_.data.status==="error"&&vG.warn(`Connect failed for ${u}:`,_.data.message),v())};window.addEventListener("message",y);const x=setInterval(()=>{c.closed&&v()},500)})}finally{n(null)}},[s,n]),a=g.useCallback(async u=>{n(u);try{const c=await fetch(`/api/integrations/${u}`,{method:"DELETE"});if(!c.ok){const f=await c.json().catch(()=>({}));throw new Error(f.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}},fu=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:a="button","data-cy":u})=>{const c=S.jsx("button",{onClick:t,disabled:s,className:i,type:a,"data-cy":u,children:r});return e?S.jsx(px,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:e}),n?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:c}):c},eC=ds("ConnectorsModal"),bG=()=>S.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})}),SG=()=>S.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${Qk})`,maskImage:`url(${Qk})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),EG=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:S.jsx(bG,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:S.jsx(SG,{})}],kG=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const a=(e==null?void 0:e.status)==="connected",u=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return S.jsxs("article",{className:`flex flex-col rounded-xl bg-main-light p-[18px] ${r?"ring-2 ring-secondary":""}`,children:[S.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"mt-4 flex-1",children:[S.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,a?S.jsx(fT,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),S.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),a&&u?S.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:u}):null]}),a?S.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg bg-main-input px-3.5 text-[13px] font-semibold text-content-muted transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):S.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg bg-secondary px-3.5 text-[13px] font-semibold text-secondary-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},__=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:u,connect:c,disconnect:f}=wG(),[h,p]=g.useState(null),v=b=>s.find(E=>E.provider===b),y=g.useCallback(b=>{c(b).catch(E=>{const C=E instanceof Error?E.message:"Could not connect.";eC.warn(`Connect error for ${b}:`,C),ht.error(C)})},[c]),x=g.useCallback(b=>{f(b).catch(E=>{const C=E instanceof Error?E.message:"Could not disconnect.";eC.warn(`Disconnect error for ${b}:`,C),ht.error(C)})},[f]),_=n==="onboarding";return S.jsx(Xm,{open:t,onOpenChange:b=>!b&&e(),children:S.jsxs(Qm,{children:[S.jsx(Jm,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(e0,{ref:p,className:"fixed left-1/2 top-1/2 z-max w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(nR,{value:h,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(t0,{className:"text-base font-medium text-content",children:"Connect design references"}),S.jsx(fu,{onClick:e,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content",children:S.jsx(ET,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(n0,{className:"text-sm text-content-subtle",children:"Connect your design references to use them with Rivet’s MCP."}),a?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:a}):null,S.jsx("div",{className:"grid grid-cols-2 gap-4",children:EG.map(b=>S.jsx(kG,{meta:b,integration:v(b.provider),isPending:i||u===b.provider,isHighlighted:r===b.provider,onConnect:()=>y(b.provider),onDisconnect:()=>x(b.provider)},b.provider))}),_?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-xs text-content-subtle",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push flex-none rounded-lg bg-secondary px-3.5 py-2 text-[13px] font-medium text-secondary-foreground transition-colors hover:bg-accent",children:"Skip for now"})]}):null]})]})})]})})},tC=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),CG=ds("SupportTicketModal"),nC=5e3,d1="feedback",PG=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},TG=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=PG(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=nL(),[s,i]=g.useState(""),[a,u]=g.useState(!1),[c,f]=g.useState(null),h=g.useCallback(()=>{i("")},[]),p=g.useCallback(()=>{a||(h(),e())},[a,e,h]),v=g.useCallback(async()=>{const b=s.trim();if(!(!b||a)){u(!0);try{const E=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:d1,message:b,contactEmail:P||void 0,metadata:{posthogSessionId:E??void 0,posthogDistinctId:C??void 0,appVersion:"0.13.5",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!T.ok){const R=await TG(T);throw new Error(R)}r==null||r.capture("support_ticket_submitted",{ticket_type:d1,has_posthog_session_id:!!E}),ht.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(E){const C=E instanceof Error?E.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:d1,error:C}),CG.error("Failed to submit support ticket:",C),ht.error("Could not send feedback",{description:C})}finally{u(!1)}}},[n,a,s,e,r,h]),y=g.useCallback(b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),v())},[v]),x=nC-s.length,_=a||s.trim().length===0;return S.jsx(Xm,{open:t,onOpenChange:b=>!b&&p(),children:S.jsxs(Qm,{children:[S.jsx(Jm,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(e0,{ref:f,className:"fixed left-1/2 top-1/2 z-max w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(nR,{value:c,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(t0,{className:"text-base font-medium text-content",children:"Send feedback"}),S.jsx(fu,{onClick:p,disabled:a,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(ET,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(n0,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"rounded-lg bg-main-input outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:b=>i(b.target.value),onKeyDown:y,maxLength:nC,rows:6,disabled:a,placeholder:"What happened?",className:"max-h-64 w-full resize-none overflow-y-auto bg-transparent pb-1 pl-3 pr-3 pt-3 text-sm text-content placeholder-content-subtle focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[S.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[x<=500&&S.jsx("span",{className:"text-xs text-content-subtle",children:x}),S.jsx(fu,{onClick:v,disabled:_,title:"Send feedback",shortcut:"⌘↵",className:"flex items-center justify-center rounded bg-primary p-1 text-content transition-colors hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-80",children:a?S.jsx(r0,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(hz,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},AG=ds("ProfileAvatar"),lR=(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):""},IG=(t,e)=>lR(t,e).charAt(0).toUpperCase(),MG=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=Qe(YT),i=Qe(n5),a=Qe(t5),[u,c]=g.useState(!1),[f,h]=g.useState(!1),[p,v]=g.useState(!1),[y,x]=g.useState(!1),{containerRef:_,onKeyDown:b}=gG(),E=Qe(pf),C=IG(r,s);if(!C)return E?S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(tC,{className:"h-7 w-7 rounded-full"}),S.jsx(tC,{className:"h-3 w-16"})]}):null;const P=lR(r,s),T=(r==null?void 0:r.trim())||null,R=(s==null?void 0:s.trim())||null,O=async()=>{x(!0);try{const M=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!M.ok)throw new Error(`Logout failed: ${M.status}`)}catch(M){AG.warn("Logout request failed",M),ht.error("Could not log out. Please try again."),x(!1);return}window.location.reload()};return S.jsxs(S.Fragment,{children:[S.jsxs(V5,{open:u,onOpenChange:c,children:[S.jsx($5,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account",className:`flex shrink-0 select-none items-center gap-2 text-content-muted transition-colors hover:text-content ${t}`,children:[S.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-main-border bg-main-input text-[11px] font-semibold leading-none",children:C}),P?S.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:P}):null]})}),S.jsx(H5,{children:S.jsxs(z5,{ref:_,onKeyDown:b,role:"menu",className:"z-[60] min-w-[180px] rounded-lg bg-surface-2 p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[T||R?S.jsxs("div",{className:"border-b border-main-border px-3 py-2",children:[T?S.jsx("div",{className:"truncate text-xs font-medium text-content",children:T}):null,R?S.jsx("div",{className:"truncate text-[11px] text-content-muted",children:R}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),h(!0)},disabled:!i||a,className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(wT,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),v(!0)},className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none",children:[S.jsx(mz,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:O,disabled:y,className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(_z,{className:"h-3.5 w-3.5",weight:"bold"}),y?"Logging out…":"Log out"]})]})})]}),S.jsx(__,{isOpen:f,onClose:()=>h(!1)}),S.jsx(RG,{isOpen:p,onClose:()=>v(!1),contactEmail:s??void 0})]})},NG=({onClose:t})=>S.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[S.jsx(pG,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(GW,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:S.jsx(MG,{side:"top",align:"start"})})]}),OG=ds("useServerConfig"),DG=()=>{const[t,e]=g.useState(null),[n,r]=g.useState(!0),[s,i]=g.useState(null),a=g.useCallback(async()=>{var u;try{r(!0),i(null);const c=await fetch("/api/health");if(!c.ok)throw new Error(`Failed to fetch config: ${c.status}`);const f=await c.json();if(!f.framework)throw new Error("Server did not return framework information");const h={userPort:((u=f.ports)==null?void 0:u.userDevServer)||3e3,framework:f.framework};return e(h),h}catch(c){const f=c instanceof Error?c.message:"Failed to fetch server config";throw i(f),OG.warn("Error fetching server config:",c),c}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},LG="#1C1C20",Ai=[118,118,124],rC=.85,jG=3,FG=.15,Jh=36,VG=4.4,$G=.7,HG=3.5,zG=.8,sC=9,UG=11,BG=[1.35,1.12,.95,.85],WG=[0,1.1,2.3,3.1],GG=[0,.35,.16,.13],KG=[.9,.5,.4,.35],Aa=3,f1=[[{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}]],ep=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},Ep=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Ia=(t,e)=>(Math.round(t/e-.5)+.5)*e,qG=Math.sin(Math.PI/3),iC=(t,e,n,r,s)=>{if(t.beginPath(),e===0)t.arc(n,r,s,0,Math.PI*2);else if(e===1){const i=s*qG;t.moveTo(n,r-s),t.lineTo(n+i,r+s/2),t.lineTo(n-i,r+s/2),t.closePath()}else{const i=s*.85;t.rect(n-i,r-i,i*2,i*2)}t.fill()},ZG=(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)-sC}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)-sC}return Ep(.5-r/(2*UG))},uR=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=st(ZT),r=g.useRef(null),s=g.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=[],f=0,h=0,p=Jh,v=Jh,y=null,x=null,_=0,b=-1;const E=new Array(33),C=j=>{const V=Math.round(j*32);let W=E[V];if(!W){const Y=V/32,K=Math.round(Ai[0]+(255-Ai[0])*Y),B=Math.round(Ai[1]+(255-Ai[1])*Y),X=Math.round(Ai[2]+(255-Ai[2])*Y);W=`rgba(${K}, ${B}, ${X}, ${rC})`,E[V]=W}return W},P=j=>{const V=1-.35*j,W=Math.round(Ai[0]*V),Y=Math.round(Ai[1]*V),K=Math.round(Ai[2]*V);return`rgba(${W}, ${Y}, ${K}, ${rC})`},T=j=>{let V=Math.floor(Math.random()*f1.length);V===b&&(V=(V+1)%f1.length),b=V;const W=[0,0,0,0],Y=f1[V].map((L,Z)=>{const ne=L.level,ie=W[ne]++,ae=WG[ne]+ie*GG[ne],ue=KG[ne]+ep(V*131+Z*17+5)*.2;if(L.hline){const le=Ia((L.y??0)*h,v);return{hline:!0,x1:Ia(L.x1*f,p),x2:Ia(L.x2*f,p),y1:le,y2:le,level:ne,start:ae,dur:ue}}const ke=Ia(L.x1*f,p),ee=Ia((L.y1??0)*h,v);return{hline:!1,x1:ke,y1:ee,x2:Math.max(Ia(L.x2*f,p),ke+p),y2:Math.max(Ia((L.y2??0)*h,v),ee+v),level:ne,start:ae,dur:ue}}),K=Y.reduce((L,Z)=>Math.max(L,Z.start+Z.dur),0),B=c.length,X=new Float32Array(B*Aa),$=new Int16Array(B*Aa).fill(-1),te=new Uint8Array(B),H=Y[0];for(let L=0;L<B;L++){const Z=c[L];Z.x>H.x1&&Z.x<H.x2&&Z.y>H.y1&&Z.y<H.y2&&(te[L]=1);const ne=L*Aa;for(let ie=0;ie<Y.length;ie++){const ae=ZG(Z.x,Z.y,Y[ie]);if(ae<=.02)continue;let ue=ne;for(let ke=ne;ke<ne+Aa;ke++){if($[ke]===-1){ue=ke;break}X[ke]<X[ue]&&(ue=ke)}($[ue]===-1||ae>X[ue])&&(X[ue]=ae,$[ue]=ie)}}return{startT:j,buildEnd:K,els:Y,frame:H,cellQ:X,cellEl:$,inFrame:te}},R=()=>{const j=i.getBoundingClientRect();f=Math.max(1,j.width),h=Math.max(1,j.height);const V=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(f*V),i.height=Math.round(h*V),a.setTransform(V,0,0,V,0,0);const W=Math.max(8,Math.round(f/Jh)),Y=Math.max(6,Math.round(h/Jh));p=f/W,v=h/Y,c=[];for(let K=0;K<Y;K++){const B=Y>1?K/(Y-1):.5,X=VG*(1+$G*.4*(B*2-1));for(let $=0;$<W;$++){const te=K*8191+$*131+1,H={x:($+.5)*p,y:(K+.5)*v,size:X,seed:te,phase:ep(te),kind:0};H.kind=Math.floor(ep(te*97)*3),c.push(H)}}x=null,y=null},O=new Float32Array(32),M=j=>{a.fillStyle=LG,a.fillRect(0,0,f,h),y||(y=T(j+.2)),j>=y.startT+y.buildEnd+HG&&(x=y,_=j,y=T(j+.2));let V=0;x&&(V=1-Ep((j-_)/zG),V<=0&&(x=null));const W=y;for(let H=0;H<W.els.length;H++){const L=W.els[H];O[H]=Ep(Math.min(1,Math.max(0,(j-W.startT-L.start)/L.dur)))}const Y=O[0],K=P(0),B=P(Y),X=V>0?P(V):K,$=V>0?P(Math.max(Y,V)):B,te=c.length;for(let H=0;H<te;H++){const L=c[H];let Z=0,ne=0;const ie=H*Aa;for(let we=ie;we<ie+Aa;we++){const Ie=W.cellEl[we];if(Ie<0)break;const qe=W.cellQ[we]*O[Ie];qe>Z&&(Z=qe,ne=W.els[Ie].level)}if(x)for(let we=ie;we<ie+Aa;we++){const Ie=x.cellEl[we];if(Ie<0)break;const qe=x.cellQ[we]*V;qe>Z&&(Z=qe,ne=x.els[Ie].level)}const ae=j/jG+L.phase,ue=Math.floor(ae),ke=ae-ue,ee=Ep(Math.min(ke,1-ke)/FG),le=Math.floor(ep(L.seed*97+ue*7919)*3);le!==L.kind&&Z<.02&&ee<.05&&(L.kind=le);const pe=Math.max(ee*(1-Z),Z);if(!(pe<.01))if(Z<.02){const we=W.inFrame[H]===1,Ie=x?x.inFrame[H]===1:!1;we?a.fillStyle=Ie?$:B:a.fillStyle=Ie?X:K;const qe=Math.max(we?Y:0,Ie?V:0);iC(a,L.kind,L.x,L.y,L.size*pe*(1-.2*qe))}else{a.fillStyle=C(Z);const we=1+(BG[ne]-1)*Z;iC(a,L.kind,L.x,L.y,L.size*pe*we)}}};R();let A=0;if(u)y=T(-100),M(0);else{const j=performance.now(),V=W=>{M((W-j)/1e3),A=requestAnimationFrame(V)};A=requestAnimationFrame(V)}const N=new ResizeObserver(()=>{R(),u&&(y=T(-100),M(0))});N.observe(i),r.current=()=>{cancelAnimationFrame(A),N.disconnect(),e&&n(j=>j-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},YG=async(t=null)=>{if(t)return XG(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return tp();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable"};let r;try{r=await e.json()}catch{return tp()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable"}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable"}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable"}:tp()},XG=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable"}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}},tp=async()=>{try{const t=await fetch("/");return{isOk:t.status!==502&&t.status!==503,unavailableReason:"upstream_unreachable"}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}},oC=ds("usePreviewUpstreamHealth"),QG=500,JG=4e3,eK=15e3,tK=(t,e={})=>{const n=g.useRef(null),r=g.useRef(null),s=e.probeMsWhileDown??QG,i=e.probeMsWhileUp??JG,a=e.firstUnreachableCaptureAfterMs??eK,u=e.rerunProbeImmediatelyOnVersion,c=e.probePath??null,f=e.skip??!1,[h,p]=g.useState(t==="static"),[v,y]=g.useState(0),[x,_]=g.useState(null),[b,E]=g.useState(0),[C,P]=g.useState(!1),[T,R]=g.useState(!1),[O,M]=g.useState(t==="static"?null:"upstream_unreachable");return g.useEffect(()=>{if(t==="static"){p(!0),_(null),E(0),P(!1),R(!0),M(null);return}if(f){p(!1),_(null),E(0),P(!1),R(!0),M("upstream_unreachable"),n.current=null;return}let A=!0;const N=Date.now();_(N),E(0),P(!1),p(!1),R(!1),M("upstream_unreachable");const D={current:!1},j={current:!1},V={current:!1},W={current:null},Y={current:!1};let K=null;const B=()=>{V.current||(V.current=!0,A&&R(!0))},X=()=>{K!==null&&(clearTimeout(K),K=null)},$=(H,L)=>{X(),K=setTimeout(L,H)},te=async()=>{if(!A)return;E(ie=>ie+1);const{isOk:H,unavailableReason:L}=await YG(c);if(!A)return;if(B(),H){const ie=!Y.current;Y.current=!0,p(!0),M(null),W.current=null,j.current=!1,P(!1),D.current?ie&&(Pe==null||Pe.capture("preview_upstream_restored",{framework:t})):(D.current=!0,Pe==null||Pe.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-N})),$(i,te);return}const Z=Y.current;Y.current=!1,p(!1),M(L),W.current===null&&(W.current=Date.now(),j.current=!1,P(!1)),Z&&(Pe==null||Pe.capture("preview_upstream_lost",{framework:t}),y(ie=>ie+1),oC.warn("Preview upstream became unavailable after it was ready"));const ne=Date.now()-W.current;ne>=a&&!j.current&&(j.current=!0,P(!0),Pe==null||Pe.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:ne}),oC.warn("Dev server did not become ready within timeout window")),$(s,te)};return n.current=()=>$(0,te),$(0,te),()=>{A=!1,n.current=null,X()}},[t,s,i,a,c,f]),g.useEffect(()=>{var N;if(t==="static"||u===void 0)return;const A=r.current;r.current=u,A!==null&&A!==u&&((N=n.current)==null||N.call(n))},[t,u]),{isUpstreamReady:h,iframeRemountKey:v,probeStartedAt:x,probeAttemptCount:b,isFirstUnreachableWindowExceeded:C,initialProbeComplete:T,unavailableReason:O}};function nK(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const cR=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}`},dR=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${cR(t)}${e}`:e,rK="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",sK=t=>rK,iK=ds("PreviewSurface"),aC=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",fR=({target:t,src:e,framework:n,remountKey:r})=>(Qe(s0),S.jsx("div",{className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:sK(),onLoad:()=>{Pe==null||Pe.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Pe==null||Pe.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:aC(e,t),framework:n}))},onError:()=>{Pe==null||Pe.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Pe==null||Pe.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:aC(e,t),framework:n})),iK.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),oK="modulepreload",aK=function(t){return"/"+t},lC={},lK=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const 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(f=>{if(f=aK(f),f in lC)return;lC[f]=!0;const h=f.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":oK,h||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),h)return new Promise((y,x)=>{v.addEventListener("load",y),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}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)})},uK=g.lazy(()=>lK(()=>Promise.resolve().then(()=>Hq),void 0)),cK={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"},dK={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},fK={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"},_d=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:u="md",children:c,state:f,role:h="status",busy:p=!1,className:v=""})=>{const y=g.useCallback(_=>{_&&f&&(Pe==null||Pe.capture("status_surface_shown",{state:f,tone:i,fill:a}))},[f,i,a]),x=!!(e||n||r||c||s!=null&&s.length);return S.jsxs("div",{ref:y,className:`${cK[a]} ${v}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":f,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,x?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:dK[u],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>S.jsx("button",{type:"button",onClick:_.onClick,className:fK[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},x_=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(_d,{...r,size:n,busy:!0,backdrop:S.jsx(uR,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(_d,{...r,size:n,busy:!0,backdrop:S.jsx(g.Suspense,{fallback:null,children:S.jsx(uK,{className:"absolute inset-0"})})}):S.jsx(_d,{...r,size:n,busy:!0,media:S.jsx(r0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),hR=({icon:t,...e})=>S.jsx(_d,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),km=t=>S.jsx(_d,{...t,tone:"error",role:"alert"}),uC="/static/",hK=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(uC)}catch{return t.endsWith(uC)}},pK=({isInteractionDisabled:t=!1,framework:e,userPort:n,activeDemoSessionId:r=null,holdPreviewNavigation:s=!1})=>{const i=Qe(l_),a=st(l_),u=Qe(xm),c=st(xm),f=Qe(hf),h=Qe(s0),p=Qe(u_),v=Qe(c_),y=Qe(XT),x=Qe(QT),_=st(c_),b=Qe(Zo),E=Qe(f_),C=st(u_),P=f.active&&f.projectContext.kind==="fresh",T=Qe(d_),R=f.active?f.variants.find(je=>je.workItemId===T&&(je.status==="pending"||je.status==="running"||je.status==="succeeded"&&!je.preview&&typeof je.port!="number"&&(!je.previewUnavailable||je.previewUnavailable.reason==="idle_timeout")))??null:null,O=f.active&&f.variants.some(je=>je.status==="pending"||je.status==="running"),M=P||O,A=f.active?f.variants.find(je=>{var Ye;return je.workItemId===T&&je.status==="succeeded"&&!!je.previewUnavailable&&((Ye=je.previewUnavailable)==null?void 0:Ye.reason)!=="idle_timeout"})??null:null,N=e==="static"&&u!==null&&hK(u);g.useEffect(()=>{f.active||C(!1)},[f.active,C]);const D=g.useRef(!1);g.useEffect(()=>{const je=!!(b!=null&&b.left||b!=null&&b.right),Ye=je&&!D.current;D.current=je;const lt=f.active?f.sessionId:null;!lt||!nK({enteringSplit:Ye,isExistingSession:f.active&&f.projectContext.kind==="existing",hasActiveVariantProxy:p&&v!==null})||(C(!1),_(null),a(Je=>Je+1),fetch(`/api/variants/${encodeURIComponent(lt)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[b,f,p,v,C,_,a]);const V=g.useMemo(()=>{var xn;if(p||u&&!N||!f.active)return null;const{stage:je,variants:Ye}=f,lt=je==="ready"||je==="degraded",Je=Ye.some(Ut=>{var Rn,Hn;return((Rn=Ut.refinement)==null?void 0:Rn.status)==="pending"||((Hn=Ut.refinement)==null?void 0:Hn.status)==="running"});if(!lt&&!Je)return null;const vt=Ye.find(Ut=>{var Rn;return Ut.status==="succeeded"&&((Rn=Ut.preview)==null?void 0:Rn.kind)==="static_artifact"});return((xn=vt==null?void 0:vt.preview)==null?void 0:xn.kind)==="static_artifact"?vt.preview.url:null},[N,u,p,f])??u,W=g.useMemo(()=>!f.active||!V?null:f.variants.find(je=>{var Ye;return((Ye=je.preview)==null?void 0:Ye.kind)==="static_artifact"&&V.startsWith(je.preview.url)})??null,[V,f]),Y=g.useMemo(()=>{if((E==null?void 0:E.previewKind)==="static")return{kind:"variant",sessionId:E.sessionId,variantId:E.variantId};if(!f.active)return _m;if(W)return{kind:"variant",sessionId:f.sessionId,variantId:W.workItemId};if(V){const Ye=V.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),lt=Ye!=null&&Ye[1]?decodeURIComponent(Ye[1]):null,Je=Ye!=null&&Ye[2]?decodeURIComponent(Ye[2]):null;if(lt===f.sessionId&&Je&&f.variants.some(Ut=>Ut.workItemId===Je))return{kind:"variant",sessionId:f.sessionId,variantId:Je};const vt=V.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),xn=vt!=null&&vt[1]?decodeURIComponent(vt[1]):null;if(xn&&f.variants.some(Ut=>Ut.workItemId===xn))return{kind:"variant",sessionId:f.sessionId,variantId:xn}}const je=!!(b!=null&&b.left||b!=null&&b.right);return(!je||P)&&!V&&p&&v&&f.variants.some(Ye=>Ye.workItemId===v)?{kind:"variant",sessionId:f.sessionId,variantId:v}:(!je||P)&&!V&&T&&f.variants.some(Ye=>Ye.workItemId===T)?{kind:"variant",sessionId:f.sessionId,variantId:T}:_m},[E,W,f,p,v,V,b,P,T]),K=g.useRef(null);g.useEffect(()=>{var Je,vt;if(!W||((Je=W.preview)==null?void 0:Je.kind)!=="static_artifact"||((vt=W.refinement)==null?void 0:vt.status)!=="succeeded")return;const je=`${W.workItemId}:${W.refinement.workItemId}`;if(K.current===je)return;K.current=je;const Ye=W.preview.url.includes("?")?"&":"?",lt=`${W.preview.url}${Ye}refinement=${encodeURIComponent(W.refinement.workItemId)}`;V!==lt&&(c(lt),a(xn=>xn+1))},[V,W,a,c,f]);const B=V!==null&&VW(V),X=V!==null&&!B||P&&!p&&!B,{isUpstreamReady:$,iframeRemountKey:te,probeAttemptCount:H,initialProbeComplete:L}=tK(e,{rerunProbeImmediatelyOnVersion:i,probePath:B?V:null,skip:X}),[Z,ne]=g.useState(()=>y&&$?i:null),ie=g.useRef(null);g.useEffect(()=>{if(!y){ie.current=null,ne(null);return}if(Z===i){ie.current=null;return}const je=ie.current;if(!je||je.remountKey!==i){ie.current={remountKey:i,probeAttemptCount:H};return}$&&H>je.probeAttemptCount&&(ie.current=null,ne(i))},[Z,i,y,H,$]);const ue=V!==null&&!B||$,ee=x||y&&Z!==i||y&&!ue,le=`${te}:${i}`,pe=r?`/try/${encodeURIComponent(r)}`:"",we=sR(window.location.pathname),Ie=e==="static"?`${pe}/static${we??"/"}`:`${pe}${we??"/"}`,qe=cR(h);let it=null;V&&(it=dR({agentApplyMode:h,url:V}));const at=R||ee?"about:blank":(B&&!ue?"about:blank":it)??(s||!ue?"about:blank":`${qe}${Ie}`),At=!!R||!!A||!ue&&L;let mt=null;return ee?mt=S.jsx(x_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):R?mt=S.jsx(x_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})}):A?mt=S.jsx(km,{fill:"overlay",state:"preview_unavailable",title:"Preview couldn’t start",description:"Its preview server didn’t start.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}):At&&(mt=M?S.jsx(hR,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(km,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),S.jsxs("div",{className:"relative h-full w-full",children:[mt,S.jsx(fR,{target:Y,src:at,framework:e,remountKey:le})]})};function cC({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var E;const u=st(Zo),c=Qe(hf),f=Qe(s0),h=g.useRef(!1),p=g.useCallback(()=>{h.current||(h.current=!0,Kd({source:i,sessionId:e,variantId:n}))},[i,e,n]),v=g.useCallback(()=>{if(a){u(null);return}p(),u(C=>{if(!C)return null;const P={...C};return delete P[t],P.left||P.right?P:null})},[u,t,a,p]),y=g.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=g.useMemo(()=>!c.active||c.sessionId!==e?null:c.variants.find(C=>C.workItemId===n)??null,[e,n,c]),_=g.useMemo(()=>{var P,T;let C=r;if(((P=x==null?void 0:x.preview)==null?void 0:P.kind)==="static_artifact"&&((T=x.refinement)==null?void 0:T.status)==="succeeded"){const R=x.preview.url.includes("?")?"&":"?";C=`${x.preview.url}${R}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return dR({agentApplyMode:f,url:C})},[f,x,r]),b=((E=x==null?void 0:x.refinement)==null?void 0:E.status)==="succeeded"?`${n}:${x.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(Fo,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:v,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(fR,{target:y,src:_,framework:"static",remountKey:b})})]})}const dC=240;function mK(){const t=Qe(Ud),e=Qe(J2),n=g.useRef(null);return g.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-dC/2,s=e.y-22;n.current.style.transform=`translate3d(${r}px, ${s}px, 0)`},[t,e]),!t||!e?null:S.jsx("div",{ref:n,"aria-hidden":"true",className:"variant-drag-ghost",style:{width:dC},children:S.jsxs("div",{className:"variant-drag-ghost-body",children:[S.jsxs("div",{className:"variant-drag-ghost-row",children:[S.jsx("div",{className:"variant-drag-ghost-title",children:t.label}),t.runLabel?S.jsx("div",{className:"variant-drag-ghost-tag",style:$T(t.runLabel),children:t.runLabel}):null]}),t.description?S.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function gK(){const t=Qe(Ud),e=Qe(J2),n=Qe(Zo),r=st(Ud),s=st(Zo),i=g.useRef(null),[a,u]=g.useState(null),[c,f]=g.useState("hidden");g.useEffect(()=>{if(!t){f("hidden"),u(null);return}const v=requestAnimationFrame(()=>f("visible"));return()=>cancelAnimationFrame(v)},[t]);const h=g.useCallback((v,y)=>{const x=i.current;if(!x)return null;const _=x.getBoundingClientRect();return v<_.left||v>_.right||y<_.top||y>_.bottom?null:v<(_.left+_.right)/2?"left":"right"},[]);if(g.useEffect(()=>{if(!t||!e)return;const v=h(e.x,e.y);u(y=>y===v?y:v)},[t,e,h]),g.useEffect(()=>{if(!t)return;const v=y=>{const x=h(y.clientX,y.clientY);if(x&&t.url){const _={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[x];b&&(b.sessionId!==_.sessionId||b.variantId!==_.variantId)&&Kd(b),s(E=>({...E??{},[x]:_})),f("exiting"),window.setTimeout(()=>r(null),220)}else Kd(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v),()=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v)}},[t,h,r,s,n]),!t)return null;const p=["variant-drop-zones",c==="visible"&&"is-visible",c==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:i,className:p,"aria-hidden":"true",children:[S.jsx(fC,{side:"left",hovered:a==="left",canDrop:!!t.url,label:t.label}),S.jsx(fC,{side:"right",hovered:a==="right",canDrop:!!t.url,label:t.label})]})}function fC({side:t,hovered:e,canDrop:n,label:r}){return S.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[S.jsxs("div",{className:"variant-drop-zone-inner",children:[S.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),S.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),S.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:S.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),S.jsx("div",{className:"variant-drop-zone-border"})]})}const pR=(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)}`},hC=(t,e)=>{if(!t)return;const n=pR(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},vK=()=>S.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:S.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:S.jsx(uR,{trackGlobalLoaderCount:!1})})}),yK=({isLoading:t=!1,isInteractionDisabled:e=!1,activeDemoSessionId:n=null,holdHostedTryoutPreviewNavigation:r=!1})=>{const{config:s,fetchConfig:i,isLoading:a,error:u}=DG();return g.useEffect(()=>{i().catch(c=>{Pe==null||Pe.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error"})})},[i]),a?r?S.jsx("div",{className:"bg-main flex h-full min-h-0 w-full flex-1","aria-busy":"true"}):S.jsx(vK,{}):u||!s?S.jsx(km,{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:()=>{Pe==null||Pe.capture("preview_config_retry_clicked"),i().catch(c=>{Pe==null||Pe.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error"})})}}]}):S.jsx(_K,{isLoading:t,isInteractionDisabled:e,framework:s.framework,userPort:s.userPort,activeDemoSessionId:n,holdHostedTryoutPreviewNavigation:r})};function _K(t){const e=Qe(Zo),n=Qe(Ud),r=Qe(hf),s=Qe(xm),i=e==null?void 0:e.left,a=e==null?void 0:e.right,u=g.useMemo(()=>{var R,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const _=(R=i??a)==null?void 0:R.variantId,b=r.variants.filter(M=>{var A;return M.status==="succeeded"&&((A=M.preview)==null?void 0:A.kind)==="static_artifact"&&M.workItemId!==_}),E=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),P=b.find(M=>{var A;return((A=M.preview)==null?void 0:A.kind)==="static_artifact"&&M.preview.url===E})??b[0];if(((O=P==null?void 0:P.preview)==null?void 0:O.kind)!=="static_artifact")return;const T=pR(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=hC(i,r)??(a?u:void 0),f=hC(a,r)??(i?u:void 0),h=!i&&!!c,p=!a&&!!f,v=!!(c||f),y=S.jsx(pK,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort,activeDemoSessionId:t.activeDemoSessionId,holdPreviewNavigation:t.holdHostedTryoutPreviewNavigation});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${v?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&S.jsx(cC,{side:"left",sessionId:c.sessionId,variantId:c.variantId,url:c.url,label:c.label,source:c.source,isFallback:h},`left-${c.sessionId}:${c.variantId}:${c.url}`),!(c&&f)&&S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:y}),f&&S.jsx(cC,{side:"right",sessionId:f.sessionId,variantId:f.variantId,url:f.url,label:f.label,source:f.source,isFallback:p},`right-${f.sessionId}:${f.variantId}:${f.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(gK,{}),S.jsx(mK,{})]})})}const mR=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(r0,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,S.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]});function ji(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gR(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
115
|
+
* GSAP 3.15.0
|
|
116
|
+
* https://gsap.com
|
|
117
|
+
*
|
|
118
|
+
* @license Copyright 2008-2026, GreenSock. All rights reserved.
|
|
119
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
120
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
121
|
+
*/var Gr={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},qd={duration:.5,overwrite:!1,delay:0},vx,Vn,zt,as=1e8,St=1/as,w_=Math.PI*2,xK=w_/4,wK=0,vR=Math.sqrt,bK=Math.cos,SK=Math.sin,Tn=function(e){return typeof e=="string"},nn=function(e){return typeof e=="function"},Xi=function(e){return typeof e=="number"},yx=function(e){return typeof e>"u"},di=function(e){return typeof e=="object"},kr=function(e){return e!==!1},_x=function(){return typeof window<"u"},np=function(e){return nn(e)||Tn(e)},yR=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Zn=Array.isArray,EK=/random\([^)]+\)/g,kK=/,\s*/g,pC=/(?:-?\.?\d|\.)+/gi,_R=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,iu=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,h1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,xR=/[+-]=-?[.\d]+/,CK=/[^,'"\[\]\s]+/gi,PK=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,qt,qs,b_,xx,Kr={},Cm={},wR,bR=function(e){return(Cm=Hu(e,Kr))&&Rr},wx=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Zd=function(e,n){return!n&&console.warn(e)},SR=function(e,n){return e&&(Kr[e]=n)&&Cm&&(Cm[e]=n)||Kr},Yd=function(){return 0},TK={suppressEvents:!0,isStart:!0,kill:!1},kp={suppressEvents:!0,kill:!1},RK={suppressEvents:!0},bx={},Uo=[],S_={},ER,Vr={},p1={},mC=30,Cp=[],Sx="",Ex=function(e){var n=e[0],r,s;if(di(n)||nn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Cp.length;s--&&!Cp[s].targetTest(n););r=Cp[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new GR(e[s],r)))||e.splice(s,1);return e},ol=function(e){return e._gsap||Ex(ls(e))[0]._gsap},kR=function(e,n,r){return(r=e[n])&&nn(r)?e[n]():yx(r)&&e.getAttribute&&e.getAttribute(n)||r},Cr=function(e,n){return(e=e.split(",")).forEach(n)||e},an=function(e){return Math.round(e*1e5)/1e5||0},Kt=function(e){return Math.round(e*1e7)/1e7||0},hu=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},AK=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Pm=function(){var e=Uo.length,n=Uo.slice(0),r,s;for(S_={},Uo.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},kx=function(e){return!!(e._initted||e._startAt||e.add)},CR=function(e,n,r,s){Uo.length&&!Vn&&Pm(),e.render(n,r,!!(Vn&&n<0&&kx(e))),Uo.length&&!Vn&&Pm()},PR=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(CK).length<2?n:Tn(e)?e.trim():e},TR=function(e){return e},qr=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},IK=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},Hu=function(e,n){for(var r in n)e[r]=n[r];return e},gC=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=di(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Tm=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},xd=function(e){var n=e.parent||qt,r=e.keyframes?IK(Zn(e.keyframes)):qr;if(kr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},MK=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},RR=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},g0=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},Qo=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},al=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},NK=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},E_=function(e,n,r,s){return e._startAt&&(Vn?e._startAt.revert(kp):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},OK=function t(e){return!e||e._ts&&t(e.parent)},vC=function(e){return e._repeat?zu(e._tTime,e=e.duration()+e._rDelay)*e:0},zu=function(e,n){var r=Math.floor(e=Kt(e/n));return e&&r===e?r-1:r},Rm=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},v0=function(e){return e._end=Kt(e._start+(e._tDur/Math.abs(e._ts||e._rts||St)||0))},y0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Kt(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),v0(e),r._dirty||al(r,e)),e},AR=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Rm(e.rawTime(),n),(!n._dur||vf(0,n.totalDuration(),r)-n._tTime>St)&&n.render(r,!0)),al(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=-St}},ti=function(e,n,r,s){return n.parent&&Qo(n),n._start=Kt((Xi(r)?r:r||e!==qt?rs(e,r,n):e._time)+n._delay),n._end=Kt(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),RR(e,n,"_first","_last",e._sort?"_start":0),k_(n)||(e._recent=n),s||AR(e,n),e._ts<0&&y0(e,e._tTime),e},IR=function(e,n){return(Kr.ScrollTrigger||wx("scrollTrigger",n))&&Kr.ScrollTrigger.create(n,e)},MR=function(e,n,r,s,i){if(Px(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!Vn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&ER!==$r.frame)return Uo.push(e),e._lazy=[i,s],1},DK=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},k_=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},LK=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&DK(e)&&!(!e._initted&&k_(e))||(e._ts<0||e._dp._ts<0)&&!k_(e))?0:1,u=e._rDelay,c=0,f,h,p;if(u&&e._repeat&&(c=vf(0,e._tDur,n),h=zu(c,u),e._yoyo&&h&1&&(a=1-a),h!==zu(e._tTime,u)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||Vn||s||e._zTime===St||!n&&e._zTime){if(!e._initted&&MR(e,n,s,r,c))return;for(p=e._zTime,e._zTime=n||(r?St:0),r||(r=n&&!p),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=c,f=e._pt;f;)f.r(a,f.d),f=f._next;n<0&&E_(e,n,r,!0),e._onUpdate&&!r&&zr(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&zr(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&Qo(e,1),!r&&!Vn&&(zr(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},jK=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}},Uu=function(e,n,r,s){var i=e._repeat,a=Kt(n)||0,u=e._tTime/e._tDur;return u&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:Kt(a*(i+1)+e._rDelay*i):a,u>0&&!s&&y0(e,e._tTime=e._tDur*u),e.parent&&v0(e),r||al(e.parent,e),e},yC=function(e){return e instanceof br?al(e):Uu(e,e._dur)},FK={_start:0,endTime:Yd,totalDuration:Yd},rs=function t(e,n,r){var s=e.labels,i=e._recent||FK,a=e.duration()>=as?i.endTime(!1):e._dur,u,c,f;return Tn(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),f=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)*(f?(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)),f&&r&&(c=c/100*(Zn(r)?r[0]:r).totalDuration()),u>1?t(e,n.substr(0,u-1),r)+c:a+c)):n==null?a:+n},wd=function(e,n,r){var s=Xi(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=kr(c.vars.inherit)&&c.parent;a.immediateRender=kr(u.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new hn(n[0],a,n[i+1])},oa=function(e,n){return e||e===0?n(e):n},vf=function(e,n,r){return r<e?e:r>n?n:r},qn=function(e,n){return!Tn(e)||!(n=PK.exec(e))?"":n[1]},VK=function(e,n,r){return oa(r,function(s){return vf(e,n,s)})},C_=[].slice,NR=function(e,n){return e&&di(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&di(e[0]))&&!e.nodeType&&e!==qs},$K=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Tn(s)&&!n||NR(s,1)?(i=r).push.apply(i,ls(s)):r.push(s)})||r},ls=function(e,n,r){return zt&&!n&&zt.selector?zt.selector(e):Tn(e)&&!r&&(b_||!Bu())?C_.call((n||xx).querySelectorAll(e),0):Zn(e)?$K(e,r):NR(e)?C_.call(e,0):e?[e]:[]},P_=function(e){return e=ls(e)[0]||Zd("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return ls(n,r.querySelectorAll?r:r===e?Zd("Invalid scope")||xx.createElement("div"):e)}},OR=function(e){return e.sort(function(){return .5-Math.random()})},DR=function(e){if(nn(e))return e;var n=di(e)?e:{each:e},r=ll(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},u=s>0&&s<1,c=isNaN(s)||u,f=n.axis,h=s,p=s;return Tn(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!u&&c&&(h=s[0],p=s[1]),function(v,y,x){var _=(x||n).length,b=a[_],E,C,P,T,R,O,M,A,N;if(!b){if(N=n.grid==="auto"?0:(n.grid||[1,as])[1],!N){for(M=-as;M<(M=x[N++].getBoundingClientRect().left)&&N<_;);N<_&&N--}for(b=a[_]=[],E=c?Math.min(N,_)*h-.5:s%N,C=N===as?0:c?_*p/N-.5:s/N|0,M=0,A=as,O=0;O<_;O++)P=O%N-E,T=C-(O/N|0),b[O]=R=f?Math.abs(f==="y"?T:P):vR(P*P+T*T),R>M&&(M=R),R<A&&(A=R);s==="random"&&OR(b),b.max=M-A,b.min=A,b.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(N>_?_-1:f?f==="y"?_/N:N:Math.max(N,_/N))||0)*(s==="edges"?-1:1),b.b=_<0?i-_:i,b.u=qn(n.amount||n.each)||0,r=r&&_<0?JK(r):r}return _=(b[v]-b.min)/b.max||0,Kt(b.b+(r?r(_):_)*b.v)+b.u}},T_=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Kt(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(Xi(r)?0:qn(r))}},LR=function(e,n){var r=Zn(e),s,i;return!r&&di(e)&&(s=r=e.radius||as,e.values?(e=ls(e.values),(i=!Xi(e[0]))&&(s*=s)):e=T_(e.increment)),oa(n,r?nn(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),f=as,h=0,p=e.length,v,y;p--;)i?(v=e[p].x-u,y=e[p].y-c,v=v*v+y*y):v=Math.abs(e[p]-u),v<f&&(f=v,h=p);return h=!s||f<=s?e[h]:a,i||h===a||Xi(a)?h:h+qn(a)}:T_(e))},jR=function(e,n,r,s){return oa(Zn(e)?!n:r===!0?!!(r=0):!s,function(){return Zn(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})},HK=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)}},zK=function(e,n){return function(r){return e(parseFloat(r))+(n||qn(r))}},UK=function(e,n,r){return VR(e,n,0,1,r)},FR=function(e,n,r){return oa(r,function(s){return e[~~n(s)]})},BK=function t(e,n,r){var s=n-e;return Zn(e)?FR(e,t(0,e.length),n):oa(r,function(i){return(s+(i-e)%s)%s+e})},WK=function t(e,n,r){var s=n-e,i=s*2;return Zn(e)?FR(e,t(0,e.length-1),n):oa(r,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},Xd=function(e){return e.replace(EK,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(kK);return jR(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},VR=function(e,n,r,s,i){var a=n-e,u=s-r;return oa(i,function(c){return r+((c-e)/a*u||0)})},GK=function t(e,n,r,s){var i=isNaN(e+n)?0:function(y){return(1-y)*e+y*n};if(!i){var a=Tn(e),u={},c,f,h,p,v;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(Zn(e)&&!Zn(n)){for(h=[],p=e.length,v=p-2,f=1;f<p;f++)h.push(t(e[f-1],e[f]));p--,i=function(x){x*=p;var _=Math.min(v,~~x);return h[_](x-_)},r=n}else s||(e=Hu(Zn(e)?[]:{},e));if(!h){for(c in n)Cx.call(u,e,c,"get",n[c]);i=function(x){return Ax(x,u)||(a?e.p:e)}}}return oa(r,i)},_C=function(e,n,r){var s=e.labels,i=as,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},zr=function(e,n,r){var s=e.vars,i=s[n],a=zt,u=e._ctx,c,f,h;if(i)return c=s[n+"Params"],f=s.callbackScope||e,r&&Uo.length&&Pm(),u&&(zt=u),h=c?i.apply(f,c):i.call(f),zt=a,h},od=function(e){return Qo(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Vn),e.progress()<1&&zr(e,"onInterrupt"),e},ou,$R=[],HR=function(e){if(e)if(e=!e.name&&e.default||e,_x()||e.headless){var n=e.name,r=nn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Yd,render:Ax,add:Cx,kill:uq,modifier:lq,rawVars:0},a={targetTest:0,get:0,getSetter:Rx,aliases:{},register:0};if(Bu(),e!==s){if(Vr[n])return;qr(s,qr(Tm(e,i),a)),Hu(s.prototype,Hu(i,Tm(e,a))),Vr[s.prop=n]=s,e.targetTest&&(Cp.push(s),bx[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}SR(n,s),e.register&&e.register(Rr,s,Pr)}else $R.push(e)},xt=255,ad={aqua:[0,xt,xt],lime:[0,xt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,xt],navy:[0,0,128],white:[xt,xt,xt],olive:[128,128,0],yellow:[xt,xt,0],orange:[xt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[xt,0,0],pink:[xt,192,203],cyan:[0,xt,xt],transparent:[xt,xt,xt,0]},m1=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)*xt+.5|0},zR=function(e,n,r){var s=e?Xi(e)?[e>>16,e>>8&xt,e&xt]:0:ad.black,i,a,u,c,f,h,p,v,y,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),ad[e])s=ad[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&xt,s&xt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&xt,e&xt]}else if(e.substr(0,3)==="hsl"){if(s=x=e.match(pC),!n)c=+s[0]%360/360,f=+s[1]/100,h=+s[2]/100,a=h<=.5?h*(f+1):h+f-h*f,i=h*2-a,s.length>3&&(s[3]*=1),s[0]=m1(c+1/3,i,a),s[1]=m1(c,i,a),s[2]=m1(c-1/3,i,a);else if(~e.indexOf("="))return s=e.match(_R),r&&s.length<4&&(s[3]=1),s}else s=e.match(pC)||ad.transparent;s=s.map(Number)}return n&&!x&&(i=s[0]/xt,a=s[1]/xt,u=s[2]/xt,p=Math.max(i,a,u),v=Math.min(i,a,u),h=(p+v)/2,p===v?c=f=0:(y=p-v,f=h>.5?y/(2-p-v):y/(p+v),c=p===i?(a-u)/y+(a<u?6:0):p===a?(u-i)/y+2:(i-a)/y+4,c*=60),s[0]=~~(c+.5),s[1]=~~(f*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},UR=function(e){var n=[],r=[],s=-1;return e.split(Bo).forEach(function(i){var a=i.match(iu)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},xC=function(e,n,r){var s="",i=(e+s).match(Bo),a=n?"hsla(":"rgba(",u=0,c,f,h,p;if(!i)return e;if(i=i.map(function(v){return(v=zR(v,n,1))&&a+(n?v[0]+","+v[1]+"%,"+v[2]+"%,"+v[3]:v.join(","))+")"}),r&&(h=UR(e),c=r.c,c.join(s)!==h.c.join(s)))for(f=e.replace(Bo,"1").split(iu),p=f.length-1;u<p;u++)s+=f[u]+(~c.indexOf(u)?i.shift()||a+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!f)for(f=e.split(Bo),p=f.length-1;u<p;u++)s+=f[u]+i[u];return s+f[p]},Bo=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in ad)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),KK=/hsl[a]?\(/,BR=function(e){var n=e.join(" "),r;if(Bo.lastIndex=0,Bo.test(n))return r=KK.test(n),e[1]=xC(e[1],r),e[0]=xC(e[0],r,UR(e[1])),!0},Qd,$r=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,u=[],c,f,h,p,v,y,x=function _(b){var E=t()-s,C=b===!0,P,T,R,O;if((E>e||E<0)&&(r+=E-n),s+=E,R=s-r,P=R-a,(P>0||C)&&(O=++p.frame,v=R-p.time*1e3,p.time=R=R/1e3,a+=P+(P>=i?4:i-P),T=1),C||(c=f(_)),T)for(y=0;y<u.length;y++)u[y](R,v,O,b)};return p={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(b){return v/(1e3/(b||60))},wake:function(){wR&&(!b_&&_x()&&(qs=b_=window,xx=qs.document||{},Kr.gsap=Rr,(qs.gsapVersions||(qs.gsapVersions=[])).push(Rr.version),bR(Cm||qs.GreenSockGlobals||!qs.gsap&&qs||{}),$R.forEach(HR)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&p.sleep(),f=h||function(b){return setTimeout(b,a-p.time*1e3+1|0)},Qd=1,x(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(c),Qd=0,f=Yd},lagSmoothing:function(b,E){e=b||1/0,n=Math.min(E||33,e)},fps:function(b){i=1e3/(b||240),a=p.time*1e3+i},add:function(b,E,C){var P=E?function(T,R,O,M){b(T,R,O,M),p.remove(P)}:b;return p.remove(b),u[C?"unshift":"push"](P),Bu(),P},remove:function(b,E){~(E=u.indexOf(b))&&u.splice(E,1)&&y>=E&&y--},_listeners:u},p})(),Bu=function(){return!Qd&&$r.wake()},ct={},qK=/^[\d.\-M][\d.\-,\s]/,ZK=/["']/g,YK=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,a=r.length,u,c,f;i<a;i++)c=r[i],u=i!==a-1?c.lastIndexOf(","):c.length,f=c.substr(0,u),n[s]=isNaN(f)?f.replace(ZK,"").trim():+f,s=c.substr(u+1).trim();return n},XK=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)},QK=function(e){var n=(e+"").split("("),r=ct[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[YK(n[1])]:XK(e).split(",").map(PR)):ct._CE&&qK.test(e)?ct._CE("",e):r},JK=function(e){return function(n){return 1-e(1-n)}},ll=function(e,n){return e&&(nn(e)?e:ct[e]||QK(e))||n},ml=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 Cr(e,function(u){ct[u]=Kr[u]=i,ct[a=u.toLowerCase()]=r;for(var c in i)ct[a+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ct[u+"."+c]=i[c]}),i},WR=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},g1=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/w_*(Math.asin(1/s)||0),u=function(h){return h===1?1:s*Math.pow(2,-10*h)*SK((h-a)*i)+1},c=e==="out"?u:e==="in"?function(f){return 1-u(1-f)}:WR(u);return i=w_/i,c.config=function(f,h){return t(e,f,h)},c},v1=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)}:WR(r);return s.config=function(i){return t(e,i)},s};Cr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;ml(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})});ct.Linear.easeNone=ct.none=ct.Linear.easeIn;ml("Elastic",g1("in"),g1("out"),g1());(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};ml("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);ml("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});ml("Circ",function(t){return-(vR(1-t*t)-1)});ml("Sine",function(t){return t===1?1:-bK(t*xK)+1});ml("Back",v1("in"),v1("out"),v1());ct.SteppedEase=ct.steps=Kr.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-St;return function(u){return((s*vf(0,a,u)|0)+i)*r}}};qd.ease=ct["quad.out"];Cr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return Sx+=t+","+t+"Params,"});var GR=function(e,n){this.id=wK++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:kR,this.set=n?n.getSetter:Rx},Jd=(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,Uu(this,+n.duration,1,1),this.data=n.data,zt&&(this._ctx=zt,zt.data.push(this)),Qd||$r.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,Uu(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(Bu(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(y0(this,r),!i._dp||i.parent||AR(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)&&ti(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===St||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),CR(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+vC(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)+vC(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?zu(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-St?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Rm(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-St?0:this._rts,this.totalTime(vf(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),v0(this),NK(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):(Bu(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==St&&(this._tTime-=St)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=Kt(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&ti(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(kr(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?Rm(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=RK);var s=Vn;return Vn=r,kx(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Vn=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,yC(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,yC(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(rs(this,r),kr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,kr(s)),this._dur||(this._zTime=-St),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?-St:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-St,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)-St)},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=nn(r)?r:TR,c=function(){var h=s.then;s.then=null,i&&i(),nn(u)&&(u=u(s))&&(u.then||u===s)&&(s.then=h),a(u),s.then=h};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?c():s._prom=c})},e.kill=function(){od(this)},t})();qr(Jd.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:-St,_prom:0,_ps:!1,_rts:1});var br=(function(t){gR(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=kr(r.sortChildren),qt&&ti(r.parent||qt,ji(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&IR(ji(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return wd(0,arguments,this),this},n.from=function(s,i,a){return wd(1,arguments,this),this},n.fromTo=function(s,i,a,u){return wd(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,xd(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new hn(s,i,rs(this,a),1),this},n.call=function(s,i,a){return ti(this,hn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,u,c,f,h){return a.duration=i,a.stagger=a.stagger||u,a.onComplete=f,a.onCompleteParams=h,a.parent=this,new hn(s,a,rs(this,c)),this},n.staggerFrom=function(s,i,a,u,c,f,h){return a.runBackwards=1,xd(a).immediateRender=kr(a.immediateRender),this.staggerTo(s,i,a,u,c,f,h)},n.staggerFromTo=function(s,i,a,u,c,f,h,p){return u.startAt=a,xd(u).immediateRender=kr(u.immediateRender),this.staggerTo(s,i,u,c,f,h,p)},n.render=function(s,i,a){var u=this._time,c=this._dirty?this.totalDuration():this._tDur,f=this._dur,h=s<=0?0:Kt(s),p=this._zTime<0!=s<0&&(this._initted||!f),v,y,x,_,b,E,C,P,T,R,O,M;if(this!==qt&&h>c&&s>=0&&(h=c),h!==this._tTime||a||p){if(u!==this._time&&f&&(h+=this._time-u,s+=this._time-u),v=h,T=this._start,P=this._ts,E=!P,p&&(f||(u=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(O=this._yoyo,b=f+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(b*100+s,i,a);if(v=Kt(h%b),h===c?(_=this._repeat,v=f):(R=Kt(h/b),_=~~R,_&&_===R&&(v=f,_--),v>f&&(v=f)),R=zu(this._tTime,b),!u&&this._tTime&&R!==_&&this._tTime-R*b-this._dur<=0&&(R=_),O&&_&1&&(v=f-v,M=1),_!==R&&!this._lock){var A=O&&R&1,N=A===(O&&_&1);if(_<R&&(A=!A),u=A?0:h%f?f:h,this._lock=1,this.render(u||(M?0:Kt(_*b)),i,!f)._lock=0,this._tTime=h,!i&&this.parent&&zr(this,"onRepeat"),this.vars.repeatRefresh&&!M&&(this.invalidate()._lock=1,R=_),u&&u!==this._time||E!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(f=this._dur,c=this._tDur,N&&(this._lock=2,u=A?f:-1e-4,this.render(u,!0),this.vars.repeatRefresh&&!M&&this.invalidate()),this._lock=0,!this._ts&&!E)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(C=jK(this,Kt(u),Kt(v)),C&&(h-=v-(v=C._start))),this._tTime=h,this._time=v,this._act=!!P,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,u=0),!u&&h&&f&&!i&&!R&&(zr(this,"onStart"),this._tTime!==h))return this;if(v>=u&&s>=0)for(y=this._first;y;){if(x=y._next,(y._act||v>=y._start)&&y._ts&&C!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(v-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(v-y._start)*y._ts,i,a),v!==this._time||!this._ts&&!E){C=0,x&&(h+=this._zTime=-St);break}}y=x}else{y=this._last;for(var D=s<0?s:v;y;){if(x=y._prev,(y._act||D<=y._end)&&y._ts&&C!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(D-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(D-y._start)*y._ts,i,a||Vn&&kx(y)),v!==this._time||!this._ts&&!E){C=0,x&&(h+=this._zTime=D?-St:St);break}}y=x}}if(C&&!i&&(this.pause(),C.render(v>=u?0:-St)._zTime=v>=u?1:-1,this._ts))return this._start=T,v0(this),this.render(s,i,a);this._onUpdate&&!i&&zr(this,"onUpdate",!0),(h===c&&this._tTime>=this.totalDuration()||!h&&u)&&(T===this._start||Math.abs(P)!==Math.abs(this._ts))&&(this._lock||((s||!f)&&(h===c&&this._ts>0||!h&&this._ts<0)&&Qo(this,1),!i&&!(s<0&&!u)&&(h||u||!c)&&(zr(this,h===c&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<c&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var a=this;if(Xi(i)||(i=rs(this,i,s)),!(s instanceof Jd)){if(Zn(s))return s.forEach(function(u){return a.add(u,i)}),this;if(Tn(s))return this.addLabel(s,i);if(nn(s))s=hn.delayedCall(0,s);else return this}return this!==s?ti(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=-as);for(var c=[],f=this._first;f;)f._start>=u&&(f instanceof hn?i&&c.push(f):(a&&c.push(f),s&&c.push.apply(c,f.getChildren(!0,i,a)))),f=f._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 Tn(s)?this.removeLabel(s):nn(s)?this.killTweensOf(s):(s.parent===this&&g0(this,s),s===this._recent&&(this._recent=this._last),al(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Kt($r.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]=rs(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var u=hn.delayedCall(0,i||Yd,a);return u.data="isPause",this._hasPause=1,ti(this,u,rs(this,s))},n.removePause=function(s){var i=this._first;for(s=rs(this,s);i;)i._start===s&&i.data==="isPause"&&Qo(i),i=i._next},n.killTweensOf=function(s,i,a){for(var u=this.getTweensOf(s,a),c=u.length;c--;)Vo!==u[c]&&u[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],u=ls(s),c=this._first,f=Xi(i),h;c;)c instanceof hn?AK(c._targets,u)&&(f?(!Vo||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&a.push(c):(h=c.getTweensOf(u,i)).length&&a.push.apply(a,h),c=c._next;return a},n.tweenTo=function(s,i){i=i||{};var a=this,u=rs(a,s),c=i,f=c.startAt,h=c.onStart,p=c.onStartParams,v=c.immediateRender,y,x=hn.to(a,qr({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:u,overwrite:"auto",duration:i.duration||Math.abs((u-(f&&"time"in f?f.time:a._time))/a.timeScale())||St,onStart:function(){if(a.pause(),!y){var b=i.duration||Math.abs((u-(f&&"time"in f?f.time:a._time))/a.timeScale());x._dur!==b&&Uu(x,b,0,1).render(x._time,!0,!0),y=1}h&&h.apply(x,p||[])}},i));return v?x.render(0):x},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,qr({startAt:{time:rs(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),_C(this,rs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),_C(this,rs(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+St)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var u=this._first,c=this.labels,f;for(s=Kt(s);u;)u._start>=a&&(u._start+=s,u._end+=s),u=u._next;if(i)for(f in c)c[f]>=a&&(c[f]+=s);return al(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={}),al(this)},n.totalDuration=function(s){var i=0,a=this,u=a._last,c=as,f,h,p;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-s:s));if(a._dirty){for(p=a.parent;u;)f=u._prev,u._dirty&&u.totalDuration(),h=u._start,h>c&&a._sort&&u._ts&&!a._lock?(a._lock=1,ti(a,u,h-u._delay,1)._lock=0):c=h,h<0&&u._ts&&(i-=h,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=Kt(h/a._ts),a._time-=h,a._tTime-=h),a.shiftChildren(-h,!1,-1/0),c=0),u._end>i&&u._ts&&(i=u._end),u=f;Uu(a,a===qt&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(qt._ts&&(CR(qt,Rm(s,qt)),ER=$r.frame),$r.frame>=mC){mC+=Gr.autoSleep||120;var i=qt._first;if((!i||!i._ts)&&Gr.autoSleep&&$r._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||$r.sleep()}}},e})(Jd);qr(br.prototype,{_lock:0,_hasPause:0,_forcing:0});var eq=function(e,n,r,s,i,a,u){var c=new Pr(this._pt,e,n,0,1,QR,null,i),f=0,h=0,p,v,y,x,_,b,E,C;for(c.b=r,c.e=s,r+="",s+="",(E=~s.indexOf("random("))&&(s=Xd(s)),a&&(C=[r,s],a(C,e,n),r=C[0],s=C[1]),v=r.match(h1)||[];p=h1.exec(s);)x=p[0],_=s.substring(f,p.index),y?y=(y+1)%5:_.substr(-5)==="rgba("&&(y=1),x!==v[h++]&&(b=parseFloat(v[h-1])||0,c._pt={_next:c._pt,p:_||h===1?_:",",s:b,c:x.charAt(1)==="="?hu(b,x)-b:parseFloat(x)-b,m:y&&y<4?Math.round:0},f=h1.lastIndex);return c.c=f<s.length?s.substring(f,s.length):"",c.fp=u,(xR.test(s)||E)&&(c.e=0),this._pt=c,c},Cx=function(e,n,r,s,i,a,u,c,f,h){nn(s)&&(s=s(i||0,e,a));var p=e[n],v=r!=="get"?r:nn(p)?f?e[n.indexOf("set")||!nn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](f):e[n]():p,y=nn(p)?f?iq:YR:Tx,x;if(Tn(s)&&(~s.indexOf("random(")&&(s=Xd(s)),s.charAt(1)==="="&&(x=hu(v,s)+(qn(v)||0),(x||x===0)&&(s=x))),!h||v!==s||R_)return!isNaN(v*s)&&s!==""?(x=new Pr(this._pt,e,n,+v||0,s-(v||0),typeof p=="boolean"?aq:XR,0,y),f&&(x.fp=f),u&&x.modifier(u,this,e),this._pt=x):(!p&&!(n in e)&&wx(n,s),eq.call(this,e,n,v,s,y,c||Gr.stringFilter,f))},tq=function(e,n,r,s,i){if(nn(e)&&(e=bd(e,i,n,r,s)),!di(e)||e.style&&e.nodeType||Zn(e)||yR(e))return Tn(e)?bd(e,i,n,r,s):e;var a={},u;for(u in e)a[u]=bd(e[u],i,n,r,s);return a},KR=function(e,n,r,s,i,a){var u,c,f,h;if(Vr[e]&&(u=new Vr[e]).init(i,u.rawVars?n[e]:tq(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=c=new Pr(r._pt,i,e,0,1,u.render,u,0,u.priority),r!==ou))for(f=r._ptLookup[r._targets.indexOf(i)],h=u._props.length;h--;)f[u._props[h]]=c;return u},Vo,R_,Px=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,u=s.immediateRender,c=s.lazy,f=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,v=s.keyframes,y=s.autoRevert,x=e._dur,_=e._startAt,b=e._targets,E=e.parent,C=E&&E.data==="nested"?E.vars.targets:b,P=e._overwrite==="auto"&&!vx,T=e.timeline,R=s.easeReverse||p,O,M,A,N,D,j,V,W,Y,K,B,X,$;if(T&&(!v||!i)&&(i="none"),e._ease=ll(i,qd.ease),e._rEase=R&&(ll(R)||e._ease),e._from=!T&&!!s.runBackwards,e._from&&(e.ratio=1),!T||v&&!s.stagger){if(W=b[0]?ol(b[0]).harness:0,X=W&&s[W.prop],O=Tm(s,bx),_&&(_._zTime<0&&_.progress(1),n<0&&h&&u&&!y?_.render(-1,!0):_.revert(h&&x?kp:TK),_._lazy=0),a){if(Qo(e._startAt=hn.set(b,qr({data:"isStart",overwrite:!1,parent:E,immediateRender:!0,lazy:!_&&kr(c),startAt:null,delay:0,onUpdate:f&&function(){return zr(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Vn||!u&&!y)&&e._startAt.revert(kp),u&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&x&&!_){if(n&&(u=!1),A=qr({overwrite:!1,data:"isFromStart",lazy:u&&!_&&kr(c),immediateRender:u,stagger:0,parent:E},O),X&&(A[W.prop]=X),Qo(e._startAt=hn.set(b,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Vn?e._startAt.revert(kp):e._startAt.render(-1,!0)),e._zTime=n,!u)t(e._startAt,St,St);else if(!n)return}for(e._pt=e._ptCache=0,c=x&&kr(c)||c&&!x,M=0;M<b.length;M++){if(D=b[M],V=D._gsap||Ex(b)[M]._gsap,e._ptLookup[M]=K={},S_[V.id]&&Uo.length&&Pm(),B=C===b?M:C.indexOf(D),W&&(Y=new W).init(D,X||O,e,B,C)!==!1&&(e._pt=N=new Pr(e._pt,D,Y.name,0,1,Y.render,Y,0,Y.priority),Y._props.forEach(function(te){K[te]=N}),Y.priority&&(j=1)),!W||X)for(A in O)Vr[A]&&(Y=KR(A,O,e,B,D,C))?Y.priority&&(j=1):K[A]=N=Cx.call(e,D,A,"get",O[A],B,C,0,s.stringFilter);e._op&&e._op[M]&&e.kill(D,e._op[M]),P&&e._pt&&(Vo=e,qt.killTweensOf(D,K,e.globalTime(n)),$=!e.parent,Vo=0),e._pt&&c&&(S_[V.id]=1)}j&&JR(e),e._onInit&&e._onInit(e)}e._onUpdate=f,e._initted=(!e._op||e._pt)&&!$,v&&n<=0&&T.render(as,!0,!0)},nq=function(e,n,r,s,i,a,u,c){var f=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,v,y;if(!f)for(f=e._ptCache[n]=[],v=e._ptLookup,y=e._targets.length;y--;){if(h=v[y][n],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==n&&h.fp!==n;)h=h._next;if(!h)return R_=1,e.vars[n]="+=0",Px(e,u),R_=0,c?Zd(n+" not eligible for reset. Try splitting into individual properties"):1;f.push(h)}for(y=f.length;y--;)p=f[y],h=p._pt||p,h.s=(s||s===0)&&!i?s:h.s+(s||0)+a*h.c,h.c=r-h.s,p.e&&(p.e=an(r)+qn(p.e)),p.b&&(p.b=h.s+qn(p.b))},rq=function(e,n){var r=e[0]?ol(e[0]).harness:0,s=r&&r.aliases,i,a,u,c;if(!s)return n;i=Hu({},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},sq=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,u;if(Zn(n))u=r[e]||(r[e]=[]),n.forEach(function(c,f){return u.push({t:f/(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})},bd=function(e,n,r,s,i){return nn(e)?e.call(n,r,s,i):Tn(e)&&~e.indexOf("random(")?Xd(e):e},qR=Sx+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",ZR={};Cr(qR+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return ZR[t]=1});var hn=(function(t){gR(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:xd(s))||this;var c=u.vars,f=c.duration,h=c.delay,p=c.immediateRender,v=c.stagger,y=c.overwrite,x=c.keyframes,_=c.defaults,b=c.scrollTrigger,E=s.parent||qt,C=(Zn(r)||yR(r)?Xi(r[0]):"length"in s)?[r]:ls(r),P,T,R,O,M,A,N,D;if(u._targets=C.length?Ex(C):Zd("GSAP target "+r+" not found. https://gsap.com",!Gr.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=y,x||v||np(f)||np(h)){s=u.vars;var j=s.easeReverse||s.yoyoEase;if(P=u.timeline=new br({data:"nested",defaults:_||{},targets:E&&E.data==="nested"?E.vars.targets:C}),P.kill(),P.parent=P._dp=ji(u),P._start=0,v||np(f)||np(h)){if(O=C.length,N=v&&DR(v),di(v))for(M in v)~qR.indexOf(M)&&(D||(D={}),D[M]=v[M]);for(T=0;T<O;T++)R=Tm(s,ZR),R.stagger=0,j&&(R.easeReverse=j),D&&Hu(R,D),A=C[T],R.duration=+bd(f,ji(u),T,A,C),R.delay=(+bd(h,ji(u),T,A,C)||0)-u._delay,!v&&O===1&&R.delay&&(u._delay=h=R.delay,u._start+=h,R.delay=0),P.to(A,R,N?N(T,A,C):0),P._ease=ct.none;P.duration()?f=h=0:u.timeline=0}else if(x){xd(qr(P.vars.defaults,{ease:"none"})),P._ease=ll(x.ease||s.ease||"none");var V=0,W,Y,K;if(Zn(x))x.forEach(function(B){return P.to(C,B,">")}),P.duration();else{R={};for(M in x)M==="ease"||M==="easeEach"||sq(M,x[M],R,x.easeEach);for(M in R)for(W=R[M].sort(function(B,X){return B.t-X.t}),V=0,T=0;T<W.length;T++)Y=W[T],K={ease:Y.e,duration:(Y.t-(T?W[T-1].t:0))/100*f},K[M]=Y.v,P.to(C,K,V),V+=K.duration;P.duration()<f&&P.to({},{duration:f-P.duration()})}}f||u.duration(f=P.duration())}else u.timeline=0;return y===!0&&!vx&&(Vo=ji(u),qt.killTweensOf(C),Vo=0),ti(E,ji(u),i),s.reversed&&u.reverse(),s.paused&&u.paused(!0),(p||!f&&!x&&u._start===Kt(E._time)&&kr(p)&&OK(ji(u))&&E.data!=="nested")&&(u._tTime=-St,u.render(Math.max(0,-h)||0)),b&&IR(ji(u),b),u}var n=e.prototype;return n.render=function(s,i,a){var u=this._time,c=this._tDur,f=this._dur,h=s<0,p=s>c-St&&!h?c:s<St?0:s,v,y,x,_,b,E,C,P;if(!f)LK(this,s,i,a);else if(p!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(v=p,P=this.timeline,this._repeat){if(_=f+this._rDelay,this._repeat<-1&&h)return this.totalTime(_*100+s,i,a);if(v=Kt(p%_),p===c?(x=this._repeat,v=f):(b=Kt(p/_),x=~~b,x&&x===b?(v=f,x--):v>f&&(v=f)),E=this._yoyo&&x&1,E&&(v=f-v),b=zu(this._tTime,_),v===u&&!a&&this._initted&&x===b)return this._tTime=p,this;x!==b&&this.vars.repeatRefresh&&!E&&!this._lock&&v!==_&&this._initted&&(this._lock=a=1,this.render(Kt(_*x),!0).invalidate()._lock=0)}if(!this._initted){if(MR(this,h?s:v,a,i,p))return this._tTime=0,this;if(u!==this._time&&!(a&&this.vars.repeatRefresh&&x!==b))return this;if(f!==this._dur)return this.render(s,i,a)}if(this._rEase){var T=v<u;if(T!==this._inv){var R=T?u:f-u;this._inv=T,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=u,this._invRecip=R?(T?-1:1)/R: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((v-this._invTime)*this._invRecip)}else this.ratio=C=this._ease(v/f);if(this._from&&(this.ratio=C=1-C),this._tTime=p,this._time=v,!this._act&&this._ts&&(this._act=1,this._lazy=0),!u&&p&&!i&&!b&&(zr(this,"onStart"),this._tTime!==p))return this;for(y=this._pt;y;)y.r(C,y.d),y=y._next;P&&P.render(s<0?s:P._dur*P._ease(v/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(h&&E_(this,s,i,a),zr(this,"onUpdate")),this._repeat&&x!==b&&this.vars.onRepeat&&!i&&this.parent&&zr(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&E_(this,s,!0,!0),(s||!f)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&Qo(this,1),!i&&!(h&&!u)&&(p||u||E)&&(zr(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){Qd||$r.wake(),this._ts||this.play();var f=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||Px(this,f),h=this._ease(f/this._dur),nq(this,s,i,a,u,h,f,c)?this.resetTo(s,i,a,u,1):(y0(this,0),this.parent||RR(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(!!Vn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Vo&&Vo.vars.overwrite!==!0)._first||od(this),this.parent&&a!==this.timeline.totalDuration()&&Uu(this,this._dur*this.timeline._tDur/a,0,1),this}var u=this._targets,c=s?ls(s):u,f=this._ptLookup,h=this._pt,p,v,y,x,_,b,E;if((!i||i==="all")&&MK(u,c))return i==="all"&&(this._pt=0),od(this);for(p=this._op=this._op||[],i!=="all"&&(Tn(i)&&(_={},Cr(i,function(C){return _[C]=1}),i=_),i=rq(u,i)),E=u.length;E--;)if(~c.indexOf(u[E])){v=f[E],i==="all"?(p[E]=i,x=v,y={}):(y=p[E]=p[E]||{},x=i);for(_ in x)b=v&&v[_],b&&((!("kill"in b.d)||b.d.kill(_)===!0)&&g0(this,b,"_pt"),delete v[_]),y!=="all"&&(y[_]=1)}return this._initted&&!this._pt&&h&&od(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return wd(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 wd(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 qt.killTweensOf(s,i,a)},e})(Jd);qr(hn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Cr("staggerTo,staggerFrom,staggerFromTo",function(t){hn[t]=function(){var e=new br,n=C_.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var Tx=function(e,n,r){return e[n]=r},YR=function(e,n,r){return e[n](r)},iq=function(e,n,r,s){return e[n](s.fp,r)},oq=function(e,n,r){return e.setAttribute(n,r)},Rx=function(e,n){return nn(e[n])?YR:yx(e[n])&&e.setAttribute?oq:Tx},XR=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},aq=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},QR=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)},Ax=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},lq=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},uq=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?g0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},cq=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},JR=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},Pr=(function(){function t(n,r,s,i,a,u,c,f,h){this.t=r,this.s=i,this.c=a,this.p=s,this.r=u||XR,this.d=c||this,this.set=f||Tx,this.pr=h||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=cq,this.m=r,this.mt=i,this.tween=s},t})();Cr(Sx+"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 bx[t]=1});Kr.TweenMax=Kr.TweenLite=hn;Kr.TimelineLite=Kr.TimelineMax=br;qt=new br({sortChildren:!1,defaults:qd,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Gr.stringFilter=BR;var ul=[],Pp={},dq=[],wC=0,fq=0,y1=function(e){return(Pp[e]||dq).map(function(n){return n()})},A_=function(){var e=Date.now(),n=[];e-wC>2&&(y1("matchMediaInit"),ul.forEach(function(r){var s=r.queries,i=r.conditions,a,u,c,f;for(u in s)a=qs.matchMedia(s[u]).matches,a&&(c=1),a!==i[u]&&(i[u]=a,f=1);f&&(r.revert(),c&&n.push(r))}),y1("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),wC=e,y1("matchMedia"))},eA=(function(){function t(n,r){this.selector=r&&P_(r),this.data=[],this._r=[],this.isReverted=!1,this.id=fq++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){nn(r)&&(i=s,s=r,r=nn);var a=this,u=function(){var f=zt,h=a.selector,p;return f&&f!==a&&f.data.push(a),i&&(a.selector=P_(i)),zt=a,p=s.apply(a,arguments),nn(p)&&a._r.push(p),zt=f,a.selector=h,a.isReverted=!1,p};return a.last=u,r===nn?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 hn&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var u=i.getTweens(),c=i.data.length,f;c--;)f=i.data[c],f.data==="isFlip"&&(f.revert(),f.getChildren(!0,!0,!1).forEach(function(h){return u.splice(u.indexOf(h),1)}));for(u.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,p){return p.g-h.g||-1/0}).forEach(function(h){return h.t.revert(r)}),c=i.data.length;c--;)f=i.data[c],f instanceof br?f.data!=="nested"&&(f.scrollTrigger&&f.scrollTrigger.revert(),f.kill()):!(f instanceof hn)&&f.revert&&f.revert(r);i._r.forEach(function(h){return h(r,i)}),i.isReverted=!0})():this.data.forEach(function(u){return u.kill&&u.kill()}),this.clear(),s)for(var a=ul.length;a--;)ul[a].id===this.id&&ul.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),hq=(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){di(r)||(r={matches:r});var a=new eA(0,i||this.scope),u=a.conditions={},c,f,h;zt&&!a.selector&&(a.selector=zt.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=r;for(f in r)f==="all"?h=1:(c=qs.matchMedia(r[f]),c&&(ul.indexOf(a)<0&&ul.push(a),(u[f]=c.matches)&&(h=1),c.addListener?c.addListener(A_):c.addEventListener("change",A_)));return h&&s(a,function(p){return a.add(null,p)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),Am={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 HR(s)})},timeline:function(e){return new br(e)},getTweensOf:function(e,n){return qt.getTweensOf(e,n)},getProperty:function(e,n,r,s){Tn(e)&&(e=ls(e)[0]);var i=ol(e||{}).get,a=r?TR:PR;return r==="native"&&(r=""),e&&(n?a((Vr[n]&&Vr[n].get||i)(e,n,r,s)):function(u,c,f){return a((Vr[u]&&Vr[u].get||i)(e,u,c,f))})},quickSetter:function(e,n,r){if(e=ls(e),e.length>1){var s=e.map(function(h){return Rr.quickSetter(h,n,r)}),i=s.length;return function(h){for(var p=i;p--;)s[p](h)}}e=e[0]||{};var a=Vr[n],u=ol(e),c=u.harness&&(u.harness.aliases||{})[n]||n,f=a?function(h){var p=new a;ou._pt=0,p.init(e,r?h+r:h,ou,0,[e]),p.render(1,p),ou._pt&&Ax(1,ou)}:u.set(e,c);return a?f:function(h){return f(e,c,r?h+r:h,u,1)}},quickTo:function(e,n,r){var s,i=Rr.to(e,qr((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(c,f,h){return i.resetTo(n,c,f,h)};return a.tween=i,a},isTweening:function(e){return qt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=ll(e.ease,qd.ease)),gC(qd,e||{})},config:function(e){return gC(Gr,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&&!Vr[u]&&!Kr[u]&&Zd(n+" effect requires "+u+" plugin.")}),p1[n]=function(u,c,f){return r(ls(u),qr(c||{},i),f)},a&&(br.prototype[n]=function(u,c,f){return this.add(p1[n](u,di(c)?c:(f=c)&&{},this),f)})},registerEase:function(e,n){ct[e]=ll(n)},parseEase:function(e,n){return arguments.length?ll(e,n):ct},getById:function(e){return qt.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new br(e),s,i;for(r.smoothChildTiming=kr(e.smoothChildTiming),qt.remove(r),r._dp=0,r._time=r._tTime=qt._time,s=qt._first;s;)i=s._next,(n||!(!s._dur&&s instanceof hn&&s.vars.onComplete===s._targets[0]))&&ti(r,s,s._start-s._delay),s=i;return ti(qt,r,0),r},context:function(e,n){return e?new eA(e,n):zt},matchMedia:function(e){return new hq(e)},matchMediaRefresh:function(){return ul.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||A_()},addEventListener:function(e,n){var r=Pp[e]||(Pp[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Pp[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:BK,wrapYoyo:WK,distribute:DR,random:jR,snap:LR,normalize:UK,getUnit:qn,clamp:VK,splitColor:zR,toArray:ls,selector:P_,mapRange:VR,pipe:HK,unitize:zK,interpolate:GK,shuffle:OR},install:bR,effects:p1,ticker:$r,updateRoot:br.updateRoot,plugins:Vr,globalTimeline:qt,core:{PropTween:Pr,globals:SR,Tween:hn,Timeline:br,Animation:Jd,getCache:ol,_removeLinkedListItem:g0,reverting:function(){return Vn},context:function(e){return e&&zt&&(zt.data.push(e),e._ctx=zt),zt},suppressOverwrites:function(e){return vx=e}}};Cr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Am[t]=hn[t]});$r.add(br.updateRoot);ou=Am.to({},{duration:0});var pq=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},mq=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=pq(a,s)),a&&a.modifier&&a.modifier(n[s],e,r[i],s))},_1=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(u){var c,f;if(Tn(i)&&(c={},Cr(i,function(h){return c[h]=1}),i=c),n){c={};for(f in i)c[f]=n(i[f]);i=c}mq(u,i)}}}},Rr=Am.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;)Vn?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)}},_1("roundProps",T_),_1("modifiers"),_1("snap",LR))||Am;hn.version=br.version=Rr.version="3.15.0";wR=1;_x()&&Bu();ct.Power0;ct.Power1;ct.Power2;ct.Power3;ct.Power4;ct.Linear;ct.Quad;ct.Cubic;ct.Quart;ct.Quint;ct.Strong;ct.Elastic;ct.Back;ct.SteppedEase;ct.Bounce;ct.Sine;ct.Expo;ct.Circ;/*!
|
|
122
|
+
* CSSPlugin 3.15.0
|
|
123
|
+
* https://gsap.com
|
|
124
|
+
*
|
|
125
|
+
* Copyright 2008-2026, GreenSock. All rights reserved.
|
|
126
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
127
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
128
|
+
*/var bC,$o,pu,Ix,Wa,SC,Mx,gq=function(){return typeof window<"u"},Qi={},Fa=180/Math.PI,mu=Math.PI/180,ql=Math.atan2,EC=1e8,Nx=/([A-Z])/g,vq=/(left|right|width|margin|padding|x)/i,yq=/[\s,\(]\S/,si={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},I_=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},_q=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)},xq=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)},wq=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)},bq=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},tA=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},nA=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},Sq=function(e,n,r){return e.style[n]=r},Eq=function(e,n,r){return e.style.setProperty(n,r)},kq=function(e,n,r){return e._gsap[n]=r},Cq=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},Pq=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},Tq=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},Zt="transform",Tr=Zt+"Origin",Rq=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in Qi&&i){if(this.tfm=this.tfm||{},e!=="transform")e=si[e]||e,~e.indexOf(",")?e.split(",").forEach(function(u){return r.tfm[u]=Vi(s,u)}):this.tfm[e]=a.x?a[e]:Vi(s,e),e===Tr&&(this.tfm.zOrigin=a.zOrigin);else return si.transform.split(",").forEach(function(u){return t.call(r,u,n)});if(this.props.indexOf(Zt)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Tr,n,"")),e=Zt}(i||n)&&this.props.push(e,n,i[e])},rA=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},Aq=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(Nx,"-$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=Mx(),(!i||!i.isStart)&&!r[Zt]&&(rA(r),s.zOrigin&&r[Tr]&&(r[Tr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},sA=function(e,n){var r={target:e,props:[],revert:Aq,save:Rq};return e._gsap||Rr.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},iA,M_=function(e,n){var r=$o.createElementNS?$o.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):$o.createElement(e);return r&&r.style?r:$o.createElement(e)},Ur=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(Nx,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Wu(n)||n,1)||""},kC="O,Moz,ms,Ms,Webkit".split(","),Wu=function(e,n,r){var s=n||Wa,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(kC[a]+e in i););return a<0?null:(a===3?"ms":a>=0?kC[a]:"")+e},N_=function(){gq()&&window.document&&(bC=window,$o=bC.document,pu=$o.documentElement,Wa=M_("div")||{style:{}},M_("div"),Zt=Wu(Zt),Tr=Zt+"Origin",Wa.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",iA=!!Wu("perspective"),Mx=Rr.core.reverting,Ix=1)},CC=function(e){var n=e.ownerSVGElement,r=M_("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),pu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),pu.removeChild(r),i},PC=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},oA=function(e){var n,r;try{n=e.getBBox()}catch{n=CC(e),r=1}return n&&(n.width||n.height)||r||(n=CC(e)),n&&!n.width&&!n.x&&!n.y?{x:+PC(e,["x","cx","x1"])||0,y:+PC(e,["y","cy","y1"])||0,width:0,height:0}:n},aA=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&oA(e))},Jo=function(e,n){if(n){var r=e.style,s;n in Qi&&n!==Tr&&(n=Zt),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(Nx,"-$1").toLowerCase())):r.removeAttribute(n)}},Ho=function(e,n,r,s,i,a){var u=new Pr(e._pt,n,r,0,1,a?nA:tA);return e._pt=u,u.b=s,u.e=i,e._props.push(r),u},TC={deg:1,rad:1,turn:1},Iq={grid:1,flex:1},ea=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",u=Wa.style,c=vq.test(n),f=e.tagName.toLowerCase()==="svg",h=(f?"client":"offset")+(c?"Width":"Height"),p=100,v=s==="px",y=s==="%",x,_,b,E;if(s===a||!i||TC[s]||TC[a])return i;if(a!=="px"&&!v&&(i=t(e,n,r,"px")),E=e.getCTM&&aA(e),(y||a==="%")&&(Qi[n]||~n.indexOf("adius")))return x=E?e.getBBox()[c?"width":"height"]:e[h],an(y?i/x*p:i/100*x);if(u[c?"width":"height"]=p+(v?a:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!f?e:e.parentNode,E&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===$o||!_.appendChild)&&(_=$o.body),b=_._gsap,b&&y&&b.width&&c&&b.time===$r.time&&!b.uncache)return an(i/b.width*p);if(y&&(n==="height"||n==="width")){var C=e.style[n];e.style[n]=p+s,x=e[h],C?e.style[n]=C:Jo(e,n)}else(y||a==="%")&&!Iq[Ur(_,"display")]&&(u.position=Ur(e,"position")),_===e&&(u.position="static"),_.appendChild(Wa),x=Wa[h],_.removeChild(Wa),u.position="absolute";return c&&y&&(b=ol(_),b.time=$r.time,b.width=_[h]),an(v?x*i/p:x&&i?p/x*i:0)},Vi=function(e,n,r,s){var i;return Ix||N_(),n in si&&n!=="transform"&&(n=si[n],~n.indexOf(",")&&(n=n.split(",")[0])),Qi[n]&&n!=="transform"?(i=tf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Mm(Ur(e,Tr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Im[n]&&Im[n](e,n,r)||Ur(e,n)||kR(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?ea(e,n,i,r)+r:i},Mq=function(e,n,r,s){if(!r||r==="none"){var i=Wu(n,e,1),a=i&&Ur(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=Ur(e,"borderTopColor"))}var u=new Pr(this._pt,e.style,n,0,1,QR),c=0,f=0,h,p,v,y,x,_,b,E,C,P,T,R;if(u.b=r,u.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=Ur(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=Ur(e,n)||s,_?e.style[n]=_:Jo(e,n)),h=[r,s],BR(h),r=h[0],s=h[1],v=r.match(iu)||[],R=s.match(iu)||[],R.length){for(;p=iu.exec(s);)b=p[0],C=s.substring(c,p.index),x?x=(x+1)%5:(C.substr(-5)==="rgba("||C.substr(-5)==="hsla(")&&(x=1),b!==(_=v[f++]||"")&&(y=parseFloat(_)||0,T=_.substr((y+"").length),b.charAt(1)==="="&&(b=hu(y,b)+T),E=parseFloat(b),P=b.substr((E+"").length),c=iu.lastIndex-P.length,P||(P=P||Gr.units[n]||T,c===s.length&&(s+=P,u.e+=P)),T!==P&&(y=ea(e,n,_,P)||0),u._pt={_next:u._pt,p:C||f===1?C:",",s:y,c:E-y,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"?nA:tA;return xR.test(s)&&(u.e=0),this._pt=u,u},RC={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Nq=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]=RC[r]||r,n[1]=RC[s]||s,n.join(" ")},Oq=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,f;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),f=i.length;--f>-1;)u=i[f],Qi[u]&&(c=1,u=u==="transformOrigin"?Tr:Zt),Jo(r,u);c&&(Jo(r,Zt),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",tf(r,1),a.uncache=1,rA(s)))}},Im={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new Pr(e._pt,n,r,0,0,Oq);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},ef=[1,0,0,1,0,0],lA={},uA=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},AC=function(e){var n=Ur(e,Zt);return uA(n)?ef:n.substr(7).match(_R).map(an)},Ox=function(e,n){var r=e._gsap||ol(e),s=e.style,i=AC(e),a,u,c,f;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"?ef:i):(i===ef&&!e.offsetParent&&e!==pu&&!r.svg&&(c=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(f=1,u=e.nextElementSibling,pu.appendChild(e)),i=AC(e),c?s.display=c:Jo(e,"display"),f&&(u?a.insertBefore(e,u):a?a.appendChild(e):pu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},O_=function(e,n,r,s,i,a){var u=e._gsap,c=i||Ox(e,!0),f=u.xOrigin||0,h=u.yOrigin||0,p=u.xOffset||0,v=u.yOffset||0,y=c[0],x=c[1],_=c[2],b=c[3],E=c[4],C=c[5],P=n.split(" "),T=parseFloat(P[0])||0,R=parseFloat(P[1])||0,O,M,A,N;r?c!==ef&&(M=y*b-x*_)&&(A=T*(b/M)+R*(-_/M)+(_*C-b*E)/M,N=T*(-x/M)+R*(y/M)-(y*C-x*E)/M,T=A,R=N):(O=oA(e),T=O.x+(~P[0].indexOf("%")?T/100*O.width:T),R=O.y+(~(P[1]||P[0]).indexOf("%")?R/100*O.height:R)),s||s!==!1&&u.smooth?(E=T-f,C=R-h,u.xOffset=p+(E*y+C*_)-E,u.yOffset=v+(E*x+C*b)-C):u.xOffset=u.yOffset=0,u.xOrigin=T,u.yOrigin=R,u.smooth=!!s,u.origin=n,u.originIsAbsolute=!!r,e.style[Tr]="0px 0px",a&&(Ho(a,u,"xOrigin",f,T),Ho(a,u,"yOrigin",h,R),Ho(a,u,"xOffset",p,u.xOffset),Ho(a,u,"yOffset",v,u.yOffset)),e.setAttribute("data-svg-origin",T+" "+R)},tf=function(e,n){var r=e._gsap||new GR(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),f=Ur(e,Tr)||"0",h,p,v,y,x,_,b,E,C,P,T,R,O,M,A,N,D,j,V,W,Y,K,B,X,$,te,H,L,Z,ne,ie,ae;return h=p=v=_=b=E=C=P=T=0,y=x=1,r.svg=!!(e.getCTM&&aA(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[Zt]=(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[Zt]!=="none"?c[Zt]:"")),s.scale=s.rotate=s.translate="none"),M=Ox(e,r.svg),r.svg&&(r.uncache?($=e.getBBox(),f=r.xOrigin-$.x+"px "+(r.yOrigin-$.y)+"px",X=""):X=!n&&e.getAttribute("data-svg-origin"),O_(e,X||f,!!X||r.originIsAbsolute,r.smooth!==!1,M)),R=r.xOrigin||0,O=r.yOrigin||0,M!==ef&&(j=M[0],V=M[1],W=M[2],Y=M[3],h=K=M[4],p=B=M[5],M.length===6?(y=Math.sqrt(j*j+V*V),x=Math.sqrt(Y*Y+W*W),_=j||V?ql(V,j)*Fa:0,C=W||Y?ql(W,Y)*Fa+_:0,C&&(x*=Math.abs(Math.cos(C*mu))),r.svg&&(h-=R-(R*j+O*W),p-=O-(R*V+O*Y))):(ae=M[6],ne=M[7],H=M[8],L=M[9],Z=M[10],ie=M[11],h=M[12],p=M[13],v=M[14],A=ql(ae,Z),b=A*Fa,A&&(N=Math.cos(-A),D=Math.sin(-A),X=K*N+H*D,$=B*N+L*D,te=ae*N+Z*D,H=K*-D+H*N,L=B*-D+L*N,Z=ae*-D+Z*N,ie=ne*-D+ie*N,K=X,B=$,ae=te),A=ql(-W,Z),E=A*Fa,A&&(N=Math.cos(-A),D=Math.sin(-A),X=j*N-H*D,$=V*N-L*D,te=W*N-Z*D,ie=Y*D+ie*N,j=X,V=$,W=te),A=ql(V,j),_=A*Fa,A&&(N=Math.cos(A),D=Math.sin(A),X=j*N+V*D,$=K*N+B*D,V=V*N-j*D,B=B*N-K*D,j=X,K=$),b&&Math.abs(b)+Math.abs(_)>359.9&&(b=_=0,E=180-E),y=an(Math.sqrt(j*j+V*V+W*W)),x=an(Math.sqrt(B*B+ae*ae)),A=ql(K,B),C=Math.abs(A)>2e-4?A*Fa:0,T=ie?1/(ie<0?-ie:ie):0),r.svg&&(X=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!uA(Ur(e,Zt)),X&&e.setAttribute("transform",X))),Math.abs(C)>90&&Math.abs(C)<270&&(i?(y*=-1,C+=_<=0?180:-180,_+=_<=0?180:-180):(x*=-1,C+=C<=0?180:-180)),n=n||r.uncache,r.x=h-((r.xPercent=h&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+a,r.y=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+a,r.z=v+a,r.scaleX=an(y),r.scaleY=an(x),r.rotation=an(_)+u,r.rotationX=an(b)+u,r.rotationY=an(E)+u,r.skewX=C+u,r.skewY=P+u,r.transformPerspective=T+a,(r.zOrigin=parseFloat(f.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Tr]=Mm(f)),r.xOffset=r.yOffset=0,r.force3D=Gr.force3D,r.renderTransform=r.svg?Lq:iA?cA:Dq,r.uncache=0,r},Mm=function(e){return(e=e.split(" "))[0]+" "+e[1]},x1=function(e,n,r){var s=qn(n);return an(parseFloat(n)+parseFloat(ea(e,"x",r+"px",s)))+s},Dq=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,cA(e,n)},Ma="0deg",Xc="0px",Na=") ",cA=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.z,f=r.rotation,h=r.rotationY,p=r.rotationX,v=r.skewX,y=r.skewY,x=r.scaleX,_=r.scaleY,b=r.transformPerspective,E=r.force3D,C=r.target,P=r.zOrigin,T="",R=E==="auto"&&e&&e!==1||E===!0;if(P&&(p!==Ma||h!==Ma)){var O=parseFloat(h)*mu,M=Math.sin(O),A=Math.cos(O),N;O=parseFloat(p)*mu,N=Math.cos(O),a=x1(C,a,M*N*-P),u=x1(C,u,-Math.sin(O)*-P),c=x1(C,c,A*N*-P+P)}b!==Xc&&(T+="perspective("+b+Na),(s||i)&&(T+="translate("+s+"%, "+i+"%) "),(R||a!==Xc||u!==Xc||c!==Xc)&&(T+=c!==Xc||R?"translate3d("+a+", "+u+", "+c+") ":"translate("+a+", "+u+Na),f!==Ma&&(T+="rotate("+f+Na),h!==Ma&&(T+="rotateY("+h+Na),p!==Ma&&(T+="rotateX("+p+Na),(v!==Ma||y!==Ma)&&(T+="skew("+v+", "+y+Na),(x!==1||_!==1)&&(T+="scale("+x+", "+_+Na),C.style[Zt]=T||"translate(0, 0)"},Lq=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.rotation,f=r.skewX,h=r.skewY,p=r.scaleX,v=r.scaleY,y=r.target,x=r.xOrigin,_=r.yOrigin,b=r.xOffset,E=r.yOffset,C=r.forceCSS,P=parseFloat(a),T=parseFloat(u),R,O,M,A,N;c=parseFloat(c),f=parseFloat(f),h=parseFloat(h),h&&(h=parseFloat(h),f+=h,c+=h),c||f?(c*=mu,f*=mu,R=Math.cos(c)*p,O=Math.sin(c)*p,M=Math.sin(c-f)*-v,A=Math.cos(c-f)*v,f&&(h*=mu,N=Math.tan(f-h),N=Math.sqrt(1+N*N),M*=N,A*=N,h&&(N=Math.tan(h),N=Math.sqrt(1+N*N),R*=N,O*=N)),R=an(R),O=an(O),M=an(M),A=an(A)):(R=p,A=v,O=M=0),(P&&!~(a+"").indexOf("px")||T&&!~(u+"").indexOf("px"))&&(P=ea(y,"x",a,"px"),T=ea(y,"y",u,"px")),(x||_||b||E)&&(P=an(P+x-(x*R+_*M)+b),T=an(T+_-(x*O+_*A)+E)),(s||i)&&(N=y.getBBox(),P=an(P+s/100*N.width),T=an(T+i/100*N.height)),N="matrix("+R+","+O+","+M+","+A+","+P+","+T+")",y.setAttribute("transform",N),C&&(y.style[Zt]=N)},jq=function(e,n,r,s,i){var a=360,u=Tn(i),c=parseFloat(i)*(u&&~i.indexOf("rad")?Fa:1),f=c-s,h=s+f+"deg",p,v;return u&&(p=i.split("_")[1],p==="short"&&(f%=a,f!==f%(a/2)&&(f+=f<0?a:-a)),p==="cw"&&f<0?f=(f+a*EC)%a-~~(f/a)*a:p==="ccw"&&f>0&&(f=(f-a*EC)%a-~~(f/a)*a)),e._pt=v=new Pr(e._pt,n,r,s,f,_q),v.e=h,v.u="deg",e._props.push(r),v},IC=function(e,n){for(var r in n)e[r]=n[r];return e},Fq=function(e,n,r){var s=IC({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,u,c,f,h,p,v,y,x;s.svg?(f=r.getAttribute("transform"),r.setAttribute("transform",""),a[Zt]=n,u=tf(r,1),Jo(r,Zt),r.setAttribute("transform",f)):(f=getComputedStyle(r)[Zt],a[Zt]=n,u=tf(r,1),a[Zt]=f);for(c in Qi)f=s[c],h=u[c],f!==h&&i.indexOf(c)<0&&(y=qn(f),x=qn(h),p=y!==x?ea(r,c,f,x):parseFloat(f),v=parseFloat(h),e._pt=new Pr(e._pt,u,c,p,v-p,I_),e._pt.u=x||0,e._props.push(c));IC(u,s)};Cr("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});Im[e>1?"border"+t:t]=function(u,c,f,h,p){var v,y;if(arguments.length<4)return v=a.map(function(x){return Vi(u,x,f)}),y=v.join(" "),y.split(v[0]).length===5?v[0]:y;v=(h+"").split(" "),y={},a.forEach(function(x,_){return y[x]=v[_]=v[_]||v[(_-1)/2|0]}),u.init(c,y,p)}});var dA={name:"css",register:N_,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,f,h,p,v,y,x,_,b,E,C,P,T,R,O,M,A,N;Ix||N_(),this.styles=this.styles||sA(e),A=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(h=n[_],!(Vr[_]&&KR(_,n,r,s,e,i)))){if(y=typeof h,x=Im[_],y==="function"&&(h=h.call(r,s,e,i),y=typeof h),y==="string"&&~h.indexOf("random(")&&(h=Xd(h)),x)x(this,e,_,h,r)&&(M=1);else if(_.substr(0,2)==="--")f=(getComputedStyle(e).getPropertyValue(_)+"").trim(),h+="",Bo.lastIndex=0,Bo.test(f)||(b=qn(f),E=qn(h),E?b!==E&&(f=ea(e,_,f,E)+E):b&&(h+=b)),this.add(u,"setProperty",f,h,s,i,0,0,_),a.push(_),A.push(_,0,u[_]);else if(y!=="undefined"){if(c&&_ in c?(f=typeof c[_]=="function"?c[_].call(r,s,e,i):c[_],Tn(f)&&~f.indexOf("random(")&&(f=Xd(f)),qn(f+"")||f==="auto"||(f+=Gr.units[_]||qn(Vi(e,_))||""),(f+"").charAt(1)==="="&&(f=Vi(e,_))):f=Vi(e,_),v=parseFloat(f),C=y==="string"&&h.charAt(1)==="="&&h.substr(0,2),C&&(h=h.substr(2)),p=parseFloat(h),_ in si&&(_==="autoAlpha"&&(v===1&&Vi(e,"visibility")==="hidden"&&p&&(v=0),A.push("visibility",0,u.visibility),Ho(this,u,"visibility",v?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=si[_],~_.indexOf(",")&&(_=_.split(",")[0]))),P=_ in Qi,P){if(this.styles.save(_),N=h,y==="string"&&h.substring(0,6)==="var(--"){if(h=Ur(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var D=e.style.perspective;e.style.perspective=h,h=Ur(e,"perspective"),D?e.style.perspective=D:Jo(e,"perspective")}p=parseFloat(h)}if(T||(R=e._gsap,R.renderTransform&&!n.parseTransform||tf(e,n.parseTransform),O=n.smoothOrigin!==!1&&R.smooth,T=this._pt=new Pr(this._pt,u,Zt,0,1,R.renderTransform,R,0,-1),T.dep=1),_==="scale")this._pt=new Pr(this._pt,R,"scaleY",R.scaleY,(C?hu(R.scaleY,C+p):p)-R.scaleY||0,I_),this._pt.u=0,a.push("scaleY",_),_+="X";else if(_==="transformOrigin"){A.push(Tr,0,u[Tr]),h=Nq(h),R.svg?O_(e,h,0,O,0,this):(E=parseFloat(h.split(" ")[2])||0,E!==R.zOrigin&&Ho(this,R,"zOrigin",R.zOrigin,E),Ho(this,u,_,Mm(f),Mm(h)));continue}else if(_==="svgOrigin"){O_(e,h,1,O,0,this);continue}else if(_ in lA){jq(this,R,_,v,C?hu(v,C+h):h);continue}else if(_==="smoothOrigin"){Ho(this,R,"smooth",R.smooth,h);continue}else if(_==="force3D"){R[_]=h;continue}else if(_==="transform"){Fq(this,h,e);continue}}else _ in u||(_=Wu(_)||_);if(P||(p||p===0)&&(v||v===0)&&!yq.test(h)&&_ in u)b=(f+"").substr((v+"").length),p||(p=0),E=qn(h)||(_ in Gr.units?Gr.units[_]:b),b!==E&&(v=ea(e,_,f,E)),this._pt=new Pr(this._pt,P?R:u,_,v,(C?hu(v,C+p):p)-v,!P&&(E==="px"||_==="zIndex")&&n.autoRound!==!1?bq:I_),this._pt.u=E||0,P&&N!==h?(this._pt.b=f,this._pt.e=N,this._pt.r=wq):b!==E&&E!=="%"&&(this._pt.b=f,this._pt.r=xq);else if(_ in u)Mq.call(this,e,_,f,C?C+h:h);else if(_ in e)this.add(e,_,f||e[_],C?C+h:h,s,i);else if(_!=="parseTransform"){wx(_,h);continue}P||(_ in u?A.push(_,0,u[_]):typeof e[_]=="function"?A.push(_,2,e[_]()):A.push(_,1,f||e[_])),a.push(_)}}M&&JR(this)},render:function(e,n){if(n.tween._time||!Mx())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Vi,aliases:si,getSetter:function(e,n,r){var s=si[n];return s&&s.indexOf(",")<0&&(n=s),n in Qi&&n!==Tr&&(e._gsap.x||Vi(e,"x"))?r&&SC===r?n==="scale"?Cq:kq:(SC=r||{})&&(n==="scale"?Pq:Tq):e.style&&!yx(e.style[n])?Sq:~n.indexOf("-")?Eq:Rx(e,n)},core:{_removeProperty:Jo,_getMatrix:Ox}};Rr.utils.checkPrefix=Wu;Rr.core.getStyleSaver=sA;(function(t,e,n,r){var s=Cr(t+","+e+","+n,function(i){Qi[i]=1});Cr(e,function(i){Gr.units[i]="deg",lA[i]=1}),si[s[13]]=t+","+e,Cr(r,function(i){var a=i.split(":");si[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");Cr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Gr.units[t]="px"});Rr.registerPlugin(dA);var bs=Rr.registerPlugin(dA)||Rr;bs.core.Tween;const Tp="/assets/logo-animation",w1=1280,Vq=[{id:"eraser",src:`${Tp}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${Tp}/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:`${Tp}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],$q=[{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}],D_=({className:t})=>{const e=g.useRef(null),n=g.useRef(null),r=g.useRef(null);return g.useEffect(()=>{const s=e.current,i=n.current,a=r.current;if(!s||!i||!a)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches,c=(E,C)=>E+Math.random()*(C-E);let f=null,h,p=1;const v=Vq.map(E=>({...E})),y=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const E=s.getBoundingClientRect(),C=E.width||w1,P=E.height||w1*.64;p=C/w1,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const R=250*p/337,O=[],M=(A,N,D)=>{const j=document.createElement("div");return j.className="la-obj",j.style.width=`${N}px`,j.innerHTML=`<img src="${A}" alt="" style="${D?"transform:scaleX(-1)":""}">`,s.appendChild(j),j};return $q.forEach((A,N)=>{const D=A.w*p,j=M(`${Tp}/sea/${A.k}.png`,D,N%2===0);bs.set(j,{x:A.x*C-D/2,y:A.y*P-D/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),O.push({el:j,hero:!1,rest:1})}),v.forEach(A=>{const N=A.cssW*p;A.el=M(A.src,N,!!A.flip),A.finalScale=A.fit*R/(A.cssW*p),bs.set(A.el,{x:A.seaX*C-N/2,y:A.seaY*P-A.cssH*p/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),O.push({el:A.el,hero:!0,rest:150/A.cssW})}),O},x=(E,C)=>{const P=s.getBoundingClientRect(),T=a.getBoundingClientRect();return{x:T.left-P.left+E/326*T.width,y:T.top-P.top+C/337*T.height}},_=()=>{f&&f.revert();const E=y();if(u){f=bs.context(()=>{E.filter(T=>!T.hero).forEach(T=>bs.set(T.el,{scale:0})),v.forEach(T=>{if(!T.el)return;const R=x(T.localX,T.localY);bs.set(T.el,{x:R.x-T.cssW*p/2,y:R.y-T.cssH*p/2,rotation:T.rot,scale:T.finalScale})})},s);return}const C=[],P=[];f=bs.context(()=>{const T=bs.timeline();T.to(E.map(R=>R.el),{scale:R=>E[R].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),T.add(()=>{E.forEach(({el:R,hero:O},M)=>{const A=O?C:P,N=M%2?1:-1;A.push(bs.to(R,{rotation:"+="+c(2.5,6)*N,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),bs.to(R,{y:"+="+c(5,11)*N,x:"+="+c(4,9)*-N,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"),v.forEach((R,O)=>{R.el&&T.to(R.el,{scale:150/R.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+O*.08)}),T.add("clear","pick+=0.7"),T.add(()=>P.forEach(R=>R.kill()),"clear"),T.to(E.filter(R=>!R.hero).map(R=>R.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(R=>R.kill()),"assemble"),v.forEach((R,O)=>{if(!R.el||R.finalScale===void 0)return;const M=x(R.localX,R.localY);T.to(R.el,{x:M.x-R.cssW*p/2,y:M.y-R.cssH*p/2,rotation:R.rot,scale:R.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+O*.12)}),v.forEach(R=>{!R.el||R.finalScale===void 0||T.to(R.el,{scale:R.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};bs.ticker.fps(12),_();const b=()=>{clearTimeout(h),h=setTimeout(_,250)};return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b),clearTimeout(h),f==null||f.revert(),s.querySelectorAll(".la-obj").forEach(E=>E.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},Hq=Object.freeze(Object.defineProperty({__proto__:null,default:D_},Symbol.toStringTag,{value:"Module"})),MC=({isSigningIn:t})=>t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{children:"Signing in..."})]}):S.jsxs(S.Fragment,{children:[S.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),S.jsx("span",{children:"Sign in with Google"})]}),fA=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,isDesktopShell:r=!1,displayMode:s="full"})=>s==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(D_,{className:"relative z-0 h-44 w-full"}),S.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),S.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(MC,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[r?S.jsx("div",{className:"fixed left-0 right-0 top-0 z-10 h-8",style:{WebkitAppRegion:"drag"}}):null,S.jsx(D_,{className:"absolute inset-0 z-0"}),S.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[S.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),S.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(MC,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),zq="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",Uq=({message:t})=>S.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:S.jsxs("div",{className:"flex flex-col items-center gap-10",children:[S.jsx("img",{src:zq,alt:"Rivet",className:"h-8 w-auto object-contain"}),S.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[S.jsx(r0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),Bq="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",Nm=44,Qc=8,rp=16,Wq=4,NC=-18,Gq=.18,Kq=[.22,1,.36,1],OC=.92,qq=1,Zq=.95,Yq=.4,Xq=[.19,1,.22,1],b1=0,Qq=1,Jq=0,eZ=0,tZ=0,hA=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Qc,s=Math.max(r,e.width-Nm-Qc),i=Math.max(Qc,e.height-Nm-Qc);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Qc,t.y))}},Dx=()=>({width:window.innerWidth,height:window.innerHeight}),nZ=({position:t,boundsLeftPx:e=0})=>hA({position:t,viewport:Dx(),boundsLeft:e}),rZ=()=>{if(typeof window>"u")return{x:rp,y:rp};const t=Dx();return{x:t.width-Nm-rp,y:t.height-Nm-rp}},sZ=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=Wq,iZ=t=>t.button===void 0||t.button<=tZ,DC=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},oZ=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:a})=>{const u=g.useRef(null),c=g.useRef(!1),[f,h]=g.useState(!1),[p,v]=g.useState(!1),y=n?!1:{opacity:b1,scale:OC,x:NC},x=n?{opacity:b1}:{opacity:b1,scale:OC,x:NC},_=n?{duration:eZ}:{duration:Gq,ease:Kq,scale:{duration:Yq,ease:Xq}},b=g.useCallback(()=>{const R=u.current;R&&(c.current=R.hasMoved),u.current=null,h(!1)},[]),E=g.useCallback(R=>{const O=u.current;if(!O)return;const M=DC(R),A=M.x-O.startPointer.x,N=M.y-O.startPointer.y,D=O.hasMoved||sZ({deltaX:A,deltaY:N});u.current={...O,hasMoved:D},D&&a(hA({position:{x:O.startPosition.x+A,y:O.startPosition.y+N},viewport:Dx(),boundsLeft:s}))},[a,s]),C=g.useCallback(R=>{if(u.current||!iZ(R))return;const O=DC(R);u.current={startPointer:O,startPosition:r,hasMoved:!1},h(!0)},[r]),P=g.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),T=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[f?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:E,onPointerUp:b,onPointerCancel:b,onMouseMove:E,onMouseUp:b}):null,S.jsx(Gi,{children:t?S.jsx(Fo,{label:T,side:"top",forceOpen:p&&!f?void 0:!1,children:S.jsx(sl.button,{type:"button","aria-label":T,"data-cy":"reopen-panel",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),initial:y,animate:{opacity:Qq,scale:qq,x:Jq},whileTap:{scale:Zq},exit:x,transition:_,onPointerDown:C,onMouseDown:C,onPointerMove:E,onPointerUp:b,onPointerCancel:b,onMouseMove:E,onMouseUp:b,onClick:P,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${f?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:S.jsx("img",{src:Bq,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},S1=ds("useConfig"),aZ=300*1e3,lZ=1800*1e3,uZ=60*1e3,cZ=300*1e3,dZ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},fZ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},hZ=t=>({...GT,...t??{}}),pZ=()=>{const t=Qe(h_),e=st(h_),n=st(r5),r=st(s5),s=st(s0),i=st(AU),a=st(n5),u=st(TU),c=st(pf),f=st(YT),h=st(t5),p=g.useCallback(C=>{a(C.agentModeAvailable),f({name:C.name??null,email:C.email??null}),h(C.demoMode===!0),C.isMCPSession&&n(!0),C.mcpEditor&&r(C.mcpEditor),s(C.agentApplyMode??fZ()??null),i(C.queueAccessToken??dZ())},[s,a,h,n,r,i,f]),v=z1({queryKey:["rivet-config"],queryFn:async()=>{const C=await fetch("/api/config");if(!C.ok)throw new Error(`Failed to fetch config: ${C.statusText}`);return await C.json()},staleTime:aZ,gcTime:lZ}),y=z1({queryKey:["rivet-feature-flags"],queryFn:async()=>{const C=await fetch("/api/feature-flags");if(!C.ok)throw new Error(`Failed to fetch feature flags: ${C.statusText}`);return await C.json()},staleTime:uZ,gcTime:cZ}),{refetch:x}=v,{refetch:_}=y;g.useLayoutEffect(()=>{v.data&&(p(v.data),c(!1),S1.info("Config loaded:",v.data)),y.data&&(e(hZ(y.data.featureFlags)),u(!0))},[v.data,y.data,p,c,e,u]),g.useLayoutEffect(()=>{v.error&&(u(!0),c(!1),S1.warn("Failed to load config:",v.error instanceof Error?v.error.message:"Failed to load config")),y.error&&(u(!0),S1.warn("Failed to load feature flags:",y.error instanceof Error?y.error.message:"Failed to load feature flags"))},[v.error,y.error,c,u]);const b=g.useCallback(async()=>{const[C]=await Promise.all([x(),_()]);return C.data?C.data:null},[x,_]);let E=null;return v.error instanceof Error?E=v.error.message:v.error&&(E="Failed to load config"),{config:v.data??null,featureFlags:t,loading:v.isPending||!v.error&&y.isPending,error:E,refetchConfig:b}},Rp="rivet_just_signed_in",Zl=ds("useOAuthCallback"),mZ="https://rivet-proxy.onrender.com",gZ=()=>{const[t,e]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var u,c,f;const i=window.location.hash,a=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{Zl.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),v=h.get("refresh_token"),x=new URLSearchParams(a).get("session");if(!p)throw new Error("No access token found in URL");if(!x)throw new Error("No session ID found in URL");Zl.info(`Completing OAuth with session: ${x}`);const _=await fetch(`${mZ}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:p,refreshToken:v}),signal:n.signal}),b=await _.json();if(!_.ok||!b.success)throw new Error(b.error||b.message||"Failed to complete authentication");if(Zl.info("OAuth authentication completed successfully"),r)return;if((u=b.user)!=null&&u.id?(Pe.identify(b.user.id,{...b.user.email?{email:b.user.email}:{}}),b.user.email&&Pe.alias(b.user.email,b.user.id)):(c=b.user)!=null&&c.email&&Pe.identify(b.user.email,{email:b.user.email}),(f=b.user)!=null&&f.email&&p)try{const C=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b.user.email,token:p,refreshToken:v,userId:b.user.id}),signal:n.signal});C.ok||Zl.warn(`Local auth store returned ${C.status}`)}catch(C){if(r)return;Zl.warn("Failed to store auth locally:",C)}if(r)return;window.sessionStorage.setItem(Rp,"1");const E=window.location.pathname;window.history.replaceState({},document.title,E),e({isProcessing:!1,isComplete:!0,error:null})}catch(h){if(r)return;const p=h instanceof Error?h.message:"Unknown error occurred";Zl.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},E1=ds("useAgentVariantsSession"),vZ=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,LC=(t,e,n)=>{e.size===0&&!n||t.set(zd,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})},yZ=(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(f=>f.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},_Z=({enabled:t=!0}={})=>{const e=st(hf),n=st(KT),r=st(SU),s=st(JT),i=st(PU),a=p2(),u=g.useRef(null);g.useEffect(()=>{if(!t)return;const c=new EventSource("/api/variants/events");return c.onmessage=f=>{try{const h=JSON.parse(f.data),p=u.current;if(h.active){const x=new Set(h.variants.map(_=>_.requestId).filter(_=>!!_));s(_=>_.filter(E=>!x.has(E.requestId))),LC(a,x,!1),a.set(zd,_=>{let b=_;for(const E of h.variants){const C=E.adoptedSource;C&&(b=CU(b,{kind:"variant",sessionId:C.sessionId,variantId:C.variantId},{kind:"variant",sessionId:h.sessionId,variantId:E.workItemId}))}return b}),a.set(zd,_=>yZ(_,h)),h.sessionId!==u.current&&(u.current=h.sessionId,n(!0),r("directions"))}else u.current=null,LC(a,new Set,vZ(h));e(h);const v=!h.active&&p!==null,y=h.active&&h.sessionId!==p;if(y&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(x=>E1.warn("failed to reset preview-port on session switch",x)),v||y){const x=new Set;if(h.active)for(const b of h.variants)x.add($d({kind:"variant",sessionId:h.sessionId,variantId:b.workItemId}));const _=a.get(Zo);for(const b of[_==null?void 0:_.left,_==null?void 0:_.right])b&&x.add($d({kind:"variant",sessionId:b.sessionId,variantId:b.variantId}));i(x)}}catch(h){E1.warn("failed to parse SSE event payload",h)}},c.onerror=f=>{E1.warn("SSE error (auto-reconnects)",f)},()=>{c.close()}},[t,e,n,r,s,i,a])};function pA(t){const e=t+"CollectionProvider",[n,r]=na(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=_=>{const{scope:b,children:E}=_,C=g.useRef(null),P=g.useRef(new Map).current;return S.jsx(s,{scope:b,itemMap:P,collectionRef:C,children:E})};a.displayName=e;const u=t+"CollectionSlot",c=jd(u),f=g.forwardRef((_,b)=>{const{scope:E,children:C}=_,P=i(u,E),T=Yt(b,P.collectionRef);return S.jsx(c,{ref:T,children:C})});f.displayName=u;const h=t+"CollectionItemSlot",p="data-radix-collection-item",v=jd(h),y=g.forwardRef((_,b)=>{const{scope:E,children:C,...P}=_,T=g.useRef(null),R=Yt(b,T),O=i(h,E);return g.useEffect(()=>(O.itemMap.set(T,{ref:T,...P}),()=>void O.itemMap.delete(T))),S.jsx(v,{[p]:"",ref:R,children:C})});y.displayName=h;function x(_){const b=i(t+"CollectionConsumer",_);return g.useCallback(()=>{const C=b.collectionRef.current;if(!C)return[];const P=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(b.itemMap.values()).sort((O,M)=>P.indexOf(O.ref.current)-P.indexOf(M.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},x,r]}var _0="Collapsible",[xZ,mA]=na(_0),[wZ,Lx]=xZ(_0),gA=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...u}=t,[c,f]=hl({prop:r,defaultProp:s??!1,onChange:a,caller:_0});return S.jsx(wZ,{scope:n,disabled:i,contentId:il(),open:c,onOpenToggle:g.useCallback(()=>f(h=>!h),[f]),children:S.jsx(Rt.div,{"data-state":Fx(c),"data-disabled":i?"":void 0,...u,ref:e})})});gA.displayName=_0;var vA="CollapsibleTrigger",yA=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=Lx(vA,n);return S.jsx(Rt.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":Fx(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:Et(t.onClick,s.onOpenToggle)})});yA.displayName=vA;var jx="CollapsibleContent",_A=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Lx(jx,t.__scopeCollapsible);return S.jsx(Ji,{present:n||s.open,children:({present:i})=>S.jsx(bZ,{...r,ref:e,present:i})})});_A.displayName=jx;var bZ=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=Lx(jx,n),[u,c]=g.useState(r),f=g.useRef(null),h=Yt(e,f),p=g.useRef(0),v=p.current,y=g.useRef(0),x=y.current,_=a.open||u,b=g.useRef(_),E=g.useRef(void 0);return g.useEffect(()=>{const C=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(C)},[]),ai(()=>{const C=f.current;if(C){E.current=E.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const P=C.getBoundingClientRect();p.current=P.height,y.current=P.width,b.current||(C.style.transitionDuration=E.current.transitionDuration,C.style.animationName=E.current.animationName),c(r)}},[a.open,r]),S.jsx(Rt.div,{"data-state":Fx(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!_,...i,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...t.style},children:_&&s})});function Fx(t){return t?"open":"closed"}var SZ=gA,EZ=yA,kZ=_A,CZ=g.createContext(void 0);function xA(t){const e=g.useContext(CZ);return t||e||"ltr"}var As="Accordion",PZ=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Vx,TZ,RZ]=pA(As),[x0]=na(As,[RZ,mA]),$x=mA(),wA=g.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return S.jsx(Vx.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?S.jsx(NZ,{...i,ref:e}):S.jsx(MZ,{...s,ref:e})})});wA.displayName=As;var[bA,AZ]=x0(As),[SA,IZ]=x0(As,{collapsible:!1}),MZ=g.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...a}=t,[u,c]=hl({prop:n,defaultProp:r??"",onChange:s,caller:As});return S.jsx(bA,{scope:t.__scopeAccordion,value:g.useMemo(()=>u?[u]:[],[u]),onItemOpen:c,onItemClose:g.useCallback(()=>i&&c(""),[i,c]),children:S.jsx(SA,{scope:t.__scopeAccordion,collapsible:i,children:S.jsx(EA,{...a,ref:e})})})}),NZ=g.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a,u]=hl({prop:n,defaultProp:r??[],onChange:s,caller:As}),c=g.useCallback(h=>u((p=[])=>[...p,h]),[u]),f=g.useCallback(h=>u((p=[])=>p.filter(v=>v!==h)),[u]);return S.jsx(bA,{scope:t.__scopeAccordion,value:a,onItemOpen:c,onItemClose:f,children:S.jsx(SA,{scope:t.__scopeAccordion,collapsible:!0,children:S.jsx(EA,{...i,ref:e})})})}),[OZ,w0]=x0(As),EA=g.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...a}=t,u=g.useRef(null),c=Yt(u,e),f=TZ(n),p=xA(s)==="ltr",v=Et(t.onKeyDown,y=>{var A;if(!PZ.includes(y.key))return;const x=y.target,_=f().filter(N=>{var D;return!((D=N.ref.current)!=null&&D.disabled)}),b=_.findIndex(N=>N.ref.current===x),E=_.length;if(b===-1)return;y.preventDefault();let C=b;const P=0,T=E-1,R=()=>{C=b+1,C>T&&(C=P)},O=()=>{C=b-1,C<P&&(C=T)};switch(y.key){case"Home":C=P;break;case"End":C=T;break;case"ArrowRight":i==="horizontal"&&(p?R():O());break;case"ArrowDown":i==="vertical"&&R();break;case"ArrowLeft":i==="horizontal"&&(p?O():R());break;case"ArrowUp":i==="vertical"&&O();break}const M=C%E;(A=_[M].ref.current)==null||A.focus()});return S.jsx(OZ,{scope:n,disabled:r,direction:s,orientation:i,children:S.jsx(Vx.Slot,{scope:n,children:S.jsx(Rt.div,{...a,"data-orientation":i,ref:c,onKeyDown:r?void 0:v})})})}),Om="AccordionItem",[DZ,Hx]=x0(Om),kA=g.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...s}=t,i=w0(Om,n),a=AZ(Om,n),u=$x(n),c=il(),f=r&&a.value.includes(r)||!1,h=i.disabled||t.disabled;return S.jsx(DZ,{scope:n,open:f,disabled:h,triggerId:c,children:S.jsx(SZ,{"data-orientation":i.orientation,"data-state":IA(f),...u,...s,ref:e,disabled:h,open:f,onOpenChange:p=>{p?a.onItemOpen(r):a.onItemClose(r)}})})});kA.displayName=Om;var CA="AccordionHeader",PA=g.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=w0(As,n),i=Hx(CA,n);return S.jsx(Rt.h3,{"data-orientation":s.orientation,"data-state":IA(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});PA.displayName=CA;var L_="AccordionTrigger",TA=g.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=w0(As,n),i=Hx(L_,n),a=IZ(L_,n),u=$x(n);return S.jsx(Vx.ItemSlot,{scope:n,children:S.jsx(EZ,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...u,...r,ref:e})})});TA.displayName=L_;var RA="AccordionContent",AA=g.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=w0(As,n),i=Hx(RA,n),a=$x(n);return S.jsx(kZ,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});AA.displayName=RA;function IA(t){return t?"open":"closed"}var MA=wA,LZ=kA,jZ=PA,FZ=TA,VZ=AA;/**
|
|
129
|
+
* @license lucide-react v1.24.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const NA=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
134
|
+
* @license lucide-react v1.24.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const $Z=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
139
|
+
* @license lucide-react v1.24.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const HZ=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
144
|
+
* @license lucide-react v1.24.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const jC=t=>{const e=HZ(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
149
|
+
* @license lucide-react v1.24.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/var k1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
154
|
+
* @license lucide-react v1.24.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const zZ=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},UZ=g.createContext({}),BZ=()=>g.useContext(UZ),WZ=g.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...u},c)=>{const{size:f=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:v="currentColor",className:y=""}=BZ()??{},x=r??p?Number(n??h)*24/Number(e??f):n??h;return g.createElement("svg",{ref:c,...k1,width:e??f??k1.width,height:e??f??k1.height,stroke:t??v,strokeWidth:x,className:NA("lucide",y,s),...!i&&!zZ(u)&&{"aria-hidden":"true"},...u},[...a.map(([_,b])=>g.createElement(_,b)),...Array.isArray(i)?i:[i]])});/**
|
|
159
|
+
* @license lucide-react v1.24.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const Ze=(t,e)=>{const n=g.forwardRef(({className:r,...s},i)=>g.createElement(WZ,{ref:i,iconNode:e,className:NA(`lucide-${$Z(jC(t))}`,`lucide-${t}`,r),...s}));return n.displayName=jC(t),n};/**
|
|
164
|
+
* @license lucide-react v1.24.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const GZ=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],KZ=Ze("arrow-left",GZ);/**
|
|
169
|
+
* @license lucide-react v1.24.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const qZ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ZZ=Ze("arrow-right",qZ);/**
|
|
174
|
+
* @license lucide-react v1.24.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const YZ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],XZ=Ze("arrow-up",YZ);/**
|
|
179
|
+
* @license lucide-react v1.24.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const QZ=[["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"}]],JZ=Ze("bell",QZ);/**
|
|
184
|
+
* @license lucide-react v1.24.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const eY=[["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"}]],tY=Ze("brain",eY);/**
|
|
189
|
+
* @license lucide-react v1.24.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const nY=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],rY=Ze("check",nY);/**
|
|
194
|
+
* @license lucide-react v1.24.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const sY=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],iY=Ze("chevron-down",sY);/**
|
|
199
|
+
* @license lucide-react v1.24.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const oY=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aY=Ze("chevron-right",oY);/**
|
|
204
|
+
* @license lucide-react v1.24.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const lY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],uY=Ze("circle",lY);/**
|
|
209
|
+
* @license lucide-react v1.24.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const cY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],dY=Ze("clock",cY);/**
|
|
214
|
+
* @license lucide-react v1.24.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const fY=[["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"}]],hY=Ze("copy",fY);/**
|
|
219
|
+
* @license lucide-react v1.24.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const pY=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],mY=Ze("dot",pY);/**
|
|
224
|
+
* @license lucide-react v1.24.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const gY=[["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"}]],vY=Ze("globe",gY);/**
|
|
229
|
+
* @license lucide-react v1.24.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const yY=[["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"}]],_Y=Ze("heart",yY);/**
|
|
234
|
+
* @license lucide-react v1.24.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const xY=[["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"}]],wY=Ze("house",xY);/**
|
|
239
|
+
* @license lucide-react v1.24.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const bY=[["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"}]],SY=Ze("image",bY);/**
|
|
244
|
+
* @license lucide-react v1.24.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const EY=[["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"}]],kY=Ze("inbox",EY);/**
|
|
249
|
+
* @license lucide-react v1.24.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const CY=[["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"}]],PY=Ze("lightbulb",CY);/**
|
|
254
|
+
* @license lucide-react v1.24.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const TY=[["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"}]],RY=Ze("link",TY);/**
|
|
259
|
+
* @license lucide-react v1.24.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const AY=[["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"}]],IY=Ze("loader",AY);/**
|
|
264
|
+
* @license lucide-react v1.24.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const MY=[["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"}]],NY=Ze("lock",MY);/**
|
|
269
|
+
* @license lucide-react v1.24.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const OY=[["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"}]],DY=Ze("mail",OY);/**
|
|
274
|
+
* @license lucide-react v1.24.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const LY=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],jY=Ze("menu",LY);/**
|
|
279
|
+
* @license lucide-react v1.24.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const FY=[["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"}]],VY=Ze("message-circle",FY);/**
|
|
284
|
+
* @license lucide-react v1.24.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const $Y=[["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"}]],HY=Ze("monitor",$Y);/**
|
|
289
|
+
* @license lucide-react v1.24.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const zY=[["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"}]],UY=Ze("moon",zY);/**
|
|
294
|
+
* @license lucide-react v1.24.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const BY=[["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"}]],WY=Ze("paintbrush",BY);/**
|
|
299
|
+
* @license lucide-react v1.24.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const GY=[["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"}]],KY=Ze("palette",GY);/**
|
|
304
|
+
* @license lucide-react v1.24.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const qY=[["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"}]],ZY=Ze("pause",qY);/**
|
|
309
|
+
* @license lucide-react v1.24.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const YY=[["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"}]],XY=Ze("pencil",YY);/**
|
|
314
|
+
* @license lucide-react v1.24.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const QY=[["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"}]],JY=Ze("pipette",QY);/**
|
|
319
|
+
* @license lucide-react v1.24.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const eX=[["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"}]],tX=Ze("play",eX);/**
|
|
324
|
+
* @license lucide-react v1.24.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const nX=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],rX=Ze("plus",nX);/**
|
|
329
|
+
* @license lucide-react v1.24.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const sX=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],iX=Ze("rectangle-horizontal",sX);/**
|
|
334
|
+
* @license lucide-react v1.24.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const oX=[["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"}]],aX=Ze("rocket",oX);/**
|
|
339
|
+
* @license lucide-react v1.24.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const lX=[["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"}]],uX=Ze("rotate-ccw",lX);/**
|
|
344
|
+
* @license lucide-react v1.24.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const cX=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],dX=Ze("search",cX);/**
|
|
349
|
+
* @license lucide-react v1.24.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const fX=[["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"}]],hX=Ze("settings",fX);/**
|
|
354
|
+
* @license lucide-react v1.24.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const pX=[["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"}]],mX=Ze("shield",pX);/**
|
|
359
|
+
* @license lucide-react v1.24.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const gX=[["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"}]],vX=Ze("skip-forward",gX);/**
|
|
364
|
+
* @license lucide-react v1.24.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const yX=[["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"}]],_X=Ze("square-library",yX);/**
|
|
369
|
+
* @license lucide-react v1.24.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const xX=[["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"}]],wX=Ze("star",xX);/**
|
|
374
|
+
* @license lucide-react v1.24.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const bX=[["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"}]],SX=Ze("sun",bX);/**
|
|
379
|
+
* @license lucide-react v1.24.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const EX=[["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"}]],kX=Ze("user",EX);/**
|
|
384
|
+
* @license lucide-react v1.24.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const CX=[["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"}]],PX=Ze("users",CX);/**
|
|
389
|
+
* @license lucide-react v1.24.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const TX=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],RX=Ze("x",TX),AX={"chevron-right":aY,"chevron-down":iY,pipette:JY,x:RX,copy:hY,menu:jY,dot:mY,monitor:HY,sun:SX,moon:UY,"rectangle-horizontal":iX,circle:uY,"square-library":_X,clock:dY,star:wX,settings:hX,plus:rX,"arrow-left":KZ,"arrow-right":ZZ,"arrow-up":XZ,search:dX,loader:IY,users:PX,lock:NY,mail:DY,bell:JZ,shield:mX,palette:KY,lightbulb:PY,rocket:aX,heart:_Y,paintbrush:WY,brain:tY,globe:vY,user:kX,image:SY,link:RY,check:rY,"rotate-ccw":uX,play:tX,pause:ZY,home:wY,"message-circle":VY,inbox:kY,pencil:XY,"skip-forward":vX},FC={lucide:AX},OA=g.createContext(null);function IX(t){const e=g.useContext(OA);return e?FC[e.iconLibrary][t]:FC.lucide[t]}function MX({children:t,defaultLibrary:e="lucide"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{r(i)},[]);return S.jsx(OA.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const DA=g.createContext(null);function zx(){return g.useContext(DA)}const LA=g.createContext(null);function jA(){const t=g.useContext(LA);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const NX=g.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,a=g.useRef(null),u=g.useRef(new Map),[c,f]=g.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:v,sessionRef:y,handlers:x,registerItem:_,measureItems:b}=HT(a),E=g.useCallback((ee,le)=>{le?u.current.set(ee,le):u.current.delete(ee)},[]),C=g.useCallback(()=>{if(!a.current)return;const ee=new Map;u.current.forEach((le,pe)=>{ee.set(pe,{top:le.offsetTop,left:le.offsetLeft,width:le.offsetWidth,height:le.offsetHeight})}),f(ee)},[]),[P,T]=g.useState(()=>r==="single"?t.defaultValue??"":""),[R,O]=g.useState(()=>r==="multiple"?t.defaultValue??[]:[]),M=t.onValueChange,A=t.onValueChange,N=t.value,D=new Set(r==="multiple"?t.value??R:(()=>{const ee=t.value??P;return ee?[ee]:[]})()),j=g.useCallback(ee=>{const le=t;le.onValueChange?le.onValueChange(ee):T(ee)},[M]),V=g.useCallback(ee=>{const le=t;le.onValueChange?le.onValueChange(ee):O(ee)},[A]),W=g.useCallback(ee=>{if(r==="multiple"){const le=t.value??R;V(le.filter(pe=>pe!==ee))}else j("")},[r,j,V,R,N]);g.useEffect(()=>{b(),C()},[b,C,n]);const Y=[...D].join(",");g.useEffect(()=>{b(),C()},[b,C,Y]);const[K,B]=g.useState(null),X=h!==null?v[h]:null,$=K!==null?v[K]:null,te=h!==null&&!c.has(h),H=p0(),{value:L,defaultValue:Z,onValueChange:ne,collapsible:ie,type:ae,...ue}=i,ke=r==="multiple"?{type:"multiple",value:t.value??R,onValueChange:V}:{type:"single",collapsible:t.collapsible??!0,value:t.value??P,onValueChange:j};return S.jsx(DA.Provider,{value:{registerItem:_,registerFullItem:E,activeIndex:h,grouped:!0,remeasure:()=>{b(),C()},openValues:D,openItemRects:c,toggleValue:W},children:S.jsx(MA,{...ke,asChild:!0,children:S.jsxs("div",{ref:ee=>{a.current=ee,typeof e=="function"?e(ee):e&&(e.current=ee)},onMouseEnter:x.onMouseEnter,onMouseMove:ee=>{const le=a.current;if(le){const pe=le.getBoundingClientRect(),we=le.offsetHeight,Ie=pe.height,qe=we>0?Ie/we:1,it=(ee.clientY-pe.top)/qe+le.scrollTop;for(const[Ae,at]of c){const At=v[Ae];if(!At)continue;const mt=At.top+At.height,je=at.top+at.height;if(it>=mt&&it<=je){p(null);return}}}x.onMouseMove(ee)},onMouseLeave:x.onMouseLeave,onFocus:ee=>{var pe;const le=(pe=ee.target.closest("[data-proximity-index]"))==null?void 0:pe.getAttribute("data-proximity-index");if(le!=null){const we=Number(le);p(we),B(ee.target.matches(":focus-visible")?we:null)}},onBlur:ee=>{var le;(le=a.current)!=null&&le.contains(ee.relatedTarget)||(B(null),p(null))},className:ar("relative flex flex-col gap-0.5 w-72 max-w-full",s),...ue,children:[S.jsx(Gi,{children:[...c.entries()].map(([ee,le])=>S.jsx(Ki.div,{className:`absolute ${H.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:le.top,left:le.left,width:le.width,height:le.height,opacity:te?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${ee}`))}),S.jsx(Gi,{children:X&&S.jsx(Ki.div,{className:`absolute ${H.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:X.top,left:X.left,width:X.width,height:X.height},animate:{opacity:1,top:X.top,left:X.left,width:X.width,height:X.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Vd.fast,opacity:{duration:.08}}},y.current)}),S.jsx(Gi,{children:$&&S.jsx(Ki.div,{className:`absolute ${H.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:$.left-2,top:$.top-2,width:$.width+4,height:$.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...Vd.fast,opacity:{duration:.08}}})}),n]})})})});NX.displayName="AccordionGroup";const FA=g.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...u},c)=>{const[f,h]=g.useState(()=>e==="single"?r??"":""),[p,v]=g.useState(()=>e==="multiple"?r??[]:[]),y=new Set(e==="multiple"?s??p:(()=>{const C=s??f;return C?[C]:[]})()),x=g.useCallback(C=>{i?i(C):h(C)},[i]),_=g.useCallback(C=>{i?i(C):v(C)},[i]),b=g.useCallback(C=>{e==="multiple"?_((s??p).filter(T=>T!==C)):x("")},[e,s,p,x,_]),E=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??f,defaultValue:r,onValueChange:x};return S.jsx(MA,{...E,asChild:!0,children:S.jsx("div",{ref:c,className:ar("w-72 max-w-full flex flex-col gap-0.5",a),...u,children:S.jsx(VA.Provider,{value:y,children:S.jsx($A.Provider,{value:b,children:t})})})})});FA.displayName="Accordion";const VA=g.createContext(new Set),$A=g.createContext(()=>{}),HA=g.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const u=g.useRef(null),c=zx(),f=g.useContext(VA),h=g.useContext($A),p=p0(),v=c!=null&&c.grouped?c.openValues.has(t):f.has(t),y=g.useRef(null),x=g.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):h(t)},[c,h,t]);return g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,y.current),()=>c.registerItem(e,null)},[e,c]),g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return v?c.registerFullItem(e,u.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,v]),S.jsx(LA.Provider,{value:{index:e,value:t,isOpen:v,onToggle:x,triggerRef:y},children:S.jsxs(LZ,{ref:_=>{u.current=_,typeof a=="function"?a(_):a&&(a.current=_)},value:t,disabled:n,"data-proximity-index":e,className:ar(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&S.jsx(Gi,{children:v&&S.jsx(Ki.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]})})});HA.displayName="AccordionItem";const zA=g.forwardRef(({children:t,className:e,...n},r)=>{const s=IX("chevron-right"),i=zx(),{index:a,isOpen:u,triggerRef:c}=jA(),f=p0(),[h,p]=g.useState(!1),v=i!=null&&i.grouped?i.activeIndex===a:h,y=S.jsx(jZ,{asChild:!0,children:S.jsx("div",{children:S.jsxs(FZ,{ref:r,className:ar(`relative z-10 flex items-center gap-2.5 ${f.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:yd.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:ar("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",u||v?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:u?yd.semibold:yd.normal},children:t})]}),S.jsx(Ki.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:u?90:0},transition:Vd.fast,children:S.jsx(s,{size:16,strokeWidth:u||v?2:1.5,className:ar("transition-[color,stroke-width] duration-80",u||v?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:c,children:y}):S.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[S.jsx(Gi,{children:h&&S.jsx(Ki.div,{className:`absolute inset-0 ${f.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),y]})});zA.displayName="AccordionTrigger";const UA=g.forwardRef(({children:t,className:e,...n},r)=>{const s=zx(),{isOpen:i}=jA();return S.jsx(Gi,{initial:!1,children:i&&S.jsx(VZ,{forceMount:!0,asChild:!0,...n,children:S.jsx(Ki.div,{ref:r,className:ar("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Vd.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:S.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});UA.displayName="AccordionContent";const Ap=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(FA,{type:"multiple",defaultValue:e,className:ar("w-full",n),children:t}),OX=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const u=a.includes("first-item");return S.jsxs(HA,{value:t,className:ar("w-full",!u&&"border-t border-main-border"),children:[S.jsxs(zA,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(UA,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};Ap.Item=OX;const DX=()=>{const t=g.useRef(Date.now()),[e,n]=g.useState(0);return g.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},LX=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},VC="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",$C="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",jX="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",Ip=["Applying","Thinking","Planning","Crafting"],FX=Ip.reduce((t,e)=>t.length>=e.length?t:e),VX=20,$X="Still working — runs can take a few minutes.",HX=({hint:t,showElapsed:e=!0})=>{const[n,r]=g.useState(0),s=DX();g.useEffect(()=>{const a=setInterval(()=>{r(u=>(u+1)%Ip.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=VX?$X:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(sl.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:S.jsx(sl.path,{animate:{d:[VC,$C,jX,$C,VC]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),S.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:yd.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:FX}),S.jsx(Gi,{mode:"popLayout",initial:!1,children:S.jsx(sl.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:Ip[n]},Ip[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:LX(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};function BA(t,[e,n]){return Math.min(n,Math.max(e,t))}function zX(t){const e=g.useRef({value:t,previous:t});return g.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var WA=["PageUp","PageDown"],GA=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],KA={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Xu="Slider",[j_,UX,BX]=pA(Xu),[Ux]=na(Xu,[BX]),[WX,yf]=Ux(Xu),qA=g.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:u=!1,minStepsBetweenThumbs:c=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:v=()=>{},inverted:y=!1,form:x,..._}=t,b=g.useRef(new Set),E=g.useRef(0),C=g.useRef(!1),T=a==="horizontal"?GX:KX,[R,O]=g.useState(null),M=Yt(e,O),[A=[],N]=hl({prop:h,defaultProp:f,onChange:B=>{var $;($=[...b.current][E.current])==null||$.focus({preventScroll:!0,focusVisible:C.current}),C.current=!1,p(B)}}),D=g.useRef(A),j=g.useRef(A);g.useEffect(()=>{const B=x?R==null?void 0:R.ownerDocument.getElementById(x):R==null?void 0:R.closest("form");if(B instanceof HTMLFormElement){const X=()=>N(j.current);return B.addEventListener("reset",X),()=>B.removeEventListener("reset",X)}},[R,x,N]);function V(B){const X=XX(A,B);K(B,X)}function W(B){K(B,E.current)}function Y(){const B=D.current[E.current];A[E.current]!==B&&v(A)}function K(B,X,{commit:$}={commit:!1}){const te=cI(i),H=Np(Math.round((B-r)/i)*i+r,te),L=BA(H,[r,s]);N((Z=[])=>{const ne=ZX(Z,L,X);if(eQ(ne,c*i)){E.current=ne.indexOf(L);const ie=String(ne)!==String(Z);return ie&&$&&v(ne),ie?ne:Z}else return Z})}return S.jsx(WX,{scope:t.__scopeSlider,name:n,disabled:u,min:r,max:s,valueIndexToChangeRef:E,thumbs:b.current,values:A,orientation:a,form:x,children:S.jsx(j_.Provider,{scope:t.__scopeSlider,children:S.jsx(j_.Slot,{scope:t.__scopeSlider,children:S.jsx(T,{"aria-disabled":u,"data-disabled":u?"":void 0,..._,ref:M,onPointerDown:Et(_.onPointerDown,()=>{u||(D.current=A,C.current=!1)}),min:r,max:s,inverted:y,onSlideStart:u?void 0:V,onSlideMove:u?void 0:W,onSlideEnd:u?void 0:Y,onHomeKeyDown:()=>{u||(C.current=!0,K(r,0,{commit:!0}))},onEndKeyDown:()=>{u||(C.current=!0,K(s,A.length-1,{commit:!0}))},onStepKeyDown:({event:B,direction:X})=>{if(!u){C.current=!0;const H=WA.includes(B.key)||B.shiftKey&&GA.includes(B.key)?10:1,L=E.current,Z=A[L],ne=tQ(Z,{min:r,step:i,direction:X,multiplier:H});K(ne,L,{commit:!0})}}})})})})});qA.displayName=Xu;var[ZA,YA]=Ux(Xu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),GX=g.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:u,onSlideEnd:c,onStepKeyDown:f,...h}=t,[p,v]=g.useState(null),y=Yt(e,v),x=g.useRef(void 0),_=xA(s),b=_==="ltr",E=b&&!i||!b&&i;function C(P){const T=x.current||p.getBoundingClientRect(),R=[0,T.width],M=Bx(R,E?[n,r]:[r,n]);return x.current=T,M(P-T.left)}return S.jsx(ZA,{scope:t.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:S.jsx(XA,{dir:_,"data-orientation":"horizontal",...h,ref:y,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:P=>{const T=C(P.clientX);a==null||a(T)},onSlideMove:P=>{const T=C(P.clientX);u==null||u(T)},onSlideEnd:()=>{x.current=void 0,c==null||c()},onStepKeyDown:P=>{const R=KA[E?"from-left":"from-right"].includes(P.key);f==null||f({event:P,direction:R?-1:1})}})})}),KX=g.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:u,onStepKeyDown:c,...f}=t,h=g.useRef(null),p=Yt(e,h),v=g.useRef(void 0),y=!s;function x(_){const b=v.current||h.current.getBoundingClientRect(),E=[0,b.height],P=Bx(E,y?[r,n]:[n,r]);return v.current=b,P(_-b.top)}return S.jsx(ZA,{scope:t.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:S.jsx(XA,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:_=>{const b=x(_.clientY);i==null||i(b)},onSlideMove:_=>{const b=x(_.clientY);a==null||a(b)},onSlideEnd:()=>{v.current=void 0,u==null||u()},onStepKeyDown:_=>{const E=KA[y?"from-bottom":"from-top"].includes(_.key);c==null||c({event:_,direction:E?-1:1})}})})}),XA=g.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:u,onStepKeyDown:c,...f}=t,h=yf(Xu,n);return S.jsx(Rt.span,{...f,ref:e,onKeyDown:Et(t.onKeyDown,p=>{p.key==="Home"?(a(p),p.preventDefault()):p.key==="End"?(u(p),p.preventDefault()):WA.concat(GA).includes(p.key)&&(c(p),p.preventDefault())}),onPointerDown:Et(t.onPointerDown,p=>{const v=p.target;v.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):r(p)}),onPointerMove:Et(t.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&s(p)}),onPointerUp:Et(t.onPointerUp,p=>{const v=p.target;v.hasPointerCapture(p.pointerId)&&(v.releasePointerCapture(p.pointerId),i(p))})})}),QA="SliderTrack",JA=g.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=yf(QA,n);return S.jsx(Rt.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});JA.displayName=QA;var F_="SliderRange",eI=g.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=yf(F_,n),i=YA(F_,n),a=g.useRef(null),u=Yt(e,a),c=s.values.length,f=s.values.map(v=>uI(v,s.min,s.max)),h=c>1?Math.min(...f):0,p=100-Math.max(...f);return S.jsx(Rt.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:u,style:{...t.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});eI.displayName=F_;var tI="SliderThumb",[qX,nI]=Ux(tI),rI="SliderThumbProvider";function sI(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=yf(rI,e),a=UX(e),[u,c]=g.useState(null),f=g.useMemo(()=>u?a().findIndex(b=>b.ref.current===u):-1,[a,u]),h=v5(u),p=u?!!i.form||!!u.closest("form"):!0,v=i.values[f],y=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),x=v===void 0?0:uI(v,i.min,i.max);g.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]);const _={value:v,name:y,form:i.form,isFormControl:p,index:f,thumb:u,onThumbChange:c,percent:x,size:h};return S.jsx(qX,{scope:e,..._,children:nQ(s)?s(_):r})}sI.displayName=rI;var Mp="SliderThumbTrigger",iI=g.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=yf(Mp,n),i=YA(Mp,n),{index:a,value:u,percent:c,size:f,onThumbChange:h}=nI(Mp,n),p=Yt(e,h),v=YX(a,s.values.length),y=f==null?void 0:f[i.size],x=y?QX(y,c,i.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${c}% + ${x}px)`},children:S.jsx(j_.ItemSlot,{scope:n,children:S.jsx(Rt.span,{role:"slider","aria-label":t["aria-label"]||v,"aria-valuemin":s.min,"aria-valuenow":u,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...r,ref:p,style:u===void 0?{display:"none"}:t.style,onFocus:Et(t.onFocus,()=>{s.valueIndexToChangeRef.current=a})})})})});iI.displayName=Mp;var oI=g.forwardRef((t,e)=>{const{__scopeSlider:n,name:r,...s}=t;return S.jsx(sI,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:i,isFormControl:a})=>S.jsxs(S.Fragment,{children:[S.jsx(iI,{...s,ref:e,__scopeSlider:n}),a?S.jsx(lI,{__scopeSlider:n},i):null]})})});oI.displayName=tI;var aI="SliderBubbleInput",lI=g.forwardRef(({__scopeSlider:t,...e},n)=>{const{value:r,name:s,form:i}=nI(aI,t),a=g.useRef(null),u=Yt(a,n),c=zX(r);return g.useEffect(()=>{const f=a.current;if(!f)return;const h=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==r&&v){const y=new Event("input",{bubbles:!0});v.call(f,r),f.dispatchEvent(y)}},[c,r]),S.jsx(Rt.input,{style:{display:"none"},name:s,form:i,...e,ref:u,defaultValue:r})});lI.displayName=aI;function ZX(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function uI(t,e,n){const i=100/(n-e)*(t-e);return BA(i,[0,100])}function YX(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function XX(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)}function QX(t,e,n){const r=t/2,i=Bx([0,50],[0,r]);return(r-i(e)*n)*n}function JX(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function eQ(t,e){if(e>0){const n=JX(t);return Math.min(...n)>=e}return!0}function Bx(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])}}function cI(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}function Np(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function tQ(t,{min:e,step:n,direction:r,multiplier:s}){const i=cI(n),a=(t-e)/n,u=Math.round(a),c=Np(u*n+e,i)===Np(t,i);let f;return c?f=u+s*r:r>0?f=Math.ceil(a):f=Math.floor(a),Np(f*n+e,i)}function nQ(t){return typeof t=="function"}const V_=g.forwardRef(({className:t,...e},n)=>S.jsxs(qA,{ref:n,className:ar("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(JA,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(eI,{className:"absolute h-full bg-primary"})}),S.jsx(oI,{className:ar("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")})]}));V_.displayName="Slider";const rQ=[{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"}],sQ=[{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"}],iQ=[{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"}],sp=[{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."}],oQ=()=>{window.location.hash=""},Ii=({title:t,eyebrow:e,description:n,children:r})=>S.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[S.jsxs("div",{className:"mb-5 max-w-2xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),S.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),HC=({swatches:t})=>S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[S.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),S.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),S.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),aQ=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",lQ=()=>{const t=sp.filter(n=>n.status==="showcased").length,e=sp.filter(n=>n.status==="cataloged").length;return S.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[S.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[S.jsxs("button",{type:"button",onClick:oQ,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(dz,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),S.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[S.jsxs("div",{className:"max-w-3xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),S.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),S.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),S.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:S.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[S.jsx(wT,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Ii,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"The gallery uses Rivet's tooltip-wrapped button, compound split button, and the lower-level Radix tooltip wrapper so the reusable control APIs are visible.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button wrapper"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(fu,{title:"Primary action",shortcut:"D",className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Design action"}),S.jsx(fu,{title:"Secondary action",className:"border-border bg-surface-4 text-content hover:bg-surface-5 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",children:"Secondary"}),S.jsx(fu,{title:"Disabled action",disabled:!0,className:"border-border bg-muted text-muted-foreground rounded-lg border px-4 py-2 text-sm font-medium opacity-60",children:"Disabled"}),S.jsx(U5,{primaryLabel:"Ship",primaryIcon:s1,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx(Fo,{label:"Rivet tooltip API",side:"bottom",children:S.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),S.jsx(px,{content:"Forced open preview",forceOpen:!0,side:"right",children:S.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),S.jsx(Ii,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:S.jsx(HC,{swatches:rQ})}),S.jsx(Ii,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(HC,{swatches:sQ})}),S.jsx(Ii,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),S.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),S.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),S.jsx(Ii,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:S.jsx("div",{className:"flex flex-col gap-3",children:iQ.map(n=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),S.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),S.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),S.jsx(Ii,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsxs(Ap,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(Ap.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(s1,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(Ap.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:S.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[S.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),S.jsxs("div",{className:"space-y-6",children:[S.jsx(V_,{defaultValue:[64],max:100,step:1}),S.jsx(V_,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Ii,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),S.jsx(mR,{message:"Applying visual change..."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),S.jsx(ex,{className:"text-primary text-xl"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),S.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:S.jsx(HX,{hint:"Reading selected elements"})})]})}),S.jsx(Ii,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(x_,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(hR,{icon:S.jsx(s1,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(km,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Ii,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[S.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),S.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:sp.length})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),S.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),S.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),S.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[S.jsx("span",{children:"Component"}),S.jsx("span",{children:"Status"}),S.jsx("span",{children:"Coverage note"})]}),S.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:sp.map(n=>S.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-foreground font-medium",children:n.name}),S.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),S.jsx("div",{children:S.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${aQ(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},uQ=64,Dm=new Set;let Op=null;const cQ=()=>{Op=null;for(const t of Dm)t()},dQ=()=>{Dm.size!==0&&(Op!==null&&clearTimeout(Op),Op=setTimeout(cQ,uQ))},fQ=t=>(Dm.add(t),()=>{Dm.delete(t)}),hQ=(t,e)=>typeof URL<"u"&&t instanceof URL?t:typeof Request<"u"&&t instanceof Request?new URL(t.url):new URL(String(t),e),pQ=(t,e)=>{try{const n=hQ(t,e);return n.origin!==e?!1:n.pathname.startsWith("/api/")}catch{return!1}},mQ=({nativeFetch:t,pageOrigin:e,getShouldIntercept:n})=>{const r=(s,i)=>t(s,i).then(a=>(a.status===401&&n()&&pQ(s,e)&&dQ(),a));return window.fetch=r,()=>{window.fetch=t}},gQ=t=>!t.hasConfig||t.configLoading||t.demoMode!==!0||t.agentModeAvailable!==!0||t.pathnameDemoSessionId!==null?!1:(t.activeDemoSessionId??t.configuredDemoSessionId??null)===null,vQ=(t,e,n)=>t===!0&&e!==!0?null:n,yQ=t=>t?"Preparing your demo session…":null,_Q=t=>!(t==="/rivet"||t.startsWith("/rivet/")),xQ=t=>!_Q(t.pathname)||t.hasConfig?!1:!t.configLoading&&!t.isRetryingConfig,wQ=t=>{const e=t.match(/^\/try\/([^/]+)/);return e!=null&&e[1]?decodeURIComponent(e[1]):null},bQ=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",C1=ds("App"),SQ=2e3,EQ=60,zC="Connecting to Google...",UC="https://rivet-proxy.onrender.com",kQ=`<!doctype html>
|
|
394
|
+
<html lang="en">
|
|
395
|
+
<head>
|
|
396
|
+
<meta charset="utf-8" />
|
|
397
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
398
|
+
<title>${zC}</title>
|
|
399
|
+
<style>
|
|
400
|
+
:root { color-scheme: light dark; }
|
|
401
|
+
body {
|
|
402
|
+
margin: 0;
|
|
403
|
+
min-height: 100vh;
|
|
404
|
+
display: grid;
|
|
405
|
+
place-items: center;
|
|
406
|
+
font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
|
|
407
|
+
background: #111215;
|
|
408
|
+
color: #f3f4f6;
|
|
409
|
+
}
|
|
410
|
+
.panel {
|
|
411
|
+
border: 1px solid rgba(255, 255, 255, 0.16);
|
|
412
|
+
border-radius: 12px;
|
|
413
|
+
padding: 18px 22px;
|
|
414
|
+
background: rgba(255, 255, 255, 0.06);
|
|
415
|
+
font-size: 14px;
|
|
416
|
+
}
|
|
417
|
+
</style>
|
|
418
|
+
</head>
|
|
419
|
+
<body>
|
|
420
|
+
<div class="panel">${zC}</div>
|
|
421
|
+
</body>
|
|
422
|
+
</html>`,CQ="Too many people are trying Rivet right now. Please try again in a few minutes.",dI="Failed to start an isolated demo session.",PQ=async t=>{if(t.status===429)return CQ;try{const e=await t.json();if(e.error)return e.error;if(e.message)return e.message}catch{}return dI},$_=274,Lm=395,P1=Math.min(Lm,Math.round(($_+Lm)/2*1.1)),BC="rivet:panelWidth:v2",TQ=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},RQ=({projectPath:t,activeDemoSessionId:e=null,showLoginGate:n=!1,onStartLogin:r,isStartingLogin:s=!1,loginError:i=null,fullPageHostedLoginProgressMessage:a=null,holdHostedTryoutPreviewNavigation:u=!1,hostedTryoutPreviewHoldMessage:c=null,deferInspectorUntilPreviewReady:f=!1})=>{const h=Qe(ZT)>0,[p,v]=nP(KT),y=HV(),[x,_]=g.useState(()=>{if(typeof window>"u")return P1;const Y=Number(window.localStorage.getItem(BC));return Number.isFinite(Y)&&Y>=$_&&Y<=Lm?Y:P1}),[b,E]=g.useState(!1),[C,P]=g.useState(rZ),T=p?x:0,[R,O]=g.useState(p);g.useEffect(()=>{if(!p){O(!1);return}P(Y=>nZ({position:Y,boundsLeftPx:x}))},[p,x]),g.useEffect(()=>{window.localStorage.setItem(BC,String(x))},[x]),g.useEffect(()=>{if(!p)return;const Y=K=>{K.key==="Escape"&&(TQ(K.target)||(K.preventDefault(),v(!1)))};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[p,v]);const M=g.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation();const K=Y.clientX,B=x;E(!0);const X=te=>{const H=Math.min(Lm,Math.max($_,B+(te.clientX-K)));_(H)},$=()=>{window.removeEventListener("pointermove",X),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$),E(!1)};window.addEventListener("pointermove",X),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",$)},[x]),A=g.useCallback(()=>_(P1),[]),N=gZ(),D=Qe(pf);_Z({enabled:!D});const j=N.isProcessing?"Completing authentication...":a,V=j!==null,W=st(e5);return g.useEffect(()=>{W(t??null)},[t,W]),g.useEffect(()=>{n&&(document.body.style.cursor="auto")},[n]),S.jsxs(sl.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[j!==null&&!n?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(Uq,{message:j})}):null,n?S.jsx("div",{className:"absolute inset-0 z-40 flex items-center justify-center bg-black/45 backdrop-blur-[2px]",children:S.jsx(fA,{isSigningIn:s||V,onStartSignIn:()=>{r==null||r()},errorMessage:i,displayMode:"modal"})}):null,S.jsxs("div",{className:`relative flex min-w-0 flex-1 flex-col ${n?"pointer-events-none select-none":""}`,children:[S.jsx(yK,{holdHostedTryoutPreviewNavigation:u,isInteractionDisabled:n,activeDemoSessionId:e}),u&&c?S.jsx("div",{className:"bg-main absolute inset-0 z-30 flex items-center justify-center",children:S.jsx("div",{className:"border-divider bg-main-light rounded-lg border p-6 shadow-lg",children:S.jsx(mR,{message:c})})}):null]}),n?null:S.jsx(S.Fragment,{children:!f&&!h?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:R?x:0},children:S.jsxs(sl.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:p?0:-x},transition:y?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{p&&O(!0)},style:{width:x,willChange:"transform"},children:[S.jsx(NG,{onClose:()=>v(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:M,onDoubleClick:A,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:S.jsx("span",{className:`h-full transition-all duration-150 ${b?"w-0.5 bg-content-muted":"w-px bg-divider group-hover/resize:w-0.5 group-hover/resize:bg-content-muted"}`})})]})}),b&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(oZ,{isVisible:!0,isPanelOpen:p,isReducedMotion:!!y,position:C,dragBoundsLeftPx:T,onPositionChange:P,onToggle:()=>v(Y=>!Y)})]}):null}),S.jsx(m$,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},H_="rivet_connect_deep_link",AQ=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(H_);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(H_,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},IQ=AQ(),MQ=()=>{const[t,e]=g.useState(window.location.hash),[n]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Rp)==="1"),[r,s]=g.useState(!1),[i,a]=g.useState(IQ);g.useEffect(()=>{n&&window.sessionStorage.removeItem(Rp)},[n]);const{config:u,refetchConfig:c,loading:f,error:h}=pZ(),p=st(pf),[v,y]=g.useState(!1),[x,_]=g.useState(null),[b,E]=g.useState(!1),[C,P]=g.useState(!1),[T,R]=g.useState(null),[O,M]=g.useState(!1),A=g.useRef(!1),N=g.useRef(!1),D=wQ(window.location.pathname),j=(u==null?void 0:u.activeDemoSessionId)??null,V=D??T??j,W=g.useMemo(()=>vQ(u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,V),[u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,V]),Y=g.useMemo(()=>gQ({configLoading:f,hasConfig:u!==null,demoMode:u==null?void 0:u.demoMode,agentModeAvailable:u==null?void 0:u.agentModeAvailable,pathnameDemoSessionId:D,activeDemoSessionId:T,configuredDemoSessionId:j}),[u,f,D,T,j]);g.useLayoutEffect(()=>{if(!Y){M(!1);return}M(!0)},[Y]);const K=O,B=g.useMemo(()=>yQ(K),[K]),X=(u==null?void 0:u.demoMode)===!0&&K,$=g.useRef(null);$.current=V;const te=g.useCallback(async()=>{if(!A.current)return;R(null);const pe=await c();if((pe==null?void 0:pe.demoMode)===!0&&pe.agentModeAvailable!==!0){P(!1);return}(pe==null?void 0:pe.demoMode)===!0&&P(!0)},[c]);g.useEffect(()=>{if((u==null?void 0:u.demoMode)===!0)return fQ(()=>{te()})},[u==null?void 0:u.demoMode,te]),g.useEffect(()=>{if(A.current=(u==null?void 0:u.demoMode)===!0,(u==null?void 0:u.demoMode)!==!0)return;const pe=window.fetch.bind(window);return mQ({nativeFetch:pe,pageOrigin:window.location.origin,getShouldIntercept:()=>A.current})},[u==null?void 0:u.demoMode]),g.useEffect(()=>{(u==null?void 0:u.agentModeAvailable)===!0&&P(!1)},[u==null?void 0:u.agentModeAvailable]);const H=g.useCallback(async pe=>{const we=$.current;if(!(pe!=null&&pe.forceRefresh)&&we)return we;if(N.current)return"";N.current=!0;try{const Ie=await fetch("/api/demo/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!Ie.ok){const it=await PQ(Ie);throw new Error(it)}const qe=await Ie.json();if(!qe.sessionId)throw new Error("Demo session response missing session id.");return R(qe.sessionId),qe.sessionId}finally{N.current=!1}},[]);g.useEffect(()=>{j&&R(j)},[j]),g.useEffect(()=>{u!=null&&u.userId?(Pe.identify(u.userId,{...u.email?{email:u.email}:{}}),u.email&&Pe.alias(u.email,u.userId)):u!=null&&u.email&&Pe.identify(u.email,{email:u.email})},[u==null?void 0:u.userId,u==null?void 0:u.email]),g.useEffect(()=>{if(!u)return;const pe=!!u.demoMode,we=pe?V:null;Pe.register({source:pe?"tryout":"core",demo_mode:pe,...we?{demo_session_id:we}:{}})},[u,V]);const L=g.useCallback(async()=>{var we;y(!0),_(null);let pe=null;try{if(pe=window.open("","_blank"),!pe)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{pe.document.open(),pe.document.write(kQ),pe.document.close()}catch(it){C1.warn("Failed to render loading state in auth popup:",it)}const Ie=await fetch(`${UC}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),qe=await Ie.json();if(!Ie.ok||!qe.success||!qe.authUrl||!qe.sessionId||!qe.pollSecret)throw new Error(qe.error||qe.message||"Failed to start Google login");if(pe.closed)throw new Error("Sign-in window was closed before Google login started.");pe.location.href=qe.authUrl;for(let it=0;it<EQ;it+=1){if(pe.closed)throw new Error("Sign-in window was closed before authentication completed.");const at=await(await fetch(`${UC}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:qe.sessionId,pollSecret:qe.pollSecret})})).json();if(at.success&&at.token&&((we=at.user)!=null&&we.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:at.user.email,token:at.token,refreshToken:at.refreshToken,userId:at.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");if(pe.close(),window.sessionStorage.setItem(Rp,"1"),(u==null?void 0:u.demoMode)===!0){await H({forceRefresh:!0}),window.location.reload();return}window.location.reload();return}if(at.error&&at.error!=="Pending")throw new Error(at.error||"Google login failed");await new Promise(At=>setTimeout(At,SQ))}throw new Error("Authentication timed out. Please try again.")}catch(Ie){pe&&!pe.closed&&pe.close();const qe=Ie instanceof Error?Ie.message:"Failed to start login flow";C1.warn("Hosted login failed:",qe),_(qe),y(!1)}},[u==null?void 0:u.demoMode,H]),Z=(u==null?void 0:u.demoMode)===!0&&((u==null?void 0:u.agentModeAvailable)!==!0||C||v),ne=u!=null&&u.agentModeAvailable!==!0,ie=bQ(t),ae=g.useCallback(async()=>{E(!0),p(!0);try{await c()}finally{p(!1),E(!1)}},[c,p]);if(g.useEffect(()=>{if(!Y)return;let pe=!1;return H({forceRefresh:!0}).catch(we=>{const Ie=we instanceof Error?we.message:dI;C1.warn("Hosted session bootstrap failed:",Ie),_(Ie),ht.error(Ie)}).finally(()=>{pe||M(!1)}),()=>{pe=!0}},[Y,H]),g.useEffect(()=>{const pe=()=>{const we=window.location.hash;e(we)};return window.addEventListener("hashchange",pe),()=>window.removeEventListener("hashchange",pe)},[]),ie==="design-system")return S.jsx(lQ,{});const ue={pathname:window.location.pathname,configLoading:f,hasConfig:u!==null,isRetryingConfig:b};if(xQ(ue)){const pe=h||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-dim mt-2 text-xs",children:pe}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{ae()},children:"Retry"})]})})}if(ne)return S.jsx(fA,{isSigningIn:v,onStartSignIn:()=>{L()},errorMessage:x,displayMode:"full"});const ee=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&i!==null,le=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&n&&!r&&!ee;return S.jsxs(S.Fragment,{children:[S.jsx(RQ,{projectPath:u==null?void 0:u.projectPath,activeDemoSessionId:W,showLoginGate:Z,onStartLogin:L,isStartingLogin:v,loginError:x,fullPageHostedLoginProgressMessage:(u==null?void 0:u.demoMode)===!0&&v?"Completing sign-in...":null,holdHostedTryoutPreviewNavigation:K,hostedTryoutPreviewHoldMessage:B,deferInspectorUntilPreviewReady:X}),S.jsx(__,{context:"onboarding",isOpen:le,onClose:()=>s(!0)}),S.jsx(__,{context:"menu",isOpen:ee,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(H_),a(null)}})]})},NQ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",OQ=new wN,DQ={session_recording:{maskAllInputs:!1,maskInputOptions:{password:!0},maskTextSelector:null}},LQ=()=>S.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:S.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})});fL.createRoot(document.getElementById("root")).render(S.jsx(ge.StrictMode,{children:S.jsx(tL,{apiKey:NQ,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",...DQ,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"core",rivet_version:"0.13.5",env:"production"})}},children:S.jsx(oL,{fallback:S.jsx(LQ,{}),children:S.jsx(bN,{client:OQ,children:S.jsx(DW,{defaultShape:"rounded",children:S.jsx(MX,{defaultLibrary:"lucide",children:S.jsx(MQ,{})})})})})})}));
|