rivet-design 0.25.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +2 -2
  2. package/README.npm.md +2 -2
  3. package/dist/agent-variants/PreviewRuntime.d.ts +1 -20
  4. package/dist/agent-variants/PreviewRuntime.js +1 -102
  5. package/dist/agent-variants/SessionStore.d.ts +1 -8
  6. package/dist/agent-variants/SessionStore.js +2 -32
  7. package/dist/agent-variants/WorkspaceInventory.d.ts +0 -3
  8. package/dist/agent-variants/WorkspaceInventory.js +5 -28
  9. package/dist/agent-variants/WorktreeOrchestrator.d.ts +1 -30
  10. package/dist/agent-variants/WorktreeOrchestrator.js +4 -643
  11. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts +0 -7
  12. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js +0 -34
  13. package/dist/agent-variants/contracts.d.ts +320 -380
  14. package/dist/agent-variants/contracts.js +1 -8
  15. package/dist/agent-variants/index.d.ts +1 -1
  16. package/dist/agent-variants/runPlan.d.ts +0 -2
  17. package/dist/agent-variants/runPlan.js +0 -3
  18. package/dist/agent-variants/variant-project-runtime.d.ts +0 -2
  19. package/dist/agent-variants/variantWorkspaceFiles.d.ts +0 -3
  20. package/dist/agent-variants/variantWorkspaceFiles.js +1 -59
  21. package/dist/agent-variants/variantsTelemetry.d.ts +0 -8
  22. package/dist/agent-variants/workItemInput.d.ts +210 -210
  23. package/dist/cli/commands/mcpServe.d.ts +2 -2
  24. package/dist/cli/commands/mcpServe.js +1 -0
  25. package/dist/cli/commands/variants.js +2 -43
  26. package/dist/cli/router.js +3 -2
  27. package/dist/config/flags.d.ts +0 -3
  28. package/dist/config/flags.js +0 -1
  29. package/dist/config/pluginMetrics.js +0 -4
  30. package/dist/index.d.ts +1 -1
  31. package/dist/index.js +20 -8
  32. package/dist/install/mcpRegistration.js +1 -0
  33. package/dist/mcp/explorationTools.js +0 -17
  34. package/dist/routes/account.js +4 -2
  35. package/dist/routes/agentVariants.js +1 -89
  36. package/dist/routes/library/browserAccess.d.ts +3 -1
  37. package/dist/routes/library/browserAccess.js +5 -3
  38. package/dist/routes/library/index.js +1 -0
  39. package/dist/routes/variantRequestSchema.d.ts +4 -4
  40. package/dist/services/AuthService.js +2 -2
  41. package/dist/services/ConfigManager.d.ts +18 -1
  42. package/dist/services/ConfigManager.js +91 -4
  43. package/dist/services/GuidanceVerifierRunner.js +13 -2
  44. package/dist/services/SessionBridgeService.d.ts +0 -2
  45. package/dist/services/SessionBridgeService.js +0 -26
  46. package/dist/services/TelemetryService.d.ts +4 -15
  47. package/dist/services/TelemetryService.js +29 -33
  48. package/dist/services/VariantRunService.d.ts +0 -5
  49. package/dist/services/VariantRunService.js +0 -3
  50. package/dist/services/WorktreeManager.d.ts +0 -3
  51. package/dist/services/WorktreeManager.js +7 -54
  52. package/dist/services/createAgentVariantsOrchestrator.js +0 -1
  53. package/dist/services/profiles/DesignProfiles.js +4 -3
  54. package/dist/storage/library/ProjectPreviewCache.d.ts +2 -2
  55. package/dist/types/guidance-verifier.d.ts +458 -59
  56. package/dist/types/guidance-verifier.js +35 -12
  57. package/dist/utils/skills/claude-skill.d.ts +1 -1
  58. package/dist/utils/skills/claude-skill.js +1 -1
  59. package/dist/utils/skills/cli-guidance.d.ts +1 -1
  60. package/dist/utils/skills/cli-guidance.js +7 -9
  61. package/dist/utils/skills/cursor-rules.d.ts +1 -1
  62. package/dist/utils/skills/cursor-rules.js +1 -1
  63. package/package.json +3 -3
  64. package/src/ui/dist/assets/{LibraryEntry-BJl_pPMq.js → LibraryEntry-Cr4GFYXW.js} +9 -9
  65. package/src/ui/dist/assets/main-tPO1OCpZ.js +439 -0
  66. package/src/ui/dist/index.html +1 -1
  67. package/dist/agent-variants/createProjectArtifacts.d.ts +0 -61
  68. package/dist/agent-variants/createProjectArtifacts.js +0 -113
  69. package/src/ui/dist/assets/main-D1832qVC.js +0 -439
@@ -1,439 +0,0 @@
1
- var xk=t=>{throw TypeError(t)};var ay=(t,e,n)=>e.has(t)||xk("Cannot "+n);var Z=(t,e,n)=>(ay(t,e,"read from private field"),n?n.call(t):e.get(t)),nt=(t,e,n)=>e.has(t)?xk("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ae=(t,e,n,r)=>(ay(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),kt=(t,e,n)=>(ay(t,e,"access private method"),n);var y0=(t,e,n,r)=>({set _(s){Ae(t,e,s,n)},get _(){return Z(t,e,r)}});function o7(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const a7="modulepreload",l7=function(t){return"/"+t},bk={},p5=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=l7(d),d in bk)return;bk[d]=!0;const f=d.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":a7,f||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((v,x)=>{m.addEventListener("load",v),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};function Vg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ly={exports:{}},_f={},cy={exports:{}},yt={};/**
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 Sk;function c7(){if(Sk)return yt;Sk=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function m(N){return N===null||typeof N!="object"?null:(N=h&&N[h]||N["@@iterator"],typeof N=="function"?N:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function w(N,Y,oe){this.props=N,this.context=Y,this.refs=_,this.updater=oe||v}w.prototype.isReactComponent={},w.prototype.setState=function(N,Y){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,Y,"setState")},w.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function b(){}b.prototype=w.prototype;function k(N,Y,oe){this.props=N,this.context=Y,this.refs=_,this.updater=oe||v}var C=k.prototype=new b;C.constructor=k,x(C,w.prototype),C.isPureReactComponent=!0;var P=Array.isArray,T=Object.prototype.hasOwnProperty,M={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function R(N,Y,oe){var ne,ie={},de=null,ge=null;if(Y!=null)for(ne in Y.ref!==void 0&&(ge=Y.ref),Y.key!==void 0&&(de=""+Y.key),Y)T.call(Y,ne)&&!I.hasOwnProperty(ne)&&(ie[ne]=Y[ne]);var ce=arguments.length-2;if(ce===1)ie.children=oe;else if(1<ce){for(var re=Array(ce),Ce=0;Ce<ce;Ce++)re[Ce]=arguments[Ce+2];ie.children=re}if(N&&N.defaultProps)for(ne in ce=N.defaultProps,ce)ie[ne]===void 0&&(ie[ne]=ce[ne]);return{$$typeof:t,type:N,key:de,ref:ge,props:ie,_owner:M.current}}function L(N,Y){return{$$typeof:t,type:N.type,key:Y,ref:N.ref,props:N.props,_owner:N._owner}}function j(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function F(N){var Y={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(oe){return Y[oe]})}var D=/\/+/g;function q(N,Y){return typeof N=="object"&&N!==null&&N.key!=null?F(""+N.key):Y.toString(36)}function W(N,Y,oe,ne,ie){var de=typeof N;(de==="undefined"||de==="boolean")&&(N=null);var ge=!1;if(N===null)ge=!0;else switch(de){case"string":case"number":ge=!0;break;case"object":switch(N.$$typeof){case t:case e:ge=!0}}if(ge)return ge=N,ie=ie(ge),N=ne===""?"."+q(ge,0):ne,P(ie)?(oe="",N!=null&&(oe=N.replace(D,"$&/")+"/"),W(ie,Y,oe,"",function(Ce){return Ce})):ie!=null&&(j(ie)&&(ie=L(ie,oe+(!ie.key||ge&&ge.key===ie.key?"":(""+ie.key).replace(D,"$&/")+"/")+N)),Y.push(ie)),1;if(ge=0,ne=ne===""?".":ne+":",P(N))for(var ce=0;ce<N.length;ce++){de=N[ce];var re=ne+q(de,ce);ge+=W(de,Y,oe,re,ie)}else if(re=m(N),typeof re=="function")for(N=re.call(N),ce=0;!(de=N.next()).done;)de=de.value,re=ne+q(de,ce++),ge+=W(de,Y,oe,re,ie);else if(de==="object")throw Y=String(N),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return ge}function G(N,Y,oe){if(N==null)return N;var ne=[],ie=0;return W(N,ne,"","",function(de){return Y.call(oe,de,ie++)}),ne}function H(N){if(N._status===-1){var Y=N._result;Y=Y(),Y.then(function(oe){(N._status===0||N._status===-1)&&(N._status=1,N._result=oe)},function(oe){(N._status===0||N._status===-1)&&(N._status=2,N._result=oe)}),N._status===-1&&(N._status=0,N._result=Y)}if(N._status===1)return N._result.default;throw N._result}var J={current:null},B={transition:null},Q={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:B,ReactCurrentOwner:M};function z(){throw Error("act(...) is not supported in production builds of React.")}return yt.Children={map:G,forEach:function(N,Y,oe){G(N,function(){Y.apply(this,arguments)},oe)},count:function(N){var Y=0;return G(N,function(){Y++}),Y},toArray:function(N){return G(N,function(Y){return Y})||[]},only:function(N){if(!j(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},yt.Component=w,yt.Fragment=n,yt.Profiler=s,yt.PureComponent=k,yt.StrictMode=r,yt.Suspense=u,yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,yt.act=z,yt.cloneElement=function(N,Y,oe){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var ne=x({},N.props),ie=N.key,de=N.ref,ge=N._owner;if(Y!=null){if(Y.ref!==void 0&&(de=Y.ref,ge=M.current),Y.key!==void 0&&(ie=""+Y.key),N.type&&N.type.defaultProps)var ce=N.type.defaultProps;for(re in Y)T.call(Y,re)&&!I.hasOwnProperty(re)&&(ne[re]=Y[re]===void 0&&ce!==void 0?ce[re]:Y[re])}var re=arguments.length-2;if(re===1)ne.children=oe;else if(1<re){ce=Array(re);for(var Ce=0;Ce<re;Ce++)ce[Ce]=arguments[Ce+2];ne.children=ce}return{$$typeof:t,type:N.type,key:ie,ref:de,props:ne,_owner:ge}},yt.createContext=function(N){return N={$$typeof:o,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},N.Provider={$$typeof:i,_context:N},N.Consumer=N},yt.createElement=R,yt.createFactory=function(N){var Y=R.bind(null,N);return Y.type=N,Y},yt.createRef=function(){return{current:null}},yt.forwardRef=function(N){return{$$typeof:l,render:N}},yt.isValidElement=j,yt.lazy=function(N){return{$$typeof:f,_payload:{_status:-1,_result:N},_init:H}},yt.memo=function(N,Y){return{$$typeof:d,type:N,compare:Y===void 0?null:Y}},yt.startTransition=function(N){var Y=B.transition;B.transition={};try{N()}finally{B.transition=Y}},yt.unstable_act=z,yt.useCallback=function(N,Y){return J.current.useCallback(N,Y)},yt.useContext=function(N){return J.current.useContext(N)},yt.useDebugValue=function(){},yt.useDeferredValue=function(N){return J.current.useDeferredValue(N)},yt.useEffect=function(N,Y){return J.current.useEffect(N,Y)},yt.useId=function(){return J.current.useId()},yt.useImperativeHandle=function(N,Y,oe){return J.current.useImperativeHandle(N,Y,oe)},yt.useInsertionEffect=function(N,Y){return J.current.useInsertionEffect(N,Y)},yt.useLayoutEffect=function(N,Y){return J.current.useLayoutEffect(N,Y)},yt.useMemo=function(N,Y){return J.current.useMemo(N,Y)},yt.useReducer=function(N,Y,oe){return J.current.useReducer(N,Y,oe)},yt.useRef=function(N){return J.current.useRef(N)},yt.useState=function(N){return J.current.useState(N)},yt.useSyncExternalStore=function(N,Y,oe){return J.current.useSyncExternalStore(N,Y,oe)},yt.useTransition=function(){return J.current.useTransition()},yt.version="18.3.1",yt}var kk;function Lx(){return kk||(kk=1,cy.exports=c7()),cy.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 Ek;function u7(){if(Ek)return _f;Ek=1;var t=Lx(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,d){var f,h={},m=null,v=null;d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(v=u.ref);for(f in u)r.call(u,f)&&!i.hasOwnProperty(f)&&(h[f]=u[f]);if(l&&l.defaultProps)for(f in u=l.defaultProps,u)h[f]===void 0&&(h[f]=u[f]);return{$$typeof:e,type:l,key:m,ref:v,props:h,_owner:s.current}}return _f.Fragment=n,_f.jsx=o,_f.jsxs=o,_f}var Ck;function d7(){return Ck||(Ck=1,ly.exports=u7()),ly.exports}var S=d7();const f7="x-rivet-editor-token",Pk="editorToken",h7=["/api/account","/api/config","/api/auth/store","/api/auth/logout","/api/library/browser-launches","/api/integrations","/api/reference-profiles"],p7=/^\/api\/variants\/(?:[^/]+\/static\/|history\/[^/]+\/[^/]+\/(?:preview(?:\/|$)|site\/)|[^/]+\/[^/]+\/references\/[^/]+\/image\/?$)/,m7=(t,e="GET")=>{const n=t.split(/[?#]/)[0].toLowerCase();return/^\/api\/variants(?:\/|$)/.test(n)?!["GET","HEAD"].includes(e.toUpperCase())||!p7.test(n):h7.some(r=>n===r||n.startsWith(`${r}/`))},n2="rivet_editor_token";let r2;const g7=()=>{if(window.location.pathname.startsWith("/rivet/library"))return;const t=new URLSearchParams(window.location.hash.slice(1)),e=t.get(Pk);if(e===null)return;r2=e||null,t.delete(Pk);const n=t.toString();window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${n?`#${n}`:""}`);try{e?window.sessionStorage.setItem(n2,e):window.sessionStorage.removeItem(n2)}catch{}},v7=()=>{if(r2!==void 0)return r2;try{return window.sessionStorage.getItem(n2)}catch{return null}};var g=Lx();const we=Vg(g),Cd=o7({__proto__:null,default:we},[g]);var y7={};const ae="u">typeof window?window:void 0,Mr="u">typeof globalThis?globalThis:ae,mr=Mr==null?void 0:Mr.navigator,Ee=Mr==null?void 0:Mr.document,zt=Mr==null?void 0:Mr.location,gh=Mr==null?void 0:Mr.fetch,Nx=Mr!=null&&Mr.XMLHttpRequest&&"withCredentials"in new Mr.XMLHttpRequest?Mr.XMLHttpRequest:void 0,Ak=Mr==null?void 0:Mr.AbortController,_7=Mr==null?void 0:Mr.CompressionStream,Hr=mr==null?void 0:mr.userAgent,wf=typeof globalThis<"u"?globalThis:ae;wf&&typeof self>"u"&&(wf.self=wf),wf&&typeof File>"u"&&(wf.File=function(){});const qe=ae??{},w7="0.9.12",Vo={DEBUG:!1,LIB_VERSION:w7,LIB_NAME:"browser-common"};var Vi=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysInProgress="surveys_in_progress",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),s2=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const x7=["$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"],b7=["token"];function Be(t,e){return t.indexOf(e)!==-1}const sd=function(t){return t.trim()},i2=function(t){return t.replace(/^\$/,"")};function m5(t){var e;const n=[];return(e=JSON.stringify(t,function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}}))!==null&&e!==void 0?e:"null"}const g5=Object.prototype,Dx=g5.hasOwnProperty,Hg=g5.toString,ze=Array.isArray||function(t){return Hg.call(t)==="[object Array]"},kn=t=>typeof t=="function",rt=t=>t===Object(t)&&!ze(t),ns=t=>{if(rt(t)){for(const e in t)if(Dx.call(t,e))return!1;return!0}return!1},le=t=>t===void 0,st=t=>Hg.call(t)=="[object String]",qf=t=>st(t)&&t.trim().length===0,un=t=>t===null,Qe=t=>le(t)||un(t),Pn=t=>Hg.call(t)=="[object Number]"&&t==t,Po=t=>Pn(t)&&t>0,zr=t=>Hg.call(t)==="[object Boolean]",S7=t=>Be(x7,t),k7=t=>Be(b7,t);function v5(t){return t===null||typeof t!="object"}function Mm(t,e){return{}.toString.call(t)===`[object ${e}]`}function Pd(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return y5(t,Error)}}function jx(t){return"u">typeof Event&&y5(t,Event)}function y5(t,e){try{return t instanceof e}catch{return!1}}const E7=[!0,"true",1,"1","yes"],uy=t=>Be(E7,t),C7=[!1,"false",0,"0","no"];function Tk(t,e,n,r,s,i,o){try{var l=t[i](o),u=l.value}catch(d){return void n(d)}l.done?e(u):Promise.resolve(u).then(r,s)}function Bt(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(u){Tk(i,r,s,o,l,"next",u)}function l(u){Tk(i,r,s,o,l,"throw",u)}o(void 0)})}}const P7=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],_0=new Map,Rk=function(t,e=[]){if(!t)return!1;const n=(function(o,l){let u="";for(let d=0;l.length>d;d++){const f=l[d];u+=f.length+":"+f}return o.length+":"+o+"|"+l.length+":"+u})(t,e),r=_0.get(n);if(r!==void 0)return r;const s=t.toLowerCase(),i=P7.concat(e).some(o=>s.indexOf(o.toLowerCase())!==-1);return 256>_0.size||_0.clear(),_0.set(n,i),i};function Ki(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Pn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),Ki(s??n,e,n,r))}var A7=class{constructor(t){this.C={},this.I=t.I,this.R=Ki(t.bucketSize,0,100,t.$),this.A=Ki(t.refillRate,0,this.R,t.$),this.O=Ki(t.refillInterval,0,864e5,t.$)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.A,this.R),t.lastAccess=t.lastAccess+n*this.O)}consumeRateLimit(t){var e;const n=Date.now(),r=String(t);let s=this.C[r];return s?this.F(s,n):(s={tokens:this.R,lastAccess:n},this.C[r]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((e=this.I)===null||e===void 0||e.call(this,t)),s.tokens===0)}stop(){this.C={}}};const id="Mobile",vh="Android",Om="Tablet",_5="Android Tablet",w5="iPad",x5="Apple Watch",J0="Safari",zg="BlackBerry",b5="Samsung Internet",em="Chrome",S5="Chrome iOS",k5="Internet Explorer",E5="Internet Explorer Mobile",C5="Opera",P5="Microsoft Edge",tm="Firefox",A5="Firefox iOS",Lm="Nintendo",Nm="PlayStation",Ug="Xbox",T5="Android Mobile",R5="Mobile Safari",dy="Windows",I5="Windows Phone",Ik="Nokia",o2="Ouya",T7="Generic "+id.toLowerCase(),M5="Generic "+Om.toLowerCase(),a2="Konqueror",O5="Oculus Browser",L5="Vivaldi",N5="Yandex",D5="Whale",j5="DuckDuckGo",$5="Pale Moon",F5="Waterfox",l2="Brave",V5="Claude",H5="Codex",z5="ChatGPT",U5="Google Search App",fy=new RegExp("Version/(\\d+(\\.\\d+)?)"),hy=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),R7=new RegExp(Ug,"i"),I7=new RegExp("PlayStation \\w+","i"),M7=new RegExp("Nintendo \\w+","i"),$x=new RegExp("BlackBerry|PlayBook|BB10","i"),O7={"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"},B5=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?l2:null})(n)||(r!=null&&r.detectGoogleSearchApp&&Be(t,"GSA/")?U5:Be(t," OPR/")&&Be(t,"Mini")?"Opera Mini":Be(t," OPR/")?C5:$x.test(t)?zg:Be(t,"IEMobile")||Be(t,"WPDesktop")?E5:Be(t,"OculusBrowser")?O5:Be(t,"SamsungBrowser")?b5:Be(t,"Edge")||Be(t,"Edg/")?P5:Be(t,"Vivaldi/")?L5:Be(t,"YaBrowser/")?N5:Be(t,"Whale/")?D5:Be(t,"DuckDuckGo/")||Be(t,"Ddg/")?j5:Be(t,"Claude/")?V5:Be(t,"Codex/")?H5:Be(t,"ChatGPT/")?z5:Be(t,"FBIOS")?"Facebook Mobile":Be(t,"UCWEB")||Be(t,"UCBrowser")?"UC Browser":Be(t,"CriOS")?S5:Be(t,"CrMo")||Be(t,em)?em:Be(t,vh)&&Be(t,J0)?T5:Be(t,"FxiOS")?A5:Be(t.toLowerCase(),a2.toLowerCase())?a2:Be(t,"Brave/")?l2:((i,o)=>o&&Be(o,"Apple")||(function(l){return Be(l,J0)&&!Be(l,em)&&!Be(l,vh)})(i))(t,e)?Be(t,id)?R5:J0:Be(t,"PaleMoon/")?$5:Be(t,"Waterfox/")?F5:Be(t,tm)?tm:Be(t,"MSIE")||Be(t,"Trident/")?k5:Be(t,"Gecko")?tm:"")},L7={[E5]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[P5]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[em]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[S5]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[J0]:[fy],[R5]:[fy],[C5]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[tm]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[A5]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[a2]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[zg]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),fy],[T5]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[b5]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[O5]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[L5]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[N5]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[D5]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[l2]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[V5]:[hy],[H5]:[hy],[z5]:[hy],[j5]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[$5]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[F5]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[U5]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[k5]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},N7=function(t,e,n,r){const s=B5(t,e,n,r),i=L7[s];if(le(i))return null;for(let o=0;i.length>o;o++){const l=t.match(i[o]);if(l)return parseFloat(l[l.length-2])}return null},Mk=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[Ug,t&&t[1]||""]],[new RegExp(Lm,"i"),[Lm,""]],[new RegExp(Nm,"i"),[Nm,""]],[$x,[zg,""]],[new RegExp(dy,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[I5,""];if(new RegExp(id).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=O7[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[dy,r]}return[dy,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=le(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[vh,[t[2],t[3],t[4]||"0"].join(".")]:[vh,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],W5=function(t){for(let e=0;Mk.length>e;e++){const[n,r]=Mk[e],s=n.exec(t),i=s&&(kn(r)?r(s,t):r);if(i)return i}return["",""]},Z5=function(t){return M7.test(t)?Lm:I7.test(t)?Nm:R7.test(t)?Ug:new RegExp(o2,"i").test(t)?o2:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?I5:/iPad/.test(t)?w5:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?x5:$x.test(t)?zg:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ik,"i").test(t)?Ik:/(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(id).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)?vh:_5:new RegExp("(pda|Mobile)","i").test(t)?T7:new RegExp(Om,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?M5:""},D7=function(t,e){var n;const r=Z5(t);return r===w5||r===_5||r==="Kobo"||r==="Kindle Fire"||r===M5?Om:r===Lm||r===Ug||r===Nm||r===o2?"Console":r===x5?"Wearable":r?id:(e==null?void 0:e.userAgentDataPlatform)==="Android"&&((n=e==null?void 0:e.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((s=e==null?void 0:e.screenWidth)!==null&&s!==void 0?s:0,(i=e==null?void 0:e.screenHeight)!==null&&i!==void 0?i:0)/((o=e==null?void 0:e.devicePixelRatio)!==null&&o!==void 0?o:1)?id:Om:"Desktop";var s,i,o},py=/\bFBAV\/(\d+(?:\.\d+)*)/i,Ok=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",py],[/\bFBAN\/EMA\b/i,"Facebook Lite",py],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",py],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],c2="[Truncated]",Jh="[Unserializable]";function Du(t){let e="";for(let n=0;t.length>n;n++){const r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{const s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function q5(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const r of n){let s;try{s=e[r]}catch{s=Jh}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const nm=3e5;var G5=class{record(t){if(t.kind==="too-large")return;if(t.kind!=="retry-later")return void this.reset();if(!t.retryAfterMs)return;const e=this.isOpen(),n=Date.now(),r=Math.min(t.retryAfterMs,nm);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+nm))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(nm,Math.max(0,this.es-t));return e===0&&this.reset(),e}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const j7=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Lk(t,e){return typeof(n=t)=="string"&&j7.test(n)?t:e();var n}function K5(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function qa(t){return t&&t.split("#")[0]}function Nk(t){try{return t()}catch{return}}function Y5(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function Dk(t,e,n){return X5.apply(this,arguments)}function X5(){return(X5=Bt(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=Y5(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function Gf(t){return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gf(t)}function $7(t,e,n){return(e=(function(r){var s=(function(i){if(Gf(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(Gf(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return Gf(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jk(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function $(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jk(Object(n),!0).forEach(function(r){$7(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jk(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}let xf,$k,Fk,cu;function F7(t){var e;const n=globalThis._posthogChunkIds,r=globalThis._debugIds;if(!n&&!r)return;const s=n?Object.keys(n):[],i=r?Object.keys(r):[];if(cu&&Vk(n,s,$k)&&Vk(r,i,Fk))return cu;$k=n?$({},n):void 0,Fk=r?$({},r):void 0,cu={},(e=xf)!==null&&e!==void 0||(xf={});const o=(l,u)=>{for(const f of l){const h=u[f];if(!h)continue;const m=xf==null?void 0:xf[f];if(m){cu[m]=h;continue}const v=t(f);for(let x=v.length-1;x>=0;x--){var d;const _=(d=v[x])===null||d===void 0?void 0:d.filename;if(_){cu[_]=h,xf[f]=_;break}}}};return r&&o(i,r),n&&o(s,n),cu}function Vk(t,e,n){return t&&n?e.length===Object.keys(n).length&&e.every(r=>t[r]===n[r]):t===n}var V7=class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,e,0).apply(t),s=this.buildParsingContext(e),i=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(t){var e=this;return Bt(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&ze(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:(e=t.syntheticException)===null||e===void 0?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let r,s;if(t.cause!=null&&(r=this.parseStacktrace(t.cause,e)),t.stack!=""&&t.stack!=null)try{s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch{}return $($({},t),{},{cause:r,stack:s,errors:(n=t.errors)===null||n===void 0?void 0:n.map(i=>this.parseStacktrace(i,e))})}applyChunkIds(t,e){return t.map(n=>(n.filename&&e&&(n.chunk_id=e[n.filename]),n))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return Bt(function*(){let n=t;for(const r of e.modifiers)n=yield r(n);return n})()}convertToExceptionList(t,e){const n=[],r=(s,i,o)=>{var l;const u=n.length,d=i===void 0?$($({type:typeof e.type=="string"&&e.type.length>0?e.type:"generic"},typeof e.handled=="boolean"?{handled:e.handled}:e.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof e.synthetic=="boolean"?e.synthetic:s.synthetic,exception_id:u}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:u,parent_id:i},f={type:s.type,value:s.value,mechanism:d};s.stack&&(f.stacktrace={type:"raw",frames:s.stack}),n.push(f),s.cause&&r(s.cause,u,"cause");for(const h of(l=s.errors)!==null&&l!==void 0?l:[])r(h,u,"member")};return r(t),n}buildParsingContext(t){var e;return{chunkIdMap:F7(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(Pd(t)){let n=Object.getPrototypeOf(t);for(let r=0;n&&100>r;r++){var e;const s=(e=Object.getOwnPropertyDescriptor(n,"constructor"))===null||e===void 0?void 0:e.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=t.errors;return ze(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(t,e,n=0){let r=0,s=0,i=!1;const o=new Set,l=[],u={},d=(m,v,x=0)=>{const _=f(v,x),w=_.apply;if(_.apply=M=>{l.push(m);try{return w(M)}finally{l.pop()}},x>4||x>0&&l.indexOf(m)!==-1)return this.coerceFallback(_);const b=typeof m=="object"&&m!==null||typeof m=="function";if(x===0&&r>=50||b&&o.has(m))return;b&&o.add(m),x===0&&r++;const k=this.getAggregateErrors(m);let C,P;i||(i=!!k);try{if(C=this.applyCoercers(m,_),!C)throw u}catch(M){if(M===u)return void(x===0&&r--);if(!i)throw M;C=this.coerceFallback(_)}if(!k||r>=50)return C;try{P=k.length}catch{return C}if(!Number.isInteger(P)||0>P||P>4294967295)return C;const T=[];for(let M=0;50>r&&1e3>s&&P>M;M++){let I;s++;try{I=_.next(k[M])}catch{r++,I=this.coerceFallback(f(v+1))}I&&T.push(I)}return $($({},C),{},{errors:T})},f=(m,v=0)=>$($({},e),{},{syntheticException:m==0?e.syntheticException:void 0,mechanism:m==0?t:{},apply(x){const _=d(x,m,v+1);if(!_)throw u;return _},next:x=>d(x,m+1)}),h=f(n);return $($({},h),{},{apply:m=>{var v;return(v=d(m,n))!==null&&v!==void 0?v:this.coerceFallback(h)}})}};const H7=/^([a-z][a-z0-9.+-]+):/i,z7=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function U7(t){if(!t||t==="<anonymous>")return!1;const e=H7.exec(t);return!e||z7.includes(e[1].toLowerCase())}function u2(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:U7(e)};return le(r)||(i.lineno=r),le(s)||(i.colno=s),i}const Q5=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},B7=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,W7=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Z7=/\((\S*)(?::(\d+))(?::(\d+))\)/,q7=(t,e)=>{const n=B7.exec(t);if(n){const[,s,i,o]=n;return u2(e,s,"?",+i,+o)}const r=W7.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=Z7.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=Q5(r[1]||"?",r[2]);return u2(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},G7=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,K7=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Y7=(t,e)=>{const n=G7.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=K7.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}let r=n[3],s=n[1]||"?";return[s,r]=Q5(s,r),u2(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Hk=/\(error: (.*)\)/;function Fx(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function X7(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let r=!0;for(let s=0;e>s;s++)if(!Fx(t[n+s],t[n+e+s])){r=!1;break}if(r){for(let s=0;e>s;s++)t[n+s]=t[n+e+s];return t.length=n+e,{start:n,length:e}}}}function Q7(t,e){const n=e.start+e.length,r=eT(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function J5(t,e){let n=e.start;for(;n>0&&Fx(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function eT(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&Fx(t[r],t[r-e.length]);)r++;return r-n}function J7(t,e){const n=e[0];let r=t.length-(n?J5(t,n):0);for(const s of e)r-=eT(t,s);return r}function e$(t,e,n){for(let r=0;t.length>r;r++){const s=t[(e+r)%t.length],i=t[(n+r)%t.length];if(s!==i)return i>s}return!1}var t$=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=st(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return Mm(t,"DOMException")}isDOMError(t){return Mm(t,"DOMError")}},n$=class{match(t){return Pd(t)}coerce(t,e){var n;const r=this.getStack(t),s=r===void 0?(n=e.syntheticException)===null||n===void 0?void 0:n.stack:void 0,i=!!s;return{type:this.getType(t),value:this.getMessage(t,e),stack:r??s,cause:t.cause?e.next(t.cause):void 0,synthetic:i}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if(typeof e=="string"&&e.length>0)return e;const n=t.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}},r$=class{match(t){return!!Mm(t,"ErrorEvent")&&(t.error!=null||this.hr(t))}coerce(t,e){var n;if(t.error!=null)return e.apply(t.error);const r=e.apply(t.message);return $($({},r),{},{stack:(n=this.vr(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}hr(t){return st(t.message)&&t.message.length>0}vr(t){var e,n;const r=t,s=(e=r.lineno)!==null&&e!==void 0?e:0,i=(n=r.colno)!==null&&n!==void 0?n:0;if(st(r.filename)&&r.filename.length!==0&&s!==0)return`Error
18
- at ${r.filename}:${s}:${i}`}};const s$=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var i$=class{match(t){return typeof t=="string"}coerce(t,e){var n;const[r,s]=this.getInfos(t);return{type:r??"Error",value:s??t,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const r=t.match(s$);return r&&(e=r[1],n=r[2]),[e,n]}};const o$=["fatal","error","warning","log","info","debug"];function tT(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let r=n.length;r>0;r--){const s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?`${s.slice(0,e)}...`:s}return""}var a$=class{match(t){return typeof t=="object"&&t!==null}coerce(t,e){var n,r;const s=this.getErrorPropertyFromObject(t);return s?e.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(n=this.getStack(t))!==null&&n!==void 0?n:(r=e.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(jx(t))return t.constructor.name;const e="name"in t?t.name:void 0;return st(e)&&!qf(e)?e:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let n=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(n+=` with message: '${t.message}'`),n}if("message"in t&&typeof t.message=="string")return t.message;const e=this.getObjectClassName(t);return`${e&&e!=="Object"?`'${e}'`:"Object"} captured as exception with keys: ${tT(t)}`}isSeverityLevel(t){return st(t)&&!qf(t)&&o$.indexOf(t)>=0}getStack(t){try{return st(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:st(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(Pd(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},l$=class{match(t){return jx(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${tT(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},c$=class{match(t){return v5(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},u$=class{match(t){return Mm(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!jx(t))return!1;try{const e=t.detail;return e!=null&&typeof e=="object"&&"reason"in e}catch{return!1}}coerce(t,e){var n;const r=this.getUnhandledRejectionReason(t);return v5(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};const Dm="$message",jm="$timestamp",d$=new Set([Dm,jm]),my={enabled:!0,max_bytes:32768};function $m(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:my.enabled,max_bytes:h$(t.max_bytes,my.max_bytes)}:$({},my)}var f$=class{constructor(t){this.ns=[],this.ss=0,this.Ar=$m(t)}setConfig(t){this.Ar=$m(t),this.rs()}add(t){const e=(function(r){let s;try{s=m5(r)}catch{return}try{const i=JSON.parse(s);if(!rt(i))return;const o=i,l=o[Dm],u=o[jm];return!st(l)||l.trim().length===0||!st(u)&&!Pn(u)?void 0:{step:o,json:s}}catch{return}})(t);if(!e)return;const n=(function(r){if("u">typeof TextEncoder)return new TextEncoder().encode(r).length;const s=encodeURIComponent(r);let i=0;for(let o=0;s.length>o;o++)s[o]==="%"?(i+=1,o+=2):i+=1;return i})(e.json);n>this.Ar.max_bytes||(this.ns.push({step:e.step,bytes:n}),this.ss+=n,this.rs())}getAttachable(){return this.ns.map(t=>t.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Ar.max_bytes&&this.ns.length>0;){const t=this.ns.shift();t&&(this.ss-=t.bytes)}}};function h$(t,e){if(!Pn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const zk=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function Uk(t){return typeof t=="string"||t}function Bk(t){return typeof t=="string"?t:void 0}const p$=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],nT="NativeGzipValidationError",d2=t=>t.length>=2&&t[0]===31&&t[1]===139,Wk=(t,e)=>t===s2.GZipJS||e===s2.GZipJS||e==="gzip",Zk=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let bf;const w0=t=>{throw K5(nT,`Native gzip produced invalid output: ${t}`)},m$=(qk=Bt(function*(t,e){18>t.size&&w0("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());d2(n)&&n[2]===8||w0("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(i=>{const o=(()=>{if(bf)return bf;bf=[];for(let u=0;256>u;u++){let d=u;for(let f=0;8>f;f++)d=1&d?3988292384^d>>>1:d>>>1;bf[u]=d>>>0}return bf})();let l=4294967295;for(let u=0;i.length>u;u++)l=o[255&(l^i[u])]^l>>>8;return(4294967295^l)>>>0})(e)&&w0("invalid-crc");const s=e.length>>>0;r.getUint32(4,!0)!==s&&w0("invalid-size")}),function(t,e){return qk.apply(this,arguments)});var qk;function f2(){return f2=Bt(function*(t,e=!0,n){try{const s=new TextEncoder().encode(t),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),l=o.write(s).then(()=>o.close()).catch((r=Bt(function*(f){try{yield o.abort(f)}catch{}throw f}),function(f){return r.apply(this,arguments)})),u=new Response(i.readable).blob(),[d]=yield Promise.all([u,l]);return yield m$(d,s),d}catch(s){if(n!=null&&n.rethrow)throw s;return e&&console.error("Failed to gzip compress data",s),null}var r}),f2.apply(this,arguments)}function rT(t,e){if(t==null)return{};var n,r,s=(function(o,l){if(o==null)return{};var u={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(l.includes(d))continue;u[d]=o[d]}return u})(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;i.length>r;r++)e.includes(n=i[r])||{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}const Rr="[redacted]",g$=/^[A-Za-z0-9+/\n\r]+=*$/,v$=/^[A-Za-z0-9_-]+={0,2}$/,y$=/[-_]/,_$=/^data:[^,\s]*;base64,/i,w$=/^[A-Za-z0-9+/_-]+={0,2}$/,x$=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,b$=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,sT=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,S$=/[\s<>"]/,iT=new RegExp(sT.source,"i"),oT=/[a-z][a-z0-9+.-]{0,63}:\/\//i,k$=new RegExp(`^${oT.source}`,"i"),E$=new RegExp(oT.source,"gi"),C$=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,P$=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,A$=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,T$=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,R$=/\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g,I$=/(^|[^\w:])((?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})))(?=$|[^\w:])/g,M$=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,O$=/\b\d(?:[ ./-]?\d){12,}\b/g,Gk=/\d+/g,L$=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,N$=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function h2(t){return(function(e){return b$.test(e)})(t)||C$.test(t)||P$.test(t)}function gy(t){return t.split("&",129).length>128}function D$(t,e,n){return h2(t)||e.includes(";")&&(function(r){return r.split(";").some(s=>h2(s.split("=",1)[0]))})(e)?Rr:iT.test(e)?n?Vx(e,{allowNestedUrls:!1,stripPunctuation:!0}):Rr:e}function aT(t,e){const n=new URLSearchParams;let r=!1,s=!1;for(const[i,o]of new URLSearchParams(t)){const l=Fm(i),u=Fm(o);r||(r=l!==i||u!==o);const d=D$(l,u,e);r||(r=d!==u),s=h2(l)||d!==u,n.append(l,d)}return{changed:r,lastFieldSensitive:s,serialized:n.toString()}}function Kk(t,e){if(!t.includes("="))return{value:j$(t,e),lastFieldSensitive:!1};const n=aT(t,e);return{value:n.changed?n.serialized:t,lastFieldSensitive:n.lastFieldSensitive}}function j$(t,e){return e?Vx(t,{allowNestedUrls:!1,stripPunctuation:!0}):iT.test(t)?Rr:t}function $$(t,e,n){return t==="#"?!e.fragment&&(e.fragment=!0):t==="?"&&(e.fragment?n!=="="&&!e.fragmentQuery&&(e.fragmentQuery=!0):!e.query&&(e.query=!0))}function vy(t,e){var n;if(t.length>8192&&k$.test(t))return Rr;const{address:r,suffix:s}=e.stripPunctuation?(function(w){let b=w.length;for(;b>0&&".,;:!?)]}'".includes(w[b-1]);)b--;return{address:w.slice(0,b),suffix:w.slice(b)}})(t):{address:t,suffix:""};let i;try{i=new URL(r)}catch{return Rr+s}const o=i.search.slice(1),l=i.hash!=="",u=(function(w){const b=w.slice(1),k=b.indexOf("?");return 0>k?{head:b,tail:null}:{head:b.slice(0,k),tail:b.slice(k+1)}})(i.hash);if(gy(o)||gy(u.head)||gy((n=u.tail)!==null&&n!==void 0?n:""))return Rr+s;let d=!1;(i.username||i.password)&&(i.username=Rr,i.password="",d=!0);const f=aT(o,e.allowNestedUrls);f.changed&&(i.search=f.serialized,d=!0);const h=Kk(u.head,e.allowNestedUrls),m=u.tail===null?null:(v=u.tail,h.lastFieldSensitive?{value:v===""?"":Rr,lastFieldSensitive:!0}:Kk(v,e.allowNestedUrls));var v;const x=m===null?h.value:`${h.value}?${m.value}`;x!==i.hash.slice(1)&&(i.hash=x,d=!0);const _=l?m??h:f;return(d?Fm(i.toString()):r)+(_.lastFieldSensitive?"":s)}function Vx(t,e){return t.replace(sT,n=>(function(r,s){const i=(function(u){if(!u.includes("://"))return[];const d=[...u.matchAll(E$)].map(_=>_.index),f=[],h={query:!1,fragment:!1,fragmentQuery:!1};let m=0,v=!1,x="";for(let _=0;u.length>_&&d.length>m;_++){d[m]===_&&(_>0&&x!=="="&&f.push(_),m++);const w=u[_];$$(w,h,x)?(x=w,v=!0):v&&"=&".includes(w)&&(x=w)}return f})(r);if(i.length===0)return vy(r,s);let o="",l=0;for(const u of i)o+=vy(r.slice(l,u),$($({},s),{},{stripPunctuation:!1})),l=u;return o+vy(r.slice(l),s)})(n,$($({},e),{},{stripPunctuation:e.stripPunctuation&&n.length!==t.length})))}function Fm(t){return t.replace(x$,Rr)}function lT(t,e){return(function(n){return n.length>=10240&&(g$.test(n)||(function(r){const s=_$.exec(r);if(!s)return!1;let i;try{i=decodeURIComponent(r.slice(s[0].length))}catch{return!1}return w$.test(i.replace(/[\r\n]/g,""))})(n)||y$.test(n)&&v$.test(n))})(t)?"[binary data redacted - not supported by PostHog MCP analytics]":(function(n,r,s){const i=4*s.maxStringLength;if(n.length>i){const o=r(n.slice(0,(function(l,u){let d=u;for(;d>0&&!S$.test(l[d-1]);)d--;return d})(n,i)));if(o.length>=2*s.maxStringLength)return o+s.truncationSuffix}return r(n)})(t,n=>(function(r){return Vx(r,{allowNestedUrls:!0,stripPunctuation:!0})})((function(r){let s=r.replace(A$," ");return s=s.replace(T$,Rr),s=s.replace(R$,Rr),s=s.replace(I$,`$1${Rr}`),s=s.replace(O$,V$),s=s.replace(M$,Rr),s=s.replace(L$,`$1${Rr}`),s=s.replace(N$,`$1${Rr}`),s})(Fm(n))),e)}function F$(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;if(0>s||s>9)return!1;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function V$(t){const e=[];for(let i=Gk.exec(t);i!==null;i=Gk.exec(t))e.push({digits:i[0],start:i.index,end:i.index+i[0].length});let n="",r=0,s=0;for(;e.length>s;){let i="",o=-1;for(let l=s;e.length>l&&(i+=e[l].digits,19>=i.length);l++)i.length>=13&&F$(i)&&(o=l);0>o?s++:(n+=t.slice(r,e[s].start)+Rr,r=e[o].end,s=o+1)}return n+t.slice(r)}const H$={}.propertyIsEnumerable;function Vm(t,e){try{return cT(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function Hx(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:c2};if(n.remainingNodes--,zr(t))return{boolValue:t};if(typeof t=="bigint")return(function(s,i){const o=s.toString(),l=BigInt("9223372036854775808");return s>=l||-l>s?(i==null||i.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const s=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e==null||e.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Du(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:c2};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?Du(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return Hx(s.call(t),e,n,r+1)}catch{}return ze(t)?{arrayValue:{values:z$(t,e,n,r+1)}}:{kvlistValue:{values:cT(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Du(String(t))}}function z$(t,e,n,r){const s=[],i=Math.min(t.length,1e3);let o=0;for(;i>o&&n.remainingNodes>0;o++)try{const l=o in t?t[o]:void 0;if(Qe(l))continue;s.push(Hx(l,e,n,r))}catch{s.push({stringValue:Jh})}return t.length>o&&s.push({stringValue:c2}),s}function cT(t,e,n,r){const s=[];for(const i in t)if(H$.call(t,i)){if(!i){e==null||e.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=t[i];if(un(o)||le(o))continue;s.push({key:Du(i),value:Hx(o,e,n,r)})}catch{s.push({key:Du(i),value:{stringValue:Jh}})}}return s}function uT(t,e,n){return $($($($({},q5({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const U$=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function dT(t,e){const n=q5({},t),r={};for(const s of U$)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...Vm(n,e),...Vm(r,e)]}const Yk={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},fT={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}},B$=fT.info;function W$(t){try{return Du(String(t))}catch{return Jh}}function Z$(t,e,n,r){const s=t.level||"info",{text:i,number:o}=fT[s]||B$,l=(function(m=Date.now()){return String(m)+"000000"})(Pn(r)?r:void 0),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),Qe(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),Qe(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);const d=$({},u),f=t.attributes;if(f){let m=[];try{m=Object.keys(f)}catch{m=[]}for(const v of m){let x;try{x=f[v]}catch{x=Jh}Object.defineProperty(d,v,{value:x,enumerable:!0,writable:!0,configurable:!0})}}const h={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:W$(t.body)},attributes:Vm(d,n)};return t.trace_id&&(h.traceId=t.trace_id),t.span_id&&(h.spanId=t.span_id),le(t.trace_flags)||(h.flags=t.trace_flags),h}function hT(t,e,n){return uT(t,e,n)}function pT(t,e,n,r){return{resourceLogs:[{resource:{attributes:dT(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var mT=class{constructor(t){this.ls=t,this.us=0}get pending(){return!!this.cs}arm(t){this.clear(),this.us=Date.now()+t,this.cs=Y5(()=>{this.cs=void 0,this.ls()},t)}armNoEarlierThan(t){this.cs&&Date.now()+t<=this.us||this.arm(t)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function gT(){return .75+.5*Math.random()}function vT(t,e,n,r){const s=Math.min(Math.max(0,e-1),6),i=t*Math.pow(2,s);return Math.round(Math.min(i,Math.max(r,t))*n)}var q$=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Ar=e,this.$=n,this.hs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new mT(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new G5,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=e.maxBufferSize,this.Is=Math.max((l=e.maxQueueSize)!==null&&l!==void 0?l:e.maxBufferSize,e.maxBufferSize),this.Ms=e.flushIntervalMs,this.Es=e.maxBatchRecordsPerPost,this.Ps=e.rateCapWindowMs,this.Rs=e.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Vi.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.$s=0,this.Cs=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Ar.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Os(t);if(r===null)return;if(!r.body)return void this.$.info("Log was rejected in beforeSend function");if(!this.Ds())return;const s={record:Z$(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.hs(),this.$,e==null?void 0:e.occurredAtMs)};this.ds(()=>this.Ls(s))}Os(t){const e=this.Ar.beforeSend;if(!e)return t;const n=ze(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.$.info("Log was rejected in beforeSend function"),null;r=i}catch(i){return this.$.error("Error in beforeSend function for log:",i),null}return r}Ds(){if(this.Rs===void 0)return!0;const t=Date.now(),e=t-this.xs;return this.Ps>e&&e>=0||(this.xs=t,this.$s=0,this.Cs=!1),this.Rs>this.$s?(this.$s++,!0):(this.Cs||(this.$.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.Cs=!0),!1)}flush(){var t=this;return Bt(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return Bt(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty(Vi.LogsQueue))!==null&&e!==void 0?e:[];if(n.length===0)return;const r=n.length;let s=0;for(;n.length>0&&r>s;){var i,o;const l=t._s;t.bs=0;const u=Math.min(n.length,t.Es),d=n.slice(0,u),f=pT(d.map(m=>m.record),t.qs(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.js(f);if(t._s!==l)return;if(h.kind==="too-large"&&d.length>1)t.Es=Math.max(1,Math.floor(d.length/2)),t.$.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${t.Es}`);else if(t.ws.record(h),t.ps.pending&&t.ps.arm(Math.max(t.Ms,t.ws.remainingMs())),h.kind==="retry-later"||(h.kind==="too-large"?t.$.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Ar.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Ar.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty(Vi.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,h.kind==="fatal"))throw h.error}})()}Bs(t){var e=this;return Bt(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty(Vi.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Vi.LogsQueue,s.slice(r)),yield e.vs()})()}qs(){return hT(this.Ar,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(Vi.LogsQueue))!==null&&e!==void 0?e:[];this.Is>n.length||(n.shift(),this.bs++,this.$.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Vi.LogsQueue,n),this.Ts>n.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(vT(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const t=this._instance.getPersistedProperty(Vi.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Bt(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield Dk(n,t):yield n})()}flushWithTimeout(t){var e=this;return Bt(function*(){const n=e.flush();yield Dk(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=gT(),this.$.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.zs())})}};const G$=/^[0-9a-f]+$/;function Xk(t,e,n){return typeof t=="string"&&t.length===e&&t!==n&&G$.test(t)}const K$=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/,Y$="00",yy=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function p2(t){return String(t)+"000000"}function Qk(t,e,n,r){let s="";return r&&(s=Object.keys(r).sort().map(i=>`${JSON.stringify(i)}:${JSON.stringify(r[i])}`).join(",")),`${t}\0${e}\0${n??""}\0${s}`}var X$=class{constructor(t,e,n){this._instance=t,this.Ar=e,this.$=n,this.Hs=new Map,this.ps=new mT(()=>this.flush().catch(r=>{this.$.error("Metrics flush failed:",r)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new G5,this.ks=0,this.Ss=1,this.Gs=0}count(t,e=1,n){this.Qs({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.Qs({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.Qs({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this;const e=this.ys,n=(function(){var r=Bt(function*(){e&&(yield e.catch(()=>{})),yield t.Zs()});return function(){return r.apply(this,arguments)}})()().finally(()=>{this.ys===n&&(this.ys=null)});return this.ys=n,n}drainWindow(){if(this.Hs.size===0)return null;const t=this.Hs;return this.Hs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(t)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.Hs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Qs(t){if(this._instance.isDisabled||this._instance.optedOut)return;const e=this.Os(t);if(e===null)return;if(!e.name||typeof e.name!="string")return void this.$.warn("Dropping metric with empty name");if(typeof e.value!="number"||!Number.isFinite(e.value))return void this.$.warn(`Dropping metric '${e.name}': value must be a finite number`);if(e.type==="count"&&0>e.value)return void this.$.warn(`Dropping count '${e.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=e.attributes?$({},e.attributes):void 0,r=Qk(e.type,e.name,e.unit,n)}catch(l){return void this.$.warn(`Dropping metric '${e.name}': attributes could not be serialized`,l)}let s=this.Hs.get(r);if(!s){if(!this.Ks())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Hs.set(r,s)}const i=this.Ws.get(e.name);i===void 0?this.Ws.set(e.name,e.type):i===e.type||this.Vs.has(e.name)||(this.Vs.add(e.name),this.$.warn(`Metric name '${e.name}' is already used as a ${i}; recording it as a ${e.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(s,e.value);const o=this.Ys();o&&(s.exemplar=$($({},o),{},{value:e.value,timeMs:Date.now()})),this.Fs()}Ys(){try{var t,e;const n=(function(r){const s=(function(o){if(typeof o!="string")return;const l=K$.exec(o.trim());if(!l)return;const[,u,d,f,h,m]=l;return u==="ff"||u==="00"&&m||!(function(v){return Xk(v,32,"00000000000000000000000000000000")})(d)||!(function(v){return Xk(v,16,"0000000000000000")})(f)?void 0:{version:u,traceId:d,spanId:f,flags:h}})(r);return s&&{traceId:s.traceId,spanId:s.spanId,flags:(i=s.flags,1&parseInt(i,16)?"01":Y$)};var i})((t=(e=this._instance).getActiveSpan)===null||t===void 0||(t=t.call(e))===null||t===void 0?void 0:t.traceparent());if(n&&n.flags==="01")return{traceId:n.traceId,spanId:n.spanId}}catch{}}Ks(){return this.Ar.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.$.warn(`Metric series cap reached (${this.Ar.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(t,e){switch(t.type){case"count":var n;t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":{t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(yy.length+1).fill(0)});const r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(let o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(e,yy)]+=1;break}}}Os(t){const e=this.Ar.beforeSend;if(!e)return t;const n=ze(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.$.info("Metric was rejected in beforeSend function"),null;r=i}catch(i){return this.$.error("Error in beforeSend function for metric:",i),null}return r}Fs(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(vT(this.Ar.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Zs(){var t=this;return Bt(function*(){if(t.ps.clear(),t.Hs.size===0)return;const e=t.Hs;t.Hs=new Map,t.Us=!1,t.Ws=new Map,t.Vs=new Set;const n=t.Gs,r=yield t._instance.po(t.Js(e));if(n===t.Gs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=gT()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.zs()),r.kind){case"ok":return;case"retry-later":return t.mo(e),void t.ps.armNoEarlierThan(t.zs());case"too-large":return void t.$.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.$.error("Failed to send metrics batch:",r.error)}})()}Js(t){return e=this.yo(t),n=(function(i,o,l){return uT(i,o,l)})(this.Ar,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:dT(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}yo(t){const e=p2(Date.now()),n=new Map;for(const o of t.values()){var r;const l=Qk(o.type,o.name,o.unit,void 0);let u=n.get(l);u||(u=$({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?u.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?u.gauge={dataPoints:[]}:u.histogram={aggregationTemporality:1,dataPoints:[]},n.set(l,u));const d=Vm((r=o.attributes)!==null&&r!==void 0?r:{},this.$),f=p2(o.windowStartMs),h=Q$(o.exemplar);if(o.type==="count"){var s;const m=$({attributes:d,startTimeUnixNano:f,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0},h);u.sum.dataPoints.push(m)}else if(o.type==="gauge"){var i;const m=$({attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0},h);u.gauge.dataPoints.push(m)}else if(o.hist){const m=$({attributes:d,startTimeUnixNano:f,timeUnixNano:e,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:yy},h);u.histogram.dataPoints.push(m)}}return Array.from(n.values())}mo(t){for(const[s,i]of t){var e;const o=this.Hs.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,i.windowStartMs),o.exemplar=(e=o.exemplar)!==null&&e!==void 0?e:i.exemplar,o.type){case"count":var n,r;o.total=((n=o.total)!==null&&n!==void 0?n:0)+((r=i.total)!==null&&r!==void 0?r:0);break;case"gauge":break;case"histogram":if(i.hist)if(o.hist){o.hist.count+=i.hist.count,o.hist.sum+=i.hist.sum,o.hist.min=Math.min(o.hist.min,i.hist.min),o.hist.max=Math.max(o.hist.max,i.hist.max);for(let l=0;o.hist.bucketCounts.length>l;l++)o.hist.bucketCounts[l]+=i.hist.bucketCounts[l]}else o.hist=i.hist}else this.Ks()&&this.Hs.set(s,i)}}};function Q$(t){return t?{exemplars:[{filteredAttributes:[],timeUnixNano:p2(t.timeMs),asDouble:t.value,traceId:t.traceId,spanId:t.spanId}]}:{}}const yT=(t,{debugEnabled:e}={})=>{const n={N(r,...s){let i;try{i=typeof window>"u"?void 0:window}catch{return}i&&(Vo.DEBUG||i.POSTHOG_DEBUG||e)&&!le(i.console)&&i.console&&("__rrweb_original__"in i.console[r]?i.console[r].__rrweb_original__:i.console[r])(t,...s)},debug(...r){n.N("debug",...r)},info(...r){n.N("log",...r)},warn(...r){n.N("warn",...r)},error(...r){n.N("error",...r)},critical(...r){console.error(t,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>yT(`${t} ${r}`,s)};return n},he=yT("[PostHog.js]"),an=he.createLogger,J$=an("[ExternalScriptsLoader]"),Hm=t=>{const e=Ee==null?void 0:Ee.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},ql=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return J$.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=Hm(e);if(r){if(r.__posthog_loading_callback_fired)return n();const i=r.__posthog_loading_error;return i?n(i):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}const s=()=>{if(!Ee)return n("document not found");if(Hm(e))return ql(t,e,n);let i=Ee.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=l=>{i.__posthog_loading_callback_fired=!0,n(void 0,l)},i.onerror=l=>{i.__posthog_loading_error=l,n(l)},t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")Ee.head.appendChild(i);else{const l=Ee.querySelectorAll("body > script");var o;l.length>0?(o=l[0].parentNode)===null||o===void 0||o.insertBefore(i,l[0]):Ee.body.appendChild(i)}};Ee!=null&&Ee.body?s():Ee==null||Ee.addEventListener("DOMContentLoaded",s)},_y={},Jk=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};qe.__PosthogExtensions__=qe.__PosthogExtensions__||{},qe.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void ql(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=_y[s];if(r==="fallback"&&i){if(Hm(i))return void ql(t,i,n);delete _y[s]}return void ql(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=Jk(t,e);_y[s]=d;const f=Hm(s);f==null||(u=f.parentNode)===null||u===void 0||u.removeChild(f),ql(t,d,n)}else n(void 0,l)}:n)}ql(t,Jk(t,e),n)},qe.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);ql(t,r,n)},Vo.DEBUG=!1,Vo.LIB_VERSION="1.440.0",Vo.LIB_NAME="web";var es=Vo;const m2="$early_access_features",Do="$active_feature_flags",dc="$feature_flag_details",yh="$feature_flag_errors",za="$feature_flag_evaluated_at",fc="$feature_flag_request_id",Kf="$minimal_flag_called_events",bi="$enabled_feature_flags",Na="$stored_group_properties",Da="$stored_person_properties",jo="$flag_call_reported",$f="$flag_call_reported_session_id",ja="$feature_flag_payloads",Fi="$override_feature_flags",Gl="$override_feature_flag_payloads",ju="visibilitychange",_T="$autocapture_disabled_server_side",Ff="$surveys",zm="$surveys_loaded_at",zx="PostHog loadExternalDependency extension not found.",g2="$surveys_activated",rm="$surveys_activated_session",sm="$surveys_activated_timestamps",eF="$people_distinct_id",Zs="distinct_id",Ux="$device_id",wy="$device_model",Um="__alias",tF="__cmpns",e8="$fbc",$u="$fbc_persistence",t8="$fbp",Yf="$fbp_persistence",v2="__timers",y2="$heatmaps_enabled_server_side",_2="$exception_capture_enabled_server_side",wT="$error_tracking_suppression_rules",w2="$error_tracking_capture_extension_exceptions",x2="$web_vitals_enabled_server_side",Bx="$dead_clicks_enabled_server_side",Wx="$product_tours_enabled_server_side",xT="$logs_capture_enabled_server_side",bT="$web_vitals_allowed_metrics",Xf="$session_recording_remote_config",nF="$session_recording_enabled_server_side",rF="$replay_sample_rate",sF="$replay_override_sampling",iF="$replay_override_linked_flag",oF="$replay_override_url_trigger",aF="$replay_override_event_trigger",Pu="$sesid",ST="$session_is_sampled",lF="$session_past_minimum_duration",cF="$session_recording_url_trigger_activated_session",uF="$session_recording_event_trigger_activated_session",dF="$debug_first_full_snapshot_timestamp",fF="$sess_rec_flush_size",kT="$groups",b2="ph_product_tours",hF="$product_tours_activated",pF="$product_tours_activated_session",mF="$conversations_widget_session_id",gF="$conversations_ticket_id",vF="$conversations_widget_state",yF="$conversations_user_traits",Tr="$user_state",S2="$client_session_props",_F="$capture_rate_limit",ET="$initial_campaign_params",CT="$initial_referrer_info",Au="$initial_person_info",Zx="$epp",xy="$posthog_cookieless",PT="$cookieless_mode",AT="$sdk_debug_extensions_init_method",TT="$sdk_debug_extensions_init_time_ms",qx="$sdk_debug_recording_script_not_loaded",Gx="$sdk_debug_replay_stale_config",RT="$sdk_debug_replay_event_trigger_status",IT="$sdk_debug_replay_linked_flag_trigger_status",MT="$sdk_debug_replay_matched_recording_trigger_groups",OT="$sdk_debug_replay_pending_trigger_conditions",LT="$sdk_debug_replay_remote_trigger_matching_config",NT="$sdk_debug_replay_trigger_groups_count",DT="$sdk_debug_replay_url_trigger_status",wF="$session_recording_start_reason",$o="anonymous",im="identified",jT="identified_only",Bm="beforeunload",Kx="$pageview",n8="$pageleave",$T="$identify",r8="$groupidentify";function Tu(t,e){ze(t)&&t.forEach(e)}function Rt(t,e){if(!Qe(t))if(ze(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)Dx.call(t,n)&&e(t[n],n)}const en=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function om(t){const e=Object.keys(t);let n=e.length;const r=new Array(n);for(;n--;)r[n]=[e[n],t[e[n]]];return r}const xF=function(t){return function(...e){try{return t.apply(this,e)}catch(n){he.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),he.critical(n)}}},Yx=function(t){const e={};return Rt(t,function(n,r){(st(n)&&n.length>0||Pn(n))&&(e[r]=n)}),e};function FT(t){const e=$({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const bF=["herokuapp.com","vercel.app","netlify.app"];function SF(t){const e=t==null?void 0:t.hostname;if(!st(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of bF)if(n===r)return!1;return!0}function xt(t,e,n,r){const{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function k2(t){return t.name==="ph_toolbar_internal"}const Qf=t=>{if(Ee){try{const e=t+"=",n=Ee.cookie.split(";").filter(r=>r.length);for(let r=0;n.length>r;r++){let s=n[r];for(;s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};var kF=class E2{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");const i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new E2(i)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new E2(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},EF=class{generate(){const t=this.generateOrAbort();if(!le(t))return t;{this.Ct=0;const e=this.generateOrAbort();if(le(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const t=(()=>{const e=Date.now();return Pn(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(t>this.Ct)this.Ct=t,this.It();else{if(this.Ct>=t+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Ct++,this.It())}return kF.fromFieldsV7(this.Ct,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.Tt.nextUint32())}It(){this.Mt=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.Mt=0,this.Tt=new PF}};const CF=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};let s8;var PF=class{nextUint32(){var t;return this.Rt.length>this.$t||(((t=s8)!==null&&t!==void 0?t:s8="u">typeof window&&!le(window.crypto)&&crypto.getRandomValues?e=>crypto.getRandomValues(e):CF)(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let i8;const Si=()=>AF().toString(),AF=()=>(i8||(i8=new EF)).generate();let Sf="";const TF=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let uu=null;const Qt={Et(){if(!un(uu))return uu;if(uu=!1,Ee)try{const t=`__ph_cookie_support_${Si()}`;Qt.At(t,"xyz"),uu=Qf(t)==='"xyz"',Qt.Pt(t)}catch{uu=!1}return uu},Ft(t){he.error("cookieStore error: "+t)},Ot:Qf,Lt(t){let e;try{e=JSON.parse(Qt.Ot(t))||{}}catch{}return e},At(t,e,n,r,s){if(!Ee)return!1;try{let i="",o="";const l=(function(d,f){if(f){let h=(function(m,v=Ee){if(Sf)return Sf;if(!v||["localhost","127.0.0.1"].includes(m))return"";const x=m.split(".");let _=Math.min(x.length,8);const w="dmn_chk_"+Si();for(;!Sf&&_--;){const b=x.slice(_).join("."),k=w+"=1;domain=."+b+";path=/";v.cookie=k+";max-age=3",v.cookie.includes(w)&&(v.cookie=k+";max-age=0",Sf=b)}return Sf})(d);if(!h){const m=(v=>{const x=v.match(TF);return x?x[0]:""})(d);m!==h&&he.info("Warning: cookie subdomain discovery mismatch",m,h),h=m}return h?"; domain=."+h:""}return""})(Ee.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&he.warn("cookieStore warning: large cookie, len="+u.length),Ee.cookie=u,!0}catch{return!1}},Pt(t,e){if(Ee!=null&&Ee.cookie&&(!e||!un(Qf(t))))try{Qt.At(t,"",-1,e)}catch{return}}};let by=null;const vt={Et(){if(!un(by))return by;let t=!0;if(le(ae))t=!1;else try{const e="__mplssupport__";vt.At(e,"xyz"),vt.Ot(e)!=='"xyz"'&&(t=!1),vt.Pt(e)}catch{t=!1}return t||he.error("localStorage unsupported; falling back to cookie store"),by=t,t},Ft(t){he.error("localStorage error: "+t)},Ot(t){try{return ae==null?void 0:ae.localStorage.getItem(t)}catch(e){vt.Ft(e)}return null},Lt(t){try{return JSON.parse(vt.Ot(t))||{}}catch{}return null},At(t,e){try{return ae==null||ae.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){vt.Ft(n)}return!1},Pt(t){try{ae==null||ae.localStorage.removeItem(t)}catch(e){vt.Ft(e)}}},Sy=[Da,Do,bi,dc,ja,fc,za,yh,jo],Kl=[Ux,Zs,Pu,ST,Zx,Au,$u,Tr],Jf=t=>t+"_cpm",RF=["__proto__","constructor","prototype"],ky=t=>{if(!rt(t))return{};const e={};return Object.keys(t).forEach(n=>{RF.indexOf(n)===-1&&(e[n]=t[n])}),e},Ey=(t,e=[])=>{const n={};return[...Kl,...e].forEach(r=>{const s=t[r];le(s)||un(s)||s===""||(n[r]=s)}),n},VT=t=>{let e=5381,n=2166136261;for(let r=0;t.length>r;r++){const s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},o8=(t,e)=>({p:e,f:VT(JSON.stringify(t))}),a8=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=Qt.Lt(Jf(t)),r=(n==null?void 0:n.f)===VT(e)&&ze(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},Cy=(t,e)=>e+"|"+(Qt.Ot(Jf(t))||""),du={},C2={Et:()=>!0,Ft(t){he.error("memoryStorage error: "+t)},Ot:t=>t in du?du[t]:null,Lt:t=>t in du?du[t]:null,At:(t,e)=>(du[t]=e,!0),Pt(t){delete du[t]}};let Ll=null;const Ut={Et(){if(!un(Ll))return Ll;if(Ll=!0,le(ae))Ll=!1;else try{const t="__support__";Ut.At(t,"xyz"),Ut.Ot(t)!=='"xyz"'&&(Ll=!1),Ut.Pt(t)}catch{Ll=!1}return Ll},Ft(t){he.error("sessionStorage error: ",t)},Ot(t){try{return ae==null?void 0:ae.sessionStorage.getItem(t)}catch(e){Ut.Ft(e)}return null},Lt(t){try{return JSON.parse(Ut.Ot(t))||null}catch{}return null},At(t,e){try{return ae==null||ae.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Ut.Ft(n)}return!1},Pt(t){try{ae==null||ae.sessionStorage.removeItem(t)}catch(e){Ut.Ft(e)}}};var IF=class{constructor(t){this._instance=t}get Ar(){return this._instance.config}get consent(){return this.Sl()?0:this.xl}isOptedOut(){return this.Ar.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Ar.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Ar.opt_out_capturing_by_default}optInOut(t){this.$l.At(this.Cl,t?1:0,this.Ar.cookie_expiration,this.Ar.cross_subdomain_cookie,this.Ar.secure_cookie)}reset(){this.$l.Pt(this.Cl,this.Ar.cross_subdomain_cookie)}get Cl(){const{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:n}=this._instance.config;return n||(e?e+t:"__ph_opt_in_out_"+t)}get xl(){const t=this.$l.Ot(this.Cl);return uy(t)?1:Be(C7,t)?0:-1}get $l(){const t=this.Ar.opt_out_capturing_persistence_type,e=t==="localStorage"?vt:Qt,n=e.Et()?e:C2;if(!this.Tl||this.Tl!==n){this.Tl=n;const r=t==="localStorage"?Qt:vt;r.Ot(this.Cl)&&(this.Tl.Ot(this.Cl)||this.optInOut(uy(r.Ot(this.Cl))),r.Pt(this.Cl,this.Ar.cross_subdomain_cookie))}return this.Tl}Sl(){return!!this.Ar.respect_dnt&&[mr==null?void 0:mr.doNotTrack,mr==null?void 0:mr.msDoNotTrack,qe.doNotTrack,mr==null?void 0:mr.globalPrivacyControl].some(t=>uy(t))}};function HT(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!kn(r))return e;try{const s=r(e);return st(s)&&s?s:e}catch(s){return he.error("Error in get_current_url, falling back to window.location.href",s),e}}function l8(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function Pi(t){return!!t&&t.nodeType===1}function gr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function zT(t){return!!t&&t.nodeType===3}function Xx(t){return!!t&&t.nodeType===11&&Pi(t.host)}function Qx(t){return t?sd(t).split(/\s+/):[]}function c8(t,e){const n=(function(r){var s;const i=typeof window>"u"?void 0:window,o=i==null||(s=i.location)===null||s===void 0?void 0:s.href;return le(o)?void 0:HT(r,o)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function od(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Qx(e)}function UT(t){return Qe(t)?null:sd(t).split(/(\s+)/).filter(e=>Fu(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function _h(t){let e="";return hc(t)&&!ad(t)&&t.childNodes&&t.childNodes.length&&Rt(t.childNodes,function(n){var r;zT(n)&&n.textContent&&(e+=(r=UT(n.textContent))!==null&&r!==void 0?r:"")}),sd(e)}function eh(t){var e;return le(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const Jx=["a","button","form","input","select","textarea","label"];function P2(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function A2(t,e){if(le(e))return!0;for(const n of t)if(e.some(r=>P2(n,r)))return!0;return!1}function BT(t){const e=t.parentNode;return!(!e||!Pi(e))&&e}const Py=[".ph-no-autocapture","[data-ph-no-autocapture]"],WT=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],eb=[...WT,"+","-","−","–"],u8=eb.length+10,MF=["button","a","input","select","textarea","label"],OF=["button","link","tab","menuitem","option"],d8=(t,e)=>/[a-z0-9]/i.test(e)?Be(eb,e)?new RegExp(`\\b${e}\\b`).test(t):t.includes(e):t===e,LF=t=>Be(MF,t.tagName.toLowerCase())||Be(OF,(t.getAttribute("role")||"").toLowerCase());function Ay(t){let e="",n="";const r=o=>{Pi(o)&&hc(o)&&!ad(o)&&(e+=` ${_h(o)}`,n=n||o.getAttribute("aria-label")||"",Rt(o.childNodes,r))};r(t),e=sd(e.replace(/\s+/g," "));const s=(Fu(e)?e:"").toLowerCase(),i=t.getAttribute("aria-label")||(s?"":n);return{safeText:s,ariaLabel:sd(i).toLowerCase()}}const f8=[".ph-no-rageclick",".ph-no-capture"],NF=["","text","search","email","password","url","tel","number"];function ZT(t,e){if(!(!(typeof window>"u")&&window)||tb(t))return!1;let n,r,s;var i,o;if(zr(e)?(n=!!e&&f8,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:f8,r=e==null?void 0:e.content_ignorelist,s=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&(function(u){return!(!u||!Pi(u))&&(!!gr(u,"textarea")||(gr(u,"input")?Be(NF,(u.getAttribute("type")||"").toLowerCase()):(function(d){var f;if(d.isContentEditable)return!0;const h=(f=d.getAttribute)===null||f===void 0?void 0:f.call(d,"contenteditable");return h==="true"||h===""})(u)))})(t))return!1;const{targetElementList:l}=qT(t,!1);return!(r&&(function(u,{safeText:d,ariaLabel:f}){let h;if(u===!0)h=WT;else{if(!ze(u))return!1;if(u.length>u8)return he.error(`[PostHog] content_ignorelist array cannot exceed ${u8} items. Use css_selector_ignorelist for more complex matching.`),!1;h=u.map(m=>m.toLowerCase())}return h.some(m=>d8(d,m)||d8(f,m))})(r,(function(u,d){for(const h of d)if(LF(h))return Ay(h);for(const h of d){try{var f;if(((f=window)===null||f===void 0?void 0:f.getComputedStyle(h).getPropertyValue("cursor"))!=="pointer")break}catch{break}const m=Ay(h);if(m.safeText||m.ariaLabel)return m}return Ay(u)})(t,l))||A2(l,n))}const tb=t=>!t||gr(t,"html")||!Pi(t),qT=(t,e)=>{const n=typeof window>"u"?void 0:window;if(!n||tb(t))return{parentIsUsefulElement:!1,targetElementList:[]};let r=!1;const s=[t];let i=t;for(;i.parentNode&&!gr(i,"body");){if(Xx(i.parentNode)){s.push(i.parentNode.host),i=i.parentNode.host;continue}const o=BT(i);if(!o)break;if(e||Jx.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{const l=n.getComputedStyle(o);l&&l.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}s.push(o),i=o}return{parentIsUsefulElement:r,targetElementList:s}};function hc(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!gr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=od(i);if(Be(o,"ph-sensitive")||Be(o,"ph-no-capture"))return!1}if(Be(od(t),"ph-include"))return!0;const r=t.type||"";if(st(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!st(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function ad(t){return!!(gr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||gr(t,"select")||gr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const h8=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),p8=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,DF=[16,15,14,13],jF=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),m8=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),g8=/[0-9A-Za-z_]/;function $F(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function Fu(t,e=!0){return!(Qe(t)||st(t)&&(t=sd(t),(e?h8.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(p8.lastIndex=0;r=p8.exec(n);){const s=r[2];if(!s)continue;const i=s.replace(/[- ]/g,"");for(let o=0;i.length>o;o++)for(const l of DF){const u=o+l;if(i.length>=u){const d=i.slice(o,u);if(h8.test(d)&&$F(d))return!0}}}return!1})(t))||(e?jF.test(t):(function(n){let r;for(m8.lastIndex=0;r=m8.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&g8.test(s)&&g8.test(i)))return!0}return!1})(t))))}function v8(t){let e=_h(t);return e=`${e} ${GT(t)}`.trim(),Fu(e)?e:""}function GT(t){let e="";return t&&t.childNodes&&t.childNodes.length&&Rt(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=_h(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${GT(n)}`.trim())}catch(s){he.error("[AutoCapture]",s)}}),e}function y8(t){return t.replace(/"|\\"/g,'\\"')}function FF(t){const e=t.attr__class;if(e)return ze(e)?e:Qx(e)}const x0=an("[Dead Clicks]"),VF=()=>!0,HF=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(Bx)),r=t.instance.config.capture_dead_clicks;return zr(r)?r:!!rt(r)||n};var _8=class{get lazyLoadedDeadClicksAutocapture(){return this.Il}constructor(t,e,n){this.instance=t,this.isEnabled=e,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Bx]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Ml(()=>{this.El()}):this.stop()}Ml(t){var e,n,r;!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=qe.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?x0.error("failed to load script",s):t()})}El(){var t;if(Ee){if(!this.Il&&(!((t=qe.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=rt(this.instance.config.capture_dead_clicks)?$({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Il=qe.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Il.start(Ee),x0.info("starting...")}}else x0.error("`document` not found. Cannot start.")}stop(){this.Il&&(this.Il.stop(),this.Il=void 0,x0.info("stopping..."))}};const kf=an("[SegmentIntegration]");function w8(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>kn(l.register))(o=r)?{analytics:o}:o;var o;(function(l,u,d,f){const h=v=>{const x=()=>v.anonymousId()||Si();l.config.get_device_id=x,f&&v.id()&&(l.register({distinct_id:v.id(),$device_id:x()}),l.persistence.set_property(Tr,im)),d(f?void 0:v.anonymousId()||void 0)},m=u.user();"then"in m&&kn(m.then)?m.then(h):h(m)})(t,s,l=>{s.register(((u,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||kf.warn("This browser does not have Promise support, and can not use the segment integration");const h=(m,v)=>{if(!v)return m;const x=!!d&&m.event.anonymousId===d&&!m.event.userId;x||m.event.userId||m.event.anonymousId===u.get_distinct_id()||(kf.info("No userId set, resetting PostHog"),u.reset()),x||(d=void 0),m.event.userId&&m.event.userId!==u.get_distinct_id()&&(kf.info("UserId set, identifying with PostHog"),u.identify(m.event.userId));let _=u.calculateEventProperties(v,m.event.properties);if(!Qe(f)){const w=m.event.properties||{},b={};for(const C of Object.keys(_))Dx.call(w,C)||(b[C]=_[C]);const k=((C,P)=>{const T=ze(C)?C:[C];let M=$({},P);for(const I of T)try{if(M=I(M),Qe(M))return null}catch(R){return kf.error("Error in Segment filterProperties:",R),null}return M})(f,b);if(Qe(k))return m;_=k}return m.event.properties=Object.assign({},_,m.event.properties),m};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(m){return h(m,m.event.event)},page(m){return h(m,Kx)},identify(m){return h(m,$T)},screen(m){return h(m,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},u=>{kf.error("Failed to register the Segment integration",u),e()})},n)}const KT="posthog-js";function YT(t,{organization:e,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var l,u,d,f,h;if(s!=="*"&&!s.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});const m=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const v=((l=o.exception)===null||l===void 0?void 0:l.values)||[],x=v.map(b=>$($({},b),{},{stacktrace:b.stacktrace?$($({},b.stacktrace),{},{type:"raw",frames:(b.stacktrace.frames||[]).map(k=>$($({},k),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((u=v[0])===null||u===void 0?void 0:u.value)||o.message,$exception_type:(d=v[0])===null||d===void 0?void 0:d.type,$exception_level:o.level,$exception_list:x,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=v[0])===null||f===void 0?void 0:f.value)||o.message,$sentry_exception_type:(h=v[0])===null||h===void 0?void 0:h.type,$sentry_tags:o.tags};var w;return e&&n&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+o.event_id),i&&((w=t.exceptions)===null||w===void 0||w.sendExceptionEvent(_)),o}}var zF=class{constructor(t,e,n,r,s,i){this.name=KT,this.setupOnce=function(o){o(YT(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},x8=class{constructor(t){this.Pl=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(he.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Rl=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Al()}Al(){var t;this.Fl=(t=this._instance.sessionManager)===null||t===void 0?void 0:t.onSessionId(this.Pl)}destroy(){var t;(t=this.Fl)===null||t===void 0||t.call(this),this.Fl=void 0}doPageView(t,e){var n;const r=this.Ol(t,e);return this.Rl={pathname:(n=ae==null?void 0:ae.location.pathname)!==null&&n!==void 0?n:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Ol(t,(e=this.Rl)===null||e===void 0?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Rl)===null||t===void 0?void 0:t.pageViewId}}Ol(t,e){const n=this.Rl;if(!n)return{$pageview_id:e};let r={$pageview_id:e,$prev_pageview_id:n.pageViewId};const s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:i,lastScrollY:o,maxScrollY:l,maxContentHeight:u,lastContentY:d,maxContentY:f}=s;if(!(le(i)||le(o)||le(l)||le(u)||le(d)||le(f))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);const h=i>1?Ki(o/i,0,1,he):1,m=i>1?Ki(l/i,0,1,he):1,v=u>1?Ki(d/u,0,1,he):1,x=u>1?Ki(f/u,0,1,he):1;r=en(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:x})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const Ef=["flags","surveys"],UF={[eF]:{exposure:"hidden"},[Um]:{exposure:"hidden"},[tF]:{exposure:"hidden"},[v2]:{exposure:"hidden"},[$u]:{exposure:"hidden"},[Yf]:{exposure:"hidden"},[_T]:{exposure:"event"},[y2]:{exposure:"hidden"},[xT]:{exposure:"hidden"},[_2]:{exposure:"event"},[wT]:{exposure:"hidden"},[w2]:{exposure:"event"},[x2]:{exposure:"event"},[Bx]:{exposure:"event"},[Wx]:{exposure:"hidden"},[bT]:{exposure:"event"},[Xf]:{exposure:"hidden"},[nF]:{exposure:"hidden"},[Pu]:{exposure:"hidden"},[ST]:{exposure:"event"},[rF]:{exposure:"event",shouldSkipFromEventProperties:t=>un(t)},[lF]:{exposure:"event"},[cF]:{exposure:"event"},[uF]:{exposure:"event"},[dF]:{exposure:"event"},[fF]:{exposure:"hidden"},[bi]:{exposure:"hidden",storageGroup:"flags"},[Do]:{exposure:"hidden",storageGroup:"flags"},[m2]:{exposure:"hidden"},[dc]:{exposure:"hidden",storageGroup:"flags"},[ja]:{exposure:"hidden",storageGroup:"flags"},[fc]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Kf]:{exposure:"hidden",storageGroup:"flags"},[Fi]:{exposure:"hidden"},[Gl]:{exposure:"hidden"},[Da]:{exposure:"hidden"},[Na]:{exposure:"hidden"},[Ff]:{exposure:"hidden",storageGroup:"surveys"},[zm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[g2]:{exposure:"event"},[rm]:{exposure:"hidden"},[sm]:{exposure:"hidden"},[b2]:{exposure:"hidden"},[hF]:{exposure:"hidden"},[pF]:{exposure:"hidden"},[mF]:{exposure:"event"},[gF]:{exposure:"event"},[vF]:{exposure:"event"},[yF]:{exposure:"event"},[jo]:{exposure:"hidden"},[$f]:{exposure:"hidden"},[kT]:{exposure:"event"},[yh]:{exposure:"hidden"},[za]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Tr]:{exposure:"hidden"},[S2]:{exposure:"hidden"},[_F]:{exposure:"hidden"},[ET]:{exposure:"hidden"},[CT]:{exposure:"hidden"},[Au]:{exposure:"hidden"},[Zx]:{exposure:"hidden"},[sF]:{exposure:"event"},[iF]:{exposure:"event"},[oF]:{exposure:"event"},[aF]:{exposure:"event"},[AT]:{exposure:"event"},[TT]:{exposure:"event"},[qx]:{exposure:"hidden"},[Gx]:{exposure:"hidden"},[RT]:{exposure:"hidden"},[IT]:{exposure:"hidden"},[MT]:{exposure:"hidden"},[OT]:{exposure:"hidden"},[LT]:{exposure:"hidden"},[NT]:{exposure:"hidden"},[DT]:{exposure:"hidden"},[wF]:{exposure:"event"}},BF=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ar=t=>{const e=UF[t];if(e)return e;for(const[n,r]of BF)if(t.indexOf(n)===0)return r};function XT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const Zo=t=>{const e=typeof document>"u"?void 0:document,n=e==null?void 0:e.createElement("a");return le(n)?null:(n.href=t,n)},QT=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},JT=(t,e)=>t>=e&&QT(),eR=(t,e,n,r)=>{if(t===0){if(QT()){const s=e+1;return s===n&&r(),s}return e}return 0},Ru=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return Pd(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,FT(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return m5(t)}},ld=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let r;for(let s=0;n.length>s;s++){const i=n[s].split(/=(.*)/);if(i[0]===e){r=i;break}}if(!ze(r)||2>r.length)return"";{let s=r[1].replace(/\+/g," ");try{s=decodeURIComponent(s)}catch{he.error("Skipping decoding for malformed query param: "+s)}return s}},wh=function(t,e,n){if(!t||!e||!e.length)return t;const r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),o=i[1],l=i[0],u=(o||"").split("&"),d=[];for(let h=0;u.length>h;h++){const m=u[h].split("=");ze(m)&&(e.includes(m[0])?d.push(m[0]+"="+n):d.push(u[h]))}let f=l;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},Wm=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},cd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],WF=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...cd],xh="<masked>",ZF=["li_fat_id"];function tR(t,e,n){if(!Ee)return{};const r=e?[...cd,...n||[]]:[],s=nR(wh(Ee.URL,r,xh),t),i=(function(){const o={};return Rt(ZF,function(l){const u=Qf(l);o[l]=u||null}),o})();return en(i,s)}function nR(t,e){const n=WF.concat(e||[]),r={};return Rt(n,function(s){const i=ld(t,s);r[s]=i||null}),r}function rR(t){const e=(function(s){return s?s.search("https?://(.*)google.([^/?]*)")===0?"google":s.search("https?://(.*)bing.com")===0?"bing":s.search("https?://(.*)yahoo.com")===0?"yahoo":s.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!un(e)){r.$search_engine=e;const s=Ee?ld(Ee.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function sR(){return navigator.language||navigator.userLanguage}function qF(){const t=sR();return typeof t=="string"?t.split("-")[0]:void 0}const Zm="$direct";function iR(){return(Ee==null?void 0:Ee.referrer)||Zm}function oR(t,e,n=!1){const r=t?[...cd,...e||[]]:[],s=n?qa(zt==null?void 0:zt.href):zt==null?void 0:zt.href,i=s==null?void 0:s.substring(0,1e3);return{r:iR().substring(0,1e3),u:i?wh(i,r,xh):void 0}}function aR(t,e=!1){var n;const{r,u:s}=t,i=e?qa(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==Zm?Zm:(n=Zo(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=Zo(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const u=nR(i);en(o,u)}if(r){const l=rR(r);en(o,l)}return o}function GF(){try{return new Date().getTimezoneOffset()}catch{return}}const KF={flags:za,surveys:zm},YF=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],b0=t=>`${t}_cookie_identity_change_pending`,S0=t=>{let e="",n=0;for(const r of t){const s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;e+=r,n+=s}return e},Vn="main",Ao=[bi,Do,dc,ja,fc,za,Kf,Da],Ty=t=>Ao.indexOf(t)!==-1,lR=[$u,Yf],b8=t=>lR.indexOf(t)!==-1,wa=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},fu=t=>{if(!t)return{};const e=JSON.parse(t);return rt(e)?e:{}},S8=(t,e)=>{Rt(t,(n,r)=>{const s=ar(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var Ry=class{constructor(t,e,n=!0,r=!t.cookieless_mode){if(this.Dl={},this.Ll=!1,this.Nl=!1,this.ql=!1,this.jl=!1,this.Bl=!1,this.zl=new Map,this.Hl=!1,this.Ul=!1,this.Wl=!1,this.Vl=new Set,this.Gl=new Set,this.Ar=t,this.Ql=n,this.props={},this.Zl=void 0,this.Jl=(s=>{let i="";return s.token&&(i=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+i+"_posthog"})(t),this.hi=t.disable_persistence||!!e,this.$l=this.Kl(t),this.ql=this.Xl(t),this.load(r),this.Yl(),t.debug&&he.info("Persistence loaded",t.persistence,$({},this.props)),this.update_config(t,t,e),this.save(),ae){const s=()=>this.flush();xt(ae,"beforeunload",s,{capture:!1}),xt(ae,"pagehide",s,{capture:!1}),this.tu=i=>{if(this.Ll&&(!i.storageArea||i.storageArea===(ae==null?void 0:ae.localStorage))&&i.key)if(i.key!==this.Jl){if(this.ql){const o=Ef.find(l=>i.key===this.eu(l));o&&this.iu(i.key,o)}}else this.iu(i.key,Vn)},xt(ae,"storage",this.tu)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.zl.get(e);if(!Ty(e)||r===!0)return;if(n===!0)return void this.nu(e,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.nu(e,s)})}onCrossTabFeatureFlagChange(t){return this.Gl.add(t),()=>this.Gl.delete(t)}destroy(){this.tu&&ae&&(ae.removeEventListener("storage",this.tu),this.tu=void 0),this.Gl.clear()}iu(t,e,n=!0){if(this.hi)return!1;let r,s;try{if(s=vt.Ot(t),un(s)){const l=this.su(e);return l.storageValue=null,e!==Vn&&(l.persisted=!1),!1}r=fu(s)}catch{return!1}const i=e===Vn?r:vt.Lt(this.Jl);if(i&&this.ru(i))return!1;const o=this.ou(r,e,n);return e===Vn&&this.ql&&!wa(this.au().main,r)||this.lu(r,e,!0,s),o}ru(t){const e=this.props[Zs],n=t[Zs];return!le(e)&&!le(n)&&e!==n}lu(t,e,n,r){const s=this.su(e);s.storageValue=r,e!==Vn&&(s.persisted=n);try{s.fingerprint=this.uu(t,e)}catch{s.fingerprint=void 0}}ou(t,e,n){let r=!1;return Ao.forEach(s=>{var i;const o=(i=ar(s))===null||i===void 0?void 0:i.storageGroup;if(e===Vn&&this.ql&&o||e!==Vn&&o!==e)return;const l=s in t,u=this.cu(s,l?t[s]:void 0),d=this.zl.has(s)?s in this.props:l;d===s in this.props&&wa(u,this.props[s])||(d?this.hu(s,u,!1):this.du(s,!1),r=!0)}),r&&n&&this.Gl.forEach(s=>s()),r}vu(){if(!this.Ll)return!1;try{this.Wl=!1;const t=vt.Ot(this.Jl),e=this.su(Vn);let n,r=!1,s=!1;if(t!==e.storageValue)if(un(t))e.storageValue=null;else{if(n=fu(t),this.Wl=!this.Ul&&this.ru(n),this.Wl)return!1;s=this.ou(n,Vn,!1),!this.ql||wa(this.au().main,n)?this.lu(n,Vn,!0,t):e.storageValue=t,r=!0}return this.ql&&Ef.forEach(i=>{const o=vt.Ot(this.eu(i)),l=this.su(i),u=n||{},d=r&&Ao.some(h=>{var m;return((m=ar(h))===null||m===void 0?void 0:m.storageGroup)===i&&h in u});if(o===l.storageValue&&!d)return;if(un(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this.ou(u,i,!1)||s));const f=fu(o);s=this.ou(f,i,!1)||s,this.lu(f,i,!0,o)}),s}catch{return!1}}nu(t,e){this.zl.set(t,e);const n=ar(t);n!=null&&n.volatile||(this.su((this.ql?n==null?void 0:n.storageGroup:void 0)||Vn).fingerprint=void 0,this.fu(t))}pu(){Ao.forEach(t=>this.zl.set(t,!0))}Yl(){if(this.Ll)try{const t=vt.Ot(this.Jl),e=fu(t);this.su(Vn).storageValue=t,Ao.forEach(n=>{var r;const s=this.ql?(r=ar(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?vt.Ot(this.eu(s)):null;if(s){const l=this.su(s);l.storageValue=i,l.persisted=!un(i)}const o=s&&!un(i)?fu(i):e;n in this.props?this.gu(n,o[n],this.props[n]):n in o&&this.nu(n,!0)})}catch{}}cu(t,e){const n=this.zl.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const i=new Set(ze(e)?e:[]),o=new Set(ze(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=rt(e)?$({},e):{},s=rt(this.props[t])?this.props[t]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}gu(t,e,n){if(!Ty(t))return;const r=this.zl.get(t);if(r===!0)return;let s=e;if(this.Ll)try{var i;const l=this.ql?(i=ar(t))===null||i===void 0?void 0:i.storageGroup:void 0,u=l?this.eu(l):this.Jl;s=fu(vt.Ot(u))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!le(e)&&!ze(e)||!le(s)&&!ze(s)||!ze(n))return void this.nu(t,!0);const l=new Set(e||[]),u=new Set(s||[]),d=new Set(n);new Set([...l,...d]).forEach(f=>{l.has(f)!==d.has(f)&&o.add(f)}),o.forEach(f=>{u.has(f)===d.has(f)&&o.delete(f)})}else{if(!rt(n))return void(wa(s,n)?this.zl.delete(t):this.nu(t,!0));{if(!le(e)&&!rt(e)||le(e)&&ns(n)&&le(s))return void this.nu(t,!0);const l=rt(e)?e:{},u=rt(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&wa(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&wa(u[d],n[d])&&o.delete(d)})}}o.size?this.nu(t,o):this.zl.delete(t)}mu(){var t;const e=(t=this.Ar)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Pn(e)&&e>0?e:0}yu(t){if(this.Ar.cookieWinsOnConflict&&this.Ar.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=Ey(t,this.Ar.cookie_persisted_properties||[]),n=o8(e,this.Ar.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=Qt.Ot(this.Jl)||void 0;s&&Cy(this.Jl,s)===r&&(this.bu=r,this._u=s)}catch{}else try{const e=Qt.Ot(this.Jl)||void 0;this.bu=e?Cy(this.Jl,e):void 0,this._u=e}catch{}}syncCookieProperties(){return this.wu(this.Ar)}wu(t,e=!1){if(this.hi&&!e||this.Bl||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=Qt.Ot(this.Jl)||void 0}catch{}if(!n||n===this._u)return!1;const r=Cy(this.Jl,n);let s;try{s=ky(JSON.parse(n))}catch{return!1}if((Qt.Ot(this.Jl)||void 0)!==n)return!1;this.bu=r,this._u=n;const i=a8(this.Jl,n),o=[...Kl,...i.properties],l={};if(Object.keys(s).forEach(_=>{const w=s[_];(le(w)||un(w)||w===""||_==="$user_state"&&w!=="anonymous"&&w!=="identified")&&(l[_]=!0,delete s[_])}),ns(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[Zs],h=d[Tr],m=en({},d);[...Kl,...t.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in s)&&!l[_]&&(u||_!=="distinct_id"&&_!=="$user_state")){const w=m[_];(i.isValid||Kl.indexOf(_)===-1||w!==!1&&w!==0)&&delete m[_]}}),this.props=en(m,s),Ao.forEach(_=>{const w=_ in this.props;_ in d===w&&wa(d[_],this.props[_])||(w?this.gu(_,d[_],this.props[_]):this.nu(_,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.hu(Tr,$o);const v=this.props[Zs],x=this.props[Tr];return!u||v===f&&x===h||(this.Ul=!0,this.jl=!0,Ut.At(b0(this.Jl),!0),this.du(Da),this.du(Do),this.du(bi),this.du(dc),this.du(ja),this.du(fc),this.du(za),this.du(yh),this.du(jo),x!=="anonymous"||h!=="identified"&&s.$user_state!=="anonymous"&&(le(f)||v===f)||(S8(this.props,s),this.du(Na)),x==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.du(Um)),!0}consumeCookieIdentityChange(){const t=b0(this.Jl),e=this.jl||!!Ut.Ot(t);return this.jl=!1,e&&Ut.Pt(t),e}ku(t=!1){return!(this.Bl||this.hi&&!t||!this.Ar.cookieWinsOnConflict||this.Ar.persistence.toLowerCase()!=="localstorage+cookie"||(this.Bl=!0,0))}Su(){this.Bl&&(le(this.xu)||(clearTimeout(this.xu),this.xu=void 0),delete this.Dl[Vn],this.$u(!0))}Cu(t=!0){if(this.Bl)try{t?this.Su():le(this.xu)||(clearTimeout(this.xu),this.xu=void 0)}finally{this.Bl=!1}}isDisabled(){return!!this.hi}Kl(t){YF.indexOf(t.persistence.toLowerCase())===-1&&(he.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1,u=()=>!1)=>{const d=[...Kl,...o];return $($({},vt),{},{Tu(f){return[Qt.Ot(f),Qt.Ot(Jf(f)),vt.Ot(f)].join("\0")},Lt(f){try{let m,v={};try{m=Qt.Ot(f)||void 0,v=m?ky(JSON.parse(m)):{}}catch{}const x=JSON.parse(vt.Ot(f)||"{}");let _;if(l){const w=a8(f,m),b=[...Kl,...w.properties],k={};Object.keys(v).forEach(P=>{const T=v[P];un(T)||T===""||P==="$user_state"&&T!=="anonymous"&&T!=="identified"||(k[P]=T)});const C="distinct_id"in k||k.$user_state==="anonymous"||k.$user_state==="identified";if(Object.keys(k).length>0){var h;const P=x[Zs],T=(h=x.$user_state)!==null&&h!==void 0?h:$o;d.forEach(M=>{if(b.indexOf(M)!==-1&&!(M in v)&&(C||M!=="distinct_id"&&M!=="$user_state")){const I=x[M];(w.isValid||Kl.indexOf(M)===-1||I!==!1&&I!==0)&&delete x[M]}}),!C||"$user_state"in v||"$user_state"in x||(x[Tr]=$o),!C||("distinct_id"in k?k[Zs]:x[Zs])===P&&("$user_state"in k?k[Tr]:x[Tr])===T||(Sy.forEach(M=>delete x[M]),k.$user_state==="identified"&&"distinct_id"in k?x.$user_id=k[Zs]:delete x.$user_id,k.$user_state!=="identified"&&(delete x[kT],delete x[Na]),delete x.__alias)}_=en(x,k)}else _=en(v,x);return u()||vt.At(f,_),_}catch{}return null},At(f,h,m,v,x,_){const w=vt.At(f,h,void 0,void 0,_);try{const b=Ey(h,o);if(Object.keys(b).length){if(l){const k=Jf(f),C=o8(b,o);if(Qt.At(k,C,m,v,x,_),Qt.Ot(k)!==JSON.stringify(C)){Qt.Pt(k,v);const P=Ey(h);return Qt.At(f,P,m,v,x,_),w}}Qt.At(f,b,m,v,x,_)}}catch(b){vt.Ft(b)}return w},Pt(f,h){try{ae==null||ae.localStorage.removeItem(f),Qt.Pt(f,h),Qt.Pt(Jf(f),h)}catch(m){vt.Ft(m)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict,()=>!!this.hi);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&vt.Et()?(n=vt,s=!0):i==="localstorage+cookie"&&e.Et()?(n=e,s=!0,r=!0):i==="sessionstorage"&&Ut.Et()?n=Ut:i==="memory"?n=C2:i==="cookie"&&Qt.Et()?(n=Qt,r=!0):e.Et()?(n=e,s=!0,r=!0):Qt.Et()?(n=Qt,r=!0):n=C2,this.Ll=s,this.Nl=r,n}eu(t){return`${this.Jl}__${t}`}Xl(t){return this.Ll&&!!t.split_storage}properties(){const t={};return Rt(this.props,(e,n)=>{const r=ar(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,e))return;t[n]=e}}),t}load(t=!1){if(this.hi&&!t)return;const e=this.Ar.cookieWinsOnConflict&&this.Ar.persistence.toLowerCase()==="localstorage+cookie",n=e?vt.Lt(this.Jl):null;let r={};if(e)try{r=ky(Qt.Lt(this.Jl)),Rt(r,(l,u)=>{(le(l)||un(l)||l==="")&&delete r[u]})}catch{}const s=this.$l.Lt(this.Jl);if(s&&(this.props=en({},s)),this.ql&&this.Iu(),e&&s){var i,o;const l=n==null?void 0:n[Zs],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:$o,d=s[Zs],f=(o=s.$user_state)!==null&&o!==void 0?o:$o;if(d!==l||f!==u){this.jl=!0,this.hi||Ut.At(b0(this.Jl),!0);const h=en({},this.props);Sy.forEach(v=>delete h[v]),f!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(le(l)||d===l)||(S8(h,r),delete h[Na]),this.props=h;const m=new Set;Sy.forEach(v=>{var x;const _=(x=ar(v))===null||x===void 0?void 0:x.storageGroup;_&&m.add(_)}),m.forEach(v=>{if(this.hi)return;const x={};Rt(this.props,(_,w)=>{var b;((b=ar(w))===null||b===void 0?void 0:b.storageGroup)===v&&(x[w]=_)}),ns(x)?(vt.Pt(this.eu(v)),this.Dl[v]={}):vt.At(this.eu(v),x)&&(this.Dl[v]={persisted:!0,fingerprint:this.uu(x,v)})})}}Ut.Ot(b0(this.Jl))&&(this.jl=!0)}Iu(){for(const t of Ef){const e=vt.Lt(this.eu(t));if(e&&!ns(e)){const n=this.su(t);n.persisted=!0,this.Mu(t)||(n.fingerprint=this.uu(e,t)),this.Eu(t,e)||en(this.props,e)}}}Mu(t){return Object.keys(this.props).some(e=>{var n;return((n=ar(e))===null||n===void 0?void 0:n.storageGroup)===t})}Eu(t,e){const n=KF[t];if(!n)return!1;const r=e[n],s=this.props[n];return Pn(r)&&Pn(s)&&s>r}refreshKey(t){this.Pu([t])}Pu(t){if(this.hi)return;let e,n=!1;const r=()=>(n||(e=this.$l.Lt(this.Jl),n=!0),e);t.forEach(s=>{var i;if(this.Vl.has(s))return;const o=this.ql?(i=ar(s))===null||i===void 0?void 0:i.storageGroup:void 0,l=o?vt.Lt(this.eu(o)):r();if(l&&s in l)this.hu(s,l[s],!1);else{if(o){const u=r();if(u&&s in u)return void this.hu(s,u[s],!1)}this.du(s,!1)}})}refreshMetaIdentifiers(){if(this.hi)return;const t=this.Ru();(le(t)||t!==this.Au)&&(this.Pu(lR),this.Fu(t))}Fu(t=this.Ru()){this.Au=this.Vl.size===0?t:void 0}Ru(){const t=this.$l.Tu?this.$l.Tu(this.Jl):this.$l.Ot(this.Jl);return st(t)?t:void 0}save(){if(this.hi)return;const t=this.mu();t>0?le(this.xu)&&(this.xu=setTimeout(()=>{this.xu=void 0,this.$u()},t)):this.$u()}flush(){le(this.xu)||(clearTimeout(this.xu),this.xu=void 0,this.$u())}$u(t=!1){if(this.hi||this.Bl&&!t)return;t||(this.syncCookieProperties(),this.Ar.cookieWinsOnConflict&&this.Ar.persistence.toLowerCase()==="localstorage+cookie"||this.refreshMetaIdentifiers());const e=!t&&!this.Hl;e||(this.Wl=!1);const n=!!e&&this.vu();if(this.Wl)return void(this.Ar.debug&&he.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.ql)return this.Ou(),void(n&&this.Gl.forEach(s=>s()));const r=this.Du(this.$l,this.Jl,this.props,Vn);r==="written"&&this.yu(this.props),r!=="failed"&&(this.zl.clear(),this.Ul=!1,this.Vl.clear()),r==="written"&&this.Fu(),n&&this.Gl.forEach(s=>s())}Ou(){const{main:t,groups:e}=this.au(),n=this.Du(this.$l,this.Jl,t,Vn);n==="written"&&this.yu(t),n!=="failed"&&(this.Ul=!1,this.Vl.clear(),Ao.forEach(s=>{var i;!((i=ar(s))===null||i===void 0)&&i.storageGroup||this.zl.delete(s)})),n==="written"&&this.Fu();for(const s of Ef){var r;const i=e[s];if(ns(i)&&!(!((r=this.Dl[s])===null||r===void 0)&&r.persisted)){Ao.forEach(l=>{var u;((u=ar(l))===null||u===void 0?void 0:u.storageGroup)===s&&this.zl.delete(l)});continue}const o=this.Du(vt,this.eu(s),i,s);o!=="failed"&&Ao.forEach(l=>{const u=ar(l);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.zl.delete(l)})}}au(){const t={},e={flags:{},surveys:{}};return Rt(this.props,(n,r)=>{var s;const i=(s=ar(r))===null||s===void 0?void 0:s.storageGroup;i?e[i][r]=n:t[r]=n}),{main:t,groups:e}}uu(t,e){if(e===Vn)return JSON.stringify(t)+"|"+this.Lu+"|"+this.Nu+"|"+this.qu;const n={};return Rt(t,(r,s)=>{var i;n[s]=!((i=ar(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Du(t,e,n,r){const s=this.su(r);if(r!==Vn&&!s.dirty&&!le(s.fingerprint))return"skipped";let i;try{if(i=this.uu(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return t.At(e,n,this.Lu,this.Nu,this.qu,this.Ar.debug)?(s.dirty=!1,r!==Vn&&(s.persisted=!0),le(i)||(s.fingerprint=i),this.Ll&&(s.storageValue=vt.Ot(e)),"written"):(this.Ar.debug&&he.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this.pu(),le(this.xu)||(clearTimeout(this.xu),this.xu=void 0),this.$l.Pt(this.Jl,!1),this.$l.Pt(this.Jl,!0),!t&&this.Ql)for(const e of Ef)vt.Pt(this.eu(e));t?delete this.Dl[Vn]:this.Dl={},this.bu=void 0,this._u=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(rt(t)){this.syncCookieProperties(),le(e)&&(e="None"),this.Lu=le(n)?this.ju:n;let r=!1;if(Rt(t,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.hu(i,s),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(rt(t)){this.syncCookieProperties(),this.Lu=le(e)?this.ju:e;let n=!1;if(Rt(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||rt(r)||ze(r))&&(this.hu(s,r),n=!0)}),n)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();const e=typeof t=="string"?[t]:t;let n=!1;for(const r of e)r in this.props&&(this.du(r),n=!0);n&&this.save()}update_campaign_params(){const t=Ee==null?void 0:Ee.URL;if(t===this.Zl)return;const e=tR(this.Ar.custom_campaign_params,this.Ar.mask_personal_data_properties,this.Ar.custom_personal_data_properties),n=!ns(Yx(e));return n&&this.register(e),this.Zl=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=Ee==null?void 0:Ee.referrer;return t?rR(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:iR(),$referring_domain:(Ee==null?void 0:Ee.referrer)&&((t=Zo(Ee.referrer))===null||t===void 0?void 0:t.host)||Zm},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=oR(this.Ar.mask_personal_data_properties,this.Ar.custom_personal_data_properties,this.Ar.disable_capture_url_hashes);this.register_once({[Au]:this.Nl?{r:S0(t.r),u:t.u?S0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};Rt([CT,ET],n=>{const r=this.props[n];r&&Rt(r,function(s,i){t["$initial_"+i2(i)]=s})});const e=this.props[Au];if(e){const n=(function(r,s=!1){const i=aR(r,s),o={};return Rt(i,function(l,u){o[`$initial_${i2(u)}`]=l}),o})(e,this.Ar.disable_capture_url_hashes);en(t,n)}return t}safe_merge(t){return Rt(this.props,function(e,n){n in t||(t[n]=e)}),t}update_config(t,e,n){const r=t.persistence!==e.persistence,s=!((v,x)=>{if(v.length!==x.length)return!1;const _=[...v].sort(),w=[...x].sort();return _.every((b,k)=>b===w[k])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),i=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!n,u=!!this.hi&&!l;l||this.wu(e,u),this.Ar=t,!l&&(r||s||o)&&(this.bu=void 0,this._u=void 0,this.wu($($({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),u));const d=i||o?this.Kl(t):this.$l;this.Bu();const f=this.Xl(t),h=i||f!==this.ql,m=!l&&(h||t.cross_subdomain_cookie!==this.Nu||t.secure_cookie!==this.qu)&&this.ku(u);this.Hl=h;try{if(this.ju=this.Lu=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),h){const v=this.props;this.clear(),this.$l=d,this.ql=f,this.props=v,this.save()}else o&&(this.$l=d,l||(delete this.Dl[Vn],this.$u()))}finally{this.Hl=!1,m&&this.Cu()}}Bu(){const t=this.props[Au];if(!this.Nl||!rt(t)||typeof t.r!="string")return;const e=S0(t.r),n=typeof t.u=="string"?S0(t.u):t.u;e===t.r&&n===t.u||this.hu(Au,$($({},t),{},{r:e,u:n}))}set_disabled(t){this.hi=t,this.hi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Nu&&(this.Nu=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.qu&&(this.qu=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.hu(v2,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return le(n)||(delete e[t],this.hu(v2,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.hu(t,e),this.save()}hu(t,e,n=!0){var r;const s=this.props[t];this.props[t]=e,n&&(t!=="distinct_id"&&t!=="$user_state"||s===e||(this.Ul=!0),b8(t)&&!wa(s,e)&&this.Vl.add(t),this.gu(t,s,e),!((r=ar(t))===null||r===void 0)&&r.volatile||this.fu(t))}du(t,e=!0){delete this.props[t],e&&(Ty(t)&&this.nu(t,!0),b8(t)&&this.Vl.add(t),this.fu(t))}fu(t){var e;const n=(e=ar(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.su(n).dirty=!0)}su(t){return this.Dl[t]||(this.Dl[t]={})}};const Ss={GZipJS:"gzip-js",Base64:"base64"},Cf={Activation:"events",Cancellation:"cancelEvents"},Iy={Popover:"popover",API:"api",Widget:"widget"},bs={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},My={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},T2={Popover:"popover",Inline:"inline"};function k0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&kn(n.then)&&n.then(void 0,()=>{})}}}}const XF={SHOWN:"product tour shown"},k8={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},E8=an("[RateLimiter]");var QF=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{const n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(r=>{E8.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void E8.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t=!1){var e,n,r;const{captureEventsBurstLimit:s,captureEventsPerSecond:i}=this,o=new Date().getTime(),l=(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property("$capture_rate_limit"))!==null&&e!==void 0?e:{tokens:s,last:o};l.tokens+=Math.max(0,o-l.last)/1e3*i,l.last=Math.max(l.last,o),l.tokens>s&&(l.tokens=s);const u=1>l.tokens;if(u||t||(l.tokens=Math.max(0,l.tokens-1)),u&&!t){const d=(Pn(l.dropped)?l.dropped:0)+1;l.dropped=d,!this.lastEventRateLimited&&this.zu(d)&&(l.dropped=0)}return this.lastEventRateLimited=u,(r=this.instance.persistence)===null||r===void 0||r.set_property("$capture_rate_limit",l),{isRateLimited:u,remainingTokens:l.tokens}}Hu(t){const e=this.instance.config.property_denylist;return!ze(e)||!e.includes(t)}Uu(){var t;if(this.Hu("$current_url")&&this.Hu("$pathname")&&(zt!=null&&zt.pathname))return`${(t=zt.origin)!==null&&t!==void 0?t:""}${zt.pathname}`}zu(t){var e,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.Uu(),o=this.Hu("$session_id")?(e=(n=this.instance).get_session_id)===null||e===void 0?void 0:e.call(n):void 0,l=[`${t} event(s) dropped since the last warning`,i?`triggered on ${i}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${l}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(t){const e=this.serverLimits[t||"events"]||!1;return e!==!1&&new Date().getTime()<e}};const xa=an("[RemoteConfig]");var cR=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=qe._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}Wu(t){var e,n,r;!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=qe.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Vu(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:t})}load(){try{if(this.remoteConfig)return xa.info("Using preloaded remote config",this.remoteConfig),void this.Gu(this.remoteConfig);if(this._instance.Qu())return void xa.warn("Remote config is disabled. Falling back to local config.");this.Wu(t=>{if(!t)return xa.info("No config found after loading remote JS config. Falling back to JSON."),void this.Vu(e=>{this.Gu(e.json,e)});this.Gu(t)})}catch(t){xa.error("Error loading remote config",t),this.Gu()}}Gu(t,e){!t&&e&&(e.statusCode===0?e.error||xa.warn("Failed to fetch remote config from PostHog."):xa.error("Failed to fetch remote config from PostHog."));try{this._instance.Gu(t?{ok:!0,config:t}:{ok:!1})}catch(r){xa.error("Error applying remote config",r)}if((t==null?void 0:t.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)===null||n===void 0||n.ensureFlagsLoaded()}catch(r){xa.error("Error loading feature flags",r)}}},Js=Uint8Array,ss=Uint16Array,ud=Uint32Array,nb=new Js([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]),rb=new Js([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]),C8=new Js([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uR=function(t,e){for(var n=new ss(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new ud(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]},dR=uR(nb,2),R2=dR[1];dR[0][28]=258,R2[258]=28;for(var P8=uR(rb,0)[1],fR=new ss(32768),dn=0;32768>dn;++dn){var hu=(43690&dn)>>>1|(21845&dn)<<1;fR[dn]=((65280&(hu=(61680&(hu=(52428&hu)>>>2|(13107&hu)<<2))>>>4|(3855&hu)<<4))>>>8|(255&hu)<<8)>>>1}var th=function(t,e,n){for(var r=t.length,s=0,i=new ss(e);r>s;++s)++i[t[s]-1];var o,l=new ss(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new ss(r),s=0;r>s;++s)o[s]=fR[l[t[s]-1]++]>>>15-t[s];return o},Sc=new Js(288);for(dn=0;144>dn;++dn)Sc[dn]=8;for(dn=144;256>dn;++dn)Sc[dn]=9;for(dn=256;280>dn;++dn)Sc[dn]=7;for(dn=280;288>dn;++dn)Sc[dn]=8;var qm=new Js(32);for(dn=0;32>dn;++dn)qm[dn]=5;var JF=th(Sc,9),eV=th(qm,5),hR=function(t){return(t/8|0)+(7&t&&1)},pR=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof ss?ss:t instanceof ud?ud:Js)(n-e);return r.set(t.subarray(e,n)),r},bo=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},Pf=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Oy=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 Js(0),0];if(s==1){var o=new Js(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(T,M){return T.f-M.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,f=1,h=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};f!=s-1;)l=n[n[h].f>n[d].f?d++:h++],u=n[d!=f&&n[h].f>n[d].f?d++:h++],n[f++]={s:-1,f:l.f+u.f,l,r:u};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var v=new ss(m+1),x=I2(n[f-1],v,0);if(x>e){r=0;var _=0,w=x-e,b=1<<w;for(i.sort(function(T,M){return v[M.s]-v[T.s]||T.f-M.f});s>r;++r){var k=i[r].s;if(e>=v[k])break;_+=b-(1<<x-v[k]),v[k]=e}for(_>>>=w;_>0;){var C=i[r].s;e>v[C]?_-=1<<e-v[C]++-1:++r}for(;r>=0&&_;--r){var P=i[r].s;v[P]==e&&(--v[P],++_)}x=e}return[new Js(v),x]},I2=function(t,e,n){return t.s==-1?Math.max(I2(t.l,e,n+1),I2(t.r,e,n+1)):e[t.s]=n},A8=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ss(++e),r=0,s=t[0],i=1,o=function(u){n[r++]=u},l=1;e>=l;++l)if(t[l]==s&&l!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=t[l]}return[n.subarray(0,r),e]},Af=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},M2=function(t,e,n){var r=n.length,s=hR(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)},T8=function(t,e,n,r,s,i,o,l,u,d,f){bo(e,f++,n),++s[256];for(var h=Oy(s,15),m=h[0],v=h[1],x=Oy(i,15),_=x[0],w=x[1],b=A8(m),k=b[0],C=b[1],P=A8(_),T=P[0],M=P[1],I=new ss(19),R=0;k.length>R;++R)I[31&k[R]]++;for(R=0;T.length>R;++R)I[31&T[R]]++;for(var L=Oy(I,7),j=L[0],F=L[1],D=19;D>4&&!j[C8[D-1]];--D);var q,W,G,H,J=d+5<<3,B=Af(s,Sc)+Af(i,qm)+o,Q=Af(s,m)+Af(i,_)+o+14+3*D+Af(I,j)+(2*I[16]+3*I[17]+7*I[18]);if(B>=J&&Q>=J)return M2(e,f,t.subarray(u,u+d));if(bo(e,f,1+(B>Q)),f+=2,B>Q){q=th(m,v),W=m,G=th(_,w),H=_;var z=th(j,F);for(bo(e,f,C-257),bo(e,f+5,M-1),bo(e,f+10,D-4),f+=14,R=0;D>R;++R)bo(e,f+3*R,j[C8[R]]);f+=3*D;for(var N=[k,T],Y=0;2>Y;++Y){var oe=N[Y];for(R=0;oe.length>R;++R)bo(e,f,z[ne=31&oe[R]]),f+=j[ne],ne>15&&(bo(e,f,oe[R]>>>5&127),f+=oe[R]>>>12)}}else q=JF,W=Sc,G=eV,H=qm;for(R=0;l>R;++R)if(r[R]>255){var ne;Pf(e,f,q[257+(ne=r[R]>>>18&31)]),f+=W[ne+257],ne>7&&(bo(e,f,r[R]>>>23&31),f+=nb[ne]);var ie=31&r[R];Pf(e,f,G[ie]),f+=H[ie],ie>3&&(Pf(e,f,r[R]>>>5&8191),f+=rb[ie])}else Pf(e,f,q[r[R]]),f+=W[r[R]];return Pf(e,f,q[256]),f+W[256]},tV=new ud([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nV=(function(){for(var t=new ud(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),Ly=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function rV(t,e){e===void 0&&(e={});var n=(function(){var h=4294967295;return{p(m){for(var v=h,x=0;m.length>x;++x)v=nV[255&v^m[x]]^v>>>8;h=v},d(){return 4294967295^h}}})(),r=t.length;n.p(t);var s,i,o,l,u,d=(l=10+((s=e).filename&&s.filename.length+1||0),u=8,(function(h,m,v,x,_,w){var b=h.length,k=new Js(x+b+5*(1+Math.floor(b/7e3))+_),C=k.subarray(x,k.length-_),P=0;if(!m||8>b)for(var T=0;b>=T;T+=65535){var M=T+65535;b>M?P=M2(C,P,h.subarray(T,M)):(C[T]=w,P=M2(C,P,h.subarray(T,b)))}else{for(var I=tV[m-1],R=I>>>13,L=8191&I,j=(1<<v)-1,F=new ss(32768),D=new ss(j+1),q=Math.ceil(v/3),W=2*q,G=function(bt){return(h[bt]^h[bt+1]<<q^h[bt+2]<<W)&j},H=new ud(25e3),J=new ss(288),B=new ss(32),Q=0,z=0,N=(T=0,0),Y=0,oe=0;b>T;++T){var ne=G(T),ie=32767&T,de=D[ne];if(F[ie]=de,D[ne]=ie,T>=Y){var ge=b-T;if((Q>7e3||N>24576)&&ge>423){P=T8(h,C,0,H,J,B,z,N,oe,T-oe,P),N=Q=z=0,oe=T;for(var ce=0;286>ce;++ce)J[ce]=0;for(ce=0;30>ce;++ce)B[ce]=0}var re=2,Ce=0,Fe=L,ke=ie-de&32767;if(ge>2&&ne==G(T-ke))for(var dt=Math.min(R,ge)-1,Lt=Math.min(32767,T),sn=Math.min(258,ge);Lt>=ke&&--Fe&&ie!=de;){if(h[T+re]==h[T+re-ke]){for(var jt=0;sn>jt&&h[T+jt]==h[T+jt-ke];++jt);if(jt>re){if(re=jt,Ce=ke,jt>dt)break;var pt=Math.min(ke,jt-2),vn=0;for(ce=0;pt>ce;++ce){var Le=T-ke+ce+32768&32767,lt=Le-F[Le]+32768&32767;lt>vn&&(vn=lt,de=Le)}}}ke+=(ie=de)-(de=F[ie])+32768&32767}if(Ce){H[N++]=268435456|R2[re]<<18|P8[Ce];var Te=31&R2[re],Je=31&P8[Ce];z+=nb[Te]+rb[Je],++J[257+Te],++B[Je],Y=T+re,++Q}else H[N++]=h[T],++J[h[T]]}}P=T8(h,C,w,H,J,B,z,N,oe,T-oe,P)}return pR(k,0,x+hR(P)+_)})(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,l,u,!0)),f=d.length;return(function(h,m){var v=m.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>m.level?4:m.level==9?2:0,h[9]=3,m.mtime!=0&&Ly(h,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),v){h[3]=8;for(var x=0;v.length>=x;++x)h[x+10]=v.charCodeAt(x)}})(d,e),Ly(d,f-8,n.d()),Ly(d,f-4,r),d}const sV=!!Nx||!!gh,mR=new WeakMap,gR="text/plain";let Ny=0,am=!1;const vR=(t,e)=>{const[n,r]=t.split("#"),[s,i]=n.split("?");if(!i)return t;const o=i.split("&").filter(l=>l.split("=")[0]!==e).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},Bg=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=$({},e),l=(r=i==null?void 0:i.split("&").map(d=>{var f;const[h,m]=d.split("="),v=n&&(f=o[h])!==null&&f!==void 0?f:m;return delete o[h],`${h}=${v}`}))!==null&&r!==void 0?r:[],u=(function(d,f="&"){let h,m;const v=[];return Rt(d,function(x,_){le(x)||le(_)||_==="undefined"||(h=encodeURIComponent((w=>w instanceof File)(x)?x.name:x.toString()),m=encodeURIComponent(_),v[v.length]=m+"="+h)}),v.join(f)})(o);return u&&l.push(u),l.length>0?`${s}?${l.join("&")}`:s},Dy=t=>{if(t.lr)return t.lr;const{data:e,compression:n}=t;if(!e)return;if(n===Ss.GZipJS){const s=rV((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new Js(i.length+(i.length>>>1)),u=0,d=function(v){l[u++]=v},f=0;o>f;++f){if(u+5>l.length){var h=new Js(u+8+(o-f<<1));h.set(l),l=h}var m=i.charCodeAt(f);128>m?d(m):2048>m?(d(192|m>>>6),d(128|63&m)):m>55295&&57344>m?(d(240|(m=65536+(1047552&m)|1023&i.charCodeAt(++f))>>>18),d(128|m>>>12&63),d(128|m>>>6&63),d(128|63&m)):(d(224|m>>>12),d(128|m>>>6&63),d(128|63&m))}return pR(l,0,u)})(Ru(e)),{mtime:0});return{contentType:gR,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===Ss.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))})(Ru(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Ru(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=Ru(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},yR=t=>{const e=()=>t.transport==="sendBeacon"?{url:Bg(t.url,{compression:Ss.Base64}),encodedBody:Dy($($({},t),{},{compression:Ss.Base64,lr:void 0}))}:{url:vR(t.url,"compression"),encodedBody:Dy($($({},t),{},{compression:void 0,lr:void 0}))};let n;try{n=Dy(t)}catch(s){if(Wk(t.compression,ld(t.url,"compression")))return he.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&Wk(t.compression,ld(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?d2(new Uint8Array(r)):ArrayBuffer.isView(r)&&d2(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(am=!0,e()):{url:t.url,encodedBody:n};var r},_R=t=>{try{return yR(t)}catch(n){var e;return he.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},iV=(function(){var t=Bt(function*(e){const n=yield(function(s){return f2.apply(this,arguments)})(Ru(e.data),es.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return $($({},e),{},{lr:{contentType:gR,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),oV=/Failed to fetch|NetworkError|Load failed/i,wR=t=>(t==null?void 0:t.name)==="TypeError"&&oV.test((t==null?void 0:t.message)||""),xR=t=>{try{const e=(function(n,r=Date.now()){if(typeof n!="string"||!n)return;const s=n.trim(),i=/^\d+\s*,/.test(s)?s.slice(0,s.indexOf(",")).trim():s;if(/^\d+$/.test(i)){const u=1e3*Math.min(Number(i),300);return u>0?u:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(i))return;const o=/^\w{3} \w{3} /.test(i)?i+" GMT":i,l=Date.parse(o)-r;return Number.isFinite(l)&&l>0?Math.min(l,nm):void 0})(t());return le(e)?void 0:Math.min(e,3e4)}catch{return}},bR=t=>{const e=_R(t);if(!e)return;const n=new Nx;mR.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Rt(t.headers,function(l,u){n.setRequestHeader(u,l)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var l;const u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}(l=t.callback)===null||l===void 0||l.call(t,u,xR(()=>n.getResponseHeader("Retry-After")))}},n.send(o)},SR=t=>{const e=_R(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;Rt(t.headers,function(x,_){l.append(_,x)}),s&&l.append("Content-Type",s);let u=null,d=!1;if(Ak){const x=new Ak;u={signal:x.signal,timeout:setTimeout(()=>{d=!0;try{x.abort(K5("AbortError","PostHog request timed out"+((_=t.timeout)?` after ${_}ms`:"")))}catch(w){h(w)}var _},t.timeout)}}let f=!1;const h=x=>{var _;f||(f=!0,d&&(x==null?void 0:x.name)==="AbortError"||wR(x)?he.warn(x):he.error(x),(_=t.callback)===null||_===void 0||_.call(t,{statusCode:0,error:x}))};let m=0;const v=()=>{Ny-=m,m=0,u&&clearTimeout(u.timeout)};try{const x=$({method:(t==null?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:i,signal:u==null?void 0:u.signal},t.fetchOptions),_=o??(le(i)?0:void 0);x.keepalive=x.method==="POST"&&!t.kl&&x.keepalive!==!1&&x.body===i&&!le(_)&&_>=0&&52428.8>Ny+_,x.keepalive&&(m=_,Ny+=m),gh(n,x).then(w=>w.text().then(b=>{var k;if(f)return;const C={statusCode:w.status,text:b};if(w.status===200)try{C.json=JSON.parse(b)}catch(P){he.error(P)}f=!0,v(),(k=t.callback)===null||k===void 0||k.call(t,C,xR(()=>w.headers.get("Retry-After")))})).catch(w=>{v(),h(w)}).finally(v)}catch(x){v(),h(x)}},O2=t=>{try{var e;const{url:n,encodedBody:r}=yR(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(mr.sendBeacon(n,l))return;const u=ze(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(ze(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),f=h=>ze(t.data)?h:$($({},t.data),{},{batch:h});return O2($($({},t),{},{data:f(u.slice(0,d))})),void O2($($({},t),{},{data:f(u.slice(d))}))}he.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${gh?"fetch":"XHR"}`),gh?SR($($({},t),{},{kl:!0})):bR(t)}catch(n){he.warn("Beacon send failed",n)}},R8=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return Bg(n===Ss.GZipJS?vR(t,"compression"):t,$($({},s?{[s]:Date.now().toString()}:{}),n===Ss.GZipJS?{}:{compression:n}))},aV=(()=>{const t=[];return gh&&t.push({transport:"fetch",method:SR}),Nx&&t.push({transport:"XHR",method:bR}),mr!=null&&mr.sendBeacon&&t.push({transport:"sendBeacon",method:O2}),t})();let kR=!sV&&(Hr==null?void 0:Hr.indexOf("MSIE"))===-1&&(Hr==null?void 0:Hr.indexOf("Mozilla"))===-1;function ER(t,e,n){var r,s,i;n&&(e=$($({},e),{},{callback:o=>n(o)})),t.__loaded?kR?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((s=e.callback)===null||s===void 0||s.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=$($({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(r=t.compression)!==null&&r!==void 0?r:e.compressionFallback:e.compression,(le(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,((o,l)=>{var u,d,f;const h=$($({},o),{},{callback:l??(w=>{var b;return(b=o.callback)===null||b===void 0?void 0:b.call(o,w)})});h.timeout=h.timeout||6e4;const m=(u=h.transport)!==null&&u!==void 0?u:"fetch";m==="sendBeacon"&&le(h.compression)&&h.data&&(h.compression=Ss.Base64),h.method==="POST"&&h.data&&(h.timestampMode==="capture-body"?h.data=(w=>{var b,k;const C=(ze(w)?w:[w]).map(T=>$($({},T),T.timestamp instanceof Date&&!isNaN(T.timestamp.getTime())?{timestamp:T.timestamp.toISOString()}:{})),P=C[0];return{api_key:(b=P==null||(k=P.properties)===null||k===void 0?void 0:k.token)!==null&&b!==void 0?b:P==null?void 0:P.token,batch:C,sent_at:new Date().toISOString()}})(h.data):h.timestampMode==="body"&&(h.data=((w,b=new Date().toISOString())=>ze(w)?w.map(k=>$($({},k),{},{sent_at:b})):$($({},w),{},{sent_at:b}))(h.data))),h.url=R8(h.url,h.method,h.compression,h.timestampMode);const v=aV.filter(w=>!h.disableTransport||!w.transport||!h.disableTransport.includes(w.transport)),x=(d=(f=(function(w,b){for(let k=0;w.length>k;k++)if(b(w[k]))return w[k]})(v,w=>w.transport===m))===null||f===void 0?void 0:f.method)!==null&&d!==void 0?d:v[0].method;if(!x)throw new Error("No available transport method");const _=w=>{try{x(w)}catch(k){var b;wR(k)?he.warn(k):he.error(k),(b=h.callback)===null||b===void 0||b.call(h,{statusCode:0,error:k})}};m!=="sendBeacon"&&!h.preferSyncCompression&&h.data&&h.compression===Ss.GZipJS&&_7&&typeof Promise<"u"&&!am?iV(h).then(w=>{_(w)}).catch(w=>{if(Zk(w))return am=!0,void _($($({},h),{},{compression:void 0,url:R8(o.url,o.method,void 0,o.timestampMode)}));(b=>{if(!b||typeof b!="object")return!1;const k="name"in b?String(b.name):"";return Zk(b)||k===nT})(w)&&(am=!0),_(h)}):_(h)})(e,(o,l)=>{var u,d,f;t.rateLimiter.checkForLimiting(o),400>o.statusCode||(u=(d=t.config).on_request_error)===null||u===void 0||u.call(d,o),n?n(o,l):(f=e.callback)===null||f===void 0||f.call(e,o)})):e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:0}))}var lV=class{constructor(t,e){this.Zu=!0,this.Ju=[],this.Ku=Ki((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,he.createLogger("flush interval"),3e3),this.Xu=t}enqueue(t){this.Ju.push(t),this.Yu||this.tc()}unload(){this.ec();const t=this.Ju.length>0?this.nc():{},e=Object.values(t);[...e.filter(n=>n.url.indexOf("/e")===0),...e.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.sc($($({},n),{},{callback:void 0}),"sendBeacon")})}enable(){this.Zu=!1,this.tc()}tc(){this.Zu||(this.Yu=setTimeout(()=>{this.ec(),this.rc()},this.Ku))}rc(){if(this.Ju.length>0){const t=this.nc();for(const e in t)this.sc(t[e])}}sc(t,e){try{this.Xu(t,e)}catch(n){he.error(n)}}ec(){clearTimeout(this.Yu),this.Yu=void 0}nc(){const t={},e={};Rt(this.Ju,n=>{var r;const s=n,i=((s?s.batchKey:null)||s.url)+(s.batchGroup?`:${s.batchGroup}`:"");le(t[i])&&(t[i]=$($({},s),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),e[i]=[]),(r=t[i].data)===null||r===void 0||r.push(s.data),s.callback&&e[i].push(s.callback)});for(const n in e){const r=e[n];r.length&&(t[n].callback=s=>{for(const i of r)i(s)})}return this.Ju=[],t}};const cV=["retriesPerformedSoFar"];var uV=class{constructor(t){this._instance=t,this.oc=!1,this.ac=3e3,this.Ju=[],this.Ju=[],this.lc=!0,this.resume()}resume(){if(!le(ae)&&"onLine"in ae.navigator){if(this.lc=ae.navigator.onLine,this.uc)return;this.uc=()=>{this.lc=!0,this.rc()},this.cc=()=>{this.lc=!1},xt(ae,"online",this.uc),xt(ae,"offline",this.cc)}}get length(){return this.Ju.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=rT(t,cV);Po(n)&&(r.url=Bg(r.url,{retry_count:n})),ER(this._instance,e?$($({},r),{},{transport:e}):r,(s,i)=>{var o;if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Ls($({retriesPerformedSoFar:n},r),i);s.statusCode===0&&he.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${n??0} retries.`)}(o=r.callback)===null||o===void 0||o.call(r,s)})}Ls(t,e){const n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const l=3e3*Math.pow(2,o),u=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-u);return Math.ceil(d+f)})(n),e??0),s=Date.now()+r;this.Ju.push({retryAt:s,requestOptions:t});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),he.warn(i),this.oc||(this.oc=!0,this.hc())}hc(){if(this.dc&&clearTimeout(this.dc),this.Ju.length===0)return this.oc=!1,void(this.dc=void 0);this.dc=setTimeout(()=>{this.lc&&this.Ju.length>0&&this.rc(),this.hc()},this.ac)}rc(){const t=Date.now(),e=[],n=this.Ju.filter(r=>t>r.retryAt||(e.push(r),!1));if(this.Ju=e,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.dc&&(clearTimeout(this.dc),this.dc=void 0),this.oc=!1,le(ae)||(this.uc&&(ae.removeEventListener("online",this.uc),this.uc=void 0),this.cc&&(ae.removeEventListener("offline",this.cc),this.cc=void 0));for(const{requestOptions:t}of this.Ju)try{this._instance._send_request($($({},t),{},{callback:ze(t.data)?void 0:t.callback,transport:"sendBeacon"}))}catch(e){he.error(e)}this.Ju=[]}},dV=class{constructor(t){this._instance=t,this.vc=()=>{var e,n,r,s;this.fc||(this.fc={});const i=this.scrollElement(),o=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=o+((i==null?void 0:i.clientHeight)||0),d=(i==null?void 0:i.scrollHeight)||0;this.fc.lastScrollY=Math.ceil(o),this.fc.maxScrollY=Math.max(o,(e=this.fc.maxScrollY)!==null&&e!==void 0?e:0),this.fc.maxScrollHeight=Math.max(l,(n=this.fc.maxScrollHeight)!==null&&n!==void 0?n:0),this.fc.lastContentY=u,this.fc.maxContentY=Math.max(u,(r=this.fc.maxContentY)!==null&&r!==void 0?r:0),this.fc.maxContentHeight=Math.max(d,(s=this.fc.maxContentHeight)!==null&&s!==void 0?s:0)}}get gc(){return this._instance.config.scroll_root_selector}getContext(){return this.fc}resetContext(){const t=this.fc;return this.fc=void 0,setTimeout(this.vc,0),t}startMeasuringScrollPosition(){xt(ae,"scroll",this.vc,{capture:!0}),xt(ae,"scrollend",this.vc,{capture:!0}),xt(ae,"resize",this.vc)}scrollElement(){if(this.gc){const n=ze(this.gc)?this.gc:[this.gc];for(const r of n){var t;const s=ae==null||(t=ae.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return ae==null||(e=ae.document)===null||e===void 0?void 0:e.documentElement}mc(t){var e,n;const r=t==="y"?"scrollTop":"scrollLeft";if(this.gc){const s=this.scrollElement();return s&&s[r]||0}return ae?t==="y"?ae.scrollY||ae.pageYOffset||((e=ae.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.scrollTop)||0:ae.scrollX||ae.pageXOffset||((n=ae.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollLeft)||0:0}scrollY(){return this.mc("y")}scrollX(){return this.mc("x")}};const fV=t=>oR(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);var I8=class{constructor(t,e,n,r){this.qe=s=>{const i=this.yc();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.bc(this._instance)};this._c.register({[S2]:o})},this._instance=t,this.wc=e,this._c=n,this.bc=r||fV,this.wc.onSessionId(this.qe)}yc(){return this._c.props[S2]}getSetOnceProps(){var t;const e=(t=this.yc())===null||t===void 0?void 0:t.props;return e?"r"in e?aR(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){const t={};return Rt(Yx(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${i2(n)}`]=e}),t}},Gm=class{on(t,e){return this.bo[t]||(this.bo[t]=[]),this.bo[t].push(e),()=>{this.bo[t]=this.bo[t].filter(n=>n!==e)}}emit(t,e){for(const n of this.bo[t]||[])n(e);for(const n of this.bo["*"]||[])n(t,e)}constructor(){this.bo={}}};const pu=an("[SessionId]"),M8=864e5;var O8=class{on(t,e){return this.kc.on(t,e)}constructor(t,e,n){var r;if(this.Sc=null,this.xc=null,this.$c=[],this.Cc=void 0,this.Tc=!1,this.kc=new Gm,this.Ic=(i,o)=>!(!Po(i)||!Po(o))&&Math.abs(i-o)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Ar=t.config,this._c=t.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Mc=void 0,this._sessionActivityTimestamp=null,this.Ec=e||Si,this.Pc=n||Si;const s=this.Ar.persistence_name||this.Ar.token;if(this._sessionTimeoutMs=1e3*Ki(this.Ar.session_idle_timeout_seconds||1800,60,36e3,pu.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Rc(),this.Ac="ph_"+s+"_window_id",this.Fc="ph_"+s+"_primary_window_exists",this.Oc()){const i=Ut.Lt(this.Ac),o=Ut.Lt(this.Fc);i&&!o?this.je=i:Ut.Pt(this.Ac),Ut.At(this.Fc,!0)}!((r=this.Ar.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Ar.bootstrap.sessionID),this.Dc()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return le(this.$c)&&(this.$c=[]),this.$c.push(t),this.Xt&&t(this.Xt,this.je),()=>{this.$c=this.$c.filter(e=>e!==t)}}Oc(){return this.Ar.persistence!=="memory"&&!this._c.hi&&Ut.Et()}Lc(t){t!==this.je&&(this.je=t,this.Oc()&&Ut.At(this.Ac,t))}Nc(){return this.je?this.je:this.Oc()?Ut.Lt(this.Ac):null}qc(t){const e=this.Sc;return!un(e)&&!un(t)&&5e3>Math.abs(t-e)}jc(t,e,n){const r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xt||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=e,this.Xt=t,s&&!r||s&&this.qc(e)||(this.Sc=e,this._c.register({[Pu]:[e,t,n]}))}Bc(){var t;const e=(t=this.Ar)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Po(e)&&e>0}zc(){this.Bc()?this._c.refreshKey(Pu):(this._c.flush(),this._c.load())}Hc(){var t;if(un(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Sc)return;this.zc();const[,e,n]=this.Uc();e===this.Xt&&n===this._sessionStartTimestamp&&(this.Sc=this._sessionActivityTimestamp,this._c.register({[Pu]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this._c.flush())}Wc(){const[t]=this.Uc(),e=Po(t)?t:0,n=Po(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,n)}Vc(t){return this.zc(),this.Ic(t,this.Wc())}Uc(){const t=this._c.props[Pu];return ze(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Sc=null,this.Mc=void 0,clearTimeout(this.Gc),this.Gc=void 0,this.jc(null,null,null)}setBootstrapSessionId(t,e=!1){const n=((r,s=new Date().getTime())=>{try{const i=(o=>{const l=o.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(r);return i>s+6e4?void pu.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void pu.error("Invalid sessionID in bootstrap",i)}})(t);return!le(n)&&(e?this.Mc={sessionId:t,sessionStartTimestamp:n}:this.jc(t,new Date().getTime(),n),!0)}destroy(){this.Tc=!0,this.Hc(),clearTimeout(this.Gc),this.Gc=void 0,this.Cc&&ae&&(ae.removeEventListener(Bm,this.Cc,{capture:!1}),this.Cc=void 0),this.$c=[]}Dc(){this.Cc=()=>{this.Hc(),this.Oc()&&Ut.Pt(this.Fc)},xt(ae,Bm,this.Cc,{capture:!1})}checkAndGetSessionAndWindowId(t=!1,e=null,n=!1){if(this.Ar.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=e||new Date().getTime(),s=this.Xt;if(n)this.xc=r;else if(un(this.xc)||this.xc>r||r-this.xc>=1e3){var i,o;(i=(o=this._c).syncCookieProperties)===null||i===void 0||i.call(o),this.xc=r}let[,l,u]=this.Uc();const d=!le(s)&&l!==s,f=this.Wc();let h=this.Nc();const m=this.Mc,v=!!m&&(m.sessionStartTimestamp>r+6e4||r-m.sessionStartTimestamp>M8),x=m?v:Po(u)&&Math.abs(r-u)>M8;let _=!1,w=d,b=!l||!!m;const k=l;let C=!b&&!t&&this.Ic(r,f);if(C&&(C=this.Vc(r),C||pu.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,u]=this.Uc(),C||(b=!l||!!m)),b||C||x){w=!1;const I=m&&!v;l=I?m.sessionId:this.Ec(),h=this.Pc(),pu.info("new session ID assigned",{sessionId:l,windowId:h,bootstrapped:!!I,changeReason:{noSessionId:b,activityTimeout:C,sessionPastMaximumLength:x}}),u=I?m.sessionStartTimestamp:r,this.Mc=void 0,_=!0}else h||(h=this.Pc(),_=!0),w=w||l!==k,w&&(pu.info("adopted cross-tab session id",{sessionId:l,windowId:h}),_=!0);const P=Po(f)&&t&&!x?f:r,T=Po(u)?u:new Date().getTime();this.Lc(h),this.jc(l,P,T),t||this.Rc();const M={noSessionId:b,activityTimeout:C,sessionPastMaximumLength:x,crossTabAdoption:w};return _&&this.$c.forEach(I=>I(l,h,M)),{sessionId:l,windowId:h,sessionStartTimestamp:T,changeReason:_?M:void 0,lastActivityTimestamp:f}}Rc(){this.Tc||(clearTimeout(this.Gc),this.Gc=setTimeout(()=>{if(!this.Tc)if(this.Vc(new Date().getTime())){const t=this.Xt;this.resetSessionId(),this.kc.emit("forcedIdleReset",{idleSessionId:t})}else this.Rc()},1.1*this.sessionTimeoutMs))}};const L8=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]),CR=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&Rk(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>Rk(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function PR(){return(PR=Bt(function*(){const t=mr==null?void 0:mr.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return st(n)&&n.length>0?n:void 0}catch(e){return void he.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function hV(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function AR(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const Km=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},E0=t=>t.toLowerCase(),TR={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=>Km(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Km(n,r))),icontains:(t,e)=>e.map(E0).some(n=>t.map(E0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(E0).every(n=>t.map(E0).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r<parseFloat(s))})};function RR(t,e){return!t||Object.entries(t).every(([n,r])=>{const s=e==null?void 0:e[n];if(s==null)return!1;const i=TR[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function jy(t,e,n){return Ru({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const L2="custom",N8="i.posthog.com",pV=/^\/static\//,mV=["/s/","/e/","/i/"];var gV=class{constructor(t){this.Qc={},this.instance=t}get apiHost(){const t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){const t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t;let e=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace(`.${N8}`,".posthog.com")),e==="https://app.posthog.com"?"https://us.posthog.com":e}get region(){return this.Qc[this.apiHost]||(this.Qc[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":L2),this.Qc[this.apiHost]}Zc(t){if(!pV.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}Jc(t){const e=Zo(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Kc(t,e,n){if(t==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=Zo(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&mV.some(o=>e.indexOf(o)===0)){const o=this.Jc(r);if(o){const l=this.apiHost;let u=this.Xc;(u==null?void 0:u.apiHost)===l&&u.rewriteRequestPath===s||(u={apiHost:l,rewriteRequestPath:s,urls:new Set},this.Xc=u),u.urls.add(o)}}return r}isIngestionEndpoint(t){const e=this.Xc,n=this.Jc(t);return(e==null?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&e.urls.has(n)}endpointFor(t,e=""){if(e&&(e=e[0]==="/"?e:`/${e}`),t==="ui")return this.Kc(t,e,this.uiHost+e);if(t==="flags")return this.Kc(t,e,this.flagsApiHost+e);if(t==="assets"){const r=this.Zc(e);if(r)return this.Kc(t,e,`${r}${e}`)}if(this.region===L2)return this.Kc(t,e,this.apiHost+e);const n=N8+e;switch(t){case"assets":return this.Kc(t,e,`https://${this.region}-assets.${n}`);case"api":return this.Kc(t,e,`https://${this.region}.${n}`)}}};const At=an("[Surveys]"),IR=t=>{try{const e=(n=>((r,s)=>`seenSurvey_${(function(i){return i.current_iteration&&i.current_iteration>0?`${i.id}_${i.current_iteration}`:i.id})(s)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){At.error("Failed to persist survey seen state",e)}},vV=[Iy.Popover,Iy.Widget,Iy.API],yV={ignoreConditions:!1,ignoreDelay:!1,displayType:T2.Popover},_V=an("[PostHog ExternalIntegrations]"),wV={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var xV=class{constructor(t){this._instance=t}Ml(t,e){var n,r;(n=qe.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return _V.error("failed to load script",s);e()})}startIfEnabledOrStop(){var t;for(const[s,i]of Object.entries((t=this._instance.config.integrations)!==null&&t!==void 0?t:{})){var e,n,r;i&&!(!((e=qe.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.Ml(wV[s],()=>{var o;(o=qe.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[s])===null||o===void 0||o.start(this._instance)}),!i&&(!((n=qe.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=qe.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},MR=class{constructor(t){this.disabled=t===!1;const e=rt(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,n){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:n}];return!1}};const N2=()=>typeof window>"u"?void 0:window,Tf=()=>typeof document>"u"?void 0:document,$y="$copy_autocapture",Fy=an("[AutoCapture]");function Vy(t,e){return e.length>t?e.slice(0,t)+"...":e}function bV(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!Pi(e));return e}function SV(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,u;if(!Pi(t))return{props:{}};const d=[t],f=new Set([t]);let h=t;for(;h.parentNode&&!gr(h,"body")&&1e3>d.length;){if(Xx(h.parentNode)){const M=h.parentNode.host;if(f.has(M))break;f.add(M),d.push(M),h=M;continue}if(!Pi(h.parentNode)||f.has(h.parentNode))break;f.add(h.parentNode),d.push(h.parentNode),h=h.parentNode}const m=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(M=>gr(M,"button")||gr(M,"a")):-1;m>0&&(r=r||d.slice(0,m+1).some(M=>!hc(M)||ad(M)));const v=[],x={};let _,w=!1,b=!1;if(Rt(d,M=>{const I=hc(M);if(gr(M,"a")&&!n&&!(s!=null&&s.includes("href"))){const R=M.getAttribute("href");w=!!(I&&R&&Fu(R))&&(o?qa(R):R)}Be(od(M),"ph-no-capture")&&(b=!0),v.push((function(R,L,j,F,D=!1){const q=R.tagName.toLowerCase(),W={tag_name:q};Jx.indexOf(q)>-1&&!j&&(W.$el_text=q.toLowerCase()==="a"||q.toLowerCase()==="button"?Vy(1024,v8(R)):Vy(1024,_h(R)));const G=od(R);L||F!=null&&F.includes("class")||0>=G.length||(W.classes=G.filter(function(Q){return Q!==""})),Rt(R.attributes,function(Q){var z;if((!ad(R)||["name","id","class","aria-label"].indexOf(Q.name)!==-1)&&!(F!=null&&F.includes(Q.name))&&!L&&Fu(Q.value)&&(!st(z=Q.name)||z.substring(0,10)!=="_ngcontent"&&z.substring(0,7)!=="_nghost")){let N=Q.value;Q.name==="class"&&(N=Qx(N).join(" ")),W["attr__"+Q.name]=Vy(1024,Q.name==="href"&&D?qa(N):N)}});let H=1,J=1,B=R;for(;B=bV(B);)H++,B.tagName===R.tagName&&J++;return W.nth_child=H,W.nth_of_type=J,W})(M,n,r,s,o)),Rt((function(R){if(!hc(R))return{};const L={};return Rt(R.attributes,function(j){if(j.name&&j.name.indexOf("data-ph-capture-attribute")===0){const F=j.name.replace("data-ph-capture-attribute-",""),D=j.value;F&&D&&Fu(D)&&(L[F]=D)}}),L})(M),(R,L)=>{({}).hasOwnProperty.call(x,L)||(x[L]=R)})}),b)return{props:{},explicitNoCapture:b};if(m>0&&(t=d[m],v.splice(0,m)),r||(v[0].$el_text=gr(t,"a")||gr(t,"button")?v8(t):_h(t)),w){var k,C;v[0].attr__href=w;const M=(k=Zo(w))===null||k===void 0?void 0:k.host,I=(C=N2())===null||C===void 0||(C=C.location)===null||C===void 0?void 0:C.host;M&&I&&M!==I&&(_=w)}return{props:en((T=e.type,{$event_type:T,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(P=v,ze(P)?(function(M){return M.map(I=>{var R,L;let j="";if(I.tag_name&&(j+=I.tag_name),I.attr_class){I.attr_class.sort();for(const q of I.attr_class)j+=`.${q.replace(/"/g,"")}`}const F=$($($($({},I.text?{text:I.text}:{}),{},{"nth-child":(R=I.nth_child)!==null&&R!==void 0?R:0,"nth-of-type":(L=I.nth_of_type)!==null&&L!==void 0?L:0},I.href?{href:I.href}:{}),I.attr_id?{attr_id:I.attr_id}:{}),I.attributes),D={};return om(F).sort(([q],[W])=>(function(G,H){return H>G?-1:G>H?1:0})(q,W)).forEach(([q,W])=>D[y8(q.toString())]=y8(W.toString())),j+=":",j+=om(D).map(([q,W])=>`${q}="${W}"`).join(""),j}).join(";")})((function(M){return M.map(I=>{var R,L;const j={text:(R=I.$el_text)===null||R===void 0?void 0:R.slice(0,400),tag_name:I.tag_name,href:(L=I.attr__href)===null||L===void 0?void 0:L.slice(0,2048),attr_class:FF(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return om(I).filter(([F])=>F.indexOf("attr__")===0).forEach(([F,D])=>j.attributes[F]=D),j})})(P)):"")},!((l=v[0])===null||l===void 0)&&l.$el_text?{$el_text:(u=v[0])===null||u===void 0?void 0:u.$el_text}:{},_&&e.type==="click"?{$external_click_url:_}:{},x),target:t};var P,T}const OR="autocapture";var kV=class{el(){this.il=void 0,clearTimeout(this.nl),this.nl=void 0}sl(t){var e;if(!hc(t))return!0;const n=(e=this.rl().css_selector_ignorelist)!==null&&e!==void 0?e:Py,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=od(i);if(Be(o,"ph-no-capture")||Be(o,"ph-sensitive")||ad(i)||n.some(u=>P2(i,u)))return!0;const l=s.parentNode;s=Xx(l)?l.host:l&&Pi(l)?l:null}return!1}ol(t){if(!this.isEnabled||t.type==="pointercancel")return void this.el();if(t.type==="pointerdown"){var e;this.el();const r=eh(t);return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&Pi(r)&&(this.il={target:r,excluded:this.sl(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:(e=this.xa)===null||e===void 0?void 0:e.distinctId}))}const n=this.il;n&&(t.pointerId!==n.id||Math.abs(t.clientX-n.x)>5||Math.abs(t.clientY-n.y)>5?this.el():t.type==="pointerup"&&(n.released=!0,this.nl=setTimeout(()=>this.el(),0)))}al(t){var e;const n=this.il;this.el();const r=eh(t);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((e=this.xa)===null||e===void 0?void 0:e.distinctId)&&t.pointerId===n.id&&(t.detail>0||t.pointerType==="touch"||t.pointerType==="pen")&&t.button===0&&5>=Math.abs(t.clientX-n.x)&&5>=Math.abs(t.clientY-n.y)&&r&&(gr(r,"html")||gr(r,"body"))){var s,i,o;if(n.excluded)return null;const l=(s=this.rl().css_selector_ignorelist)!==null&&s!==void 0?s:Py;return[r,(i=Tf())===null||i===void 0?void 0:i.documentElement,(o=Tf())===null||o===void 0?void 0:o.body].some(u=>{if(!u)return!1;const d=od(u);return Be(d,"ph-no-capture")||Be(d,"ph-sensitive")||!hc(u)||ad(u)||l.some(f=>P2(u,f))})?null:n.target}}constructor(t){this.Ta=t,this.name=OR,this.ll=!1,this.ul=null,this.cl=!1,this.hl=new Map,this.dl=!1,this.Ar={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Ci=!1,this.Ta.refresh(this.Ar),this.rageclicks=new MR(this.Ar.rageclick),this.vl=null}setup(t){this.fl(),this.xa=t;const e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Ci?e.dispose():(this.qa=e,this.startIfEnabled())}dispose(){var t;this.Ci||(this.Ci=!0,this.xa=void 0,(t=this.qa)===null||t===void 0||t.dispose(),this.qa=void 0,this.hl.clear(),this.vl=null,this.pl())}rl(){return this.Ta.refresh(this.Ar),this.Ar}fl(){var t,e;return this.rl(),this.Ar.url_allowlist=(t=this.Ar.url_allowlist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Ar.url_ignorelist=(e=this.Ar.url_ignorelist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Ar}gl(){const t=N2(),e=Tf();if(!this.isBrowserSupported())return void Fy.info("Disabling Automatic Event Collection because this browser is not supported");if(!t||!e)return;this.ml=t,this.yl=e;const n=this.bl=r=>{r=r||(t==null?void 0:t.event);try{if(r.type==="blur")return void this.el();if(r.type.indexOf("pointer")===0)return void this.ol(r);const s=r.type==="click"?this.al(r):void 0;if(un(s))return;this._l(r,"$autocapture",s)}catch(s){Fy.error("Failed to capture event",s)}};if(xt(t,"blur",n),xt(e,"submit",n,{capture:!0}),xt(e,"change",n,{capture:!0}),xt(e,"click",n,{capture:!0}),Rt(["pointerdown","pointermove","pointerup","pointercancel"],r=>{xt(e,r,n,{capture:!0})}),this.rl().capture_copied_text){const r=this.wl=s=>{s=s||(t==null?void 0:t.event);try{this._l(s,$y)}catch(i){Fy.error("Failed to capture clipboard event",i)}};xt(e,"copy",r,{capture:!0}),xt(e,"cut",r,{capture:!0}),xt(e,"paste",r,{capture:!0})}}pl(){const t=this.ml,e=this.yl;this.el(),this.bl&&(t==null||t.removeEventListener("blur",this.bl),Rt(["pointerdown","pointermove","pointerup","pointercancel"],n=>{e==null||e.removeEventListener(n,this.bl,!0)}),e==null||e.removeEventListener("submit",this.bl,!0),e==null||e.removeEventListener("change",this.bl,!0),e==null||e.removeEventListener("click",this.bl,!0),this.bl=void 0),this.wl&&(e==null||e.removeEventListener("copy",this.wl,!0),e==null||e.removeEventListener("cut",this.wl,!0),e==null||e.removeEventListener("paste",this.wl,!0),this.wl=void 0),this.ml=void 0,this.yl=void 0,this.ll=!1}startIfEnabled(){this.isEnabled||this.el(),!this.Ci&&this.xa&&this.isEnabled&&!this.ll&&(this.gl(),this.ll=!0)}onRemoteConfig(t){if(this.Ci)return;if(this.cl=!0,!t.ok)return void this.startIfEnabled();const e=t.config;e.elementsChainAsString&&(this.dl=e.elementsChainAsString);const n=e.autocapture_opt_out;var r;zr(n)&&((r=this.xa)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.ul=n),this.startIfEnabled()}setElementSelectors(t,e=this){if(this.Ci)return;t.size?this.hl.set(e,new Set(t)):this.hl.delete(e);const n=new Set;this.hl.forEach(r=>{r.forEach(s=>n.add(s))}),this.vl=n}getElementSelectors(t,e){var n;const r=[];return(n=this.vl)===null||n===void 0||n.forEach(s=>{var i;const o=(i=Tf())===null||i===void 0?void 0:i.querySelectorAll(s);o==null||o.forEach(l=>{t!==l&&e!==l||Be(r,s)||r.push(s)})}),r}get isEnabled(){var t,e;if(this.Ci)return!1;const n=(t=this.xa)===null||t===void 0?void 0:t.kv.get(_T),r=this.ul,s=this.rl();if(!s.remoteRequestsDisabled&&!this.cl)return!1;const i=s.remoteRequestsDisabled&&!this.cl;if(un(r)&&!zr(n)&&!i)return!1;const o=(e=this.ul)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}_l(t,e="$autocapture",n){if(!this.isEnabled)return void this.el();let r=n||eh(t);zT(r)&&(r=r.parentNode||null);const s=this.fl();var i;e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&s.rageclick&&(!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime()))&&ZT(r,s.rageclick)&&this._l(t,"$rageclick",n);const o=e===$y,l=o?$($({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(h,m,v,x,_,w){var b;const k=typeof window>"u"?void 0:window;if(!k||tb(h)||v!=null&&v.url_allowlist&&!c8(v.url_allowlist,w)||v!=null&&v.url_ignorelist&&c8(v.url_ignorelist,w))return!1;if(v!=null&&v.dom_event_allowlist){const M=v.dom_event_allowlist;if(M&&!M.some(I=>m.type===I))return!1}const{parentIsUsefulElement:C,targetElementList:P}=qT(h,x);if(!(function(M,I){const R=I==null?void 0:I.element_allowlist;if(le(R))return!0;for(const L of M)if(R.some(j=>L.tagName.toLowerCase()===j))return!0;return!1})(P,v)||!A2(P,v==null?void 0:v.css_selector_allowlist)||A2(P,(b=v==null?void 0:v.css_selector_ignorelist)!==null&&b!==void 0?b:Py))return!1;try{const M=k.getComputedStyle(h);if(M&&M.getPropertyValue("cursor")==="pointer"&&m.type==="click")return!0}catch{}const T=h.tagName.toLowerCase();switch(T){case"html":return!1;case"form":return(_||["submit"]).indexOf(m.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(m.type)>=0;default:return C?(_||["click"]).indexOf(m.type)>=0:(_||["click"]).indexOf(m.type)>=0&&(Jx.indexOf(T)>-1||h.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var u;const{props:h,explicitNoCapture:m,target:v}=SV(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.dl,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(m)return!1;const x=this.getElementSelectors(r,v);if(x&&x.length>0&&(h.$element_selectors=x),e===$y){const _=t.type||"clipboard";if(_!=="paste"){var d,f;const w=(d=N2())===null||d===void 0||(d=d.getSelection())===null||d===void 0?void 0:d.toString(),b=UT(w);if(!b)return!1;h.$selected_content=b,h.$clipboard_text_length=(f=w==null?void 0:w.length)!==null&&f!==void 0?f:0}h.$copy_type=_}return(u=this.xa)===null||u===void 0||u.capture(e,h),!0}}isBrowserSupported(){var t;return kn((t=Tf())===null||t===void 0?void 0:t.querySelectorAll)}};const LR="featureFlags",NR="logs";var EV=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if(typeof t=="string")return e==null?void 0:e.get_property(t);const n={};for(const r of t){const s=e==null?void 0:e.get_property(r);le(s)||(n[r]=s)}return n}set(t,e){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof t=="string"?{[t]:e}:t)}remove(t){var e;(e=this._instance.persistence)===null||e===void 0||e.unregister(t)}},CV=class{constructor(t){this.instance=t,this.$=he,this.kv=new EV(t),this.onSession=e=>k0(this.instance.onSessionId(n=>{try{e(n)}catch(r){this.$.error("Browser extension session listener failed",r)}})),this.onEvent=e=>k0(this.instance._addCaptureHook((n,r)=>{if(r)try{e({event:n,properties:r.properties})}catch(s){this.$.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=e=>{const n=s=>{try{e(s)}catch(i){this.$.error("Browser extension remote config listener failed",i)}},r=this.instance.ur.on("extensionsRemoteConfig",n);return this.instance.cr&&n(this.instance.cr),k0(r)}}get logger(){return this.$}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return(t=this.instance.get_property("$device_id"))!==null&&t!==void 0?t:this.distinctId}get deviceId(){const t=this.instance.get_property(Ux);return typeof t=="string"?t:void 0}get library(){return{name:es.LIB_NAME,version:es.LIB_VERSION}}get initialPersonProperties(){var t,e;return(t=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,r,s;const i=(t=this.instance.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(e=i==null?void 0:i.sessionId)!==null&&e!==void 0?e:"",windowId:(n=i==null?void 0:i.windowId)!==null&&n!==void 0?n:"",sessionStartTimestamp:(r=i==null?void 0:i.sessionStartTimestamp)!==null&&r!==void 0?r:0,lastActivityTimestamp:(s=i==null?void 0:i.lastActivityTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return kn(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get projectToken(){return this.instance.config.token}getExtension(t){let e;switch(t){case LR:case"featureFlagsCommon":e=this.instance.featureFlags;break;case NR:e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case OR:e=this.instance.autocapture}return e}capture(t,e,n){if(!n)return void this.instance.capture(t,e);const r=$({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},n.delivery==="unload"?{transport:"sendBeacon",send_instantly:!0}:{});this.instance.capture(t,e,r)}registerDynamicEventProperties(t){return k0(this.instance.dr(t))}sendRequest(t){var e=this;return Bt(function*(n,r={}){var s;const i=(s=r.target)!==null&&s!==void 0?s:"api",o=r.query?Bg(n,r.query):n,l=e.instance.requestRouter.endpointFor(i,o),u={method:r.method,url:l,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:r.target==="flags"&&r.compression==="best-available"?s2.Base64:void 0,timestampMode:r.sentAt};return i==="api"&&n==="/i/v1/logs"&&(u.batchKey="logs"),r.transport==="sendBeacon"?(e.instance._send_request(u),{statusCode:202}):new Promise(d=>{u.callback=d,e.instance._send_request(u)})}).apply(this,arguments)}};const nh={};let Hy=0;const rh=()=>{},D8='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',mu="Surveys module not available",j8="sanitize_properties is deprecated. Use before_send instead",DR="Invalid value for property_denylist config: ",PV=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],AV=["$feature_flag_called","$$heatmap","$snapshot"],$8=t=>t.charAt(0)==="$"&&!Be(AV,t),TV=/^[A-Za-z0-9_-]{1,400}$/,F8=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,V8=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,RV=["token","distinct_id",PT],Vf="posthog",IV=[...L8].sort()[L8.length-1],MV=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},zy=t=>{var e;return $({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:SF(Ee==null?void 0:Ee.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:rh,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_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:zt&&st(zt==null?void 0:zt.search)&&zt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(ae==null||(e=ae.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){he.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:jT,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:rh},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:eb,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:MV(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},OV=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],H8=t=>{const e={};for(const[s,i]of OV)le(t[s])||(e[i]=t[s]);const n=en({},e,t),r=t.__preview_external_dependency_versioned_paths;return le(r)||(le(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),st(r)&&le(t.asset_host)&&(n.asset_host=r)),ze(t.property_blacklist)&&(le(t.property_denylist)?n.property_denylist=t.property_blacklist:ze(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:he.error(DR+t.property_denylist)),n};var LV=class{constructor(){this.__forceAllowLocalhost=!1}get Yc(){return this.__forceAllowLocalhost}set Yc(t){he.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},sh=class Sa{th(e){if(!e)return;const n=this.eh.indexOf(e);n!==-1&&this.eh.splice(n,1)}ih(e,n){var r;return this.th(e),this.eh.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}nh(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}sh(){if(this.rh||this.config.reuseAnonymousId||this.config.segment||this.nh())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.oh)return;let n,r,s;e?(n=`persistence is set to '${this.config.persistence}'`,r=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",s="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",r="on every page load",s="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.rh=!0,console.warn("[PostHog.js]",`${n} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${r}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${s}`)}ah(){const e=this.persistence;if(!e||this.uh)return;if(this.nh())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.hh(),this.dh()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.fh()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(Si());this.register({distinct_id:r,$device_id:r}),e.set_property(Tr,$o)}this.hh()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.ph=!1,this.gh=!1,this.webPerformance=new LV,this.mh=!1,this.version=es.LIB_VERSION,this.yh=new Set,this.bh="",this.ur=new Gm,this.eh=[],this._h=[],this.wh=!1,this.oh=!1,this.rh=!1,this.uh=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=zy(),this.SentryIntegration=zF,this.sentryIntegration=r=>(function(s,i){const o=YT(s,i);return{name:KT,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.kh=!1,this.Sh=null,this.xh=null,this.$h=null,this.scrollManager=new dV(this),this.pageViewManager=new x8(this),this.rateLimiter=new QF(this),this.requestRouter=new gV(this),this.consent=new IF(this),this.externalIntegrations=new xV(this);const n=(e=Sa.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{const o=st(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=st(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>he.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==Vf){var s;const i=(s=nh[r])!==null&&s!==void 0?s:new Sa;return i._init(e,n,r),nh[r]=i,nh[Vf][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=st(e)?e.trim():"";if(!l)return he.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var u;if(this.__loaded)return l!==((u=this.config)===null||u===void 0?void 0:u.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${l}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=zy(n.defaults),n.debug=this.Ch(n.debug),this.Th=n,this.Ih=[],n.person_profiles?this.xh=n.person_profiles:n.process_person&&(this.xh=n.process_person);const d=zy(n.defaults),f=H8(n),h=en({},d,f,{name:r,token:l});rt(d.rageclick)&&rt(f.rageclick)&&(h.rageclick=en({},d.rageclick,f.rageclick)),rt(d.session_recording)&&rt(f.session_recording)&&(h.session_recording=en({},d.session_recording,f.session_recording)),this.set_config(h),this.config.on_xhr_error&&he.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Ss.GZipJS;const m=this.fh(),v=!this.nh();if(this.persistence=new Ry(this.config,m,!0,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ry($($({},this.config),{},{persistence:"sessionStorage"}),m,!1,v),this.bh="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!m&&Ut.Et()){const k=Ut.Lt(this.bh);ze(k)&&k.forEach(C=>{st(C)&&this.yh.add(C)})}else Ut.Pt(this.bh);const x=$({},this.persistence.props),_=$({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mh=new lV((k,C)=>this.Eh(k,C),this.config.request_queue_config),this.Ph=new uV(this),this.__request_queue=[];const w=this.nh();w||(this.sessionManager=new O8(this),this.sessionPropsManager=new I8(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((k,C,P)=>{(P!=null&&P.activityTimeout||P!=null&&P.sessionPastMaximumLength||P!=null&&P.crossTabAdoption)&&this.Rh()})),this.Ah(),this.config.__preview_deferred_init_extensions?(he.info("Deferring extension initialization to improve startup performance"),this.Fh=setTimeout(()=>{this.Fh=void 0,this.Oh(w)},0)):(he.info("Initializing extensions synchronously"),this.Oh(w)),es.DEBUG=es.DEBUG||this.config.debug,es.DEBUG&&he.info("Starting in debug mode",{this:this,config:n,thisC:$({},this.config),p:x,s:_}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=$($({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const b=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.oh=!!b&&!qf(b),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const k=n.bootstrap.distinctID,C=this.get_distinct_id(),P=this.persistence.get_property(Tr);if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&P==="anonymous")this.identify(k);else if(n.bootstrap.isIdentifiedID&&C!=null&&C!==k&&P==="identified")he.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const T=this.config.get_device_id(Si()),M=n.bootstrap.isIdentifiedID?T:k;this.persistence.set_property(Tr,n.bootstrap.isIdentifiedID?im:$o),this.register({distinct_id:k,$device_id:M})}}if(w)this.register_once({distinct_id:xy,$device_id:null},"");else if(!this.get_distinct_id()){const k=this.config.get_device_id(Si());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Tr,$o)}return xt(ae,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),xt(ae,"pageshow",k=>{if(this.ph=!1,!this.gh){var C;if(k.persisted&&this.persistence){const P=this.persistence.get_property(Zs),T=this.persistence.get_property(Tr);this.persistence.load(),this.Dh()||P===this.persistence.get_property("distinct_id")&&T===this.persistence.get_property("$user_state")||this.Lh()}(C=this.Ph)===null||C===void 0||C.resume()}}),n.segment?w8(this,()=>this.Nh()):this.Nh(),kn(this.config._onCapture)&&this.config._onCapture!==rh&&(he.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",k=>this.config._onCapture(k.event,k))),this.config.ip&&he.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 PR.apply(this,arguments)})().then(k=>{k&&this.register({[wy]:k})}).catch(rh),this}qh(e){const n=e;return st(n.name)&&kn(n.setup)}jh(e,n){var r=this;this.qh(e)?n.push(Bt(function*(){try{yield e.setup(r.Bh())}catch(i){he.error(`Failed to set up extension "${e.name}"`,i);try{var s;yield(s=e.dispose)===null||s===void 0?void 0:s.call(e)}catch(o){he.error(`Failed to dispose extension "${e.name}"`,o)}}})):this.eh.push(e)}Ah(){var e,n,r,s=this;const i=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=Sa.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var o,l,u;if(i)if(this.featureFlags&&this.featureFlags instanceof i||((o=this.zh)===null||o===void 0||o.call(this),this.zh=void 0,this.featureFlags=new i(this)),kn(this.featureFlags.onReloading)&&kn(this.featureFlags.setup)){if(!this.zh){this.zh=this.featureFlags.onReloading(()=>{this.ur.emit("featureFlagsReloading",!0)});const d=this.featureFlags;Bt(function*(){try{yield d.setup(s.Bh())}catch(f){he.error("Failed to set up feature flags",f);const h=s.zh;s.zh=void 0;try{h==null||h()}catch(m){he.error("Failed to unsubscribe feature flag reloading",m)}try{yield d.dispose()}catch(m){he.error("Failed to dispose feature flags",m)}}})()}}else(l=(u=this.featureFlags).initialize)===null||l===void 0||l.call(u)}Oh(e){const n=performance.now(),r=$($({},Sa.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,u,d,f,h,m;r.exceptions&&this.eh.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.eh.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.eh.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.eh.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.eh.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.jh(this.autocapture=new r.autocapture(this),s),r.surveys&&this.jh(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.jh(this.logs=(l=this.logs)!==null&&l!==void 0?l:new r.logs(this),s),r.metrics&&this.eh.push(this.metrics=(u=this.metrics)!==null&&u!==void 0?u:new r.metrics(this)),r.conversations&&this.eh.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.eh.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.eh.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.eh.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.eh.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.eh.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,HF)),r.toolbar&&this.eh.push(this.toolbar=(f=this.toolbar)!==null&&f!==void 0?f:new r.toolbar(this)),r.experiments&&this.eh.push(this.experiments=(h=this.experiments)!==null&&h!==void 0?h:new r.experiments(this)),r.webMCP&&this.eh.push(this.webMCP=(m=this.webMCP)!==null&&m!==void 0?m:new r.webMCP(this)),this.eh.forEach(v=>{v.initialize&&s.push(()=>{var x;(x=v.initialize)===null||x===void 0||x.call(v)})}),s.push(()=>{if(this.Hh){const v=this.Hh;this.Hh=void 0,this.eh.forEach(x=>{var _;return(_=x.onRemoteConfig)===null||_===void 0?void 0:_.call(x,v)})}}),this.Uh(s,n)}Uh(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void(this.Fh=setTimeout(()=>{this.Fh=void 0,this.Uh(e,n)},0));const s=e.shift();if(s)try{s()}catch(i){he.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[AT]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[TT]:r}),this.config.__preview_deferred_init_extensions&&he.info(`PostHog extensions initialized (${r}ms)`)}Gu(e){if(!Ee||!Ee.body)return he.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Gu(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Hh=e),this.cr=e,this.compression=void 0,e.ok){var n;const r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Be(r.supportedCompression,Ss.GZipJS)?Ss.GZipJS:Be(r.supportedCompression,Ss.Base64)?Ss.Base64:void 0),!((n=r.analytics)===null||n===void 0)&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.xh?this.xh:jT}),this.ur.emit("extensionsRemoteConfig",e),this.eh.forEach(r=>{var s;return(s=r.onRemoteConfig)===null||s===void 0?void 0:s.call(r,e)})}Nh(){try{this.config.loaded(this)}catch(e){he.critical("`loaded` function failed",e)}if(this.Wh(),this.config.internal_or_test_user_hostname&&(zt==null?void 0:zt.hostname)){const e=zt.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.nh())&&this.Vh()},1),this.Gh=new cR(this),this.Gh.load()}Wh(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Mh)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&Tu(this.__request_queue,e=>this.Eh(e)),this.__request_queue=[],this.Wh()}_handle_unload(){var e,n,r,s,i,o;this.ph=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(r=this.metrics)===null||r===void 0||r.flush("sendBeacon"),this.config.request_batching?(this.Qh()&&this.capture(n8),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.Mh)===null||i===void 0||i.unload(),(o=this.Ph)===null||o===void 0||o.unload()):this.Qh()&&this.capture(n8,null,{transport:"sendBeacon"})}_send_request(e){ER(this,e)}Eh(e,n){this.Ph?this.Ph.retriableRequest(e,n):this._send_request(n?$($({},e),{},{transport:n}):e)}_execute_array(e){Hy++;try{let n;const r=[],s=[],i=[];Tu(e,l=>{if(l)if(n=l[0],ze(n))i.push(l);else if(kn(l))try{l.call(this)}catch(u){he.error("Error executing queued PostHog call",l,u)}else ze(l)&&n==="alias"?r.push(l):ze(l)&&n.indexOf("capture")!==-1&&kn(this[n])?i.push(l):s.push(l)});const o=function(l,u){Tu(l,function(d){try{if(ze(d[0])){let f=u;Rt(d,function(h){f=f[h[0]].apply(f,h.slice(1))})}else u[d[0]].apply(u,d.slice(1))}catch(f){he.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{Hy--}}push(e){if(Hy>0&&ze(e)&&st(e[0])){const n=Sa.prototype[e[0]];return void(kn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get Zh(){return{property:e8,persistenceKey:$u,cookieName:"_fbc",pattern:F8,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[$u]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister($u)}}}get Jh(){return{property:t8,persistenceKey:Yf,cookieName:"_fbp",pattern:V8,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Yf]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Yf)}}}Kh(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return st(r)&&e.pattern.test(r)?{value:r,delivered:!1}:rt(r)&&st(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}Xh(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}Yh(e){if(!this.config.save_campaign_params||this.nh())return;const n=Qf(e.cookieName);return st(n)&&e.pattern.test(n)?n:void 0}td(e,n,r,s){if(!this.persistence)return;const i=this.Zh;this.persistence.refreshMetaIdentifiers();const o=this.Kh(i);if(s)return void i.unregister();if(r)return st(n)&&F8.test(n)?this.Xh(i,n,o):void i.unregister();const l=st(e)&&TV.test(e)?e:void 0,u=this.Yh(i);return u&&((d,f,h)=>{const m=d.split(".");if(f)return m[3]===f;if(!h)return!0;const v=h.value.split(".");return m[3]===v[3]||Number(m[2])>Number(v[2])})(u,l,o)?this.Xh(i,u,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.Xh(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}ed(e,n,r){if(!this.persistence)return;const s=this.Jh;this.persistence.refreshMetaIdentifiers();const i=this.Kh(s);if(r)return void s.unregister();if(n)return st(e)&&V8.test(e)?this.Xh(s,e,i):void s.unregister();const o=this.Yh(s);return o?this.Xh(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}nd(e,n){if(!this.persistence)return;this.persistence.refreshMetaIdentifiers();const r=this.Kh(e);(r==null?void 0:r.value)!==n||r.delivered||e.register(n,!0)}capture(e,n,r){var s,i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mh))return void he.uninitializedWarning("posthog.capture");if(!this.is_capturing())return void he.info(`Event "${e}" was not captured because capturing is disabled (opted out or consent pending).`);if(le(e)||!st(e))return void he.error("No event name provided to posthog.capture");if(this.ah(),e==="$snapshot"&&this.nh())return;const o=!this.config.opt_out_useragent_filter&&this._is_bot();if(o&&!this.config.__preview_capture_bot_pageviews)return void he.info(`Event "${e}" was not captured because the user agent looks like a bot. Set \`opt_out_useragent_filter: true\` to capture it.`);const l=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(l!=null&&l.isRateLimited)return void he.critical("This capture call is ignored due to client rate limiting.");let u;n!=null&&n.$current_url&&!st(n==null?void 0:n.$current_url)&&(he.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.sd||he.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(u=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const d=new Date,f=(r==null?void 0:r.timestamp)||d,h=Lk(r==null?void 0:r.uuid,Si);let m={uuid:h,event:e,properties:this.calculateEventProperties(e,n||{},f,h)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(m.event="$bot_pageview",m.properties.$browser_type="bot"),l&&(m.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens);const v=e==="$feature_flag_called"&&m.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!v&&(m.$set=r==null?void 0:r.$set);const x=rt(n==null?void 0:n.$set)?n.$set:void 0,_=ze(n==null?void 0:n.$unset)?n.$unset:[],w=(r==null?void 0:r.$unset)||[],b=W=>{var G;const H=!!(r!=null&&r.$set)&&W in r.$set;return{hasProvided:H||!!x&&W in x,provided:H?r==null||(G=r.$set)===null||G===void 0?void 0:G[W]:x==null?void 0:x[W],unset:_.indexOf(W)!==-1||w.indexOf(W)!==-1}},k=b(e8),C=b(t8),P=[{channel:this.Zh,hasProvided:k.hasProvided,update:this.td(u==null?void 0:u.fbclid,k.provided,k.hasProvided,k.unset)},{channel:this.Jh,hasProvided:C.hasProvided,update:this.ed(C.provided,C.hasProvided,C.unset)}];for(const{channel:W,hasProvided:G,update:H}of P)H&&m.properties.$process_person_profile===!0&&H.pending&&!G&&!v&&(m.$set=$({[W.property]:H.value},m.$set));const T=r==null?void 0:r.$unset;T&&(m.$unset=T);const M=v?void 0:this.rd(r==null?void 0:r.$set_once,e!==r8,e===$T);if(M&&(m.$set_once=M),r!=null&&r._noTruncate||(I=this.config.properties_string_max_length,m=(function(W,G){const H=new Set;return(function J(B,Q){if(B!==Object(B))return G?G(B):B;if(H.has(B))return;let z;if(H.add(B),ze(B))z=[],Tu(B,N=>{z.push(J(N))});else{const N={};Rt(Pd(B)?FT(B):B,(Y,oe)=>{H.has(Y)||(N[oe]=J(Y))}),z=N}return z})(W)})(m,W=>st(W)?W.slice(0,I):W)),m.timestamp=f,le(r==null?void 0:r.timestamp)||(m.properties.$event_time_override_provided=!0,m.properties.$event_time_override_system_time=d),v&&(m.properties=((W,G=[])=>{const H={},J=B=>{W[B]!==void 0&&(H[B]=W[B])};return p$.forEach(J),G.forEach(J),H})(m.properties,RV)),e===bs.DISMISSED||e===bs.SENT){const W=n==null?void 0:n[My.SURVEY_ID],G=n==null?void 0:n[My.SURVEY_ITERATION];IR({id:W,current_iteration:G}),m.$set=$($({},m.$set),{},{[hV({id:W,current_iteration:G},e===bs.SENT?"responded":"dismissed")]:!0})}else e===bs.SHOWN&&(m.$set=$($({},m.$set),{},{[My.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var I;if(e===XF.SHOWN){const W=n==null?void 0:n[k8.TOUR_TYPE];W&&(m.$set=$($({},m.$set),{},{[`${k8.TOUR_LAST_SEEN_DATE}/${W}`]:new Date().toISOString()}))}const R=$($({},m.properties.$set),m.$set);if(ns(R)||this.setPersonPropertiesForFlags(R),!Qe(this.config.before_send)){const W=this.Os(m);if(!W)return;m=W,m.uuid=Lk(m.uuid,Si)}this.sessionRecording&&!this.wh&&$8(e)&&(this.wh=!0,setTimeout(()=>this.wh=!1,3e4));const L=P.filter(({channel:W,update:G})=>{var H,J,B;const Q=(H=(J=m.$set)===null||J===void 0?void 0:J[W.property])!==null&&H!==void 0?H:rt((B=m.properties)===null||B===void 0?void 0:B.$set)?m.properties.$set[W.property]:void 0;return(G==null?void 0:G.pending)&&Q===G.value});this.ur.emit("eventCaptured",m);const j=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),F=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(j),D=$($($({method:"POST",url:j,data:m,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:F?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},F&&(!((i=m.properties)===null||i===void 0)&&i.$session_id)?{batchGroup:m.properties.$session_id+(m.properties.$window_id?`-${m.properties.$window_id}`:"")}:{}),r!=null&&r.transport?{transport:r.transport}:{}),L.length?{fireCallbackOnDrop:!0,callback:W=>{if(W.statusCode>=200&&300>W.statusCode)for(const{channel:G,update:H}of L)this.nd(G,H.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly){var q;let W;!D.transport&&!D.callback&&ns((q=this.config.request_headers)!==null&&q!==void 0?q:{})&&this.ph&&(W="sendBeacon"),this.Eh(D,W)}else this.Mh.enqueue(D);return m}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.od)===null||n===void 0?void 0:n.getExtension(e)}Bh(){var e;return(e=this.od)!==null&&e!==void 0?e:this.od=new CV(this)}dr(e){this._h.push(e);let n=!0;return()=>{if(!n)return;n=!1;const r=this._h.indexOf(e);r!==-1&&this._h.splice(r,1)}}Dh(e=!0){var n;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Lh(e),!0)}Lh(e=!0){var n,r,s;this.$h=null,((n=this.persistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="anonymous"&&((s=this.sessionPersistence)===null||s===void 0||s.clear(),this.yh.clear(),this.ad()),(r=this.featureFlags)===null||r===void 0||r.reset(),e&&this.reloadFeatureFlags()}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.ah(),this.persistence.syncCookieProperties(),this.Dh();const o=i?void 0:this.persistence.remove_event_timer(e);let l=$({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults==="latest"?IV:this.config.defaults,this.nh()&&(l[PT]=!0),e==="$snapshot"){const k=$($({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=k.distinct_id,(!st(l.distinct_id)&&!Pn(l.distinct_id)||qf(l.distinct_id))&&he.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const u=(function(k,C,P,T=!1){var M,I,R,L;if(!Hr)return{};const j=k?[...cd,...C||[]]:[],[F,D]=W5(Hr),[q,W]=(function(ne){for(let ie=0;Ok.length>ie;ie++){const[de,ge,ce]=Ok[ie],re=ne.match(de);if(re){const Ce=ce&&ne.match(ce)||re;return[ge,(Ce==null?void 0:Ce[1])||""]}}return["",""]})(Hr),G=(function(){const ne="u">typeof navigator?navigator:void 0;return ne!=null&&ne.brave?{brave:!0}:{}})(),H={};le(P)||(H.detectGoogleSearchApp=P);const J={},B=(M=navigator)===null||M===void 0||(M=M.userAgentData)===null||M===void 0?void 0:M.platform,Q=(I=navigator)===null||I===void 0?void 0:I.maxTouchPoints,z=ae==null||(R=ae.screen)===null||R===void 0?void 0:R.width,N=ae==null||(L=ae.screen)===null||L===void 0?void 0:L.height,Y=ae==null?void 0:ae.devicePixelRatio;le(B)||(J.userAgentDataPlatform=B),le(Q)||(J.maxTouchPoints=Q),le(z)||(J.screenWidth=z),le(N)||(J.screenHeight=N),le(Y)||(J.devicePixelRatio=Y);const oe=en(Yx({$os:F,$os_version:D,$browser:B5(Hr,navigator.vendor,G,H),$webview_app:q,$webview_app_version:W,$device:Z5(Hr),$device_type:D7(Hr,J),$timezone:XT(),$timezone_offset:GF()}),{$current_url:wh(T?qa(zt==null?void 0:zt.href):zt==null?void 0:zt.href,j,xh),$host:zt==null?void 0:zt.host,$pathname:zt==null?void 0:zt.pathname,$raw_user_agent:Hr.length>1e3?Hr.substring(0,997)+"...":Hr,$browser_version:N7(Hr,navigator.vendor,G,H),$browser_language:sR(),$browser_language_prefix:qF(),$screen_height:ae==null?void 0:ae.screen.height,$screen_width:ae==null?void 0:ae.screen.width,$viewport_height:ae==null?void 0:ae.innerHeight,$viewport_width:ae==null?void 0:ae.innerWidth,$lib:Vo.LIB_NAME,$lib_version:Vo.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Vo.SDK_DIST_CHANNEL&&(oe.$sdk_dist_channel=Vo.SDK_DIST_CHANNEL),oe})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){const{sessionId:k,windowId:C}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);l.$session_id=k,l.$window_id=C}this.sessionPropsManager&&en(l,this.sessionPropsManager.getSessionProps());try{var d;if(this.sessionRecording){const k=this.sessionRecording.sdkDebugProperties,C=!this.wh&&$8(e);for(const P in k)(C||Be(PV,P))&&(l[P]=k[P])}l.$sdk_debug_retry_queue_size=(d=this.Ph)===null||d===void 0?void 0:d.length}catch(k){l.$sdk_debug_error_capturing_properties=String(k)}let f;if(this.requestRouter.region===L2&&(l.$lib_custom_api_host=this.config.api_host),f=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),l=en(l,f),e==="$pageview"&&Ee&&(l.title=Ee.title),!le(o)){const k=r.getTime()-o;l.$duration=parseFloat((k/1e3).toFixed(3))}Hr&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const h=this.persistence.properties(),m=this.sessionPersistence.properties(),v=l.$groups,x=h.$groups;rt(v)&&!ns(v)&&(l.$groups=$($({},rt(x)?x:{}),v)),Rt(["$referrer","$referring_domain"],k=>{k in h&&delete m[k]});const _={};if(this._h.length>0)for(const k of this._h.slice())try{en(_,k())}catch(C){he.error("Failed to produce browser extension event properties",C)}l=en({},u,h,m,$($({},_),l)),l.$is_identified=this._isIdentified(),ze(this.config.property_denylist)?Rt(this.config.property_denylist,function(k){delete l[k]}):he.error(DR+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const w=this.config.sanitize_properties;w&&(he.error(j8),l=w(l,e));const b=this.ld();return l.$process_person_profile=b,b&&!i&&this.ud("_calculate_event_properties"),l}rd(e,n=!0,r=!1){var s;if(!this.persistence||!this.ld()||this.mh&&!r)return e;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let l=en({},i,o||{},e||{});const u=this.config.sanitize_properties;return u&&(he.error(j8),l=u(l,"$set_once")),n&&(this.mh=!0),ns(l)?void 0:l}register(e,n){var r;(r=this.persistence)===null||r===void 0||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)===null||s===void 0||s.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.Dh(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.yh.add(s)),this.ad()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.yh.delete(e),this.ad()}hd(e,n){this.register({[e]:n})}Rh(){this.yh.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.yh.clear(),this.ad()}ad(){var e;if(!this.bh)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.hi||!Ut.Et())return void Ut.Pt(this.bh);const n=[];this.yh.forEach(r=>n.push(r)),n.length>0?Ut.At(this.bh,n):Ut.Pt(this.bh)}getFeatureFlag(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.ur.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:mu}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:mu})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:mu})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:mu}),()=>{})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=yV){var r;(r=this.surveys)===null||r===void 0||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:mu}}canRenderSurveyAsync(e,n=!1){var r,s;return(r=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:mu})}dd(e){return!e||qf(e)?(he.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(he.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())||(he.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 he.uninitializedWarning("posthog.identify");if(Pn(e)&&(e=e.toString(),he.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.dd(e)||!this.ud("posthog.identify"))return;this.ah();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.Dh(!1),l=this.persistence.ku();let u=!1;try{const f=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:f},""),e!==f&&e!==this.get_property("__alias")&&(this.unregister(Um),this.register({distinct_id:e}));const h=(this.persistence.get_property("$user_state")||"anonymous")===$o,m=e!==f,v=!m&&h;if(m&&h){var d;const x=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(Tr,im),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Su(),this.capture("$identify",x,{$set:n||{},$set_once:r||{}})&&(this.$h=jy(e,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:f)}else if(v){this.persistence.set_property(Tr,im);const x=n||{},_=r||{};this.setPersonPropertiesForFlags({$set:x,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.Su(),this.capture("$set",{$set:x,$set_once:_})&&(this.$h=jy(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);m||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(jo)):v&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{l&&this.persistence.Cu(u)}}setPersonProperties(e,n){if(!e&&!n||!this.ud("posthog.setPersonProperties"))return;const r=jy(this.get_distinct_id(),e,n);this.$h!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.$h=r)):he.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(ze(e)?e:[e]).filter(s=>st(s)&&s.length>0);r.length!==0&&this.ud("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.$h=null)}group(e,n,r){var s;if(!e||!n)return void he.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.Dh();const i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:$($({},i),{},{[e]:n})}),(o||r)&&this.ld()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(r8,l)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var r;(r=this.featureFlags)===null||r===void 0||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var r;this.ud("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)===null||r===void 0||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=zr(e)?e:e==null?void 0:e.resetDeviceID,r=zr(e)||e==null?void 0:e.bootstrap;this.vd(n,!1,r)}vd(e,n=!1,r){var s,i,o,l,u,d;if(he.info("reset"),!this.__loaded)return he.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Th)===null||s===void 0?void 0:s.bootstrap)||{},(i=this.featureFlags)===null||i===void 0||(o=i.updateConfig)===null||o===void 0||o.call(i,this.config,this.Qu());const h=this.get_property(Ux),m=this.get_property(wy),v=this.get_property(Xf);(l=this.sessionRecording)===null||l===void 0||l.flushBeforeIdentityReset();const x=this.is_capturing();n||this.consent.reset(),n||!x||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const _=(u=this.persistence)===null||u===void 0||(d=u.ku)===null||d===void 0?void 0:d.call(u),w=this.uh;this.uh=w||n;let b=!1;try{var k,C,P,T,M,I,R,L,j,F,D,q,W;if((k=this.persistence)===null||k===void 0||k.clear(),(C=this.sessionPersistence)===null||C===void 0||C.clear(),this.yh.clear(),this.ad(),le(v)||(F=this.persistence)===null||F===void 0||F.register({$session_recording_remote_config:v}),(P=this.surveys)===null||P===void 0||P.reset(),(T=this.featureFlags)===null||T===void 0||T.reset(),(M=this.conversations)===null||M===void 0||M.reset(),(I=this.logs)===null||I===void 0||I.reset(),(R=this.metrics)===null||R===void 0||R.reset(),(L=this.persistence)===null||L===void 0||L.set_property("$user_state","anonymous"),(j=this.sessionManager)===null||j===void 0||j.resetSessionId(),this.$h=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:xy,$device_id:null},"");else{const B=this.config.get_device_id(Si());this.register_once({distinct_id:B,$device_id:e?B:h},""),e||le(m)||this.register({[wy]:m})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this.nh()&&((W=this.persistence)===null||W===void 0||W.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),(D=this.featureFlags)===null||D===void 0||D.initialize(),!Qe(f)&&!(!((q=this.sessionManager)===null||q===void 0)&&q.setBootstrapSessionId(f,!0)))){const B=$({},r);delete B.sessionID,this.config.bootstrap=B}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,b=!0}finally{var G,H;this.uh=w,_&&((G=this.persistence)===null||G===void 0||(H=G.Cu)===null||H===void 0||H.call(G,b))}var J;this.cr&&((J=this.conversations)===null||J===void 0||J.onRemoteConfig(this.cr)),this.reloadFeatureFlags()}shutdown(e){var n=this;return Bt(function*(){if(!n.__loaded)return void he.uninitializedWarning("posthog.shutdown");n.gh=!0,clearTimeout(n.Fh),n.Fh=void 0;const r=n.zh;n.zh=void 0;for(const s of[()=>{var i;return(i=n.sessionRecording)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.logs)===null||i===void 0?void 0:i.flushLogs("sendBeacon")},()=>{var i;return(i=n.metrics)===null||i===void 0?void 0:i.flush("sendBeacon")},()=>{var i;return(i=n.metrics)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.logs)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.surveys)===null||i===void 0?void 0:i.dispose()},()=>{var i;return(i=n.autocapture)===null||i===void 0?void 0:i.dispose()},()=>r==null?void 0:r(),()=>{var i;return(i=n.Mh)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.Ph)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.featureFlags)===null||i===void 0?void 0:i.destroy()},()=>{var i;return(i=n.persistence)===null||i===void 0?void 0:i.destroy()},()=>{var i;return(i=n.sessionPersistence)===null||i===void 0?void 0:i.destroy()}])try{const i=s();i&&kn(i.then)&&i.then(void 0,o=>{he.error("Error during shutdown",o)})}catch(i){he.error("Error during shutdown",i)}})()}setIdentity(e,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)===null||r===void 0||r.fd()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e.pd()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e!=null&&e.withTimestamp&&r){var i;const o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+=`?t=${Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}`}return s}alias(e,n){return e===this.get_property("$people_distinct_id")?(he.critical("Attempting to create alias for existing People user - aborting."),-2):this.ud("posthog.alias")?(le(n)&&(n=this.get_distinct_id()),e!==n?(this.hd(Um,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(he.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=$({},this.config);if(rt(e)){var r,s,i,o,l,u,d,f,h,m,v,x,_,w;en(this.config,H8(e));const T=this.fh();if(this.persistence){const I=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var b,k;if(I&&this.sessionPersistence!==this.persistence&&((b=this.sessionPersistence)===null||b===void 0||b.remove(),(k=this.sessionPersistence)===null||k===void 0||k.destroy()),this.persistence.update_config(this.config,n,T),I)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new Ry($($({},this.config),{},{persistence:"sessionStorage"}),T,!1);else{var C;(C=this.sessionPersistence)===null||C===void 0||C.update_config($($({},this.config),{},{persistence:"sessionStorage"}),$($({},n),{},{persistence:"sessionStorage"}),T)}}const M=this.Ch(this.config.debug);var P;zr(M)&&(this.config.debug=M),zr(this.config.debug)&&(this.config.debug?(es.DEBUG=!0,vt.Et()&&vt.At("ph_debug",!0),he.info("set_config",{config:e,oldConfig:n,newConfig:$({},this.config)})):(es.DEBUG=!1,vt.Et()&&vt.Pt("ph_debug"))),(r=this.featureFlags)===null||r===void 0||(s=r.updateConfig)===null||s===void 0||s.call(r,this.config,this.Qu()),(i=this.exceptionObserver)===null||i===void 0||i.onConfigChange(),(o=this.exceptions)===null||o===void 0||o.onConfigChange(),(l=this.metrics)===null||l===void 0||l.onConfigChange(),(u=this.webMCP)===null||u===void 0||u.startIfEnabled(),(d=this.sessionRecording)===null||d===void 0||d.startIfEnabledOrStop(),(f=this.tracingHeaders)===null||f===void 0||f.startIfEnabledOrStop(),(h=this.autocapture)===null||h===void 0||h.startIfEnabled(),(m=this.heatmaps)===null||m===void 0||m.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((P=this.historyAutocapture)===null||P===void 0||P.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(x=this.deadClicksAutocapture)===null||x===void 0||x.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.hh(),(w=this.externalIntegrations)===null||w===void 0||w.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&w8(this,rh,!1)}}_overrideSDKInfo(e,n){es.LIB_NAME=e,es.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,r={sampling:n||!!(e!=null&&e.sampling),linked_flag:n||!!(e!=null&&e.linked_flag),url_trigger:n||!!(e!=null&&e.url_trigger),event_trigger:n||!!(e!=null&&e.event_trigger)};var s,i,o,l,u;Object.values(r).some(Boolean)&&((s=this.sessionManager)===null||s===void 0||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)===null||i===void 0||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((u=this.sessionRecording)===null||u===void 0||u.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(!((e=this.sessionRecording)===null||e===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent($($({},r),n))}catch{return}}addExceptionStep(e,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:Sa.gd}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)===null||r===void 0?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:Vf;return n!==Vf&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}ld(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ns(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}Qh(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.ld()||this.ud("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ud("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ud(e){return this.config.person_profiles==="never"?(he.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.sh(),this.hd(Zx,!0),!0)}fh(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}hh(){var e,n;const r=this.fh();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.md(),((e=this.persistence)===null||e===void 0?void 0:e.hi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.hi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),this.ad(),r}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.nh()){var r,s,i,o,l,u;(r=this.sessionRecording)===null||r===void 0||r.dispose({discardBufferedEvents:!0}),this.vd(!0,!0),(s=this.sessionManager)===null||s===void 0||s.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=new O8(this),this.pageViewManager=new x8(this),this.persistence&&(this.sessionPropsManager=new I8(this,this.sessionManager,this.persistence));const x=(o=(l=this.config.__extensionClasses)===null||l===void 0?void 0:l.sessionRecording)!==null&&o!==void 0?o:(u=Sa.__defaultExtensionClasses)===null||u===void 0?void 0:u.sessionRecording;var d,f;x&&(this.sessionRecording=this.ih(this.sessionRecording,new x(this)),this.cr&&((d=this.sessionRecording)===null||d===void 0||(f=d.onRemoteConfig)===null||f===void 0||f.call(d,this.cr)))}var h,m,v;this.consent.optInOut(!0),this.hh(),this.Wh(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((h=this.surveys)===null||h===void 0||h.loadIfEnabled(),(m=this.conversations)===null||m===void 0||m.loadIfEnabled()),(le(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((v=e==null?void 0:e.captureEventName)!==null&&v!==void 0?v:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vh()}else he.warn(D8)}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.hh(),this.config.cookieless_mode==="on_reject"&&this.dh()):he.warn(D8)}dh(){var e,n;const r=this.sessionRecording;r==null||r.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.vd(!0,!0),this.register({distinct_id:xy,$device_id:null}),this.th(r),this.sessionRecording=void 0,(e=this.sessionManager)===null||e===void 0||e.destroy(),(n=this.pageViewManager)===null||n===void 0||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vh(),this.Wh()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return!this.uh&&(this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))}clear_opt_in_out_capturing(){this.consent.reset(),this.hh()}_is_bot(){return mr?CR(mr,this.config.custom_blocked_useragents):void 0}Vh(){Ee&&(Ee.visibilityState==="visible"?this.kh||(this.kh=!0,this.capture(Kx,{title:Ee.title},{send_instantly:!0}),this.Sh&&(Ee.removeEventListener(ju,this.Sh),this.Sh=null)):this.Sh||(this.Sh=this.Vh.bind(this),xt(Ee,ju,this.Sh)))}debug(e){e===!1?(ae==null||ae.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ae==null||ae.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}))}Qu(){const e=this.Th||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(he.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,r,s,i,o){const l=r in n&&!Qe(n[r]),u=s in n&&!Qe(n[s]);return l?n[r]:!!u&&(o&&o.warn(`Config field '${s}' is deprecated. Please use '${r}' instead. The old field will be removed in a future major version.`),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,he)}Os(e){var n;if(Qe(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(k7),s=ze(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=e;for(const o of s)try{if(i=o(i),Qe(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return S7(e.event)?he.warn(`${l}. This can cause unexpected behavior.`):he.info(l),null}i.properties&&!ns(i.properties)||he.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return he.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&Qe(i.properties[o]))return he.warn(`Event '${e.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.Rl)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Ch(e){const n=zr(e)&&!e,r=vt.Et()&&vt.Ot("ph_debug")==="true";return!n&&(!!r||e)}};sh.__defaultExtensionClasses={},sh.gd=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=xF(t.prototype[e[n]])})(sh,["identify"]);var NV=class{constructor(t){this._instance=t}refresh(t){const e=this._instance.config,n=rt(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.Qu(),t.url_allowlist=n==null?void 0:n.url_allowlist,t.url_ignorelist=n==null?void 0:n.url_ignorelist,t.dom_event_allowlist=n==null?void 0:n.dom_event_allowlist,t.element_allowlist=n==null?void 0:n.element_allowlist,t.css_selector_allowlist=n==null?void 0:n.css_selector_allowlist,t.css_selector_ignorelist=n==null?void 0:n.css_selector_ignorelist,t.element_attribute_ignorelist=n==null?void 0:n.element_attribute_ignorelist,t.capture_copied_text=n==null?void 0:n.capture_copied_text}};const Rf=an("[ExceptionAutocapture]"),z8=()=>{},U8=t=>{var e;if(kn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function dd(t,e,n){try{if(!(e in t))return z8;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return kn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);let i=t[e],o=U8(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=U8(i)}}}catch{return z8}}const DV=an("[TracingHeaders]"),Nl=an("[Web Vitals]"),B8=9e5,W8=["CLS","FCP","INP","LCP"],jV=["INP","LCP"],$V=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Uy="disabled",Z8="lazy_loading",So=an("[SessionRecording]"),FV=[qx,Gx,RT,IT,MT,OT,LT,NT,DT],VV=an("[Heatmaps]");function By(t){return rt(t)&&"clientX"in t&&"clientY"in t&&Pn(t.clientX)&&Pn(t.clientY)}const C0=an("[Product Tours]"),Wy=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(Wx))},HV=["$set_once","$set"],Li=an("[SiteApps]"),q8="Error while initializing PostHog app with config id ";function gu(t,e,n){if(Qe(t))return!1;switch(n){case"exact":return t===e;case"contains":{const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var zV=class{constructor(t){this.Ai=t,this._o=new Set,this.wo=new Set,this.ko=new Gm,this.So=(e,n)=>this.xo(e,n)&&this.$o(e,n)&&this.Co(e,n)&&this.To(e,n),this.xo=(e,n)=>!(n!=null&&n.event)||(e==null?void 0:e.event)===(n==null?void 0:n.event)}init(){var t,e;le((t=this.Ai)===null||t===void 0?void 0:t.subscribeCapture)||(this.Io=(e=this.Ai)===null||e===void 0?void 0:e.subscribeCapture((n,r)=>{this.on(n,r)}))}dispose(){var t,e,n;(t=this.Io)===null||t===void 0||t.call(this),this.Io=void 0,(e=this.Ai)===null||e===void 0||(n=e.setElementSelectors)===null||n===void 0||n.call(e,new Set,this),this.ko=new Gm}register(t){var e,n;if(!le((e=this.Ai)===null||e===void 0?void 0:e.subscribeCapture)&&(t.forEach(r=>{var s;this._o.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.wo.add((i==null?void 0:i.event)||"")})}),(n=this.Ai)===null||n===void 0?void 0:n.setElementSelectors)){const r=new Set;this._o.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this.Ai.setElementSelectors(r,this)}}replace(t){this._o.clear(),this.wo.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.wo.has(t)||this.wo.has(e.event))&&this._o.forEach(n=>{this.Mo(e,n)&&this.ko.emit("actionCaptured",n.name)})}Eo(t){this.onAction("actionCaptured",e=>t(e))}Mo(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.So(t,n))return!0;return!1}onAction(t,e){return this.ko.on(t,e)}$o(t,e){if(e!=null&&e.url){var n;let i=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!(t!=null&&t.properties)||!("$current_url"in t.properties))try{var r,s;i=(r=this.Ai)===null||r===void 0||(s=r.getActionUrl)===null||s===void 0?void 0:s.call(r)}catch{return!1}if(!i||typeof i!="string"||!gu(i,e.url,e.url_matching||"contains"))return!1}return!0}Co(t,e){return!!this.Po(t,e)&&!!this.Ro(t,e)&&!!this.Ao(t,e)}Po(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.Fo(t);if(r.length>0)return r.some(i=>gu(i.href,e.href,e.href_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&gu((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}Ro(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.Fo(t);if(r.length>0)return r.some(u=>gu(u.text,e.text,e.text_matching||"exact")||gu(u.$el_text,e.text,e.text_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(u){const d=[],f=/(?::|")text="(.*?)"/g;let h;for(;!Qe(h=f.exec(u));)d.includes(h[1])||d.push(h[1]);return d})(s),o=e.text,l=e.text_matching||"exact",i.some(u=>gu(u,o,l)));var i,o,l}Ao(t,e){var n,r;if(!(e!=null&&e.selector))return!0;const s=t==null||(n=t.properties)===null||n===void 0?void 0:n.$element_selectors;if(s!=null&&s.includes(e.selector))return!0;const i=(t==null||(r=t.properties)===null||r===void 0?void 0:r.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch{}return!1}Fo(t){var e;return(t==null||(e=t.properties)===null||e===void 0?void 0:e.$elements)==null?[]:t==null?void 0:t.properties.$elements}To(t,e){return!(e!=null&&e.properties)||e.properties.length===0||RR(e.properties.reduce((n,r)=>{const s=ze(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),t==null?void 0:t.properties)}},UV=class{constructor(t,e){this.Oo=e,this.Do=[],this.Ai=t,this.Lo=new Map,this.No=new Map,this.qo=new Map}jo(){var t,e;this.Bo=(t=(e=this.Ai).subscribeSession)===null||t===void 0?void 0:t.call(e,n=>this.zo(n))}Ho(t){return!1}Uo(){return null}Wo(t){}Vo(){}Go(t,e){return!!t&&RR(t.propertyFilters,e==null?void 0:e.properties)}Qo(t,e){const n=new Map;return t.forEach(r=>{var s;(s=r.conditions)===null||s===void 0||(s=s[e])===null||s===void 0||(s=s.values)===null||s===void 0||s.forEach(i=>{if(i!=null&&i.name){const o=n.get(i.name)||[];o.push(r.id),n.set(i.name,o)}})}),n}Zo(t,e,n){const r=(n===Cf.Activation?this.Lo:this.No).get(t);let s=[];return this.Jo(i=>{s=i.filter(o=>r==null?void 0:r.includes(o.id))}),s.filter(i=>{var o;const l=(o=i.conditions)===null||o===void 0||(o=o[n])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(u=>u.name===t);return this.Go(l,e)})}register(t){this.Ko(t,!1)}replace(t){this.Ko(t,!0)}Ko(t,e){le(this.Ai.subscribeCapture)||(this.Xo(t,e),this.Yo(t,e))}Yo(t,e){const n=t.filter(i=>{var o;return(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var r;if(e&&this.qo.clear(),n.length===0)return void(e&&((r=this.ta)===null||r===void 0||r.replace([])));this.ta||(this.ta=new zV(this.Ai),this.ta.init(),this.ta.Eo(i=>this.onAction(i)));const s=[];n.forEach(i=>{var o;(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(l=>{if(s.push(l),l.name){var u;const d=(u=this.qo.get(l.name))!==null&&u!==void 0?u:[];d.includes(i.id)||d.push(i.id),this.qo.set(l.name,d)}})}),e?this.ta.replace(s):this.ta.register(s)}ea(t,e){e.forEach((n,r)=>{var s;const i=(s=t.get(r))!==null&&s!==void 0?s:[];n.forEach(o=>{i.includes(o)||i.push(o)}),t.set(r,i)})}Xo(t,e){var n,r,s;const i=t.filter(d=>{var f,h;return((f=d.conditions)===null||f===void 0?void 0:f.events)&&((h=d.conditions)===null||h===void 0||(h=h.events)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),o=t.filter(d=>{var f,h;return((f=d.conditions)===null||f===void 0?void 0:f.cancelEvents)&&((h=d.conditions)===null||h===void 0||(h=h.cancelEvents)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),l=this.Qo(t,Cf.Activation),u=this.Qo(t,Cf.Cancellation);e?(this.Lo=l,this.No=u):(this.ea(this.Lo,l),this.ea(this.No,u)),(i.length!==0||o.length!==0||t.some(d=>{var f;return(f=d.conditions)===null||f===void 0||(f=f.actions)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length}))&&((n=this.Io)!==null&&n!==void 0||(this.Io=(r=(s=this.Ai).subscribeCapture)===null||r===void 0?void 0:r.call(s,(d,f)=>{this.onEvent(d,f)})))}onEvent(t,e){var n,r;const s=this.ia(),i=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$survey_id)||(e==null||(r=e.properties)===null||r===void 0?void 0:r.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const l=this.na(t,i,e);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.sa([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.ra(i),void this.oa([i])}if(this.No.has(t)){const l=this.Zo(t,e,Cf.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(u=>u.id)}),this.sa(l.map(u=>u.id)),l.forEach(u=>this.aa(u.id)))}if(!this.Lo.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this.Lo.get(t)});const o=this.Zo(t,e,Cf.Activation);this.la(o.map(l=>l.id))}onAction(t){this.qo.has(t)&&this.la(this.qo.get(t)||[])}la(t){if(t.length===0)return;const e=!!this.Ai.getSessionId(),n=[];for(const r of t)e&&this.Ho(r)?this.ra(r)&&this.ua(r):n.push(r);n.length>0&&(this.Do=[...new Set([...this.Do,...n])]),this.ia().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.ca()}ra(t){this.Do=this.Do.filter(n=>n!==t);const e=this.ha();return!e.includes(t)&&(this.da([...e,t]),this.va(),!0)}sa(t){const e=new Set(t);this.Do=this.Do.filter(s=>!e.has(s));const n=this.fa(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.da(r),r.length===0&&this.pa()),this.oa(t),this.ca()}ca(){try{var t;(t=this.Oo)===null||t===void 0||t.call(this)}catch(e){this.ia().error("Error while handling activated items change",e)}}ga(){const t=this.Uo();if(!t)return{};const e=this.Ai.getProperty(t);return e&&typeof e=="object"?e:{}}ua(t){if(!this.Uo())return;const e=this.ga();this.Wo($($({},e),{},{[t]:Date.now()}))}oa(t){if(!this.Uo())return;const e=this.ga(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(ns(n)?this.Vo():this.Wo(n))}ma(){this.Uo()&&this.Vo()}getActivationTimestamp(t){if(!this.ha().includes(t))return;const e=this.ga()[t];return Pn(e)?e:void 0}fa(){const t=this.ya();return this.Ai.getProperty(t)||[]}ha(){const t=this.fa();if(t.length===0)return[];const e=this.Ai.getProperty(this.ba()),n=this.Ai.getSessionId();return n&&e===n?t:[]}va(){const t=this.Ai.getSessionId();t&&this._a(t)}pa(){this.wa()}zo(t){const e=this.Ai.getProperty(this.ba());if(e&&e!==t){const n=this.fa(),r=this.ga();n.length>0&&(this.da([]),n.filter(s=>Pn(r[s])).forEach(s=>this.aa(s))),this.pa(),this.ma(),n.length>0&&this.ca()}}getActivatedIds(){return[...new Set([...this.ha(),...this.Do])].filter(t=>!this.ka(t))}dispose(){var t,e,n;(t=this.Bo)===null||t===void 0||t.call(this),this.Bo=void 0,(e=this.Io)===null||e===void 0||e.call(this),this.Io=void 0,(n=this.ta)===null||n===void 0||n.dispose(),this.ta=void 0}reset(){this.Do=[],this.fa().length>0&&this.da([]),this.pa(),this.ma(),this.ca()}getEventToItemsMap(){return this.Lo}Sa(){return this.ta}},BV=class extends UV{constructor(t,e,n,r){var s;super({subscribeCapture(i){const o=t.onEvent(l=>i(l.event,l));return()=>o.dispose()},subscribeSession(i){const o=t.onSession(i);return()=>o.dispose()},getSessionId(){var i;return(i=t.session)===null||i===void 0?void 0:i.sessionId},getProperty:i=>t.kv.get(i),getActionUrl:n==null?void 0:n.getActionUrl,setElementSelectors:(s=n==null?void 0:n.setElementSelectors)!==null&&s!==void 0?s:(i,o)=>{var l;return(l=t.getExtension("autocapture"))===null||l===void 0?void 0:l.setElementSelectors(i,o)}},r),this.xa=t,this.$a=e,this.jo()}ya(){return g2}ba(){return rm}Uo(){return sm}Wo(t){this.xa.kv.set({[sm]:t})}Vo(){this.xa.kv.remove(sm)}Ho(t){var e;let n;this.Jo(s=>{n=s.find(i=>i.id===t)});const r=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return Pn(r)&&r>0}Ca(){return bs.SHOWN}Jo(t){this.$a.getSurveys(t)}aa(t){this.$a.cancelPendingSurvey(t)}ia(){return At}da(t){this.xa.kv.set({[g2]:t})}_a(t){this.xa.kv.set({[rm]:t})}wa(){this.xa.kv.remove(rm)}ka(){return!1}na(t,e,n){var r;if(t===bs.SENT&&(n==null||(r=n.properties)===null||r===void 0?void 0:r.$survey_completed)===!1)return"ignore";let s;return this.Jo(i=>{s=i.find(o=>o.id===e)}),!s||(function(i){var o;return AR(i)&&!!(!((o=i.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||i.schedule==="always"})(s)?t===bs.SHOWN?"consume":"ignore":t===bs.SHOWN?"persist":t===bs.DISMISSED||t===bs.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}};const sb=(t,e)=>t!=null&&t.then?t.then(e):e(t),vu="SDK is not enabled or survey functionality is not yet loaded",G8="Disabled. Not loading surveys.";var WV=class{constructor(t){this.Ta=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Ia=!1,this.Ma=!1,this.Ea=[],this.Pa=[],this.Ra=null,this.Aa=null,this.Ci=!1,this.Fa=new Set,this.onRemoteConfig=e=>{if(this.Ci||this.Ar.disableSurveys)return;if(!e.ok)return this.Ma=!0,this.Oa({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),At.warn("Remote config unavailable. Not loading surveys.");const n=e.config.surveys;if(Qe(n))return At.warn("Flags not loaded yet. Not loading surveys.");this.Da=zr(n)?n:n.length>0,At.info(`flags response received, isSurveysEnabled: ${this.Da}`),this.loadIfEnabled()},this.Oa=e=>{this.Pa.slice().forEach(n=>this.La(n,e))}}setup(t){if(!this.Ci)return this.Na=t,sb(t.kv.initialize(),()=>{if(this.Na!==t||this.Ci)return;this.Na=void 0,this.xa=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.Ci?e.dispose():(this.qa=e,this.loadIfEnabled())})}dispose(){var t,e,n,r,s;this.Ci||(this.Ci=!0,this.Na=void 0,this.xa=void 0,(t=this.qa)===null||t===void 0||t.dispose(),this.qa=void 0,(e=this._surveyEventReceiver)===null||e===void 0||e.dispose(),this._surveyEventReceiver=null,(n=this._surveyManager)===null||n===void 0||(r=n.dispose)===null||r===void 0||r.call(n),this._surveyManager=null,this.Ea=[],this.Pa.forEach(i=>{i.active=!1}),this.Pa=[],(s=this.ja)===null||s===void 0||s.call(this),this.ja=void 0,this.Ra=null,this.Fa.forEach(i=>clearTimeout(i)),this.Fa.clear())}get Ar(){return this.Ta.get()}getRenderContext(){if(!this.xa)return;const t=this;return{client:this.xa,get config(){return t.Ar},surveys:t}}initialize(){this.loadIfEnabled()}reset(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.clearInMemoryInProgressSurveyState)===null||e===void 0||e.call(t);try{var n;(n=this._surveyEventReceiver)===null||n===void 0||n.reset(),localStorage.removeItem("lastSeenSurveyDate");const r=[];for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);(i!=null&&i.startsWith("seenSurvey_")||i!=null&&i.startsWith("inProgressSurvey_"))&&r.push(i)}r.forEach(s=>localStorage.removeItem(s))}catch{}this.Oa()}loadIfEnabled(){if(this.Ci||!this.xa)return;const t=this.Ar;if(this._surveyManager)return;if(this.Ia)return void At.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void At.info(G8);if(t.cookielessMode&&this.xa.isOptedOut)return void At.info("Not loading surveys in cookieless mode without consent.");const e=this.Ta.getExtensions();if(!e)return void this.Ba("PostHog Extensions not found.");if(le(this.Da)&&!t.advancedEnableSurveys)return;const n=this.Da||t.advancedEnableSurveys;this.Ia=!0,this.Ma=!1;try{const r=e.generateSurveys;if(r)return this.za(r,n),void(this.Ia=!1);const s=e.loadExternalDependency;if(!s)return this.Ba(zx),void(this.Ia=!1);s(i=>{try{if(this.Ci)return;const o=this.Ta.getExtensions();i||!(o!=null&&o.generateSurveys)?this.Ba("Could not load surveys script",i):this.za(o.generateSurveys,n)}finally{this.Ia=!1}})}catch(r){throw this.Ia=!1,this.Ba("Error initializing surveys",r),r}}za(t,e){var n;if(this.Ci)return;this._surveyManager=t(e),this._surveyEventReceiver=this.Ha(this.xa,this.Oa);const r=(n=this.xa)===null||n===void 0?void 0:n.kv.get(Ff);r&&this.Ua(r),At.info("Surveys loaded successfully"),this.Wa(),this.Oa(),this.Va({isLoaded:!0})}Ha(t,e){return new BV(t,this,void 0,e)}Ba(t,e){this.Ma=!0,At.error(t,e),this.Oa({isLoaded:!1,error:t}),this.Va({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ea.push(t),this._surveyManager&&this.Va({isLoaded:!0}),()=>{this.Ea=this.Ea.filter(e=>e!==t)}}getSurveys(t,e=!1){if(this.Ci)return;const n=this.xa;if(!n)return t([],{isLoaded:!1,error:vu});if(this.Ar.disableSurveys)return At.info(G8),t([]);const r=n.kv.get(Ff);if(r&&!e)return t(r,{isLoaded:!0}),void(this.Ga()&&this.getSurveys(()=>{},!0));if(this.Ra)return void this.Ra.then(({surveys:o,context:l})=>{this.Ci||t(o,l)}).catch(o=>At.error("Error in survey callback",o));const s=n.sendRequest("/api/surveys/",{method:"GET",query:{token:n.projectToken},sentAt:"query",timeoutMs:this.Ar.requestTimeoutMs}).then(o=>{try{return this.Qa(n,o)}catch(l){return At.error("Error processing surveys response",l),this.Qa(n,{statusCode:0,error:l})}},o=>this.Qa(n,{statusCode:0,error:o}));this.Ra=s;const i=()=>{this.Ra===s&&(this.Ra=null)};s.then(o=>{i(),this.Ci||(this.Oa(o.context),t(o.surveys,o.context))},i).catch(o=>At.error("Error in survey callback",o))}Qa(t,e){if(this.Ci)return{surveys:[],context:{isLoaded:!1,error:vu}};const n=e.statusCode;if(n!==200||!e.json){const s=`Surveys API could not be loaded, status: ${n}`;return n!==0?At.error(s):e.error||At.warn(s),this.Aa=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Aa=null;const r=e.json.surveys||[];return t.kv.set({[Ff]:r,[zm]:Date.now()}),this.Ua(r),{surveys:r,context:{isLoaded:!0}}}Ua(t){const e=t.filter(n=>(function(r){return!(!r.start_date||r.end_date)})(n)&&(AR(n)||(function(r){var s;return!!(!((s=r.conditions)===null||s===void 0||(s=s.actions)===null||s===void 0||(s=s.values)===null||s===void 0)&&s.length)})(n)));this.Za(e)}Za(t){var e;(e=this._surveyEventReceiver)===null||e===void 0||e.replace(t)}Ga(){return this.Ja()&&!this.Ra&&!this.Ka()}Ja(){var t;const e=(t=this.xa)===null||t===void 0?void 0:t.kv.get(zm);return Pn(e)&&Date.now()-e>3e5}Ka(){return Pn(this.Aa)&&3e5>Date.now()-this.Aa}markSurveyAsSeen(t,e){var n;const r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};IR(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Oa()}Va(t){for(const e of this.Ea){if(this.Ci)return;try{t.isLoaded?this.getSurveys(e):e([],t)}catch(n){At.error("Error in survey callback",n)}}}getActiveMatchingSurveys(t,e=!1){if(!Qe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);At.warn("init was not called")}onActiveMatchingSurveysChanged(t){var e;if(this.Ci)return()=>{};const n={callback:t,active:!0,revision:0};this.Pa.push(n),this.Wa();const r=(e=this.xa)===null||e===void 0?void 0:e.kv.get(Ff);return this.Ar.disableSurveys||!this._surveyManager&&this.Ma&&!this.Ia||!r&&!Qe(this.Aa)&&!this.Ra?this.La(n,{isLoaded:!1}):this._surveyManager&&this.La(n),()=>{var s;n.active=!1,this.Pa=this.Pa.filter(i=>i!==n),this.Pa.length===0&&((s=this.ja)===null||s===void 0||s.call(this),this.ja=void 0)}}Wa(){var t,e,n;this._surveyManager&&this.Pa.length>0&&((t=this.ja)!==null&&t!==void 0||(this.ja=(e=(n=this.Ta).onMatchingConditionsChanged)===null||e===void 0?void 0:e.call(n,this.Oa)))}La(t,e){if(this.Ci||!t.active)return;const n=++t.revision,r=s=>{if(!this.Ci&&t.active&&n===t.revision)try{const i=e??{isLoaded:!0},o=JSON.stringify([s,i]);if(o===t.lastResult)return;t.lastResult=o,t.callback(s,i)}catch(i){At.error("Error in active matching surveys callback",i)}};try{e&&!e.isLoaded?r([]):this.getActiveMatchingSurveys(r)}catch(s){At.error("Error in active matching surveys callback",s)}}Xa(t){let e=null;return this.getSurveys(n=>{var r;e=(r=n.find(s=>s.id===t))!==null&&r!==void 0?r:null}),e}Ya(t){if(Qe(this._surveyManager))return{eligible:!1,reason:vu};const e=typeof t=="string"?this.Xa(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}tl(t){var e;if(!(!((e=this.xa)===null||e===void 0)&&e.canCapture))return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(Qe(this._surveyManager))return{eligible:!1,reason:vu};const n=typeof t=="string"?this.Xa(t):t;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Qe(this._surveyManager))return At.warn("init was not called"),{visible:!1,disabledReason:vu};const e=this.tl(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Qe(this._surveyManager)?(At.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:vu})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===t))!==null&&s!==void 0?s:null;if(i){const o=this.tl(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var r,s,i;if(!(!((r=this.xa)===null||r===void 0)&&r.canCapture))return;if(Qe(this._surveyManager))return void At.warn("init was not called");const o=typeof t=="string"?this.Xa(t):t;if(!(o!=null&&o.id))return void At.warn("Survey not found");if(!vV.includes(o.type))return void At.warn(`Surveys of type ${o.type} cannot be rendered in the app`);const l=(s=typeof document>"u"?void 0:document)===null||s===void 0?void 0:s.querySelector(e);if(l){if(!((i=o.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){At.info(`Rendering survey ${o.id} with delay of ${o.appearance.surveyPopupDelaySeconds} seconds`);const u=setTimeout(()=>{var d,f,h;this.Fa.delete(u),!this.Ci&&(!((d=this.xa)===null||d===void 0)&&d.canCapture)&&(At.info(`Rendering survey ${o.id} with delay of ${(f=o.appearance)===null||f===void 0?void 0:f.surveyPopupDelaySeconds} seconds`),(h=this._surveyManager)===null||h===void 0||h.renderSurvey(o,l,n),At.info(`Survey ${o.id} rendered`))},1e3*o.appearance.surveyPopupDelaySeconds);return void this.Fa.add(u)}this._surveyManager.renderSurvey(o,l,n)}else At.warn("Survey element not found")}displaySurvey(t,e){var n,r;if(!(!((n=this.xa)===null||n===void 0)&&n.canCapture))return;if(Qe(this._surveyManager))return void At.warn("init was not called");const s=this.Xa(t);if(!s)return void At.warn("Survey not found");let i=s;if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(i=$($({},s),{},{appearance:$($({},s.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==T2.Popover&&e.initialResponses&&At.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const o=this.Ya(s);if(!o.eligible)return void At.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==T2.Inline?this._surveyManager.handlePopoverSurvey(i,e):this.renderSurvey(i,e.selector,e.properties)}cancelPendingSurvey(t){Qe(this._surveyManager)?At.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.handlePageUnload)===null||e===void 0||e.call(t)}},ZV=class{constructor(t){this._instance=t}get(){var t,e,n,r;const s=(t=this._instance)===null||t===void 0?void 0:t.config;return{disableSurveys:!!(s!=null&&s.disable_surveys),cookielessMode:!!(s!=null&&s.cookieless_mode),advancedEnableSurveys:!!(s!=null&&s.advanced_enable_surveys),requestTimeoutMs:(e=s==null?void 0:s.surveys_request_timeout_ms)!==null&&e!==void 0?e:1e4,prefillFromUrl:!!(!(s==null||(n=s.surveys)===null||n===void 0)&&n.prefillFromUrl),automaticDisplay:!(s!=null&&s.disable_surveys_automatic_display),featureFlagEvaluation:!(s!=null&&s.advanced_disable_feature_flags),overrideLanguage:s==null?void 0:s.override_display_language,prepareStylesheet:s==null?void 0:s.prepare_external_dependency_stylesheet,get_current_url:s==null?void 0:s.get_current_url,uiHost:(r=this._instance)===null||r===void 0||(r=r.requestRouter)===null||r===void 0?void 0:r.endpointFor("ui","")}}getExtensions(){const t=qe==null?void 0:qe.__PosthogExtensions__;if(!t||!this._instance)return;const e=this._instance,{generateSurveys:n,loadExternalDependency:r}=t;return{generateSurveys:n?s=>n(e,s):void 0,loadExternalDependency:r?s=>r(e,"surveys",s):void 0}}onMatchingConditionsChanged(t){var e,n;const r=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook(l=>{l!=="$pageview"&&l!==bs.SHOWN&&l!==bs.DISMISSED&&l!==bs.SENT||t()}),s=()=>t();xt(ae,"PHSurveyShown",s);let i=!1;const o=(n=this._instance)===null||n===void 0?void 0:n.onFeatureFlags(()=>{i&&t()});return i=!0,()=>{i=!1,r==null||r(),o==null||o(),ae==null||ae.removeEventListener("PHSurveyShown",s)}}};const qV=ae!=null&&ae.location?Wm(ae.location.hash,"__posthog")||Wm(location.hash,"state"):null,K8="_postHogToolbarParams",Y8=an("[Toolbar]"),X8=an("[FeatureFlags]"),Dl=an("[FeatureFlags]",{debugEnabled:!0}),Zy=`" failed. Feature flags didn't load in time.`,GV=[502,504],Q8=["click","keydown","wheel","touchstart","pointerdown"],J8="connection_error",eE=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},tE=t=>{const e={};for(const[n,r]of om(t||{}))r&&(e[n]=r);return e};var KV=class{constructor(t){this.name="featureFlags",this.yd=!1,this.featureFlagEventHandlers=[],this.$=X8,this.bd={},this._d={},this.wd=[],this.kd=new Set,this.Sd=new Set,this.xd=!1,this.$d=!1,this.Cd=0,this.Td=!1,this.Id=!1,this.Md=!1,this.Ed=!1,this.Pd=!1,this.Rd=0,this.Ad=!1,this.rn=()=>{const e=this.Fd();this.Rd=0,e&&this.reloadFeatureFlags()},this.Od=()=>{var e,n;const r=this.Dd,s=(e=this.Ld)!==null&&e!==void 0?e:r;le(r)||le(s)||this.Ar.remoteRequestsDisabled||!this.Nd||this.Nd.visibilityState==="hidden"||Date.now()-((n=this.qd)!==null&&n!==void 0?n:0)<s||(this.Ld=this.Ad||!this.Ar.idleRefreshBackoff?r:Math.min(2*s,36e5),this.Ad=!1,this.reloadFeatureFlags(),this.jd())},this.Bd=()=>{this.Ad&&this.Ld===this.Dd||this.zd()},this.sn=()=>{var e;((e=this.Nd)===null||e===void 0?void 0:e.visibilityState)==="visible"&&this.zd()},this.Ta=t}get Hd(){}Ud(){this.xa&&this.Wd()}setup(t){try{this.Vd=typeof window>"u"?void 0:window,this.Nd=typeof document>"u"?void 0:document}catch{this.Vd=void 0,this.Nd=void 0}return this.Na=t,this.$=t.logger.createLogger("[FeatureFlags]"),sb(t.kv.initialize(),()=>{this.Na===t&&(this.Na=void 0,this.xa=t,this.Gd(t))})}Gd(t){var e;if(this.xa===t)return this.Vd&&xt(this.Vd,"online",this.rn),this.Wd(),this.Qd=t.registerDynamicEventProperties(()=>this.Zd()?this.bd:this._d),this.Jd=(e=this.Hd)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Kd(),this.Xd(),this.Yd()}),this.Xd(),this.initialize()}zd(){this.Ad=!0,this.Ld=this.Dd,this.Od()}Wd(){var t;const e=this.Ar.refreshIntervalMs,n=!this.Ar.remoteRequestsDisabled&&this.Nd&&!le(e)&&e>0?e:void 0;this.Ar.idleRefreshBackoff||(this.Ld=n),n!==this.Dd&&(this.tv(),le(n)||(this.Dd=n,this.Ld=n,this.jd(),!((t=this.Nd)===null||t===void 0)&&t.addEventListener&&(xt(this.Nd,ju,this.sn),Tu(Q8,r=>{xt(this.Nd,r,this.Bd,{capture:!0})}))))}jd(){le(this.Dd)||(le(this.ev)||clearInterval(this.ev),this.qd=Date.now(),this.ev=setInterval(this.Od,this.Dd))}tv(){var t,e;le(this.ev)||(clearInterval(this.ev),this.ev=void 0,(t=this.Nd)===null||t===void 0||(e=t.removeEventListener)===null||e===void 0||e.call(t,"visibilitychange",this.sn),Tu(Q8,n=>{var r,s;(r=this.Nd)===null||r===void 0||(s=r.removeEventListener)===null||s===void 0||s.call(r,n,this.Bd,{capture:!0})})),this.Dd=void 0,this.Ld=void 0,this.Ad=!1,this.qd=void 0}destroy(){this.iv()}dispose(){this.iv()}iv(){var t,e,n;this.tv(),this.Cd++,this.Id=!1,this.Na=void 0,this.nv(this.kd,"cancelled"),this.nv(this.Sd,"cancelled"),this.xa&&(this.sv(),(t=this.Qd)===null||t===void 0||t.dispose(),this.Qd=void 0,(e=this.Jd)===null||e===void 0||e.call(this),this.Jd=void 0,this.wd=[],(n=this.Vd)===null||n===void 0||n.removeEventListener("online",this.rn),this.xa=void 0)}get Ar(){return this.Ta.get()}rv(t){var e;return this.ov&&t in this.ov?this.ov[t]:(e=this.xa)===null||e===void 0?void 0:e.kv.get(t)}Kd(){return!!this.ov&&(this.ov=void 0,!0)}av(){var t;return!le((t=this.xa)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.Kd()}At(t){this.lv(()=>{var e;return(e=this.xa)===null||e===void 0?void 0:e.kv.set(t)})}uv(t,e,n){if(!this.Hd||!t.$enabled_feature_flags)return;const r=this.rv("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},i=e.flags||e.featureFlags,o=e.flags?Object.entries(e.flags).filter(([,w])=>!(w!=null&&w.failed)).map(([w])=>w):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,u=l?o:n&&!ze(i)?Object.keys(i||{}):Array.from(new Set([...Object.keys(r),...Object.keys(s)])),d=this.rv("$feature_flag_payloads")||{},f=t.$feature_flag_payloads||{},h=l||n?u:Array.from(new Set([...Object.keys(d),...Object.keys(f)])),m=!l&&!n,v=!!m||u,x=!!m||h,_={[Do]:v,[bi]:v,[ja]:x};t.$feature_flag_details&&(_[dc]=v);for(const w of[fc,za,Kf])le(t[w])||(_[w]=!0);this.Hd.markCrossTabFeatureFlagChanges(_)}Pt(t){this.lv(()=>{var e;return(e=this.xa)===null||e===void 0?void 0:e.kv.remove(t)})}lv(t){try{t()}catch(e){this.$.error("Failed to update feature flag persistence",e)}}Xd(){const t={};for(const r of[Do,ja,fc,Fi]){const s=this.rv(r);le(s)||(t[r]=s)}this.bd=t;const e=$({},t),n=this.rv(bi);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this._d=e}Zd(){const t=this.Ar.cacheTtlMs;if(!t||0>=t)return!1;const e=this.rv(za);return typeof e!="number"||Date.now()-e>t}hv(){return!!this.Zd()&&(this.Pd||this.$d||(this.Pd=!0,this.$.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}dv(){const t=this.Ar.evaluationContexts;return t!=null&&t.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.$.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}vv(){const t=this.Ar.flagKeys;if(!le(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.$.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Ar,r=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i;const o=(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},l=Object.keys(r).filter(d=>!le(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),u=Object.keys(o).filter(d=>l[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.fv({featureFlags:l,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s;const i=n!=null&&n.merge&&(r=this.rv("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.rv("$feature_flag_payloads"))!==null&&s!==void 0?s:{},l=$($({},i),t),u=$($({},o),e),d={};for(const[f,h]of Object.entries(l))d[f]={key:f,enabled:Uk(h),variant:Bk(h),reason:void 0,metadata:le(u==null?void 0:u[f])?void 0:{id:0,version:void 0,description:void 0,payload:u[f]}};this.fv({flags:d})}get hasLoadedFlags(){return this.xd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.rv(dc),e=this.rv(Fi),n=this.rv(Gl);if(!n&&!e)return t||{};const r=en({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i,o;const u=r[l],d=e==null?void 0:e[l],f=le(d)?(i=u==null?void 0:u.enabled)!==null&&i!==void 0&&i:!!d,h=le(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[l],v=$($({},u),{},{enabled:f,variant:f?h??(u==null?void 0:u.variant):void 0});f!==(u==null?void 0:u.enabled)&&(v.original_enabled=u==null?void 0:u.enabled),h!==(u==null?void 0:u.variant)&&(v.original_variant=u==null?void 0:u.variant),m&&(v.metadata=$($({},u==null?void 0:u.metadata),{},{payload:m,original_payload:u==null||(o=u.metadata)===null||o===void 0?void 0:o.payload})),r[l]=v}return this.yd||(this.$.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.yd=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:Uk(r),variant:Bk(r),payload:zk(e[n])}})}getFlagVariants(){const t=this.rv(bi),e=this.rv(Fi);if(!e)return t||{};const n=en({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.yd||(this.$.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.yd=!0),n}getFlagPayloads(){const t=this.rv(ja),e=this.rv(Gl);if(!e)return t||{};const n=en({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.yd||(this.$.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.yd=!0),n}reloadFeatureFlags(){this.Td||this.Ar.featureFlagsDisabled||this.Fd()||(this.Md&&this.$.warn("reloadFeatureFlags() was called inside an onFeatureFlags callback. This callback also runs when flags change in other tabs, so this can cause a request loop."),this.$d&&(this.Id=!0),this.pv||(this.wd.slice().forEach(t=>{try{t()}catch(e){this.$.error("Error while running feature flags reloading callback",e)}}),this.pv=setTimeout(()=>{this.gv()},5)))}reloadFeatureFlagsAsync(){return!this.xa||this.Td||this.Ar.featureFlagsDisabled||this.Ar.remoteRequestsDisabled||this.Fd()?Promise.resolve({status:"skipped"}):new Promise(t=>{this.kd.add(t),this.reloadFeatureFlags()})}nv(t,e){t.forEach(n=>n({status:e})),t.clear()}sv(){clearTimeout(this.pv),this.pv=void 0}onReloading(t){return this.wd.push(t),()=>{this.wd=this.wd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.xd||this.$d||this.pv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Td=t}resetFlagCallReported(){this.Pt(jo)}gv(t){var e;this.sv();const n=this.xa;if(!n||this.Ar.remoteRequestsDisabled||this.Fd())return void this.nv(this.kd,"skipped");if(this.$d)return void(this.Id=!0);const r={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:$($($({},n.initialPersonProperties),this.rv("$stored_person_properties")||{}),{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this.rv(Na),timezone:XT()};le(n.deviceId)||(r.$device_id=n.deviceId),(t!=null&&t.disableFlags||this.Ar.featureFlagsDisabled)&&(r.disable_flags=!0);const s=this.dv();s.length&&(r.evaluation_contexts=s);const i=this.vv();le(i)||(r.flag_keys=i);const o=this.Ar.onlyEvaluateSurveyFeatureFlags,l="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),u=this.Cd,d=this.kd;this.kd=new Set,this.Sd=d,this.$d=!0;const f=()=>{this.Id&&(this.Id=!1,this.gv())},h=w=>{var b,k;const C=(b=w.json)!==null&&b!==void 0?b:{},P=w.statusCode!==200;if(this.$d=!1,u!==this.Cd)return void f();if(this.mv(w.statusCode),P||this.Id||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.Id)return void this.nv(d,"skipped");this.Ed=!P;const T=[];w.error?T.push(w.error instanceof Error&&w.error.name==="AbortError"?"timeout":w.error instanceof Error?J8:"unknown_error"):w.statusCode!==200&&T.push(`api_error_${w.statusCode}`),C.errorsWhileComputingFlags&&T.push("errors_while_computing_flags");const M=!!(!((k=C.quotaLimited)===null||k===void 0)&&k.includes("feature_flags"));M&&T.push("quota_limited"),this.At({[yh]:T}),M?this.$.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):r.disable_flags||this.fv(C,P,{partialResponse:o}),this.nv(d,r.disable_flags?"skipped":T.length||!C.flags&&!C.featureFlags?"error":"loaded"),f()},m=w=>{this.$d=!1,u===this.Cd&&(this.At({[yh]:[J8]}),this.$.error("Feature flag request failed",w),this.av()&&this.Yd(!0),this.nv(d,"error")),f()};let v=(e=this.Ar.requestMaxRetries)!==null&&e!==void 0?e:1;const x=()=>v>0&&u===this.Cd,_=()=>{if(u!==this.Cd||!this.xa||this.Ar.remoteRequestsDisabled)return this.$d=!1,this.nv(d,"skipped"),void f();try{n.sendRequest(l,{target:"flags",method:"POST",body:r,compression:this.Ar.compression,sentAt:"body",timeoutMs:this.Ar.requestTimeoutMs}).then(w=>{if((b=>GV.includes(b.statusCode)||(k=>k.statusCode===0&&k.error instanceof Error&&k.error.name==="AbortError")(b))(w)&&x())return v--,void setTimeout(_,500);h(w)}).catch(m)}catch(w){m(w)}};_()}Fd(){return JT(this.Rd,3)}mv(t){this.Rd=eR(t,this.Rd,3,()=>this.$.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e={}){var n;if(e.fresh&&!this.Ed)return;if(!(this.xd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlag for key "'+t+Zy);if(this.hv())return;const r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this.Ed)return;if(!(this.xd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlagResult for key "'+t+Zy);if(this.hv())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.rv("$feature_flag_request_id")||void 0,u=this.rv("$feature_flag_evaluated_at")||void 0;let d,f=this.rv("$flag_call_reported")||{};if(this.Ar.deduplicateCallsPerSession){var h;const F=(h=this.xa)===null||h===void 0||(h=h.session)===null||h===void 0?void 0:h.sessionId,D=this.rv($f);F&&F!==D&&(f={},d=F)}if(!e.send_event&&"send_event"in e)d&&this.At({[jo]:f,[$f]:d});else{var m,v;const F=(m=this.xa)===null||m===void 0?void 0:m.canCapture;if(!F&&Object.keys(f).length>0&&(f={},this.At({[jo]:f})),F&&!(!((v=f[t])===null||v===void 0)&&v.includes(o))){var x,_,w,b,k,C,P,T,M,I,R,L,j;ze(f[t])?f[t].push(o):f[t]=[o],this.At($({[jo]:f},d?{[$f]:d}:{}));const D=this.getFeatureFlagDetails(t),q=[...(x=this.rv("$feature_flag_errors"))!==null&&x!==void 0?x:[]];le(s)&&q.push("flag_missing");const W={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(_=(w=this.Ar.bootstrap)===null||w===void 0||(w=w.featureFlags)===null||w===void 0?void 0:w[t])!==null&&_!==void 0?_:null,$feature_flag_bootstrapped_payload:(b=(k=this.Ar.bootstrap)===null||k===void 0||(k=k.featureFlagPayloads)===null||k===void 0?void 0:k[t])!==null&&b!==void 0?b:null,$used_bootstrap_value:!this.Ed};le(D==null||(C=D.metadata)===null||C===void 0?void 0:C.has_experiment)||(W.$feature_flag_has_experiment=D.metadata.has_experiment),le(D==null||(P=D.metadata)===null||P===void 0?void 0:P.version)||(W.$feature_flag_version=D.metadata.version);const G=(T=D==null||(M=D.reason)===null||M===void 0?void 0:M.description)!==null&&T!==void 0?T:D==null||(I=D.reason)===null||I===void 0?void 0:I.code;G&&(W.$feature_flag_reason=G),!(D==null||(R=D.metadata)===null||R===void 0)&&R.id&&(W.$feature_flag_id=D.metadata.id),le(D==null?void 0:D.original_variant)&&le(D==null?void 0:D.original_enabled)||(W.$feature_flag_original_response=le(D.original_variant)?D.original_enabled:D.original_variant),!(D==null||(L=D.metadata)===null||L===void 0)&&L.original_payload&&(W.$feature_flag_original_payload=D==null||(j=D.metadata)===null||j===void 0?void 0:j.original_payload),q.length&&(W.$feature_flag_error=q.join(",")),this.yv(W)}else d&&this.At({[jo]:f,[$f]:d})}return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:zk(i)}:void 0}yv(t){try{var e;(e=this.xa)===null||e===void 0||e.capture("$feature_flag_called",t)}catch(n){this.$.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.bv(t,e)}bv(t,e){var n=this;return Bt(function*(){const r=n.xa;if(!r)return;const s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.dv();i.length&&(s.evaluation_contexts=i);const o=n.vv();let l;le(o)||(s.flag_keys=o);try{var u;const d=(u=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Ar.compression,sentAt:"body",timeoutMs:n.Ar.requestTimeoutMs})).json)===null||u===void 0?void 0:u.featureFlagPayloads;l=(d==null?void 0:d[t])||void 0}catch(d){return void n.$.error("Remote config feature flag request failed",d)}try{e(l)}catch(d){n.$.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.Ed)return e.defaultValue;if(!(this.xd||this.getFlags()&&this.getFlags().length>0))return this.$.warn('isFeatureEnabled for key "'+t+Zy),e.defaultValue;const n=this.getFeatureFlag(t,e);return le(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.fv(t,e,n)}fv(t,e,n){if(!this.xa)return;this.xd=!0;const r=((s,i={},o={},l={},u,d=X8)=>{const f=((C,P)=>{const T=C.flags;if(T){const M=Object.fromEntries(Object.keys(T).map(R=>{var L;return[R,(L=T[R].variant)!==null&&L!==void 0?L:T[R].enabled]})),I=Object.fromEntries(Object.keys(T).filter(R=>T[R].enabled).filter(R=>{var L;return!le((L=T[R].metadata)===null||L===void 0?void 0:L.payload)}).map(R=>{var L;return[R,(L=T[R].metadata)===null||L===void 0?void 0:L.payload]}));return $($({},C),{},{featureFlags:M,featureFlagPayloads:I})}return C.featureFlags&&P.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(s,d),h=f.flags,m=f.featureFlags,v=f.featureFlagPayloads;if(!m)return;const x=s.requestId,_=s.evaluatedAt;if(ze(m)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const C={};if(m)for(let P=0;m.length>P;P++)C[m[P]]=!0;return{[Do]:m,[bi]:C,[Kf]:!1}}let w=m,b=v,k=h;if(u!=null&&u.partialResponse){const C=Object.keys(w),P=b||{};w=$($({},i),w),b=$($({},o),P),C.forEach(T=>{T in P||b==null||delete b[T]}),k=$($({},l),k)}else if(s.errorsWhileComputingFlags)if(h){const C=new Set(Object.keys(h).filter(T=>{var M;return!(!((M=h[T])===null||M===void 0)&&M.failed)}));w=$($({},i),Object.fromEntries(Object.entries(w).filter(([T])=>C.has(T))));const P=Object.fromEntries(Object.entries(b||{}).filter(([T])=>C.has(T)));b=$($({},o),P),C.forEach(T=>{T in P||b==null||delete b[T]}),k=$($({},l),Object.fromEntries(Object.entries(k||{}).filter(([T])=>C.has(T))))}else w=$($({},i),w),b=$($({},o),b),k=$($({},l),k);return $($({[Do]:Object.keys(tE(w)),[bi]:w||{},[ja]:b||{},[dc]:k||{},[Kf]:s.minimalFlagCalledEvents===!0},x?{[fc]:x}:{}),_?{[za]:_}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.$);if(r)if((n==null?void 0:n.persist)===!1){const s=!le(this.xa.kv.get(bi));this.ov=r,s||this.At(r)}else this.Kd(),this.uv(r,t,!!(n!=null&&n.partialResponse)),this.At(r);else e&&this.av();e||(this.Pd=!1),this.Yd(e)}override(t,e=!1){this.$.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this._v(t)}_v(t){if(this.xa){if(t===!1)return this.Pt([Fi,Gl]),this.Yd(),void Dl.info("All overrides cleared");if(ze(t))return this.At({[Fi]:eE(t)}),this.Yd(),void Dl.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.yd=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[Fi]=ze(s)?eE(s):s),i&&(r[Gl]=i),Object.keys(r).length&&this.At(r),s===!1&&i===!1?this.Pt([Fi,Gl]):s===!1?this.Pt(Fi):i===!1&&this.Pt(Gl),this.Yd(),s===!1?Dl.info("Flag overrides cleared"):s&&Dl.info("Flag overrides set",{flags:s}),void(i===!1?Dl.info("Payload overrides cleared"):i&&Dl.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.At({[Fi]:t}),this.Yd(),void Dl.info("Flag overrides set",{flags:t});this.$.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.$.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.xd){const{flags:e,flagVariants:n}=this.wv();try{t(e,n)}catch(r){this.$.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r;const s=(this.rv("$early_access_features")||[]).find(d=>d.flagKey===t),i={[`$feature_enrollment/${t}`]:e},o={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n);const l=$($({},this.getFlagVariants()),{},{[t]:e});(r=this.Hd)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.At({[Do]:Object.keys(tE(l)),[bi]:l,[Da]:$($({},this.rv("$stored_person_properties")||{}),i)}),this.Yd();try{var u;(u=this.xa)===null||u===void 0||u.capture("$feature_enrollment_update",o)}catch(d){this.$.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(t,e=!1,n){const r=this.rv(m2);!r||e?this.Sv(t,n):t(r)}Sv(t,e){var n=this;return Bt(function*(){const r=n.xa;if(!r)return;const s=e?`&${e.map(o=>`stage=${o}`).join("&")}`:"";let i;try{const o=yield r.sendRequest(`/api/early_access_features/?token=${r.projectToken}${s}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i=o.json.earlyAccessFeatures,n.At({[m2]:i})}catch(o){return void n.$.error("Early access feature request failed",o)}try{t(i)}catch(o){n.$.error("Early access feature callback failed",o)}})()}wv(){const t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,r)=>(n[r]=e[r],n),{})}}Yd(t){this.Xd();const{flags:e,flagVariants:n}=this.wv(),r=this.Md;this.Md=!0,this.featureFlagEventHandlers.forEach(s=>{try{s(e,n,{errorsLoading:t})}catch(i){this.$.error("Error while running feature flags callback",i)}}),this.Md=r}setPersonPropertiesForFlags(t,e=!0){this.xv(t,e)}xv(t,e=!0){const n=this.rv("$stored_person_properties")||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(const o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.At({[Da]:$($($({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=$({},this.rv("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.At({[Da]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Pt(Da),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.rv("$stored_group_properties")||{},r=$({},n);for(const s of Object.keys(t))r[s]=$($({},n[s]),t[s]);this.At({[Na]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.rv("$stored_group_properties")||{};this.At({[Na]:$($({},e),{},{[t]:{}})})}else this.Pt(Na)}reset(){this.Cd++,this.nv(this.kd,"cancelled"),this.nv(this.Sd,"cancelled"),this.Id=!1,this.bd={},this._d={},this.ov=void 0,this.xd=!1,this.Td=!1,this.Ed=!1,this.$anon_distinct_id=void 0,this.sv(),this.yd=!1,this.Rd=0}};const nE=an("[FeatureFlags]");var YV=class{constructor(t,e=!1){this.$v=!1,this.update(t,e)}update(t,e){this.Cv=((n,r)=>{var s,i,o,l,u,d,f,h;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(l=n.bootstrap)===null||l===void 0?void 0:l.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:r,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(u=n.remote_config_refresh_interval_ms)!==null&&u!==void 0?u:3e5,idleRefreshBackoff:le(n.remote_config_refresh_interval_ms),requestTimeoutMs:n.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(d=n.feature_flag_request_max_retries)!==null&&d!==void 0?d:1),compression:n.disable_compression?void 0:"best-available",evaluationContexts:(f=(h=n.evaluation_contexts)!==null&&h!==void 0?h:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:ze(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.$v||(nE.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.$v=!0),le(t.flag_keys)||ze(t.flag_keys)||nE.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Cv}};const rE=t=>Pd(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),pi=an("[Error tracking]"),D2="webkit-masked-url:",XV=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],QV=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",D2],JV=["__firefox__","__gCrWeb"],sE="Refusing to render web experiment since the viewer is a likely bot",eH={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Km(e,t),not_regex:(t,e)=>!Km(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Ws=an("[Conversations]"),jl="Conversations not available yet.";function iE(t,e){var n,r,s,i,o,l,u;const d=(n=t==null?void 0:t.flushIntervalMs)!==null&&n!==void 0?n:3e3,f=(r=t==null?void 0:t.maxBufferSize)!==null&&r!==void 0?r:100,h=e!=null&&e.consoleCapture?void 0:(s=t==null?void 0:t.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,m=le(h)?Math.max(f,2048):Math.max(f,h),v=$($({},(function(){let x="",_="";try{var w;const b="u">typeof globalThis?globalThis:"u">typeof window?window:void 0,k=b==null||(w=b.navigator)===null||w===void 0?void 0:w.userAgent;k&&([x,_]=W5(k))}catch{}return(function(b,k){const C=(function(P){if(P)return{}.hasOwnProperty.call(Yk,P)?Yk[P]:P})(b);return $($({},C?{"os.name":C}:{}),k?{"os.version":k}:{})})(x,_)})()),t==null?void 0:t.resourceAttributes);return{serviceName:(i=(o=v==null?void 0:v["service.name"])!==null&&o!==void 0?o:t==null?void 0:t.serviceName)!==null&&i!==void 0?i:e==null?void 0:e.serviceNameDefault,serviceVersion:(l=v==null?void 0:v["service.version"])!==null&&l!==void 0?l:t==null?void 0:t.serviceVersion,environment:(u=v==null?void 0:v["deployment.environment"])!==null&&u!==void 0?u:t==null?void 0:t.environment,resourceAttributes:v,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:m,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const tH=["debug","log","warn","error","info"],nH=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},oE="console",jR="__posthogHandledLogsRequestError",qy=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[jR]=!0,n},aE=t=>!!t&&typeof t=="object"&&t[jR]===!0;var rH=class{get Tv(){return $($({},this.$),{},{error:(...t)=>{t.some(aE)||this.$.error(...t)}})}constructor(t,e){var n;this.Ta=t,this.Iv=e,this.name="logs",this.Mv=!1,this.Ev=!1,this.Pv=!1,this.$=an("[logs]"),this.Ju=[],this.Rv=[],this.Rd=0,this.Av=!1,this.Ci=!1,this.Fv=[],this.Ov=[],this.Dv=!1,this.Lv=!1,this.Nv=!1,this.qv=()=>{var r,s;this.Ci||(this.Rd=0,(r=this.jv)===null||r===void 0||r.onReconnect(),(s=this.Bv)===null||s===void 0||s.onReconnect())},this.Mv=!!(!((n=t.get())===null||n===void 0)&&n.captureConsoleLogs)}get zv(){return!0}Hv(){}Uv(){if(!this.Nv){try{this.Vd=typeof window>"u"?void 0:window}catch{this.Vd=void 0}this.Vd&&(xt(this.Vd,"online",this.qv),this.Nv=!0)}}Wv(t,e,n,r){this.Uv();const s=iE(this.Ta.get(),n);return[new q$(this.Vv(t,e),s,this.Tv,()=>this.Iv(),i=>i(),void 0,r),s]}Gv(){const t=this.Ta.get();var e;return this.jv&&this.Qv===t||((e=this.jv)===null||e===void 0||e.reset(),this.Qv=t,[this.jv,this.Zv]=this.Wv(()=>this.Ju,n=>{this.Ju=n})),this.jv}Jv(){const t=this.Ta.get();var e;return this.Bv&&this.Kv===t||((e=this.Bv)===null||e===void 0||e.reset(),this.Kv=t,[this.Bv,this.Xv]=this.Wv(()=>this.Rv,n=>{this.Rv=n},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},oE)),this.Bv}setup(t){if(!this.Ci&&!this.Av)return this.Av=!0,this.xa=t,this.$=t.logger.createLogger("[logs]"),sb(t.kv.initialize(),()=>{this.Ci||this.Gd(t)})}Gd(t){var e;this.Uv(),!((e=this.Ta.get())===null||e===void 0)&&e.captureConsoleLogs&&(this.Mv=!0),(this.Mv||this.Ta.remoteConfigWillArrive&&t.kv.get(this.Ta.captureHintKey))&&this.Yv();let n=!1;const r=t.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.Ci?r.dispose():(this.qa=r,n||this.loadIfEnabled())}dispose(){var t,e,n,r,s,i,o;this.Ci||(this.Ci=!0,this.tf(),(t=this.qa)===null||t===void 0||t.dispose(),this.qa=void 0,this.xa=void 0,this.Pv=!1,(e=this.Vd)===null||e===void 0||e.removeEventListener("online",this.qv),(n=this.ef)===null||n===void 0||n.call(this),this.ef=void 0,(r=this.jv)===null||r===void 0||r.clearQueue(),(s=this.Bv)===null||s===void 0||s.clearQueue(),(i=this.jv)===null||i===void 0||i.reset(),(o=this.Bv)===null||o===void 0||o.reset())}onRemoteConfig(t){var e,n;if(this.Ci)return;const r=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;Qe(r)?this.if():((n=this.xa)===null||n===void 0||n.kv.set(this.Ta.captureHintKey,!!r),r?(this.Mv=!0,this.Ev||this.Yv(),this.loadIfEnabled()):this.if())}reset(){var t,e,n,r;this.tf(),(t=this.jv)===null||t===void 0||t.clearQueue(),this.Ju=[],(e=this.jv)===null||e===void 0||e.reset(),(n=this.Bv)===null||n===void 0||n.clearQueue(),this.Rv=[],(r=this.Bv)===null||r===void 0||r.reset(),this.Rd=0}captureLog(t){!this.Ci&&this.xa&&this.Gv().captureLog(t)}captureConsoleLog(t){!this.Ci&&this.xa&&this.Jv().captureLog(t)}captureBufferedConsoleLog(t,e,n){!this.Ci&&this.xa&&this.Jv().captureLog(t,{context:e,occurredAtMs:n})}md(){var t;this.tf(),(t=this.Bv)===null||t===void 0||t.clearQueue(),this.Rv=[]}if(){this.Mv||this.tf()}Yv(){var t;if(this.Dv||!(!((t=this.Vd)===null||t===void 0)&&t.console))return;const e=iE(this.Ta.get()).maxBufferSize;let n=!0;this.Ov.push(()=>{n=!1});for(const r of tH){let s;try{s=nH(this.Vd.console[r])}catch{continue}s&&this.Ov.push(dd(this.Vd.console,r,i=>{const o=(...l)=>{try{n&&this.nf(r,l,e)}catch{}return i.apply(this.Vd.console,l)};return o.__rrweb_original__=s,o}))}this.Dv=!0,this.sf=setTimeout(()=>{this.tf()},3e4)}nf(t,e,n){var r;if(this.Dv&&!this.Lv&&e.length!==0)if(!((r=this.xa)===null||r===void 0)&&r.canCapture){if(n>this.Fv.length){this.Lv=!0;try{this.Fv.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Iv()})}finally{this.Lv=!1}}}else this.tf()}tf(){if(this.Fv=[],this.Dv){this.Dv=!1,this.sf&&(clearTimeout(this.sf),this.sf=void 0);for(const t of this.Ov)t();this.Ov=[]}}rf(){const t=this.Fv;return this.tf(),t}get logger(){return this.af||(this.af={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.af}flushLogs(t){this.xa&&(t?this.lf(t):(this.jv&&this.jv.flush().catch(e=>this.uf(e)),this.Bv&&this.Bv.flush().catch(e=>this.uf(e))))}flush(){var t=this;return Bt(function*(){var e,n;const r=(e=t.jv)===null||e===void 0?void 0:e.flush().catch(i=>t.uf(i)),s=(n=t.Bv)===null||n===void 0?void 0:n.flush().catch(i=>t.uf(i));yield r,yield s})()}uf(t){aE(t)||this.$.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Ci||!this.Mv||this.Ev||this.Pv)return;const t=this.Hv();if(t){this.Pv=!0;try{t((e,n)=>{if(this.Pv=!1,!this.Ci&&this.Mv)if(e||!n)this.$.error("Could not load logs script",e),this.tf();else{const r=this.rf();this.ef=n.initialize(this.xa),this.Ev=!0,r.length>0&&n.replay(this.xa,r)}})}catch(e){throw this.Pv=!1,e}}else this.tf()}Vv(t,e){const n=this.xa;return{get isDisabled(){return!1},get optedOut(){return!n.canCapture},getPersistedProperty:r=>r===Vi.LogsQueue?t():void 0,setPersistedProperty(r,s){r===Vi.LogsQueue&&e(s??[])},js:r=>this.js(r),getLibraryId:()=>n.library.name,getLibraryVersion:()=>n.library.version}}js(t){return new Promise(e=>{if(JT(this.Rd,3))return void e({kind:"fatal",error:qy(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=o=>{n||(n=!0,clearTimeout(s),e(o))},s=setTimeout(()=>{this.$.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:qy(void 0,"logs request timed out")})},9e4),i=this.zv;this.xa.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.xa.projectToken},body:t,compression:"best-available",timeoutMs:6e4}).then(o=>{var l;const u=o.statusCode;this.cf(u,i),u>=200&&300>u?r({kind:"ok"}):u===413?r({kind:"too-large"}):u!==0&&u!==408&&u!==429&&500>u?r({kind:"fatal",error:new Error(`logs request failed with status ${u}`)}):u===0?(o.error||this.$.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:qy(o.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error(`logs request failed with status ${u}`)})},o=>{r({kind:"retry-later",error:o})})})}cf(t,e){(t!==0||e)&&(this.Rd=eR(t,this.Rd,3,()=>this.$.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}lf(t){this.Ju.length>0&&this.hf(t,this.Ju,this.Zv,this.xa.library.name,e=>{this.Ju=e}),this.Rv.length>0&&this.hf(t,this.Rv,this.Xv,oE,e=>{this.Rv=e})}hf(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=pT(i,hT(n,this.xa.library.name,this.xa.library.version),r,this.xa.library.version);this.xa.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.xa.projectToken},body:o,compression:"best-available",transport:t,timeoutMs:6e4}).catch(l=>this.uf(l))}};const Ym=an("[NetworkMetrics]"),ib=()=>{var t;return!(ae==null||(t=ae.performance)===null||t===void 0)&&t.now?ae.performance.now():Date.now()},sH={"http:":80,"https:":443},iH=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),$R=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=Zo(r))===null||n===void 0?void 0:n.href)||r}},j2=(t,e,n,r,s,i,o=!1)=>{try{var l,u;const d=s();if(!d)return;const f=n||void 0,h=ib()-r,m=Zo(e.url);if(m&&m.protocol!=="http:"&&m.protocol!=="https:")return;const v={url:(m==null?void 0:m.href)||e.url,method:e.method},x=kn(d.name)?d.name(v):st(d.name)?d.name:"http.client.request.duration";if(!x)return;const _=o&&!f?void 0:((b,k)=>b?400>b?void 0:String(b):(k==null?void 0:k.name)||"_OTHER")(f,i),w=$($($($($({},(b=>{const k=iH.has(b)?b:"_OTHER";return $({"http.request.method":k},k==="_OTHER"&&b!==k?{"http.request.method_original":b}:{})})(v.method)),m?(b=>{return{"server.address":b.hostname.startsWith("[")&&b.hostname.endsWith("]")?b.hostname.slice(1,-1):b.hostname,"server.port":Number(b.port)||sH[b.protocol],"url.scheme":b.protocol.slice(0,-1),"url.template":(k=b.pathname,k.split("/").map(C=>(P=>/^\d+$/.test(P)||P.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(P))(C)?":id":C).join("/"))};var k})(m):{}),f?{"http.response.status_code":f}:{}),_?{"error.type":_}:{}),(l=d.attributes)===null||l===void 0?void 0:l.call(d,v,{status:f,durationMs:h}));(u=t.metrics)===null||u===void 0||u.histogram(x,h,{unit:"ms",attributes:w})}catch(d){Ym.error("Failed to record network metric",d)}},FR=()=>{},oH=(t,e)=>kn(ae==null?void 0:ae.fetch)?dd(ae,"fetch",n=>function(...r){const s=ib(),i=n.apply(this,r);if(!e())return i;try{var o,l,u;const[d,f]=r,h=$R((o=(l=f==null?void 0:f.method)!==null&&l!==void 0?l:d==null?void 0:d.method)!==null&&o!==void 0?o:"GET",(u=d==null?void 0:d.url)!==null&&u!==void 0?u:d);return i.then(m=>(j2(t,h,m==null?void 0:m.status,s,e,void 0,!0),m),m=>{throw j2(t,h,void 0,s,e,m),m})}catch(d){return Ym.error("Failed to observe fetch",d),i}}):FR,aH=(t,e)=>{var n;const r=ae==null||(n=ae.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return FR;const s=new WeakMap,i=dd(r,"open",l=>function(...u){try{mR.has(this)||s.set(this,$R(u[0],u[1]))}catch(d){Ym.error("Failed to observe XHR open",d)}return l.apply(this,u)}),o=dd(r,"send",l=>function(...u){let d;try{const f=s.get(this);if(f&&e()){const h=ib();d=()=>{this.removeEventListener("loadend",d),j2(t,f,this.status,h,e)},xt(this,"loadend",d)}}catch(f){Ym.error("Failed to observe XHR send",f)}try{return l.apply(this,u)}catch(f){throw d&&this.removeEventListener("loadend",d),f}});return()=>{i(),o()}},lE=new WeakMap,lH=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),cH={maxStringLength:2048,truncationSuffix:"..."},uH={maxStringLength:2048,truncationSuffix:"..."};function cE(t){if(t)return t===!0?{intent:!0,model:!0}:{intent:t.intent!==!1,model:t.model!==!1}}function Gy(t,e){return{}.hasOwnProperty.call(t,e)}function Ky(t,e){const n=Object.create(t);return e&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:e}),n}function uE(t,e,n=!1){if(!st(t))return;const r=t.trim();return r?(n?lT(r,cH):r).slice(0,e):void 0}function dE(t){try{return rt(t)&&t.isError===!0}catch{return!1}}function VR(t){return lT(t||"Unknown error",uH).slice(0,2048)}function dH(t,e){try{return VR(e?(function(n){try{return!rt(n)||!ze(n.content)?void 0:n.content.filter(r=>rt(r)&&r.type==="text"&&st(r.text)).map(r=>r.text).join(" ").trim()||void 0}catch{return}})(t):rt(t)&&st(t.message)?t.message:st(t)?t:String(t))}catch{return"Unknown error"}}function fH(t,e,n){return e.errorResult?[{type:"Error",value:n,mechanism:{type:"generic",handled:!0,synthetic:!0,exception_id:0}}]:t.buildProperties(e.error,{handled:!0}).$exception_list.map(r=>$($({},r),{},{value:VR(r.value)}))}function hH(t,e){if(e)return"Error";try{if(!rt(t))return"Error";let n=st(t.name)?t.name.trim():"";const r=t.constructor;return n&&n!=="Error"||!kn(r)||r.name==="Error"||(n=r.name),(n||"Error").slice(0,256)}catch{return"Error"}}function pH(t,e){return{message:dH(t,e),type:hH(t,e)}}const Wg={featureFlags:class extends KV{constructor(t){const e=new YV(t.config,t.Qu());super(e),this.name=LR,this._instance=t,this.df=e}get Hd(){return this._instance.persistence}updateConfig(t,e){this.df.update(t,e),this.Ud()}}},mH={sessionRecording:class{get Ar(){return this._instance.config}get _c(){return this._instance.persistence}get started(){var t;return!!(!((t=this.vf)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.ff==="awaiting_config"||this.ff==="missing_config"?this.ff:(t=(e=this.vf)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.ff}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.ff=Uy,this.pf=void 0,this.gf=!1,this.Je=(()=>{var e,n;if(!(Ee!=null&&Ee.visibilityState)||Ee.visibilityState==="visible")return!0;const r=ae==null||(e=ae.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.sn=()=>{var e,n;(Ee==null?void 0:Ee.visibilityState)==="visible"&&(this.Je=!0,(e=this.vf)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw So.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Ar.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');Ee!=null&&Ee.addEventListener&&xt(Ee,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.gf=!0,Ee==null||(e=Ee.removeEventListener)===null||e===void 0||e.call(Ee,"visibilitychange",this.sn),t?this.mf(!0):this.stopRecording()}get yf(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Ar.disable_session_recording,r=this.Ar.disable_session_recording||this._instance.consent.isOptedOut();return ae&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this.gf||this.yf&&(!((e=this.vf)===null||e===void 0)&&e.isStarted))return;const n=!le(Object.assign)&&!le(Array.from);this.yf&&n?(this.bf(t),So.info("starting")):(this.ff=Uy,this.stopRecording())}bf(t){var e,n;if(this.yf)if(this.ff!=="awaiting_config"&&this.ff!=="missing_config"&&(this.ff=Z8),(qe==null||(e=qe.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=qe.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this._f(t);else{var r,s;const i=this._instance.sessionManager;(r=qe.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.wf,o=>{if(!this.gf&&this.yf&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),So.error("could not load recorder",o)):void this._f(t);this.ff="disabled"})}}stopRecording(){var t,e;(t=this.pf)===null||t===void 0||t.call(this),this.pf=void 0,(e=this.vf)===null||e===void 0||e.stop()}mf(t=!1){var e,n;(e=this.pf)===null||e===void 0||e.call(this),this.pf=void 0,(n=this.vf)===null||n===void 0||n.discard({discardProducerEvents:t})}kf(){var t,e;(t=this._c)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this._c)===null||e===void 0||e.unregister("$replay_sample_rate")}Sf(t,e){if(Qe(t))return null;const n=Pn(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(So.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}xf(t){if(this._c){var e,n;const r=this._c,s=()=>{var i;const o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this.Sf((i=this.Ar.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.Sf(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??u;Qe(d)&&this.kf();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Xf]:$($({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:$({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:d,minimumDurationMilliseconds:le(f)?null:f,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(e=this.pf)===null||e===void 0||e.call(this),this.pf=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(s)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.xf(e),void this.mf()):(this.xf(e),void this.startIfEnabledOrStop()):(this.ff==="awaiting_config"&&(this.ff="missing_config",this._instance.register_for_session({[Gx]:!0}),So.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.vf)===null||n===void 0)&&n.log?this.vf.log(t,e):So.warn("log called before recorder was ready")}get wf(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(Xf);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}$f(){const t=this._instance.get_property(Xf);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return So.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!Qe(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}_f(t){var e,n,r;if(!this.gf&&this.yf&&this._instance.sessionManager){if(!(!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return So.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[qx]:!0});var s;if(this.vf||(this.vf=(s=qe.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Je),this.vf._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.$f())return this.ff==="missing_config"||this.ff==="awaiting_config"?void 0:(this.ff="awaiting_config",So.info("persisted remote config is stale, requesting fresh config before starting"),void new cR(this._instance).load());this.ff=Z8,(n=(r=this.vf).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Je),this.vf.start(t)}else this.ff=Uy}onRRwebEmit(t){var e,n;(e=this.vf)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.vf||(e=this._c)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.vf)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.vf||(e=this._c)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.vf)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.vf||(n=this._c)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.vf)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;const e={};for(const r of FV){var n;const s=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(r);le(s)||(e[r]=s)}return $($({},e),((t=this.vf)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(t,e){var n;return!!(!((n=this.vf)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.vf)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},gH={autocapture:class extends kV{constructor(t){super(new NV(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.Cf=!1,this._instance=t,this.Tf=this.If()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.Mf();return!!(t.path||t.search||this.Ef(t))}startIfEnabled(){this.isEnabled&&(he.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Tf=this.If(),this.startIfEnabled()}stop(){this.Pf&&this.Pf(),this.Pf=void 0,this.Rf&&this.Rf(),this.Rf=void 0,he.info("History API monitoring stopped")}monitorHistoryChanges(){ae&&ae.history&&(this.Af("pushState"),this.Af("replaceState"),this.Ff(),this.Ef()&&this.Of())}Af(t){var e;if(!ae||!((e=ae.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;dd(ae.history,t,r=>function(s,i,o){var l;n.Df(o)&&n.Lf(),r.call(this,s,i,o),n.Nf(t,!n.Cf&&(ae==null||(l=ae.event)===null||l===void 0?void 0:l.type)!=="popstate")})}If(){const t=ae==null?void 0:ae.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Mf(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:rt(t)?t:{}}Ef(t=this.Mf()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}qf(t){const e=this.Mf(),n=this.Tf;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.Ef(e)&&t.hash!==n.hash))}Nf(t,e=!1){try{e||this.Lf();const n=this.If();if(!n)return;if(this.qf(n)){const r=()=>this._instance.capture(Kx,{navigation_type:t});e?(this.jf=r,Promise.resolve().then(()=>this.Lf())):r()}this.Tf=n}catch(n){he.error(`Error capturing ${t} pageview`,n)}}Df(t){var e,n;return!(Qe(t)||!ae)&&((e=Zo(String(t)))===null||e===void 0?void 0:e.href)!==((n=ae.location)===null||n===void 0?void 0:n.href)}Lf(){const t=this.jf;if(t){this.jf=void 0,this.Cf=!0;try{t()}catch(e){he.error("Error capturing deferred pageview",e)}finally{this.Cf=!1}this.Tf=this.If()}}Ff(){if(this.Pf)return;const t=()=>{this.Nf("popstate")};xt(ae,"popstate",t),this.Pf=()=>{ae&&ae.removeEventListener("popstate",t)}}Of(){if(this.Rf)return;const t=()=>{this.Nf("hashchange")};xt(ae,"hashchange",t),this.Rf=()=>{ae&&ae.removeEventListener("hashchange",t)}}},heatmaps:class{get Ar(){return this.instance.config}constructor(t){var e;this.Bf=!1,this.ll=!1,this.zf=null,this.instance=t,this.Bf=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[y2]),this.rageclicks=new MR(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return rt(this.Ar.capture_heatmaps)&&this.Ar.capture_heatmaps.flush_interval_milliseconds&&(t=this.Ar.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Qe(this.Ar.capture_heatmaps)?Qe(this.Ar.enable_heatmaps)?this.Bf:this.Ar.enable_heatmaps:this.Ar.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ll)return;VV.info("starting..."),this.Hf(),this.sn()}else{var t;clearInterval((t=this.zf)!==null&&t!==void 0?t:void 0),this.Uf(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[y2]:n}),this.Bf=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}Wf(t){By(t.originalEvent)&&this.Er(t.originalEvent,"deadclick")}sn(){this.zf&&clearInterval(this.zf),this.zf=(Ee==null?void 0:Ee.visibilityState)==="visible"?setInterval(this.rc.bind(this),this.flushIntervalMilliseconds):null}Hf(){ae&&Ee&&(this.Vf=this.rc.bind(this),xt(ae,Bm,this.Vf),this.Gf=t=>this.Er(t||(ae==null?void 0:ae.event)),xt(Ee,"click",this.Gf,{capture:!0}),this.Qf=t=>this.Zf(t||(ae==null?void 0:ae.event)),xt(Ee,"mousemove",this.Qf,{capture:!0}),this.Jf=new _8(this.instance,VF,this.Wf.bind(this)),this.Jf.startIfEnabledOrStop(),this.Kf=this.sn.bind(this),xt(Ee,ju,this.Kf),this.ll=!0)}Uf(){var t;ae&&Ee&&(this.Vf&&ae.removeEventListener(Bm,this.Vf),this.Gf&&Ee.removeEventListener("click",this.Gf,{capture:!0}),this.Qf&&Ee.removeEventListener("mousemove",this.Qf,{capture:!0}),this.Kf&&Ee.removeEventListener(ju,this.Kf),clearTimeout(this.Xf),(t=this.Jf)===null||t===void 0||t.stop(),this.ll=!1)}Yf(t,e){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,l,u){let d=o;for(;d&&Pi(d)&&!gr(d,"body");){if(d===u)return!1;let v;try{var f,h,m;v=(f=(h=(m=d.ownerDocument)===null||m===void 0?void 0:m.defaultView)!==null&&h!==void 0?h:ae)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(Be(l,v))return!0;d=BT(d)}return!1})(eh(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Er(t,e="click"){var n;if(l8(t.target)||!By(t))return;const r=this.Yf(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&ZT(eh(t),this.instance.config.rageclick)&&this.Qs($($({},r),{},{type:"rageclick"})),this.Qs(r)}Zf(t){!l8(t.target)&&By(t)&&(clearTimeout(this.Xf),this.Xf=setTimeout(()=>{this.Qs(this.Yf(t,"mousemove"))},500))}Qs(t){if(!ae)return;const e=this.Ar.disable_capture_url_hashes?qa(ae.location.href):ae.location.href,n=this.Ar.custom_personal_data_properties,r=this.Ar.mask_personal_data_properties?[...cd,...n||[]]:[],s=wh(e,r,xh);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}rc(){this.Rt&&!ns(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:_8,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.Bf=!1,this.ll=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.tp=(n=!1)=>{clearTimeout(this.ep),this.ep=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",$({$current_url:this.Rt.url},this.Rt.metrics.reduce((r,s)=>$($({},r),{},{[`$web_vitals_${s.name}_event`]:$({},s),[`$web_vitals_${s.name}_value`]:s.value}),{})),n?{transport:"sendBeacon",send_instantly:!0}:void 0),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.np=n=>{var r;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Qe(n==null?void 0:n.name)||Qe(n==null?void 0:n.value))return void Nl.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.sp(s);if(le(i))return;const o=Pn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.rp&&n.value>=this.rp)return void Nl.error("Ignoring metric with value >= "+this.rp,n);this.Rt.navigationKey!==o&&(this.tp(),this.ep=setTimeout(this.tp,this.flushToCaptureTimeoutMs)),le(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=i),this.Rt.firstMetricTimestamp=le(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const l=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),u=$($($({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,rt(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of $V){const h=f==="url"&&typeof n.attribution[f]=="string"?this.sp(n.attribution[f]):n.attribution[f];le(h)||(d[f]=h)}u.attribution=d}else delete u.attribution;le(l)||(u.$session_id=l.sessionId,u.$window_id=l.windowId),this.Rt.metrics.push(u),this.Rt.metrics.length===this.allowedMetrics.length&&this.tp()},this.op=()=>{if(this.ll)return;let n,r,s,i,o=!1;const l=qe.__PosthogExtensions__,u=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(u==null?void 0:u[this.ap])||(this.ap==="web-vitals"&&le(u)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!le(d)){const v=d.withoutAttribution,x=this.attributionMetrics;o=!le(v),n=x.indexOf("LCP")>-1?d.onLCP:(v==null?void 0:v.onLCP)||d.onLCP,r=x.indexOf("CLS")>-1?d.onCLS:(v==null?void 0:v.onCLS)||d.onCLS,s=x.indexOf("FCP")>-1?d.onFCP:(v==null?void 0:v.onFCP)||d.onFCP,i=x.indexOf("INP")>-1?d.onINP:(v==null?void 0:v.onINP)||d.onINP}if(!(n&&r&&s&&i))return void Nl.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},h=o&&this.attributionMetrics.indexOf("INP")>-1?$($({},f),{},{includeProcessedEventEntries:!1}):f;this.allowedMetrics.indexOf("LCP")>-1&&n(this.np.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.np.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.np.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.np.bind(this),h);const m=ae==null?void 0:ae.document;xt(m,ju,()=>{(m==null?void 0:m.visibilityState)==="hidden"&&this.tp(!0)}),xt(ae,"pagehide",()=>this.tp(!0)),this.ll=!0},this.Bf=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[x2]),this.startIfEnabled()}get lp(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=rt(this.lp)?(t=this.lp)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return Qe(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||W8:n}get flushToCaptureTimeoutMs(){return(rt(this.lp)?this.lp.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=rt(this.lp)?this.lp.web_vitals_attribution:void 0;return zr(t)?t?W8:[]:ze(t)?t:jV}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=rt(this.lp)?this.lp.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get rp(){const t=rt(this.lp)&&Pn(this.lp.__web_vitals_max_value)?this.lp.__web_vitals_max_value:B8;return t>0&&6e4>=t?B8:t}get isEnabled(){const t=zt==null?void 0:zt.protocol;if(t!=="http:"&&t!=="https:")return Nl.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=rt(this.lp)?this.lp.web_vitals:zr(this.lp)?this.lp:void 0;return zr(e)?e:this.Bf}startIfEnabled(){this.isEnabled&&!this.ll&&(Nl.info("enabled, starting..."),this.Ml(this.op))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=rt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=rt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[x2]:n}),this._instance.persistence.register({[bT]:r})),this.Bf=n,this.startIfEnabled()}get ap(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ml(t){var e;const n=qe.__PosthogExtensions__,r=this.ap,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&le(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,r,i=>{i?Nl.error("failed to load script",i):t()})}sp(t){const e=t||(ae==null?void 0:ae.location.href);if(!e)return void Nl.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?qa(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...cd,...r||[]]:[];return wh(n,s,xh)}}},vH={exceptionObserver:class{constructor(t){var e;this.op=()=>{var n;if(!ae||!this.isEnabled||!(!((n=qe.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=qe.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=qe.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=qe.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.up&&this.Ar.capture_unhandled_errors&&(this.up=r(this.captureException.bind(this))),!this.cp&&this.Ar.capture_unhandled_rejections&&(this.cp=s(this.captureException.bind(this))),!this.hp&&this.Ar.capture_console_errors&&(this.hp=i(this.captureException.bind(this)))}catch(o){Rf.error("failed to start",o),this.dp()}},this._instance=t,this.vp=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[_2]),this.wt=new A7($($({},(function(n={}){var r,s,i,o;return{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,$:Rf})),this.Ar=this.fp(),this.startIfEnabledOrStop()}fp(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return rt(t)?e=$($({},e),t):(le(t)?this.vp:t)&&(e=$($({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Ar.capture_console_errors||this.Ar.capture_unhandled_errors||this.Ar.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Rf.info("enabled"),this.dp(),this.Ml(this.op)):this.dp()}Ml(t){var e,n,r;!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=qe.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return Rf.error("failed to load script",s);t()})}dp(){var t,e,n;(t=this.up)===null||t===void 0||t.call(this),this.up=void 0,(e=this.cp)===null||e===void 0||e.call(this),this.cp=void 0,(n=this.hp)===null||n===void 0||n.call(this),this.hp=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.vp=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[_2]:this.vp}),this.Ar=this.fp(),this.startIfEnabledOrStop())}onConfigChange(){this.Ar=this.fp()}captureException(t){try{var e,n,r;const s=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.wt.consumeRateLimit(s))return void Rf.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.pp=[],this.gp=new V7([new t$,new u$,new r$,new n$,new l$,new a$,new i$,new c$],(function(r,...s){return(i,o=0)=>{const l=[],u=i.split(`
19
- `),d=Math.min(u.length,o+1e3),f=[];for(let v=o;d>v;v++){const x=u[v];if(x.length>1024)continue;const _=Hk.test(x)?x.replace(Hk,"$1"):x;if(!_.match(/\S*Error: /)){for(const w of s){const b=w(_,r);if(b){l.push(b);const k=X7(l);if(k){for(let C=f.length-1;C>=0;C--){const P=f[C];if(k.start>=P.start+P.length)break;f.pop()}f.push(k)}break}}if(J7(l,f)>=50)break}}const h=[...f].sort((v,x)=>x.start-v.start),m=h[h.length-1];if(m){const v=J5(l,m);l.splice(m.start-v,v);for(const x of h)x.start-=v}for(const v of h)Q7(l,v);return f.some(v=>v.start===0&&l.length===v.length)&&(function(v){const x=v.map(w=>`${w.function}|${w.filename}|${w.lineno}|${w.colno}|${w.module}`);let _=0;for(let w=1;x.length>w;w++)e$(x,w,_)&&(_=w);v.push(...v.splice(0,_))})(l),(function(v){if(!v.length)return[];const x=Array.from(v);return x.reverse(),x.slice(0,50).map(_=>{return $($({},_),{},{filename:_.filename||(w=x,w[w.length-1]||{}).filename,function:_.function||"?"});var w})})(l)}})("web:javascript",q7,Y7)),this._instance=t,this.pp=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.mp=$m(this.yp()),this.bp=new f$(this.mp)}onConfigChange(){this.mp=$m(this.yp()),this.bp.setConfig(this.mp)}onRemoteConfig(t){var e,n,r;if(!t.ok)return;const s=t.config;if(!("errorTracking"in s))return;const i=(e=(n=s.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=s.errorTracking)===null||r===void 0?void 0:r.captureExtensionExceptions;this.pp=i,this._instance.persistence&&this._instance.persistence.register({[wT]:this.pp,[w2]:o})}get _p(){var t;const e=!!this._instance.get_property(w2),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.gp.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.mp.enabled)try{if(!st(t)||t.trim().length===0)return void pi.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:r}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};const i=[];return{sanitizedProperties:Object.keys(s).reduce((o,l)=>d$.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.wp(e));r.length>0&&pi.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.bp.add($({[Dm]:t,[jm]:new Date().toISOString()},n))}catch(n){pi.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.kp(e)){if(this.Sp(e))return this.xp("Exception dropped: matched a suppression rule"),void pi.info("Skipping exception capture because a suppression rule matched");if(!this._p&&this.$p(e))return this.xp("Exception dropped: thrown by a browser extension"),void pi.info("Skipping exception capture because it was thrown by an extension");if(!this._p&&this.Cp(e))return this.xp("Exception dropped: thrown by an injected browser script"),void pi.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Tp(e))return this.xp("Exception dropped: thrown by the PostHog SDK"),void pi.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.mp.enabled&&Qe(t.$exception_steps)?this.Ip(t):t,r=(function(){if("u">typeof process){var s;const o=(s=y7.POSTHOG_RELEASE_ID)===null||s===void 0?void 0:s.trim();if(o)return o}const i=globalThis._posthogReleaseId;return typeof i=="string"&&i.length>0?i:void 0})();r&&(n.$release_id=r);try{const s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",sd:!0});return s&&this.bp.clear(),s}catch(s){return rE(s)||pi.error("Failed to capture exception event. Dropping this exception.",s),void this.bp.clear()}}catch(e){return void(rE(e)||pi.error("Failed to process exception event. Ignoring this exception.",e))}}Ip(t){try{const e=this.bp.getAttachable();return e.length===0?t:$($({},t),{},{$exception_steps:e})}catch(e){return pi.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}xp(t){this.mp.enabled&&this.bp.add({[Dm]:t,[jm]:new Date().toISOString()})}wp(t){return rt(t)?$({},t):{}}yp(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}Sp(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:r,value:s})=>(st(r)&&r.length>0&&n.$exception_types.push(r),st(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.pp.some(n=>{const r=n.values.map(s=>{const i=TR[s.operator],o=e[s.key];if(!i||!o)return!1;const l=ze(s.value)?s.value:[s.value];return l.length>0&&i(l,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(e){return pi.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}$p(t){const e=t.flatMap(r=>{var s,i;return(s=(i=r.stacktrace)===null||i===void 0?void 0:i.frames)!==null&&s!==void 0?s:[]}),n=e.filter(({filename:r})=>!!r&&QV.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(D2))||t.some(({type:r,value:s})=>r==="NoResponse"||st(s)&&XV.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(D2))))}Cp(t){return t.some(({value:e})=>st(e)&&JV.some(n=>e.includes(n)))}Tp(t){if(t.length>0){var e,n,r,s;const i=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(r=o==null||(s=o.filename)===null||s===void 0?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}kp(t){return!Qe(t)&&ze(t)}}},yH=$({productTours:class{get _c(){return this._instance.persistence}constructor(t){this.Mp=null,this.Ep=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,r;if(this._c&&this._c.register({[Wx]:!!e.productTours}),!Wy(this._instance))return!this.Mp&&Qe((n=this._c)===null||n===void 0?void 0:n.props.ph_product_tours)||C0.info("product tours disabled; stopping and clearing cached tours"),(r=this.Mp)===null||r===void 0||r.stop(),this.Mp=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Mp&&Wy(this._instance)&&this.Ml(()=>this.Pp())}Ml(t){var e,n,r;!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=qe.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?C0.error("Could not load product tours script",s):t()})}Pp(){var t;!this.Mp&&(!((t=qe.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.Mp=qe.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(ze(this.Ep)&&!e)return void t(this.Ep,{isLoaded:!0});const n=this._c;if(n){const r=n.props[b2];if(ze(r)&&!e)return this.Ep=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:r=>{if(!Wy(this._instance))return void t([],{isLoaded:!0});const s=r.statusCode;if(s!==200||!r.json){const o=`Product Tours API could not be loaded, status: ${s}`;return s===0?r.error||C0.warn(o):C0.error(o),void t([],{isLoaded:!1,error:o})}const i=ze(r.json.product_tours)?r.json.product_tours:[];this.Ep=i,n&&n.register({[b2]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){Qe(this.Mp)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Mp.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Mp)===null||e===void 0||e.showTourById(t)}previewTour(t){this.Mp?this.Mp.previewTour(t):this.Ml(()=>{var e;this.Pp(),(e=this.Mp)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.Mp)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Mp)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.Mp)===null||t===void 0||t.previousStep()}clearCache(){var t;this.Ep=null,(t=this._c)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.Mp)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.Mp)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Mp)===null||e===void 0||e.cancelPendingTour(t)}}},Wg),_H={siteApps:class{constructor(t){this._instance=t,this.Rp=0,this.Ap=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Fp(t,e){if(!e)return;const n=this.globalsForEvent(e);this.Ap.push(n),this.Ap.length>1e3&&(this.Ap=this.Ap.slice(10))}get siteAppLoaders(){var t;return(t=qe._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.Fp.bind(this));this.Op=()=>{t(),this.Ap=[],this.Op=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,l;if(!t)throw new Error("Event payload is required");const u={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(const[v,x]of Object.entries(f))u[v]={id:d[v],type:v,properties:x};const{$set_once:h,$set:m}=t;return{event:$($({},rT(t,HV)),{},{properties:$($($({},t.properties),m?{$set:$($({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),m)}:{}),h?{$set_once:$($({},(r=(s=t.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),h)}:{}),elements_chain:(i=(o=t.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}Dp(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Li.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)||(Li.error("prepare_external_dependency_script returned null"),null):t}Lp(){var t,e,n,r,s,i,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const u=Ee==null?void 0:Ee.defaultView,d=u==null||(t=u.Node)===null||t===void 0?void 0:t.prototype;if(!u||!d)return()=>{};if(this.Rp++,this.Np)return this.qp();const f=[],h=this,m=new WeakSet,v=(w,b,k)=>{if(!(w!=null&&w[b]))return;const C=w[b];w[b]=k(C),f.push(()=>{w[b]=C})},x=w=>{if(m.has(w))return w;const b=h.Dp(w);return b&&m.add(b),b},_=w=>w.map(b=>typeof b=="string"?b:x(b)).filter(b=>!un(b));return v(d,"appendChild",w=>function(b){const k=x(b);return k?w.call(this,k):b}),v(d,"insertBefore",w=>function(b,k){const C=x(b);return C?w.call(this,C,k):b}),v(d,"replaceChild",w=>function(b,k){const C=x(b);return C?w.call(this,C,k):k}),[(e=u.Element)===null||e===void 0?void 0:e.prototype,(n=u.Document)===null||n===void 0?void 0:n.prototype,(r=u.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(w=>{v(w,"append",b=>function(...k){return b.apply(this,_(k))}),v(w,"prepend",b=>function(...k){return b.apply(this,_(k))})}),[(s=u.Element)===null||s===void 0?void 0:s.prototype,(i=u.CharacterData)===null||i===void 0?void 0:i.prototype,(o=u.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(w=>{v(w,"before",b=>function(...k){return b.apply(this,_(k))}),v(w,"after",b=>function(...k){return b.apply(this,_(k))}),v(w,"replaceWith",b=>function(...k){const C=_(k);return k.length&&!C.length?void 0:b.apply(this,C)})}),v((l=u.Element)===null||l===void 0?void 0:l.prototype,"insertAdjacentElement",w=>function(b,k){const C=x(k);return C?w.call(this,b,C):null}),this.Np=()=>{f.forEach(w=>w()),this.Np=void 0},this.qp()}qp(){let t=!1;return()=>{var e;t||(t=!0,this.Rp--,this.Rp===0&&((e=this.Np)===null||e===void 0||e.call(this)))}}jp(t,e=!0){const n=this.Lp();try{const r=t(n);return e&&n(),r}catch(r){throw n(),r}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var i;!e.errored&&this.Ap.length&&(Li.info(`Processing ${this.Ap.length} events for site app with id ${t.id}`),this.Ap.forEach(o=>this.jp(()=>{var l;return(l=e.processEvent)===null||l===void 0?void 0:l.call(e,o)})),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((i=this.Op)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,Li.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.jp(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){Li.error(q8+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){Li.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}Bp(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}zp(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.jp(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,e)})}catch(r){Li.error(`Error while processing event ${t.event} for site app ${n.id}`,r)}}onRemoteConfig(t){var e,n,r;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this.Bp(),void this._instance.on("eventCaptured",l=>this.zp(l))):void Li.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Op)===null||n===void 0||n.call(this),!t.ok)return;const s=t.config;if(!((r=s.siteApps)===null||r===void 0)&&r.length)if(this.isEnabled)for(const{id:l,url:u}of s.siteApps){var i,o;qe[`__$$ph_site_app_${l}`]=this._instance,(i=qe.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,u,d=>{if(d)return Li.error(q8+l,d)})}else Li.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},wH={tracingHeaders:class{constructor(t){this._instance=t,this.Hp=void 0,this.Up=void 0,this.Wp=void 0,this.op=()=>{const e=this.Vp();var n,r;e?(le(this.Hp)&&(this.Hp=(n=qe.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),le(this.Up)&&(this.Up=(r=qe.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.dp()}}initialize(){this.startIfEnabledOrStop()}Ml(t){var e,n,r;!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=qe.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return DV.error("failed to load script",s);t()})}Gp(){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}Vp(){const t=this.Gp();return ze(t)?(ze(this.Wp)?this.Wp.splice(0,this.Wp.length,...t):this.Wp=[...t],t.length>0?this.Wp:void 0):(ze(this.Wp)&&this.Wp.splice(0),this.Wp=t||void 0,this.Wp)}dp(){var t,e;(t=this.Hp)===null||t===void 0||t.call(this),(e=this.Up)===null||e===void 0||e.call(this),this.Hp=void 0,this.Up=void 0}startIfEnabledOrStop(){this.Vp()?this.Ml(this.op):this.dp()}}},xH=$({surveys:class extends WV{constructor(t){super(new ZV(t))}}},Wg),bH={toolbar:class{constructor(t){this.instance=t}Qp(t){qe.ph_toolbar_state=t}Zp(){var t;return(t=qe.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var r,s;if(k2(this.instance.config)||!ae||!Ee)return!1;t=(r=t)!==null&&r!==void 0?r:ae.location,n=(s=n)!==null&&s!==void 0?s:ae.history;try{if(!e){try{ae.localStorage.setItem("test","test"),ae.localStorage.removeItem("test")}catch{return!1}e=ae==null?void 0:ae.localStorage}const i=qV||Wm(t.hash,"__posthog")||Wm(t.hash,"state");let o;const l=i?Nk(()=>JSON.parse(atob(decodeURIComponent(i))))||Nk(()=>JSON.parse(decodeURIComponent(i))):null;return l&&l.action==="ph_authorize"?(o=l,o.source="url",o&&Object.keys(o).length>0&&(l.desiredHash?t.hash=l.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(o=JSON.parse(e.getItem(K8)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}Jp(t){const e=qe.ph_load_toolbar||qe.ph_load_editor;!Qe(e)&&kn(e)?e(t,this.instance):Y8.warn("No toolbar load function found")}loadToolbar(t){const e=!!(Ee!=null&&Ee.getElementById("__POSTHOG_TOOLBAR__"));if(!ae||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=$($({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ae.localStorage.setItem(K8,JSON.stringify($($({},r),{},{source:void 0}))),this.Zp()===2)this.Jp(r);else if(this.Zp()===0){var s,i;this.Qp(1),(s=qe.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return Y8.error("[Toolbar] Failed to load",o),void this.Qp(0);this.Qp(2),this.Jp(r)}),xt(ae,"turbolinks:load",()=>{this.Qp(0),this.loadToolbar(r)})}return!0}Kp(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},SH=$({experiments:class $r{get Ar(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{$r.Xp("retrieved web experiments from the server"),this.Yp=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.Yp&&($r.Xp("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.Yp)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);st(o)&&s.variants[o]&&this.tg(s.name,o,s.variants[o].transforms)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];$r.eg(l,this._instance)&&this.tg(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())$r.Xp(sE);else if(!this.Ar.disable_web_experiments){if(Qe(this.Yp))return this.Yp=new Map,this.loadIfEnabled(),void this.previewWebExperiment();$r.Xp("applying feature flags",e),e.forEach(n=>{var r;if(this.Yp&&(!((r=this.Yp)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.Yp)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this.tg(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){const e=$r.getWindowLocation();if(e!=null&&e.search){const n=ld(e==null?void 0:e.search,"__experiment_id"),r=ld(e==null?void 0:e.search,"__experiment_variant");n&&r&&($r.Xp(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.ig(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Ar.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Ar.disable_web_experiments&&!r)return e([]);const s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Ar.token}`),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}ig(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&($r.Xp(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.tg(s[0].name,n,s[0].variants[n].transforms))}static eg(e,n){return!Qe(e.conditions)&&$r.ng(e,n)&&$r.sg(e)}static ng(e,n){var r;if(Qe(e.conditions)||Qe((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=$r.getWindowLocation();if(s){var i,o,l;const u=HT(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||eH[(o=(l=e.conditions)===null||l===void 0?void 0:l.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return ae==null?void 0:ae.location}static sg(e){var n;if(Qe(e.conditions)||Qe((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=tR();if(r.utm_source){var s,i,o,l,u,d,f,h;const m=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=e.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_source)==r.utm_source,x=!(!((u=e.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_medium)||((d=e.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,_=!(!((f=e.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0)&&f.utm_term)||((h=e.conditions)===null||h===void 0||(h=h.utm)===null||h===void 0?void 0:h.utm_term)==r.utm_term;return m&&x&&_&&v}return!1}static Xp(e,...n){he.info(`[WebExperiments] ${e}`,n)}tg(e,n,r){this._is_bot()?$r.Xp(sE):n!=="control"?r.forEach(s=>{if(s.selector){var i;$r.Xp(`applying transform of variant ${n} for experiment ${e} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(l=>{const u=l;s.html&&(u.innerHTML=s.html),s.css&&u.setAttribute("style",s.css)})}}):$r.Xp("Control variants leave the page unmodified.")}_is_bot(){return mr&&this._instance?CR(mr,this.Ar.custom_blocked_useragents):void 0}}},Wg),kH={conversations:class{constructor(t){this._instance=t,this.rg=void 0,this._conversationsManager=null,this.og=!1,this.ne=null,this.ag=!1,this.lg=0}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations||(this.ug=t.ok,!t.ok))return;const e=t.config.conversations;Qe(e)||(zr(e)?this.rg=e:(this.rg=e.enabled,this.ne=e),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.lg++,this.rg=void 0,this.ne=null,this.ug=void 0,this.ag=!1}loadIfEnabled(){if(this._conversationsManager||this.og||this._instance.config.disable_conversations||k2(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=qe==null?void 0:qe.__PosthogExtensions__;if(t&&!le(this.rg)&&this.rg)if(this.ne&&this.ne.token){this.og=!0;try{const e=t.initConversations;if(e)return this.cg(e),void(this.og=!1);const n=t.loadExternalDependency;if(!n)return void this.hg(zx);const r=this.lg;n(this._instance,"conversations",s=>{if(r!==this.lg)return this.og=!1,void this.loadIfEnabled();s||!t.initConversations?this.hg("Could not load conversations script",s):this.cg(t.initConversations),this.og=!1})}catch(e){this.hg("Error initializing conversations",e),this.og=!1}}else Ws.error("Conversations enabled but missing token in remote config.")}cg(t){if(this.ne)try{this._conversationsManager=t(this.ne,this._instance),this.ag=!1,Ws.info("Conversations loaded successfully")}catch(e){this.hg("Error completing conversations initialization",e)}else Ws.error("Cannot complete initialization: remote config is null")}hg(t,e){Ws.error(t,e),this._conversationsManager=null,this.og=!1,this.ag=!0}show(){this._conversationsManager?this._conversationsManager.show():Ws.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.rg===!0&&!un(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":k2(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.ug===!1?"remote_config_failed":le(this.rg)?this.ug?"disabled_in_project":"remote_config_pending":this.rg?Qe(this.ne)||!this.ne.token?"missing_token":qe!=null&&qe.__PosthogExtensions__?this.og?"initializing":this.ag?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return Bt(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Ws.warn(jl),null)})()}getMessages(t,e){var n=this;return Bt(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Ws.warn(jl),null)})()}markAsRead(t){var e=this;return Bt(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Ws.warn(jl),null)})()}getTickets(t){var e=this;return Bt(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Ws.warn(jl),null)})()}requestRestoreLink(t){var e=this;return Bt(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Ws.warn(jl),null)})()}restoreFromToken(t){var e=this;return Bt(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Ws.warn(jl),null)})()}restoreFromUrlToken(){var t=this;return Bt(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Ws.warn(jl),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}fd(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}pd(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},EH={logs:class extends rH{constructor(t){super({get(){var e;return t==null||(e=t.config)===null||e===void 0?void 0:e.logs},captureHintKey:xT,get remoteConfigWillArrive(){var e,n;return!(!((e=t.Qu)===null||e===void 0)&&e.call(t))||!!(!((n=qe._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[t.config.token])===null||n===void 0)&&n.config)}},()=>(function(e){var n;const r={};if(r.distinctId=e.get_distinct_id(),e.sessionManager){const{sessionId:s,windowId:i,sessionStartTimestamp:o,lastActivityTimestamp:l}=e.sessionManager.checkAndGetSessionAndWindowId(!0);r.sessionId=s,r.windowId=i,Qe(o)||(r.sessionStartTimestamp=o),Qe(l)||(r.lastActivityTimestamp=l)}if(!(qe==null||(n=qe.location)===null||n===void 0)&&n.href&&(r.currentUrl=e.config.disable_capture_url_hashes?qa(qe.location.href):qe.location.href),e.featureFlags){const s=e.featureFlags.getFlags();s&&s.length>0&&(r.activeFeatureFlags=s)}return r})(t)),this._instance=t,this.name=NR,this.Uv()}get zv(){return this._instance.__loaded}Hv(){const t=an("[logs]"),e=qe==null?void 0:qe.__PosthogExtensions__;if(!e)return void t.error("PostHog Extensions not found.");const n=e.loadExternalDependency;if(n)return r=>{n(this._instance,"logs",s=>{const i=e.logs;r(s,i!=null&&i.initializeLogs?{initialize:o=>i.initializeLogs(o),replay(o,l){var u;return(u=i.replayConsoleBuffer)===null||u===void 0?void 0:u.call(i,o,l)}}:void 0)})};t.error(zx)}}},CH={metrics:class{constructor(t){this._instance=t,this.$=an("[metrics]"),this.Ci=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.Ci)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.dg?this.dg=(n=>{let r=!0;const s=()=>r?(l=>{var u;const d=(u=l.config.metrics)===null||u===void 0?void 0:u.network;return d===!0?{}:d||void 0})(n):void 0,i=oH(n,s),o=aH(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.dg&&(this.dg(),this.dg=void 0)}Gv(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.jv&&this.Qv===e||((n=this.jv)===null||n===void 0||n.reset(),this.Qv=e,this.jv=new X$(this.Vv(),(function(r){var s,i,o,l,u;const d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(o=d==null?void 0:d["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(l=r==null?void 0:r.flushIntervalMs)!==null&&l!==void 0?l:1e4,maxSeriesPerFlush:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(e),this.$)),this.jv}count(t,e=1,n){this.Gv().count(t,e,n)}gauge(t,e,n){this.Gv().gauge(t,e,n)}histogram(t,e,n){this.Gv().histogram(t,e,n)}flush(t){if(!this.jv)return Promise.resolve();if(t){const e=this.jv.drainWindow();return e&&this.po(e,t),Promise.resolve()}return this.jv.flush().catch(e=>this.$.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.jv)===null||t===void 0||t.reset()}dispose(){var t,e;this.Ci=!0,(t=this.dg)===null||t===void 0||t.call(this),this.dg=void 0,(e=this.jv)===null||e===void 0||e.reset()}Vv(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},po:n=>e.po(n),getLibraryId:()=>es.LIB_NAME,getLibraryVersion:()=>es.LIB_VERSION}}po(t,e){return new Promise(n=>{let r=!1;const s=o=>{r||(r=!0,clearTimeout(i),n(o))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request($($({method:"POST",url:this.vg(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(o){const l=o.statusCode;if(l>=200&&300>l)s({kind:"ok"});else if(l===413)s({kind:"too-large"});else if(l!==0&&l!==408&&l!==429&&500>l)s({kind:"fatal",error:new Error(`metrics request failed with status ${l}`)});else{var u;s({kind:"retry-later",error:(u=o.error)!==null&&u!==void 0?u:new Error(`metrics request failed with status ${l}`)})}}}))})}vg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},PH={webMCP:class{constructor(t){this._instance=t,this.fg=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.fg)return;const t=Ee==null?void 0:Ee.modelContext;if(!t||!kn(t.registerTool))return;const e=lE.get(t);if(e)return e.instances.add(this._instance),void(this.fg=!0);const n={instances:new Set([this._instance])},r=t.registerTool,s=this;dd(t,"registerTool",i=>{const o=i;return function(l,...u){let d=l;try{d=s.pg(l,n)}catch{return o.call(this,l,...u)}return o.call(this,d,...u)}}),t.registerTool!==r&&(lE.set(t,n),this.fg=!0)}pg(t,e){if(!t||!kn(t.execute))return t;const n=t.execute,r=this,{tool:s,injected:i}=(function(o,l){const u={intent:!1,model:!1},d=o.inputSchema;if(!(function(x){return!!le(x)||rt(x)&&Object.keys(x).every(_=>lH.has(_)||_.startsWith("x-"))&&x.additionalProperties!==!0&&!rt(x.additionalProperties)&&(!x.type||x.type==="object")&&(!x.properties||rt(x.properties))&&(!x.required||ze(x.required))})(d))return{tool:Ky(o),injected:u};const f=(d==null?void 0:d.properties)||{},h=x=>Gy(f,x)||ze(d==null?void 0:d.required)&&d.required.includes(x);if(u.intent=l.intent&&!h("context"),u.model=l.model&&!h("llm_model"),!u.intent&&!u.model)return{tool:Ky(o),injected:u};const m=$({},f),v=ze(d==null?void 0:d.required)?[...d.required]:[];return u.intent&&(m.context={type:"string",description:`Explain why this tool is called and how it supports the user's goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".`},v.includes("context")||v.push("context")),u.model&&(m.llm_model={type:"string",description:'The exact model identifier you are running as, taken from your system prompt or environment. Pass "unknown" if you do not know it. Never guess.'},v.includes("llm_model")||v.push("llm_model")),{tool:Ky(o,$($({},d),{},{type:(d==null?void 0:d.type)||"object",properties:m,required:v})),injected:u}})(t,(function(o){const l={intent:!1,model:!1};for(const u of o.instances){const d=cE(u.config.capture_webmcp);l.intent||(l.intent=(d==null?void 0:d.intent)===!0),l.model||(l.model=(d==null?void 0:d.model)===!0)}return l})(e));return Object.defineProperty(s,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){const l=new Date,u=(function(v,x){if(!rt(v))return{};try{const _=x.intent?uE(v.context,2048,!0):void 0,w=x.model?uE(v.llm_model,256):void 0;return $($({},_&&_!=="{}"?{intent:_}:{}),w&&w.toLowerCase()!=="unknown"?{model:w}:{})}catch{return{}}})(o[0],i),d=(function(v,x){const _=v[0];if(!rt(_))return v;try{const w=x.intent&&Gy(_,"context"),b=x.model&&Gy(_,"llm_model");if(!w&&!b)return v;const k=$({},_);return w&&delete k.context,b&&delete k.llm_model,[k,...v.slice(1)]}catch{return v}})(o,i);let f;try{f=n.apply(this===s?t:this,d)}catch(v){throw r.gg(e,s,l,{error:v,errorResult:!1},u),v}if((h=f)&&typeof h.then=="function")return Promise.resolve(f).then(v=>{const x=dE(v)?{error:v,errorResult:!0}:void 0;return r.gg(e,s,l,x,u),v},v=>{throw r.gg(e,s,l,{error:v,errorResult:!1},u),v});var h;const m=dE(f)?{error:f,errorResult:!0}:void 0;return r.gg(e,s,l,m,u),f}}),s}gg(t,e,n,r,s){const i=Date.now()-n.getTime();let o;for(const u of t.instances){var l;const d=cE(u.config.capture_webmcp);if(d){r&&!o&&(o=pH(r.error,r.errorResult));try{u.capture("$mcp_tool_call",$($($({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:e.name,$mcp_resource_name:e.name,$mcp_tool_description:e.description,$mcp_server_name:zt==null?void 0:zt.hostname,$mcp_duration_ms:i,$mcp_is_error:!!r},o?{$mcp_error_type:o.type,$mcp_error_message:o.message}:{}),d.intent&&s.intent?{$mcp_intent:s.intent,$mcp_intent_source:"context_parameter"}:{}),d.model&&s.model?{$mcp_llm_model:s.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:n})}catch{continue}if(r&&o&&u.exceptions&&(!((l=u.exceptionObserver)===null||l===void 0)&&l.isEnabled))try{const f={$exception_list:fH(u.exceptions,r,o.message),$exception_level:"error",$exception_source:"mcp.tool_call",$mcp_interface:"webmcp",$mcp_tool_name:e.name,$mcp_resource_name:e.name,$mcp_tool_description:e.description,$mcp_server_name:zt==null?void 0:zt.hostname};u.exceptionObserver.captureException(f)}catch{}}}}}};sh.__defaultExtensionClasses=$({},$($($($($($($($($($($($($($({},Wg),mH),gH),vH),yH),_H),xH),wH),bH),SH),kH),EH),CH),PH));const AH=(function(){es.SDK_DIST_CHANNEL="npm";const t=nh[Vf]=new sh;return(function(){function e(){e.done||(e.done=!0,kR=!1,Rt(nh,function(n){n._dom_loaded()}))}Ee!=null&&Ee.addEventListener?Ee.readyState==="complete"?e():xt(Ee,"DOMContentLoaded",e,{capture:!1}):ae&&he.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Ie=AH,Ot;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Ot||(Ot={}));var fE;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(fE||(fE={}));const je=Ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ca=t=>{switch(typeof t){case"undefined":return je.undefined;case"string":return je.string;case"number":return Number.isNaN(t)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(t)?je.array:t===null?je.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?je.promise:typeof Map<"u"&&t instanceof Map?je.map:typeof Set<"u"&&t instanceof Set?je.set:typeof Date<"u"&&t instanceof Date?je.date:je.object;default:return je.unknown}},xe=Ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class qo extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,u=0;for(;u<o.path.length;){const d=o.path[u];u===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(n(o))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return s(this),r}static assert(e){if(!(e instanceof qo))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}qo.create=t=>new qo(t);const $2=(t,e)=>{let n;switch(t.code){case xe.invalid_type:t.received===je.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case xe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ot.jsonStringifyReplacer)}`;break;case xe.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ot.joinValues(t.keys,", ")}`;break;case xe.invalid_union:n="Invalid input";break;case xe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ot.joinValues(t.options)}`;break;case xe.invalid_enum_value:n=`Invalid enum value. Expected ${Ot.joinValues(t.options)}, received '${t.received}'`;break;case xe.invalid_arguments:n="Invalid function arguments";break;case xe.invalid_return_type:n="Invalid function return type";break;case xe.invalid_date:n="Invalid date";break;case xe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ot.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case xe.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case xe.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case xe.custom:n="Invalid input";break;case xe.invalid_intersection_types:n="Intersection results could not be merged";break;case xe.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case xe.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ot.assertNever(t)}return{message:n}};let TH=$2;function RH(){return TH}const IH=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)l=d(o,{data:e,defaultError:l}).message;return{...s,path:i,message:l}};function Pe(t,e){const n=RH(),r=IH({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===$2?void 0:$2].filter(s=>!!s)});t.common.issues.push(r)}class Wr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return it;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Wr.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return it;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const it=Object.freeze({status:"aborted"}),Hf=t=>({status:"dirty",value:t}),ti=t=>({status:"valid",value:t}),hE=t=>t.status==="aborted",pE=t=>t.status==="dirty",fd=t=>t.status==="valid",Xm=t=>typeof Promise<"u"&&t instanceof Promise;var Ze;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ze||(Ze={}));class no{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const mE=(t,e)=>{if(fd(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new qo(t.common.issues);return this._error=n,this._error}}};function ht(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,l)=>{const{message:u}=t;return o.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:u??n??l.defaultError}},description:s}}class Et{get description(){return this._def.description}_getType(e){return Ca(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ca(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Wr,ctx:{common:e.parent.common,data:e.data,parsedType:Ca(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Xm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ca(e)},s=this._parseSync({data:e,path:r.path,parent:r});return mE(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ca(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return fd(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>fd(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ca(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Xm(s)?s:Promise.resolve(s));return mE(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),l=()=>i.addIssue({code:xe.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new Cc({schema:this,typeName:at.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return zo.create(this,this._def)}nullable(){return Pc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qi.create(this)}promise(){return rg.create(this,this._def)}or(e){return Jm.create([this,e],this._def)}and(e){return eg.create(this,e,this._def)}transform(e){return new Cc({...ht(this._def),schema:this,typeName:at.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new sg({...ht(this._def),innerType:this,defaultValue:n,typeName:at.ZodDefault})}brand(){return new BR({typeName:at.ZodBranded,type:this,...ht(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ig({...ht(this._def),innerType:this,catchValue:n,typeName:at.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return ab.create(this,e)}readonly(){return og.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const MH=/^c[^\s-]{8,}$/i,OH=/^[0-9a-z]+$/,LH=/^[0-9A-HJKMNP-TV-Z]{26}$/i,NH=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,DH=/^[a-z0-9_-]{21}$/i,jH=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$H=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,FH=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,VH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Yy;const HH=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zH=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,UH=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,BH=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,WH=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ZH=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,HR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qH=new RegExp(`^${HR}$`);function zR(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function GH(t){return new RegExp(`^${zR(t)}$`)}function KH(t){let e=`${HR}T${zR(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function YH(t,e){return!!((e==="v4"||!e)&&HH.test(t)||(e==="v6"||!e)&&UH.test(t))}function XH(t,e){if(!jH.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function QH(t,e){return!!((e==="v4"||!e)&&zH.test(t)||(e==="v6"||!e)&&BH.test(t))}class Ho extends Et{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==je.string){const i=this._getOrReturnCtx(e);return Pe(i,{code:xe.invalid_type,expected:je.string,received:i.parsedType}),it}const r=new Wr;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),Pe(s,{code:xe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),Pe(s,{code:xe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(e,s),o?Pe(s,{code:xe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Pe(s,{code:xe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")FH.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"email",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Yy||(Yy=new RegExp(VH,"u")),Yy.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"emoji",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")NH.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"uuid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")DH.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"nanoid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")MH.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"cuid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")OH.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"cuid2",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")LH.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"ulid",code:xe.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Pe(s,{validation:"url",code:xe.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"regex",code:xe.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),Pe(s,{code:xe.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),Pe(s,{code:xe.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),Pe(s,{code:xe.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?KH(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{code:xe.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?qH.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{code:xe.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?GH(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{code:xe.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?$H.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"duration",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?YH(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"ip",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?XH(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"jwt",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?QH(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"cidr",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?WH.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"base64",code:xe.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?ZH.test(e.data)||(s=this._getOrReturnCtx(e,s),Pe(s,{validation:"base64url",code:xe.invalid_string,message:i.message}),r.dirty()):Ot.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:xe.invalid_string,...Ze.errToObj(r)})}_addCheck(e){return new Ho({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ze.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ze.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ze.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ze.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ze.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ze.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ze.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ze.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ze.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ze.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ze.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ze.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ze.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ze.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ze.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ze.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ze.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ze.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ze.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ze.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ze.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ze.errToObj(n)})}nonempty(e){return this.min(1,Ze.errToObj(e))}trim(){return new Ho({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ho({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ho({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ho.create=t=>new Ho({checks:[],typeName:at.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...ht(t)});function JH(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class hd extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==je.number){const i=this._getOrReturnCtx(e);return Pe(i,{code:xe.invalid_type,expected:je.number,received:i.parsedType}),it}let r;const s=new Wr;for(const i of this._def.checks)i.kind==="int"?Ot.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Pe(r,{code:xe.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Pe(r,{code:xe.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Pe(r,{code:xe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?JH(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Pe(r,{code:xe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Pe(r,{code:xe.not_finite,message:i.message}),s.dirty()):Ot.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,s){return new hd({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(e){return new hd({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ze.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ze.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ot.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}hd.create=t=>new hd({checks:[],typeName:at.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ht(t)});class bh extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==je.bigint)return this._getInvalidInput(e);let r;const s=new Wr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Pe(r,{code:xe.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Pe(r,{code:xe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Pe(r,{code:xe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Ot.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Pe(n,{code:xe.invalid_type,expected:je.bigint,received:n.parsedType}),it}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,s){return new bh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(e){return new bh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}bh.create=t=>new bh({checks:[],typeName:at.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...ht(t)});class F2 extends Et{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==je.boolean){const r=this._getOrReturnCtx(e);return Pe(r,{code:xe.invalid_type,expected:je.boolean,received:r.parsedType}),it}return ti(e.data)}}F2.create=t=>new F2({typeName:at.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ht(t)});class Qm extends Et{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==je.date){const i=this._getOrReturnCtx(e);return Pe(i,{code:xe.invalid_type,expected:je.date,received:i.parsedType}),it}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Pe(i,{code:xe.invalid_date}),it}const r=new Wr;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),Pe(s,{code:xe.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),Pe(s,{code:xe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Ot.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Qm({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ze.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ze.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Qm.create=t=>new Qm({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:at.ZodDate,...ht(t)});class gE extends Et{_parse(e){if(this._getType(e)!==je.symbol){const r=this._getOrReturnCtx(e);return Pe(r,{code:xe.invalid_type,expected:je.symbol,received:r.parsedType}),it}return ti(e.data)}}gE.create=t=>new gE({typeName:at.ZodSymbol,...ht(t)});class V2 extends Et{_parse(e){if(this._getType(e)!==je.undefined){const r=this._getOrReturnCtx(e);return Pe(r,{code:xe.invalid_type,expected:je.undefined,received:r.parsedType}),it}return ti(e.data)}}V2.create=t=>new V2({typeName:at.ZodUndefined,...ht(t)});class H2 extends Et{_parse(e){if(this._getType(e)!==je.null){const r=this._getOrReturnCtx(e);return Pe(r,{code:xe.invalid_type,expected:je.null,received:r.parsedType}),it}return ti(e.data)}}H2.create=t=>new H2({typeName:at.ZodNull,...ht(t)});class vE extends Et{constructor(){super(...arguments),this._any=!0}_parse(e){return ti(e.data)}}vE.create=t=>new vE({typeName:at.ZodAny,...ht(t)});class z2 extends Et{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ti(e.data)}}z2.create=t=>new z2({typeName:at.ZodUnknown,...ht(t)});class Ga extends Et{_parse(e){const n=this._getOrReturnCtx(e);return Pe(n,{code:xe.invalid_type,expected:je.never,received:n.parsedType}),it}}Ga.create=t=>new Ga({typeName:at.ZodNever,...ht(t)});class yE extends Et{_parse(e){if(this._getType(e)!==je.undefined){const r=this._getOrReturnCtx(e);return Pe(r,{code:xe.invalid_type,expected:je.void,received:r.parsedType}),it}return ti(e.data)}}yE.create=t=>new yE({typeName:at.ZodVoid,...ht(t)});class Qi extends Et{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==je.array)return Pe(n,{code:xe.invalid_type,expected:je.array,received:n.parsedType}),it;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(Pe(n,{code:o?xe.too_big:xe.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Pe(n,{code:xe.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Pe(n,{code:xe.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new no(n,o,n.path,l)))).then(o=>Wr.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new no(n,o,n.path,l)));return Wr.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Qi({...this._def,minLength:{value:e,message:Ze.toString(n)}})}max(e,n){return new Qi({...this._def,maxLength:{value:e,message:Ze.toString(n)}})}length(e,n){return new Qi({...this._def,exactLength:{value:e,message:Ze.toString(n)}})}nonempty(e){return this.min(1,e)}}Qi.create=(t,e)=>new Qi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:at.ZodArray,...ht(e)});function ku(t){if(t instanceof zn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=zo.create(ku(r))}return new zn({...t._def,shape:()=>e})}else return t instanceof Qi?new Qi({...t._def,type:ku(t.element)}):t instanceof zo?zo.create(ku(t.unwrap())):t instanceof Pc?Pc.create(ku(t.unwrap())):t instanceof kc?kc.create(t.items.map(e=>ku(e))):t}class zn extends Et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ot.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==je.object){const d=this._getOrReturnCtx(e);return Pe(d,{code:xe.invalid_type,expected:je.object,received:d.parsedType}),it}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Ga&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||l.push(d);const u=[];for(const d of o){const f=i[d],h=s.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new no(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Ga){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")l.length>0&&(Pe(s,{code:xe.unrecognized_keys,keys:l}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l){const h=s.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new no(s,h,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const h=await f.key,m=await f.value;d.push({key:h,value:m,alwaysSet:f.alwaysSet})}return d}).then(d=>Wr.mergeObjectSync(r,d)):Wr.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Ze.errToObj,new zn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ze.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new zn({...this._def,unknownKeys:"strip"})}passthrough(){return new zn({...this._def,unknownKeys:"passthrough"})}extend(e){return new zn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new zn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:at.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new zn({...this._def,catchall:e})}pick(e){const n={};for(const r of Ot.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new zn({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Ot.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new zn({...this._def,shape:()=>n})}deepPartial(){return ku(this)}partial(e){const n={};for(const r of Ot.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new zn({...this._def,shape:()=>n})}required(e){const n={};for(const r of Ot.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof zo;)i=i._def.innerType;n[r]=i}return new zn({...this._def,shape:()=>n})}keyof(){return UR(Ot.objectKeys(this.shape))}}zn.create=(t,e)=>new zn({shape:()=>t,unknownKeys:"strip",catchall:Ga.create(),typeName:at.ZodObject,...ht(e)});zn.strictCreate=(t,e)=>new zn({shape:()=>t,unknownKeys:"strict",catchall:Ga.create(),typeName:at.ZodObject,...ht(e)});zn.lazycreate=(t,e)=>new zn({shape:t,unknownKeys:"strip",catchall:Ga.create(),typeName:at.ZodObject,...ht(e)});class Jm extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new qo(l.ctx.common.issues));return Pe(n,{code:xe.invalid_union,unionErrors:o}),it}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(u=>new qo(u));return Pe(n,{code:xe.invalid_union,unionErrors:l}),it}}get options(){return this._def.options}}Jm.create=(t,e)=>new Jm({options:t,typeName:at.ZodUnion,...ht(e)});const To=t=>t instanceof B2?To(t.schema):t instanceof Cc?To(t.innerType()):t instanceof ng?[t.value]:t instanceof Ec?t.options:t instanceof W2?Ot.objectValues(t.enum):t instanceof sg?To(t._def.innerType):t instanceof V2?[void 0]:t instanceof H2?[null]:t instanceof zo?[void 0,...To(t.unwrap())]:t instanceof Pc?[null,...To(t.unwrap())]:t instanceof BR||t instanceof og?To(t.unwrap()):t instanceof ig?To(t._def.innerType):[];class ob extends Et{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==je.object)return Pe(n,{code:xe.invalid_type,expected:je.object,received:n.parsedType}),it;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Pe(n,{code:xe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),it)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const s=new Map;for(const i of n){const o=To(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);s.set(l,i)}}return new ob({typeName:at.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...ht(r)})}}function U2(t,e){const n=Ca(t),r=Ca(e);if(t===e)return{valid:!0,data:t};if(n===je.object&&r===je.object){const s=Ot.objectKeys(e),i=Ot.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o={...t,...e};for(const l of i){const u=U2(t[l],e[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(n===je.array&&r===je.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],l=e[i],u=U2(o,l);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===je.date&&r===je.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class eg extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(hE(i)||hE(o))return it;const l=U2(i.value,o.value);return l.valid?((pE(i)||pE(o))&&n.dirty(),{status:n.value,value:l.data}):(Pe(r,{code:xe.invalid_intersection_types}),it)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}eg.create=(t,e,n)=>new eg({left:t,right:e,typeName:at.ZodIntersection,...ht(n)});class kc extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.array)return Pe(r,{code:xe.invalid_type,expected:je.array,received:r.parsedType}),it;if(r.data.length<this._def.items.length)return Pe(r,{code:xe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),it;!this._def.rest&&r.data.length>this._def.items.length&&(Pe(r,{code:xe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new no(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Wr.mergeArray(n,o)):Wr.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new kc({...this._def,rest:e})}}kc.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new kc({items:t,typeName:at.ZodTuple,rest:null,...ht(e)})};class tg extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.object)return Pe(r,{code:xe.invalid_type,expected:je.object,received:r.parsedType}),it;const s=[],i=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:i._parse(new no(r,l,r.path,l)),value:o._parse(new no(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Wr.mergeObjectAsync(n,s):Wr.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Et?new tg({keyType:e,valueType:n,typeName:at.ZodRecord,...ht(r)}):new tg({keyType:Ho.create(),valueType:e,typeName:at.ZodRecord,...ht(n)})}}class _E extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.map)return Pe(r,{code:xe.invalid_type,expected:je.map,received:r.parsedType}),it;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,u],d)=>({key:s._parse(new no(r,l,r.path,[d,"key"])),value:i._parse(new no(r,u,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return it;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const u of o){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return it;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}_E.create=(t,e,n)=>new _E({valueType:e,keyType:t,typeName:at.ZodMap,...ht(n)});class Sh extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.set)return Pe(r,{code:xe.invalid_type,expected:je.set,received:r.parsedType}),it;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Pe(r,{code:xe.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Pe(r,{code:xe.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const d=new Set;for(const f of u){if(f.status==="aborted")return it;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((u,d)=>i._parse(new no(r,u,r.path,d)));return r.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,n){return new Sh({...this._def,minSize:{value:e,message:Ze.toString(n)}})}max(e,n){return new Sh({...this._def,maxSize:{value:e,message:Ze.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Sh.create=(t,e)=>new Sh({valueType:t,minSize:null,maxSize:null,typeName:at.ZodSet,...ht(e)});class B2 extends Et{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}B2.create=(t,e)=>new B2({getter:t,typeName:at.ZodLazy,...ht(e)});class ng extends Et{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Pe(n,{received:n.data,code:xe.invalid_literal,expected:this._def.value}),it}return{status:"valid",value:e.data}}get value(){return this._def.value}}ng.create=(t,e)=>new ng({value:t,typeName:at.ZodLiteral,...ht(e)});function UR(t,e){return new Ec({values:t,typeName:at.ZodEnum,...ht(e)})}class Ec extends Et{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Pe(n,{expected:Ot.joinValues(r),received:n.parsedType,code:xe.invalid_type}),it}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Pe(n,{received:n.data,code:xe.invalid_enum_value,options:r}),it}return ti(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Ec.create(e,{...this._def,...n})}exclude(e,n=this._def){return Ec.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Ec.create=UR;class W2 extends Et{_parse(e){const n=Ot.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==je.string&&r.parsedType!==je.number){const s=Ot.objectValues(n);return Pe(r,{expected:Ot.joinValues(s),received:r.parsedType,code:xe.invalid_type}),it}if(this._cache||(this._cache=new Set(Ot.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Ot.objectValues(n);return Pe(r,{received:r.data,code:xe.invalid_enum_value,options:s}),it}return ti(e.data)}get enum(){return this._def.values}}W2.create=(t,e)=>new W2({values:t,typeName:at.ZodNativeEnum,...ht(e)});class rg extends Et{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==je.promise&&n.common.async===!1)return Pe(n,{code:xe.invalid_type,expected:je.promise,received:n.parsedType}),it;const r=n.parsedType===je.promise?n.data:Promise.resolve(n.data);return ti(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}rg.create=(t,e)=>new rg({type:t,typeName:at.ZodPromise,...ht(e)});class Cc extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===at.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{Pe(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return it;const u=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return u.status==="aborted"?it:u.status==="dirty"||n.value==="dirty"?Hf(u.value):u});{if(n.value==="aborted")return it;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?it:l.status==="dirty"||n.value==="dirty"?Hf(l.value):l}}if(s.type==="refinement"){const o=l=>{const u=s.refinement(l,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?it:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?it:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!fd(o))return it;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>fd(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):it);Ot.assertNever(s)}}Cc.create=(t,e,n)=>new Cc({schema:t,typeName:at.ZodEffects,effect:e,...ht(n)});Cc.createWithPreprocess=(t,e,n)=>new Cc({schema:e,effect:{type:"preprocess",transform:t},typeName:at.ZodEffects,...ht(n)});class zo extends Et{_parse(e){return this._getType(e)===je.undefined?ti(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}zo.create=(t,e)=>new zo({innerType:t,typeName:at.ZodOptional,...ht(e)});class Pc extends Et{_parse(e){return this._getType(e)===je.null?ti(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pc.create=(t,e)=>new Pc({innerType:t,typeName:at.ZodNullable,...ht(e)});class sg extends Et{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===je.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}sg.create=(t,e)=>new sg({innerType:t,typeName:at.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ht(e)});class ig extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Xm(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new qo(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new qo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ig.create=(t,e)=>new ig({innerType:t,typeName:at.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ht(e)});class wE extends Et{_parse(e){if(this._getType(e)!==je.nan){const r=this._getOrReturnCtx(e);return Pe(r,{code:xe.invalid_type,expected:je.nan,received:r.parsedType}),it}return{status:"valid",value:e.data}}}wE.create=t=>new wE({typeName:at.ZodNaN,...ht(t)});class BR extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ab extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?it:i.status==="dirty"?(n.dirty(),Hf(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?it:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new ab({in:e,out:n,typeName:at.ZodPipeline})}}class og extends Et{_parse(e){const n=this._def.innerType._parse(e),r=s=>(fd(s)&&(s.value=Object.freeze(s.value)),s);return Xm(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}og.create=(t,e)=>new og({innerType:t,typeName:at.ZodReadonly,...ht(e)});var at;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(at||(at={}));const Ge=Ho.create,lb=hd.create,Ua=F2.create,Bae=z2.create;Ga.create;const Ac=Qi.create,gn=zn.create,ez=Jm.create,tz=ob.create;eg.create;kc.create;const WR=tg.create,xE=ng.create,lr=Ec.create;rg.create;zo.create;Pc.create;const nz=it,mi=lb().finite().nonnegative().max(Number.MAX_SAFE_INTEGER),rz=gn({command:lr(["open","status","stop","wait","auth.status","variants.start","variants.status","variants.get","variants.list","variants.complete","variants.commit","variants.cancel","reference.fetch","evidence.capture"]).optional(),tool_name:lr(["rivet_login","rivet_explore_designs","rivet_get_exploration","rivet_apply_design","rivet_cancel_exploration","rivet_complete_variant_work","rivet_get_design_context","rivet_find_references","rivet_save_reference","rivet_remove_reference","rivet_preview_reference_import","rivet_import_references","rivet_connect_reference_account","rivet_discover_reference_collections","rivet_save_design_preference","rivet_remove_design_preference","rivet_save_design_check","rivet_remove_design_check","rivet_run_design_check"]).optional(),caller_agent:lr(["claude","codex","cursor","unknown","other"]).optional(),mcp_editor:lr(["claude","claude-desktop","codex","cursor","unknown","other"]).optional(),source:lr(["cli","mcp","core","ui","visual_editor"]).optional(),surface:lr(["cli","mcp","visual_editor"]).optional(),mode:lr(["initial_generation","zero_to_one","source_grounded","comment_refine","vary","history_adoption","commit","unknown"]).optional(),entry_point:lr(["mcp_tool","visual_editor_comment","variants_panel","history","watch_loop","route","unknown","login_command","signin_command","install_flow","tool_call","account_menu","library","menu","onboarding","editor_gate","cli","mcp"]).optional(),project_context_kind:lr(["existing","fresh"]).optional(),preview_kind:lr(["dev_server","static_artifact"]).optional(),provider:lr(["pinterest","arena","cosmos","x"]).optional(),request_status:lr(["accepted","rejected","completed","failed","cancelled","degraded","superseded"]).optional(),error_code:lr(["OPERATION_FAILED","USAGE_ERROR","AUTH_REQUIRED","SERVER_UNAVAILABLE","WAIT_TIMEOUT","SESSION_NOT_FOUND","WORK_ITEM_NOT_FOUND","MCP_REMOVED","STATIC_PREVIEW_FAILED","DEV_SERVER_FAILED","PREVIEW_UNAVAILABLE"]).optional(),failure_reason:lr(["ack_failed","active_session","destination_not_empty","feature_disabled","invalid_stage_action","lease_expired","missing_artifact","missing_required_input","pending_change_conflict","queue_full","runtime_validation_failed","schema_validation_failed","source_context_invalid","start_in_flight","target_not_editable","timeout","unknown","work_item_not_found","local_server_failed","oauth_failed","popup_blocked","credential_store_failed","popup_closed","provider_failed","request_failed","auth_required","invalid_arguments","operation_failed","server_unavailable","usage_error","wait_timeout","session_not_found","mcp_removed","server_start_timeout","handshake_missing","handshake_invalid","process_not_running","health_check_failed","plugin_context_mismatch","telemetry_policy_mismatch","server_starting","transport_failed","server_shutdown_pending","server_process_exited","server_upgrade_required","replacement_version_mismatch","replacement_health_failed","app_health_failed","dev_server_resolution_failed","rivet_port_unavailable","editor_server_start_failed"]).optional(),ok:Ua().optional(),is_recoverable:Ua().optional(),is_fresh:Ua().optional(),duration_ms:mi.optional(),dwell_ms_from_terminal:mi.optional(),exit_code:mi.optional(),requested_count:mi.optional(),accepted_count:mi.optional(),work_item_count:mi.optional(),completed_count:mi.optional(),failed_count:mi.optional(),cancelled_count:mi.optional(),reference_count:mi.optional(),changed_files_count:mi.optional()}),sz=new Set(["cli_command_completed","cli_auth_started","cli_auth_completed","cli_auth_failed","mcp_auth_started","mcp_auth_completed","mcp_auth_failed","mcp_tool_executed","mcp_tool_failed","mcp_login_failed","mcp_login_started","mcp_login_completed","visual_editor_auth_started","visual_editor_auth_completed","visual_editor_auth_failed","visual_editor_reference_connection_started","visual_editor_reference_connection_completed","visual_editor_reference_connection_failed","agent_variants.request_started","agent_variants.request_accepted","agent_variants.request_rejected","agent_variants.refinement_requested","agent_variants.refinement_completed","agent_variants.refinement_failed","agent_variants.round_started","agent_variants.round_completed","agent_variants.preview_started","agent_variants.preview_ready","agent_variants.preview_failed","agent_variants.committed","agent_variants.commit_failed"]),iz=(t,e)=>{if(!sz.has(t))return null;const n={};for(const[r,s]of Object.entries(rz.shape)){const i=s.safeParse(e[r]);i.success&&i.data!==void 0&&(n[r]=i.data)}return n},oz=gn({token:Ge().min(1)}),az=t=>oz.parse(t).token,Zg="rivet_library_token";let Go="",pd=0,ki=null,bE=!1;const Z2=new Set,kh=()=>Z2.forEach(t=>t()),Wae=()=>ki,Zae=()=>pd,Eh=()=>{try{const t=window.localStorage.getItem(Zg)??"";Go!==t&&(pd+=1),Go=t,ki=null}catch{ki="Rivet cannot access browser storage. Allow site storage and try again."}},ZR=()=>{bE||(window.addEventListener("storage",t=>{t.key!==Zg&&t.key!==null||(Eh(),kh())}),bE=!0)},qae=()=>!!Go,Gae=t=>(ZR(),Z2.add(t),()=>Z2.delete(t)),lz=(t,e)=>{if(e!==void 0&&Eh(),e!==void 0&&e!==pd)throw new Error("Sign-in was cancelled because the browser login changed.");try{window.localStorage.setItem(Zg,t)}catch{throw ki="Rivet cannot save browser access. Allow site storage and try again.",kh(),new Error(ki)}Go=t,pd+=1,ki=null,kh()},qR=()=>{Go="",pd+=1,ki=null;try{window.localStorage.removeItem(Zg)}catch{ki="Rivet cannot clear browser storage. Allow site storage and try again."}kh()},cz=async()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;ZR(),Eh();const t=pd,e=new URLSearchParams(window.location.hash.slice(1)).get("code");if(e){window.history.replaceState(null,"",window.location.pathname+window.location.search);try{const n=await fetch("/api/library/browser-sessions/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e})});if(n.ok){lz(az(await n.json()),t);return}n.status>=500&&!Go&&(ki="Rivet is temporarily unavailable. Please retry this link.")}catch{!Go&&!ki&&(ki="Rivet could not open this link. Please retry when the server is available.")}}kh()},GR=async(t,e={})=>{Eh();const n=Go,r=new Headers(e.headers);r.set("Authorization",`Bearer ${n}`);const s=await fetch(t,{...e,headers:r});return s.status===401&&(Eh(),Go===n&&qR()),s},uz=async(t,e={})=>{const n=await GR(`/api/library${t}`,{method:e.method??"GET",signal:e.signal,headers:{"Content-Type":"application/json"},...e.body!==void 0?{body:JSON.stringify(e.body)}:{}});return dz(n)},dz=async t=>{const e=await t.text();let n;try{n=JSON.parse(e)}catch{if(t.ok)throw new Error("The library returned an invalid response.")}if(!t.ok){if(t.status===401)throw new Error("Sign in to access this library.");const r=n&&typeof n=="object"&&"error"in n&&typeof n.error=="string"&&n.error.trim()?n.error:`Library request failed (${t.status}).`;throw new Error(r)}return n},_t=(t,e={})=>{if(!window.location.pathname.startsWith("/rivet/library")){const n=new Headers(e.headers),r=v7();return r&&m7(t,e.method)&&n.set(f7,r),fetch(t,{...e,headers:n,redirect:"error"})}return GR(t,e)};let KR="off";const SE=t=>{KR=t},q2=()=>KR==="full",fz="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",hz=3e3,pz=/^plugin-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,mz=t=>({person_profiles:"never",autocapture:!1,opt_out_useragent_filter:!0,capture_pageview:!1,capture_pageleave:!1,capture_exceptions:!1,capture_performance:!1,disable_session_recording:!0,enable_recording_console_log:!1,disable_external_dependency_loading:!0,disable_surveys:!0,advanced_disable_flags:!0,advanced_disable_feature_flags:!0,mask_all_text:!0,mask_all_element_attributes:!0,persistence:"memory",bootstrap:{distinctID:t,isIdentifiedID:!1},before_send:e=>{const n=iz(e.event,e.properties);return n&&_t("/api/telemetry/events",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e.event,properties:n}),keepalive:!0}).catch(()=>{}),null}}),gz=async()=>{try{const t=await _t("/api/telemetry",{signal:AbortSignal.timeout(hz),cache:"no-store"});if(!t.ok)return;const e=await t.json();if(e.mode!=="full"&&e.mode!=="metrics"||e.mode==="metrics"&&(typeof e.distinctId!="string"||!pz.test(e.distinctId)))return;const n=e.mode,s={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",...{session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]",blockSelector:"iframe[data-rivet-private]"}},mask_all_text:!1,mask_all_element_attributes:!1,loaded:i=>i.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.25.0",env:"production"})};n==="metrics"&&Object.assign(s,mz(e.distinctId),{api_host:window.location.origin}),Ie.init(fz,s),SE(n)}catch{SE("off")}},YR=g.createContext(void 0),XR=t=>{const e=g.useContext(YR);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},vz=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(YR.Provider,{value:t,children:e})),yz={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var Pa,Ox,s5,_z=(s5=class{constructor(){nt(this,Pa,yz);nt(this,Ox,!1)}setTimeoutProvider(t){Ae(this,Pa,t)}setTimeout(t,e){return Z(this,Pa).setTimeout(t,e)}clearTimeout(t){Z(this,Pa).clearTimeout(t)}setInterval(t,e){return Z(this,Pa).setInterval(t,e)}clearInterval(t){Z(this,Pa).clearInterval(t)}},Pa=new WeakMap,Ox=new WeakMap,s5);const Ql=new _z;function wz(t){setTimeout(t,0)}const xz=typeof window>"u"||"Deno"in globalThis;function ts(){}function bz(t,e){return typeof t=="function"?t(e):t}function QR(t){return typeof t=="number"&&t>=0&&t!==1/0}function JR(t,e){return Math.max(t+(e||0)-Date.now(),0)}function pn(t,e){return typeof t=="function"?t(e):t}function kE(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==cb(o,e.options))return!1}else if(!md(e.queryKey,o))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||i&&!i(e))}function EE(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Ch(e.options.mutationKey)!==Ch(i))return!1}else if(!md(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function cb(t,e){return((e==null?void 0:e.queryKeyHashFn)||Ch)(t)}function Ch(t){return JSON.stringify(t,(e,n)=>G2(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function md(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(e.length>t.length)return!1;for(let r=0;r<e.length;r++)if(!md(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!md(t[r],e[r]))return!1;return!0}return!1}const Sz=Object.prototype.hasOwnProperty;function eI(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=CE(t)&&CE(e);if(!r&&!(G2(t)&&G2(e)))return e;const s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),o=i.length,l=r?new Array(o):{};let u=0;for(let d=0;d<o;d++){const f=r?d:i[d],h=t[f],m=e[f];if(h===m){l[f]=h,(r?d<s:Sz.call(t,f))&&u++;continue}if(h===null||m===null||typeof h!="object"||typeof m!="object"){l[f]=m;continue}const v=eI(h,m,n+1);l[f]=v,v===h&&u++}return s===o&&u===s?t:l}function Xy(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 CE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function G2(t){if(!PE(t))return!1;const e=Object.getPrototypeOf(t),n=e==null?void 0:e.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!PE(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function PE(t){return Object.prototype.toString.call(t)==="[object Object]"}function kz(t){return new Promise(e=>{Ql.setTimeout(e,t)})}function K2(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?eI(t,e):e}function Ez(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Cz(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}const ub=Symbol();function tI(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===ub?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function nI(t,e){return typeof t=="function"?t(...e):!!t}function Pz(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}let Az=()=>xz;const db=()=>Az();var ep=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(){}},nc,Aa,Wu,i5,Tz=(i5=class extends ep{constructor(){super();nt(this,nc);nt(this,Aa);nt(this,Wu);Ae(this,Wu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,Aa)||this.setEventListener(Z(this,Wu))}onUnsubscribe(){var e;this.hasListeners()||((e=Z(this,Aa))==null||e.call(this),Ae(this,Aa,void 0))}setEventListener(e){var n;Ae(this,Wu,e),(n=Z(this,Aa))==null||n.call(this),Ae(this,Aa,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){Z(this,nc)!==e&&(Ae(this,nc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof Z(this,nc)=="boolean"?Z(this,nc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},nc=new WeakMap,Aa=new WeakMap,Wu=new WeakMap,i5);const fb=new Tz,Rz=wz;function Iz(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=Rz;const i=l=>{e?t.push(l):s(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&s(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||o()}return u},batchCalls:l=>(...u)=>{i(()=>{l(...u)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const vr=Iz();var Zu,Ta,qu,o5,Mz=(o5=class extends ep{constructor(){super();nt(this,Zu,!0);nt(this,Ta);nt(this,qu);Ae(this,qu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,Ta)||this.setEventListener(Z(this,qu))}onUnsubscribe(){var e;this.hasListeners()||((e=Z(this,Ta))==null||e.call(this),Ae(this,Ta,void 0))}setEventListener(e){var n;Ae(this,qu,e),(n=Z(this,Ta))==null||n.call(this),Ae(this,Ta,e(this.setOnline.bind(this)))}setOnline(e){Z(this,Zu)!==e&&(Ae(this,Zu,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return Z(this,Zu)}},Zu=new WeakMap,Ta=new WeakMap,qu=new WeakMap,o5);const ag=new Mz;function Oz(t){return Math.min(1e3*2**t,3e4)}function rI(t){return(t??"online")==="online"?ag.isOnline():!0}var Y2=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function sI(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((k,C)=>{i=k,o=C});l.catch(ts);const u=()=>s!=="pending",d=k=>{var C;if(!u()){const P=new Y2(k);_(P),(C=t.onCancel)==null||C.call(t,P)}},f=()=>{e=!0},h=()=>{e=!1},m=()=>fb.isFocused()&&(t.networkMode==="always"||ag.isOnline())&&t.canRun(),v=()=>rI(t.networkMode)&&t.canRun(),x=k=>{u()||(r==null||r(),s="resolved",i(k))},_=k=>{u()||(r==null||r(),s="rejected",o(k))},w=k=>new Promise(C=>{var P;r=T=>{(u()||k())&&C(T)},(P=t.onPause)==null||P.call(t)}).then(()=>{var C;r=void 0,u()||(C=t.onContinue)==null||C.call(t)}),b=()=>{if(u())return;let k;const C=n===0?t.initialPromise:void 0;try{k=C??t.fn()}catch(P){k=Promise.reject(P)}Promise.resolve(k).then(x).catch(P=>{var L;if(u())return;const T=t.retry??(db()?0:3),M=t.retryDelay??Oz,I=typeof M=="function"?M(n,P):M,R=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,P);if(e||!R){_(P);return}n++,(L=t.onFail)==null||L.call(t,n,P),kz(I).then(()=>m()?void 0:w(m)).then(()=>{e?_(P):b()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:h,canStart:v,start:()=>(v()?b():w(v).then(b),l)}}var rc,a5,iI=(a5=class{constructor(){nt(this,rc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),QR(this.gcTime)&&Ae(this,rc,Ql.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(db()?1/0:3e5))}clearGcTimeout(){Z(this,rc)!==void 0&&(Ql.clearTimeout(Z(this,rc)),Ae(this,rc,void 0))}},rc=new WeakMap,a5);function Lz(t){return{onFetch:(e,n)=>{var f,h,m,v,x;const r=e.options,s=(m=(h=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((x=e.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const w=C=>{Pz(C,()=>e.signal,()=>_=!0)},b=tI(e.options,e.fetchOptions),k=async(C,P,T)=>{if(_)return Promise.reject(e.signal.reason);if(P==null&&C.pages.length)return Promise.resolve(C);const I=(()=>{const F={client:e.client,queryKey:e.queryKey,pageParam:P,direction:T?"backward":"forward",meta:e.options.meta};return w(F),F})(),R=await b(I),{maxPages:L}=e.options,j=T?Cz:Ez;return{pages:j(C.pages,R,L),pageParams:j(C.pageParams,P,L)}};if(s&&i.length){const C=s==="backward",P=C?Nz:AE,T={pages:i,pageParams:o};l=await k(T,P(r,T),C)}else{const C=t??i.length;do{const P=u===0?o[0]===void 0?r.initialPageParam:o[0]:AE(r,l);if(u>0&&P==null)break;l=await k(l,P),u++}while(u<C)}return l};e.options.persister?e.fetchFn=()=>{var _,w;return(w=(_=e.options).persister)==null?void 0:w.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function AE(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 Nz(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Gu,sc,Ku,Gs,ic,Qn,Gh,oc,wi,Ro,l5,Dz=(l5=class extends iI{constructor(e){super();nt(this,wi);nt(this,Gu);nt(this,sc);nt(this,Ku);nt(this,Gs);nt(this,ic);nt(this,Qn);nt(this,Gh);nt(this,oc);Ae(this,oc,!1),Ae(this,Gh,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ae(this,ic,e.client),Ae(this,Gs,Z(this,ic).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ae(this,sc,RE(this.options)),this.state=e.state??Z(this,sc),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return Z(this,Gu)}get promise(){var e;return(e=Z(this,Qn))==null?void 0:e.promise}setOptions(e){if(this.options={...Z(this,Gh),...e},e!=null&&e._type&&Ae(this,Gu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=RE(this.options);n.data!==void 0&&(this.setState(TE(n.data,n.dataUpdatedAt)),Ae(this,sc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Z(this,Gs).remove(this)}setData(e,n){const r=K2(this.state.data,e,this.options);return kt(this,wi,Ro).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){kt(this,wi,Ro).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=Z(this,Qn))==null?void 0:r.promise;return(s=Z(this,Qn))==null||s.cancel(e),n?n.then(ts).catch(ts):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Z(this,sc)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>pn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ub||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>pn(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:!JR(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=Z(this,Qn))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=Z(this,Qn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Z(this,Gs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(Z(this,Qn)&&(Z(this,oc)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?Z(this,Qn).cancel({revert:!0}):Z(this,Qn).cancelRetry()),this.scheduleGc()),Z(this,Gs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||kt(this,wi,Ro).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,h,m,v,x,_,w,b,k,C,P;if(this.state.fetchStatus!=="idle"&&((d=Z(this,Qn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,Qn))return Z(this,Qn).continueRetry(),Z(this,Qn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(M=>M.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Ae(this,oc,!0),r.signal)})},i=()=>{const T=tI(this.options,n),I=(()=>{const R={client:Z(this,ic),queryKey:this.queryKey,meta:this.meta};return s(R),R})();return Ae(this,oc,!1),this.options.persister?this.options.persister(T,I,this):T(I)},l=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Z(this,ic),state:this.state,fetchFn:i};return s(T),T})();(f=Z(this,Gu)==="infinite"?Lz(this.options.pages):this.options.behavior)==null||f.onFetch(l,this),Ae(this,Ku,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&kt(this,wi,Ro).call(this,{type:"fetch",meta:(m=l.fetchOptions)==null?void 0:m.meta});const u=Ae(this,Qn,sI({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:T=>{T instanceof Y2&&T.revert&&this.setState({...Z(this,Ku),fetchStatus:"idle"}),r.abort()},onFail:(T,M)=>{kt(this,wi,Ro).call(this,{type:"failed",failureCount:T,error:M})},onPause:()=>{kt(this,wi,Ro).call(this,{type:"pause"})},onContinue:()=>{kt(this,wi,Ro).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const T=await u.start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(x=(v=Z(this,Gs).config).onSuccess)==null||x.call(v,T,this),(w=(_=Z(this,Gs).config).onSettled)==null||w.call(_,T,this.state.error,this),T}catch(T){if(T instanceof Y2){if(T.silent)return Z(this,Qn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw kt(this,wi,Ro).call(this,{type:"error",error:T}),(k=(b=Z(this,Gs).config).onError)==null||k.call(b,T,this),(P=(C=Z(this,Gs).config).onSettled)==null||P.call(C,this.state.data,T,this),T}finally{Z(this,Qn)===u&&Ae(this,Qn,void 0),this.scheduleGc()}}},Gu=new WeakMap,sc=new WeakMap,Ku=new WeakMap,Gs=new WeakMap,ic=new WeakMap,Qn=new WeakMap,Gh=new WeakMap,oc=new WeakMap,wi=new WeakSet,Ro=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,...oI(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...TE(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ae(this,Ku,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),vr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),Z(this,Gs).notify({query:this,type:"updated",action:e})})},l5);function oI(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rI(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function TE(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function RE(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 Fr,Ct,Kh,Vr,ac,Yu,No,Yh,Xu,Qu,lc,cc,Ra,Ju,Ft,zf,X2,Q2,J2,ew,tw,nw,rw,sw,c5,jz=(c5=class extends ep{constructor(e,n){super();nt(this,Ft);nt(this,Fr);nt(this,Ct);nt(this,Kh);nt(this,Vr);nt(this,ac);nt(this,Yu);nt(this,No);nt(this,Yh);nt(this,Xu);nt(this,Qu);nt(this,lc);nt(this,cc);nt(this,Ra);nt(this,Ju,new Set);this.options=n,Ae(this,Fr,e),Ae(this,No,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,Ct).addObserver(this),IE(Z(this,Ct),this.options)?kt(this,Ft,zf).call(this):this.updateResult(),kt(this,Ft,tw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return iw(Z(this,Ct),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return iw(Z(this,Ct),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,kt(this,Ft,nw).call(this),kt(this,Ft,rw).call(this),Z(this,Ct).removeObserver(this)}setOptions(e){const n=this.options,r=Z(this,Ct);if(this.options=Z(this,Fr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pn(this.options.enabled,Z(this,Ct))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");kt(this,Ft,sw).call(this),Z(this,Ct).setOptions(this.options),n._defaulted&&!Xy(this.options,n)&&Z(this,Fr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,Ct),observer:this});const s=this.hasListeners();s&&ME(Z(this,Ct),r,this.options,n)&&kt(this,Ft,zf).call(this),this.updateResult(),s&&(Z(this,Ct)!==r||pn(this.options.enabled,Z(this,Ct))!==pn(n.enabled,Z(this,Ct))||pn(this.options.staleTime,Z(this,Ct))!==pn(n.staleTime,Z(this,Ct)))&&kt(this,Ft,Q2).call(this);const i=kt(this,Ft,J2).call(this);s&&(Z(this,Ct)!==r||pn(this.options.enabled,Z(this,Ct))!==pn(n.enabled,Z(this,Ct))||i!==Z(this,Ra))&&kt(this,Ft,ew).call(this,i)}getOptimisticResult(e){const n=Z(this,Fr).getQueryCache().build(Z(this,Fr),e),r=this.createResult(n,e);return Xy(this.getCurrentResult(),r)||(Ae(this,Vr,r),Ae(this,Yu,this.options),Ae(this,ac,Z(this,Ct).state)),r}getCurrentResult(){return Z(this,Vr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){Z(this,Ju).add(e)}getCurrentQuery(){return Z(this,Ct)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=Z(this,Fr).defaultQueryOptions(e),r=Z(this,Fr).getQueryCache().build(Z(this,Fr),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=Z(this,Fr).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch(n).then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return kt(this,Ft,zf).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,Vr)))}createResult(e,n){var M;const r=Z(this,Ct),s=this.options,i=Z(this,Vr),o=Z(this,ac),l=Z(this,Yu),u=e!==r?e.state:Z(this,Kh),{state:d}=e;let f={...d},h=!1,m;if(n._optimisticResults){const I=this.hasListeners(),R=!I&&IE(e,n),L=I&&ME(e,r,n,s);(R||L)&&(f={...f,...oI(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:x,status:_}=f;m=f.data;let w=!1;if(n.placeholderData!==void 0&&m===void 0&&_==="pending"){let I;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=i.data,w=!0):I=typeof n.placeholderData=="function"?n.placeholderData((M=Z(this,Qu))==null?void 0:M.state.data,Z(this,Qu)):n.placeholderData,I!==void 0&&(_="success",m=K2(i==null?void 0:i.data,I,n),h=!0)}if(n.select&&m!==void 0&&!w)if(i&&m===(o==null?void 0:o.data)&&n.select===Z(this,Yh))m=Z(this,Xu);else try{Ae(this,Yh,n.select),m=n.select(m),m=K2(i==null?void 0:i.data,m,n),Ae(this,Xu,m),Ae(this,No,null)}catch(I){Ae(this,No,I)}else m===void 0&&Ae(this,No,null);Z(this,No)&&(v=Z(this,No),m=Z(this,Xu),x=Date.now(),_="error",h=!1);const b=f.fetchStatus==="fetching",k=_==="pending",C=_==="error",P=k&&b,T=m!==void 0;return{status:_,fetchStatus:f.fetchStatus,isPending:k,isSuccess:_==="success",isError:C,isInitialLoading:P,isLoading:P,data:m,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:x,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!k,isLoadingError:C&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:C&&T,isStale:hb(e,n),refetch:this.refetch,isEnabled:pn(n.enabled,e)!==!1}}updateResult(){const e=Z(this,Vr),n=this.createResult(Z(this,Ct),this.options);if(Ae(this,ac,Z(this,Ct).state),Ae(this,Yu,this.options),Z(this,ac).data!==void 0&&Ae(this,Qu,Z(this,Ct)),Xy(n,e))return;Ae(this,Vr,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!Z(this,Ju).size)return!0;const l=new Set(o??Z(this,Ju));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,Vr)).some(u=>{const d=u;return Z(this,Vr)[d]!==e[d]&&l.has(d)})})();vr.batch(()=>{s&&this.listeners.forEach(i=>{i(Z(this,Vr))}),Z(this,Fr).getQueryCache().notify({query:Z(this,Ct),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&kt(this,Ft,tw).call(this)}},Fr=new WeakMap,Ct=new WeakMap,Kh=new WeakMap,Vr=new WeakMap,ac=new WeakMap,Yu=new WeakMap,No=new WeakMap,Yh=new WeakMap,Xu=new WeakMap,Qu=new WeakMap,lc=new WeakMap,cc=new WeakMap,Ra=new WeakMap,Ju=new WeakMap,Ft=new WeakSet,zf=function(e){kt(this,Ft,sw).call(this);let n=Z(this,Ct).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ts)),n},X2=function(e){return!db()&&pn(this.options.enabled,Z(this,Ct))!==!1&&QR(e)},Q2=function(){kt(this,Ft,nw).call(this);const e=pn(this.options.staleTime,Z(this,Ct));if(Z(this,Vr).isStale||!kt(this,Ft,X2).call(this,e))return;const n=JR(Z(this,Vr).dataUpdatedAt,e)+1;Ae(this,lc,Ql.setTimeout(()=>{Z(this,Vr).isStale||this.updateResult()},n))},J2=function(){return pn(this.options.refetchInterval,Z(this,Ct))??!1},ew=function(e){kt(this,Ft,rw).call(this),Ae(this,Ra,e),!(Z(this,Ra)===0||!kt(this,Ft,X2).call(this,Z(this,Ra)))&&Ae(this,cc,Ql.setInterval(()=>{(this.options.refetchIntervalInBackground||fb.isFocused())&&kt(this,Ft,zf).call(this)},Z(this,Ra)))},tw=function(){kt(this,Ft,Q2).call(this),kt(this,Ft,ew).call(this,kt(this,Ft,J2).call(this))},nw=function(){Z(this,lc)!==void 0&&(Ql.clearTimeout(Z(this,lc)),Ae(this,lc,void 0))},rw=function(){Z(this,cc)!==void 0&&(Ql.clearInterval(Z(this,cc)),Ae(this,cc,void 0))},sw=function(){const e=Z(this,Fr).getQueryCache().build(Z(this,Fr),this.options);if(e===Z(this,Ct))return;const n=Z(this,Ct);Ae(this,Ct,e),Ae(this,Kh,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},c5);function $z(t,e){return pn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&pn(e.retryOnMount,t)===!1)}function IE(t,e){return $z(t,e)||t.state.data!==void 0&&iw(t,e,e.refetchOnMount)}function iw(t,e,n){if(pn(e.enabled,t)!==!1&&pn(e.staleTime,t)!=="static"){const r=pn(n,t);return r==="always"||r!==!1&&hb(t,e)}return!1}function ME(t,e,n,r){return(t!==e||pn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&hb(t,n)}function hb(t,e){return pn(e.enabled,t)!==!1&&t.isStaleByTime(pn(e.staleTime,t))}var Xh,Ui,Ar,uc,Bi,ka,u5,Fz=(u5=class extends iI{constructor(e){super();nt(this,Bi);nt(this,Xh);nt(this,Ui);nt(this,Ar);nt(this,uc);Ae(this,Xh,e.client),this.mutationId=e.mutationId,Ae(this,Ar,e.mutationCache),Ae(this,Ui,[]),this.state=e.state||Vz(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Z(this,Ui).includes(e)||(Z(this,Ui).push(e),this.clearGcTimeout(),Z(this,Ar).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ae(this,Ui,Z(this,Ui).filter(n=>n!==e)),this.scheduleGc(),Z(this,Ar).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Z(this,Ui).length||(this.state.status==="pending"?this.scheduleGc():Z(this,Ar).remove(this))}continue(){var e;return((e=Z(this,uc))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,u,d,f,h,m,v,x,_,w,b,k,C,P,T,M,I,R;const n=()=>{kt(this,Bi,ka).call(this,{type:"continue"})},r={client:Z(this,Xh),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Ae(this,uc,sI({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,j)=>{kt(this,Bi,ka).call(this,{type:"failed",failureCount:L,error:j})},onPause:()=>{kt(this,Bi,ka).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Z(this,Ar).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{kt(this,Bi,ka).call(this,{type:"pending",variables:e,isPaused:o}),Z(this,Ar).config.onMutate&&await Z(this,Ar).config.onMutate(e,this,r);const j=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));j!==this.state.context&&kt(this,Bi,ka).call(this,{type:"pending",context:j,variables:e,isPaused:o})}const L=await s.start();return await((f=(d=Z(this,Ar).config).onSuccess)==null?void 0:f.call(d,L,e,this.state.context,this,r)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,L,e,this.state.context,r)),await((x=(v=Z(this,Ar).config).onSettled)==null?void 0:x.call(v,L,null,this.state.variables,this.state.context,this,r)),await((w=(_=this.options).onSettled)==null?void 0:w.call(_,L,null,e,this.state.context,r)),kt(this,Bi,ka).call(this,{type:"success",data:L}),L}catch(L){try{await((k=(b=Z(this,Ar).config).onError)==null?void 0:k.call(b,L,e,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((P=(C=this.options).onError)==null?void 0:P.call(C,L,e,this.state.context,r))}catch(j){Promise.reject(j)}try{await((M=(T=Z(this,Ar).config).onSettled)==null?void 0:M.call(T,void 0,L,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((R=(I=this.options).onSettled)==null?void 0:R.call(I,void 0,L,e,this.state.context,r))}catch(j){Promise.reject(j)}throw kt(this,Bi,ka).call(this,{type:"error",error:L}),L}finally{Z(this,uc)===s&&Ae(this,uc,void 0),Z(this,Ar).runNext(this)}}},Xh=new WeakMap,Ui=new WeakMap,Ar=new WeakMap,uc=new WeakMap,Bi=new WeakSet,ka=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),vr.batch(()=>{Z(this,Ui).forEach(r=>{r.onMutationUpdate(e)}),Z(this,Ar).notify({mutation:this,type:"updated",action:e})})},u5);function Vz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ia,xi,Qh,d5,Hz=(d5=class extends ep{constructor(e={}){super();nt(this,Ia);nt(this,xi);nt(this,Qh);this.config=e,Ae(this,Ia,new Set),Ae(this,xi,new Map),Ae(this,Qh,0)}build(e,n,r){const s=new Fz({client:e,mutationCache:this,mutationId:++y0(this,Qh)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){Z(this,Ia).add(e);const n=P0(e);if(typeof n=="string"){const r=Z(this,xi).get(n);r?r.push(e):Z(this,xi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(Z(this,Ia).delete(e)){const n=P0(e);if(typeof n=="string"){const r=Z(this,xi).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&Z(this,xi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=P0(e);if(typeof n=="string"){const s=(r=Z(this,xi).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r,s;const n=P0(e);return typeof n=="string"?((s=(r=Z(this,xi).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){vr.batch(()=>{const e=this.getAll();Z(this,Ia).clear(),Z(this,xi).clear(),e.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(Z(this,Ia))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>EE(n,r))}findAll(e={}){return this.getAll().filter(n=>EE(e,n))}notify(e){vr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return vr.batch(()=>Promise.all(e.map(n=>n.continue().catch(ts))))}},Ia=new WeakMap,xi=new WeakMap,Qh=new WeakMap,d5);function P0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Wi,f5,zz=(f5=class extends ep{constructor(e={}){super();nt(this,Wi);this.config=e,Ae(this,Wi,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??cb(s,n);let o=this.get(i);return o||(o=new Dz({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){Z(this,Wi).has(e.queryHash)||(Z(this,Wi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){Z(this,Wi).get(e.queryHash)===e&&(e.destroy(),Z(this,Wi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Z(this,Wi).get(e)}getAll(){return[...Z(this,Wi).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>kE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>kE(e,r)):n}notify(e){vr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Wi=new WeakMap,f5),bn,Ma,Oa,ed,td,La,nd,rd,h5,Uz=(h5=class{constructor(t={}){nt(this,bn);nt(this,Ma);nt(this,Oa);nt(this,ed);nt(this,td);nt(this,La);nt(this,nd);nt(this,rd);Ae(this,bn,t.queryCache||new zz),Ae(this,Ma,t.mutationCache||new Hz),Ae(this,Oa,t.defaultOptions||{}),Ae(this,ed,new Map),Ae(this,td,new Map),Ae(this,La,0)}mount(){y0(this,La)._++,Z(this,La)===1&&(Ae(this,nd,fb.subscribe(async t=>{t&&(await this.resumePausedMutations(),Z(this,bn).onFocus())})),Ae(this,rd,ag.subscribe(async t=>{t&&(await this.resumePausedMutations(),Z(this,bn).onOnline())})))}unmount(){var t,e;y0(this,La)._--,Z(this,La)===0&&((t=Z(this,nd))==null||t.call(this),Ae(this,nd,void 0),(e=Z(this,rd))==null||e.call(this),Ae(this,rd,void 0))}isFetching(t){return Z(this,bn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Z(this,Ma).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Z(this,bn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=Z(this,bn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(pn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return Z(this,bn).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var o;const r=this.defaultQueryOptions({queryKey:t}),s=(o=Z(this,bn).get(r.queryHash))==null?void 0:o.state.data,i=bz(e,s);if(i!==void 0)return Z(this,bn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return vr.batch(()=>Z(this,bn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Z(this,bn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=Z(this,bn);vr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=Z(this,bn);return vr.batch(()=>{const r=n.findAll(t),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},r=vr.batch(()=>Z(this,bn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(ts).catch(ts)}invalidateQueries(t,e={}){return vr.batch(()=>(Z(this,bn).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=vr.batch(()=>Z(this,bn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(ts)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(ts)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=Z(this,bn).build(this,e),r=n.isStaleByTime(pn(e.staleTime,n))?await n.fetch(e):n.state.data,s=e.select;return s?s(r):r}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=Z(this,bn).build(this,e);return n.isStaleByTime(pn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ts).catch(ts)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ts).catch(ts)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return ag.isOnline()?Z(this,Ma).resumePausedMutations():Promise.resolve()}getQueryCache(){return Z(this,bn)}getMutationCache(){return Z(this,Ma)}getDefaultOptions(){return Z(this,Oa)}setDefaultOptions(t){Ae(this,Oa,t)}setQueryDefaults(t,e){Z(this,ed).set(Ch(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Z(this,ed).values()],n={};return e.forEach(r=>{md(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){Z(this,td).set(Ch(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Z(this,td).values()],n={};return e.forEach(r=>{md(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Z(this,Oa).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=cb(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===ub&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Z(this,Oa).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Z(this,bn).clear(),Z(this,Ma).clear()}},bn=new WeakMap,Ma=new WeakMap,Oa=new WeakMap,ed=new WeakMap,td=new WeakMap,La=new WeakMap,nd=new WeakMap,rd=new WeakMap,h5);const aI=g.createContext(!1),Bz=()=>g.useContext(aI);aI.Provider;function Wz(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const Zz=g.createContext(Wz()),qz=()=>g.useContext(Zz),Gz=(t,e,n)=>{const r=(n==null?void 0:n.state.status)==="error"&&typeof t.throwOnError=="function"?nI(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},Kz=t=>{g.useEffect(()=>{t.clearReset()},[t])},Yz=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||nI(n,[t.error,r])),Xz=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))}},Qz=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Jz=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function eU(t,e,n){const r=Bz(),s=qz(),i=XR(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),u=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,Xz(o),Gz(o,s,l),Kz(s);const[d]=g.useState(()=>new e(i,o)),f=d.getOptimisticResult(o),h=!r&&u;if(g.useSyncExternalStore(g.useCallback(m=>{const v=h?d.subscribe(vr.batchCalls(m)):ts;return d.updateResult(),v},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),g.useEffect(()=>{d.setOptions(o)},[o,d]),Qz(o,f))throw Jz(o,d,s);if(Yz({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function Ph(t,e){return eU(t,jz)}var tU=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var nU=function(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})},A0,OE="__POSTHOG_REACT_SHARED_STATE__",LE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Ah;try{Ah=LE[OE]=LE[OE]||new WeakMap}catch{Ah=new WeakMap}Ah.has(g.createContext)||Ah.set(g.createContext,{});var pc=Ah.get(g.createContext),ow;function rU(t){(!pc.defaultPostHogInstance||pc.defaultPostHogInstance===ow)&&(pc.defaultPostHogInstance=t),ow=t}function aw(){return ow}pc.context||(pc.context=g.createContext({get client(){return aw()||pc.defaultPostHogInstance},bootstrap:void 0}));var pb=pc.context;function lI(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var i=0,o=r;i<o.length;i++){var l=o[i];if(!s.includes(l)||!lI(t[l],e[l],n))return!1}return!0}function sU(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=g.useRef(null),u=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`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var d=aw();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),d},[s,i,JSON.stringify(o)]);return g.useEffect(function(){if(!(s||!i)){var d=aw(),f=l.current;f?(i!==f.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!lI(o,f.options)&&d.set_config(o),l.current={apiKey:i,options:o??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,o),l.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),we.createElement(pb.Provider,{value:{client:u,bootstrap:(e=o==null?void 0:o.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var Qy=function(t){return typeof t=="function"},iU=function(t){return t===void 0},ni=function(){var t=g.useContext(pb).client;return t},lm=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},oU=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},aU=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!lm(r.cause)){iU(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},lU=function(t,e){if(!e)return t;var n=new Error(lm(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return oU(n,"React ErrorBoundary ".concat(lm(t)?t.name:"Error")),n.stack=e,lm(t)?(aU(t,n),t):n},NE={componentStack:null,exceptionEvent:null,error:null},cU={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},uU=(A0=(function(t){tU(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(NE)},r.state=NE,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Qy(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,u=o.captureException(lU(n,l),i);this.setState({error:n,componentStack:l??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return Qy(r)?r():r;var o=Qy(s)?we.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return we.isValidElement(o)?o:(console.warn(cU.INVALID_FALLBACK),we.createElement(we.Fragment,null))},e})(we.Component),nU(A0,"PostHogErrorBoundary"),(function(){A0.contextType=pb})(),A0);rU(Ie);const dU="rivet-preview-bridge",fU=["ArrowUp","ArrowDown"],hU=new Set(["INPUT","TEXTAREA","SELECT"]),cI=t=>!t||!("tagName"in t)||typeof t.tagName!="string"?!1:hU.has(t.tagName.toUpperCase())||"isContentEditable"in t&&t.isContentEditable===!0,pU=t=>typeof t!="object"||t===null||!("channel"in t)||t.channel!==dU||!("direction"in t)||t.direction!=="event"||!("type"in t)||t.type!=="keydown"||!("key"in t)?null:fU.find(e=>e===t.key)??null,mU=t=>{try{return new URL(t.src,window.location.href).origin}catch{return null}},gU=t=>t.source===null?null:Array.from(document.querySelectorAll("iframe")).find(e=>e.contentWindow===t.source&&mU(e)===t.origin)??null,vU=t=>{const e=n=>{cI(n.target)||t(n)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},yU=()=>{const t=e=>{const n=pU(e.data),r=n?gU(e):null;!n||!r||r.dispatchEvent(new KeyboardEvent("keydown",{key:n,bubbles:!0,cancelable:!0}))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)};var T0={},Jy={exports:{}},Qr={},e_={exports:{}},t_={};/**
20
- * @license React
21
- * scheduler.production.min.js
22
- *
23
- * Copyright (c) Facebook, Inc. and its affiliates.
24
- *
25
- * This source code is licensed under the MIT license found in the
26
- * LICENSE file in the root directory of this source tree.
27
- */var DE;function _U(){return DE||(DE=1,(function(t){function e(B,Q){var z=B.length;B.push(Q);e:for(;0<z;){var N=z-1>>>1,Y=B[N];if(0<s(Y,Q))B[N]=Q,B[z]=Y,z=N;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var Q=B[0],z=B.pop();if(z!==Q){B[0]=z;e:for(var N=0,Y=B.length,oe=Y>>>1;N<oe;){var ne=2*(N+1)-1,ie=B[ne],de=ne+1,ge=B[de];if(0>s(ie,z))de<Y&&0>s(ge,ie)?(B[N]=ge,B[de]=z,N=de):(B[N]=ie,B[ne]=z,N=ne);else if(de<Y&&0>s(ge,z))B[N]=ge,B[de]=z,N=de;else break e}}return Q}function s(B,Q){var z=B.sortIndex-Q.sortIndex;return z!==0?z:B.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],d=[],f=1,h=null,m=3,v=!1,x=!1,_=!1,w=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(B){for(var Q=n(d);Q!==null;){if(Q.callback===null)r(d);else if(Q.startTime<=B)r(d),Q.sortIndex=Q.expirationTime,e(u,Q);else break;Q=n(d)}}function P(B){if(_=!1,C(B),!x)if(n(u)!==null)x=!0,H(T);else{var Q=n(d);Q!==null&&J(P,Q.startTime-B)}}function T(B,Q){x=!1,_&&(_=!1,b(R),R=-1),v=!0;var z=m;try{for(C(Q),h=n(u);h!==null&&(!(h.expirationTime>Q)||B&&!F());){var N=h.callback;if(typeof N=="function"){h.callback=null,m=h.priorityLevel;var Y=N(h.expirationTime<=Q);Q=t.unstable_now(),typeof Y=="function"?h.callback=Y:h===n(u)&&r(u),C(Q)}else r(u);h=n(u)}if(h!==null)var oe=!0;else{var ne=n(d);ne!==null&&J(P,ne.startTime-Q),oe=!1}return oe}finally{h=null,m=z,v=!1}}var M=!1,I=null,R=-1,L=5,j=-1;function F(){return!(t.unstable_now()-j<L)}function D(){if(I!==null){var B=t.unstable_now();j=B;var Q=!0;try{Q=I(!0,B)}finally{Q?q():(M=!1,I=null)}}else M=!1}var q;if(typeof k=="function")q=function(){k(D)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,G=W.port2;W.port1.onmessage=D,q=function(){G.postMessage(null)}}else q=function(){w(D,0)};function H(B){I=B,M||(M=!0,q())}function J(B,Q){R=w(function(){B(t.unstable_now())},Q)}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(B){B.callback=null},t.unstable_continueExecution=function(){x||v||(x=!0,H(T))},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(B){switch(m){case 1:case 2:case 3:var Q=3;break;default:Q=m}var z=m;m=Q;try{return B()}finally{m=z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(B,Q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var z=m;m=B;try{return Q()}finally{m=z}},t.unstable_scheduleCallback=function(B,Q,z){var N=t.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?N+z:N):z=N,B){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=z+Y,B={id:f++,callback:Q,priorityLevel:B,startTime:z,expirationTime:Y,sortIndex:-1},z>N?(B.sortIndex=z,e(d,B),n(u)===null&&B===n(d)&&(_?(b(R),R=-1):_=!0,J(P,z-N))):(B.sortIndex=Y,e(u,B),x||v||(x=!0,H(T))),B},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(B){var Q=m;return function(){var z=m;m=Q;try{return B.apply(this,arguments)}finally{m=z}}}})(t_)),t_}var jE;function wU(){return jE||(jE=1,e_.exports=_U()),e_.exports}/**
28
- * @license React
29
- * react-dom.production.min.js
30
- *
31
- * Copyright (c) Facebook, Inc. and its affiliates.
32
- *
33
- * This source code is licensed under the MIT license found in the
34
- * LICENSE file in the root directory of this source tree.
35
- */var $E;function xU(){if($E)return Qr;$E=1;var t=Lx(),e=wU();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,p=1;p<arguments.length;p++)c+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(a,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(s[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},h={};function m(a){return u.call(h,a)?!0:u.call(f,a)?!1:d.test(a)?h[a]=!0:(f[a]=!0,!1)}function v(a,c,p,y){if(p!==null&&p.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:p!==null?!p.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function x(a,c,p,y){if(c===null||typeof c>"u"||v(a,c,p,y))return!0;if(y)return!1;if(p!==null)switch(p.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(a,c,p,y,E,A,O){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=E,this.mustUseProperty=p,this.propertyName=a,this.type=c,this.sanitizeURL=A,this.removeEmptyString=O}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[a]=new _(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];w[c]=new _(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new _(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[a]=new _(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){w[a]=new _(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){w[a]=new _(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){w[a]=new _(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){w[a]=new _(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){w[a]=new _(a,5,!1,a.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function k(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(b,k);w[c]=new _(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(b,k);w[c]=new _(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(b,k);w[c]=new _(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){w[a]=new _(a,1,!1,a.toLowerCase(),null,!1,!1)}),w.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){w[a]=new _(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,c,p,y){var E=w.hasOwnProperty(c)?w[c]:null;(E!==null?E.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(x(c,p,E,y)&&(p=null),y||E===null?m(c)&&(p===null?a.removeAttribute(c):a.setAttribute(c,""+p)):E.mustUseProperty?a[E.propertyName]=p===null?E.type===3?!1:"":p:(c=E.attributeName,y=E.attributeNamespace,p===null?a.removeAttribute(c):(E=E.type,p=E===3||E===4&&p===!0?"":""+p,y?a.setAttributeNS(y,c,p):a.setAttribute(c,p))))}var P=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),M=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),F=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),B=Symbol.iterator;function Q(a){return a===null||typeof a!="object"?null:(a=B&&a[B]||a["@@iterator"],typeof a=="function"?a:null)}var z=Object.assign,N;function Y(a){if(N===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);N=c&&c[1]||""}return`
36
- `+N+a}var oe=!1;function ne(a,c){if(!a||oe)return"";oe=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(se){var y=se}Reflect.construct(a,[],c)}else{try{c.call()}catch(se){y=se}a.call(c.prototype)}else{try{throw Error()}catch(se){y=se}a()}}catch(se){if(se&&y&&typeof se.stack=="string"){for(var E=se.stack.split(`
37
- `),A=y.stack.split(`
38
- `),O=E.length-1,U=A.length-1;1<=O&&0<=U&&E[O]!==A[U];)U--;for(;1<=O&&0<=U;O--,U--)if(E[O]!==A[U]){if(O!==1||U!==1)do if(O--,U--,0>U||E[O]!==A[U]){var K=`
39
- `+E[O].replace(" at new "," at ");return a.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",a.displayName)),K}while(1<=O&&0<=U);break}}}finally{oe=!1,Error.prepareStackTrace=p}return(a=a?a.displayName||a.name:"")?Y(a):""}function ie(a){switch(a.tag){case 5:return Y(a.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return a=ne(a.type,!1),a;case 11:return a=ne(a.type.render,!1),a;case 1:return a=ne(a.type,!0),a;default:return""}}function de(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case I:return"Fragment";case M:return"Portal";case L:return"Profiler";case R:return"StrictMode";case q:return"Suspense";case W:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case F:return(a.displayName||"Context")+".Consumer";case j:return(a._context.displayName||"Context")+".Provider";case D:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case G:return c=a.displayName||null,c!==null?c:de(a.type)||"Memo";case H:c=a._payload,a=a._init;try{return de(a(c))}catch{}}return null}function ge(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(c);case 8:return c===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ce(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function re(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Ce(a){var c=re(a)?"checked":"value",p=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var E=p.get,A=p.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return E.call(this)},set:function(O){y=""+O,A.call(this,O)}}),Object.defineProperty(a,c,{enumerable:p.enumerable}),{getValue:function(){return y},setValue:function(O){y=""+O},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Fe(a){a._valueTracker||(a._valueTracker=Ce(a))}function ke(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var p=c.getValue(),y="";return a&&(y=re(a)?a.checked?"true":"false":a.value),a=y,a!==p?(c.setValue(a),!0):!1}function dt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Lt(a,c){var p=c.checked;return z({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??a._wrapperState.initialChecked})}function sn(a,c){var p=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;p=ce(c.value!=null?c.value:p),a._wrapperState={initialChecked:y,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function jt(a,c){c=c.checked,c!=null&&C(a,"checked",c,!1)}function pt(a,c){jt(a,c);var p=ce(c.value),y=c.type;if(p!=null)y==="number"?(p===0&&a.value===""||a.value!=p)&&(a.value=""+p):a.value!==""+p&&(a.value=""+p);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Le(a,c.type,p):c.hasOwnProperty("defaultValue")&&Le(a,c.type,ce(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function vn(a,c,p){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,p||c===a.value||(a.value=c),a.defaultValue=c}p=a.name,p!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,p!==""&&(a.name=p)}function Le(a,c,p){(c!=="number"||dt(a.ownerDocument)!==a)&&(p==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+p&&(a.defaultValue=""+p))}var lt=Array.isArray;function Te(a,c,p,y){if(a=a.options,c){c={};for(var E=0;E<p.length;E++)c["$"+p[E]]=!0;for(p=0;p<a.length;p++)E=c.hasOwnProperty("$"+a[p].value),a[p].selected!==E&&(a[p].selected=E),E&&y&&(a[p].defaultSelected=!0)}else{for(p=""+ce(p),c=null,E=0;E<a.length;E++){if(a[E].value===p){a[E].selected=!0,y&&(a[E].defaultSelected=!0);return}c!==null||a[E].disabled||(c=a[E])}c!==null&&(c.selected=!0)}}function Je(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return z({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function bt(a,c){var p=c.value;if(p==null){if(p=c.children,c=c.defaultValue,p!=null){if(c!=null)throw Error(n(92));if(lt(p)){if(1<p.length)throw Error(n(93));p=p[0]}c=p}c==null&&(c=""),p=c}a._wrapperState={initialValue:ce(p)}}function Ke(a,c){var p=ce(c.value),y=ce(c.defaultValue);p!=null&&(p=""+p,p!==a.value&&(a.value=p),c.defaultValue==null&&a.defaultValue!==p&&(a.defaultValue=p)),y!=null&&(a.defaultValue=""+y)}function ft(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function wr(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Zn(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?wr(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Me,ta=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,p,y,E){MSApp.execUnsafeLocalFunction(function(){return a(c,p,y,E)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Me=Me||document.createElement("div"),Me.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Me.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Dn(a,c){if(c){var p=a.firstChild;if(p&&p===a.lastChild&&p.nodeType===3){p.nodeValue=c;return}}a.textContent=c}var nr={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},ul=["Webkit","ms","Moz","O"];Object.keys(nr).forEach(function(a){ul.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),nr[c]=nr[a]})});function yn(a,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||nr.hasOwnProperty(a)&&nr[a]?(""+c).trim():c+"px"}function Yt(a,c){a=a.style;for(var p in c)if(c.hasOwnProperty(p)){var y=p.indexOf("--")===0,E=yn(p,c[p],y);p==="float"&&(p="cssFloat"),y?a.setProperty(p,E):a[p]=E}}var Dd=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ns(a,c){if(c){if(Dd[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function fs(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var rr=null;function co(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ri=null,jn=null,Ds=null;function dl(a){if(a=rf(a)){if(typeof ri!="function")throw Error(n(280));var c=a.stateNode;c&&(c=Op(c),ri(a.stateNode,a.type,c))}}function uo(a){jn?Ds?Ds.push(a):Ds=[a]:jn=a}function hs(){if(jn){var a=jn,c=Ds;if(Ds=jn=null,dl(a),c)for(a=0;a<c.length;a++)dl(c[a])}}function Ye(a,c){return a(c)}function Nt(){}var Vt=!1;function qn(a,c,p){if(Vt)return a(c,p);Vt=!0;try{return Ye(a,c,p)}finally{Vt=!1,(jn!==null||Ds!==null)&&(Nt(),hs())}}function ps(a,c){var p=a.stateNode;if(p===null)return null;var y=Op(p);if(y===null)return null;p=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(p&&typeof p!="function")throw Error(n(231,c,typeof p));return p}var qt=!1;if(l)try{var $n={};Object.defineProperty($n,"passive",{get:function(){qt=!0}}),window.addEventListener("test",$n,$n),window.removeEventListener("test",$n,$n)}catch{qt=!1}function Zr(a,c,p,y,E,A,O,U,K){var se=Array.prototype.slice.call(arguments,3);try{c.apply(p,se)}catch(me){this.onError(me)}}var si=!1,dr=null,Mn=!1,fl=null,Nc={onError:function(a){si=!0,dr=a}};function fo(a,c,p,y,E,A,O,U,K){si=!1,dr=null,Zr.apply(Nc,arguments)}function na(a,c,p,y,E,A,O,U,K){if(fo.apply(this,arguments),si){if(si){var se=dr;si=!1,dr=null}else throw Error(n(198));Mn||(Mn=!0,fl=se)}}function Ti(a){var c=a,p=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(p=c.return),a=c.return;while(a)}return c.tag===3?p:null}function hl(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function jd(a){if(Ti(a)!==a)throw Error(n(188))}function $d(a){var c=a.alternate;if(!c){if(c=Ti(a),c===null)throw Error(n(188));return c!==a?null:a}for(var p=a,y=c;;){var E=p.return;if(E===null)break;var A=E.alternate;if(A===null){if(y=E.return,y!==null){p=y;continue}break}if(E.child===A.child){for(A=E.child;A;){if(A===p)return jd(E),a;if(A===y)return jd(E),c;A=A.sibling}throw Error(n(188))}if(p.return!==y.return)p=E,y=A;else{for(var O=!1,U=E.child;U;){if(U===p){O=!0,p=E,y=A;break}if(U===y){O=!0,y=E,p=A;break}U=U.sibling}if(!O){for(U=A.child;U;){if(U===p){O=!0,p=A,y=E;break}if(U===y){O=!0,y=A,p=E;break}U=U.sibling}if(!O)throw Error(n(189))}}if(p.alternate!==y)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?a:c}function ra(a){return a=$d(a),a!==null?Dc(a):null}function Dc(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=Dc(a);if(c!==null)return c;a=a.sibling}return null}var pp=e.unstable_scheduleCallback,pl=e.unstable_cancelCallback,Pv=e.unstable_shouldYield,Av=e.unstable_requestPaint,_n=e.unstable_now,Fd=e.unstable_getCurrentPriorityLevel,ml=e.unstable_ImmediatePriority,Vd=e.unstable_UserBlockingPriority,jc=e.unstable_NormalPriority,Tv=e.unstable_LowPriority,Hd=e.unstable_IdlePriority,$c=null,js=null;function zd(a){if(js&&typeof js.onCommitFiberRoot=="function")try{js.onCommitFiberRoot($c,a,void 0,(a.current.flags&128)===128)}catch{}}var ms=Math.clz32?Math.clz32:Mv,Rv=Math.log,Iv=Math.LN2;function Mv(a){return a>>>=0,a===0?32:31-(Rv(a)/Iv|0)|0}var Fc=64,sa=4194304;function gl(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Vc(a,c){var p=a.pendingLanes;if(p===0)return 0;var y=0,E=a.suspendedLanes,A=a.pingedLanes,O=p&268435455;if(O!==0){var U=O&~E;U!==0?y=gl(U):(A&=O,A!==0&&(y=gl(A)))}else O=p&~E,O!==0?y=gl(O):A!==0&&(y=gl(A));if(y===0)return 0;if(c!==0&&c!==y&&(c&E)===0&&(E=y&-y,A=c&-c,E>=A||E===16&&(A&4194240)!==0))return c;if((y&4)!==0&&(y|=p&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)p=31-ms(c),E=1<<p,y|=a[p],c&=~E;return y}function Ov(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ud(a,c){for(var p=a.suspendedLanes,y=a.pingedLanes,E=a.expirationTimes,A=a.pendingLanes;0<A;){var O=31-ms(A),U=1<<O,K=E[O];K===-1?((U&p)===0||(U&y)!==0)&&(E[O]=Ov(U,c)):K<=c&&(a.expiredLanes|=U),A&=~U}}function vl(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Bd(){var a=Fc;return Fc<<=1,(Fc&4194240)===0&&(Fc=64),a}function mp(a){for(var c=[],p=0;31>p;p++)c.push(a);return c}function $s(a,c,p){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-ms(c),a[c]=p}function gp(a,c){var p=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<p;){var E=31-ms(p),A=1<<E;c[E]=0,y[E]=-1,a[E]=-1,p&=~A}}function yl(a,c){var p=a.entangledLanes|=c;for(a=a.entanglements;p;){var y=31-ms(p),E=1<<y;E&c|a[y]&c&&(a[y]|=c),p&=~E}}var $t=0;function vp(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var yp,Hc,_p,Wd,_l,wl=!1,xl=[],ii=null,oi=null,ai=null,V=new Map,ue=new Map,_e=[],ve="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 be(a,c){switch(a){case"focusin":case"focusout":ii=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":V.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ue.delete(c.pointerId)}}function fe(a,c,p,y,E,A){return a===null||a.nativeEvent!==A?(a={blockedOn:c,domEventName:p,eventSystemFlags:y,nativeEvent:A,targetContainers:[E]},c!==null&&(c=rf(c),c!==null&&Hc(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,E!==null&&c.indexOf(E)===-1&&c.push(E),a)}function Xe(a,c,p,y,E){switch(c){case"focusin":return ii=fe(ii,a,c,p,y,E),!0;case"dragenter":return oi=fe(oi,a,c,p,y,E),!0;case"mouseover":return ai=fe(ai,a,c,p,y,E),!0;case"pointerover":var A=E.pointerId;return V.set(A,fe(V.get(A)||null,a,c,p,y,E)),!0;case"gotpointercapture":return A=E.pointerId,ue.set(A,fe(ue.get(A)||null,a,c,p,y,E)),!0}return!1}function $e(a){var c=bl(a.target);if(c!==null){var p=Ti(c);if(p!==null){if(c=p.tag,c===13){if(c=hl(p),c!==null){a.blockedOn=c,_l(a.priority,function(){_p(p)});return}}else if(c===3&&p.stateNode.current.memoizedState.isDehydrated){a.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Xt(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var p=Lv(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(p===null){p=a.nativeEvent;var y=new p.constructor(p.type,p);rr=y,p.target.dispatchEvent(y),rr=null}else return c=rf(p),c!==null&&Hc(c),a.blockedOn=p,!1;c.shift()}return!0}function mt(a,c,p){Xt(a)&&p.delete(c)}function xr(){wl=!1,ii!==null&&Xt(ii)&&(ii=null),oi!==null&&Xt(oi)&&(oi=null),ai!==null&&Xt(ai)&&(ai=null),V.forEach(mt),ue.forEach(mt)}function Gn(a,c){a.blockedOn===c&&(a.blockedOn=null,wl||(wl=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,xr)))}function br(a){function c(E){return Gn(E,a)}if(0<xl.length){Gn(xl[0],a);for(var p=1;p<xl.length;p++){var y=xl[p];y.blockedOn===a&&(y.blockedOn=null)}}for(ii!==null&&Gn(ii,a),oi!==null&&Gn(oi,a),ai!==null&&Gn(ai,a),V.forEach(c),ue.forEach(c),p=0;p<_e.length;p++)y=_e[p],y.blockedOn===a&&(y.blockedOn=null);for(;0<_e.length&&(p=_e[0],p.blockedOn===null);)$e(p),p.blockedOn===null&&_e.shift()}var St=P.ReactCurrentBatchConfig,Ht=!0;function Sr(a,c,p,y){var E=$t,A=St.transition;St.transition=null;try{$t=1,ho(a,c,p,y)}finally{$t=E,St.transition=A}}function wp(a,c,p,y){var E=$t,A=St.transition;St.transition=null;try{$t=4,ho(a,c,p,y)}finally{$t=E,St.transition=A}}function ho(a,c,p,y){if(Ht){var E=Lv(a,c,p,y);if(E===null)Xv(a,c,y,xp,p),be(a,y);else if(Xe(E,a,c,p,y))y.stopPropagation();else if(be(a,y),c&4&&-1<ve.indexOf(a)){for(;E!==null;){var A=rf(E);if(A!==null&&yp(A),A=Lv(a,c,p,y),A===null&&Xv(a,c,y,xp,p),A===E)break;E=A}E!==null&&y.stopPropagation()}else Xv(a,c,y,null,p)}}var xp=null;function Lv(a,c,p,y){if(xp=null,a=co(y),a=bl(a),a!==null)if(c=Ti(a),c===null)a=null;else if(p=c.tag,p===13){if(a=hl(c),a!==null)return a;a=null}else if(p===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return xp=a,null}function a6(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Fd()){case ml:return 1;case Vd:return 4;case jc:case Tv:return 16;case Hd:return 536870912;default:return 16}default:return 16}}var ia=null,Nv=null,bp=null;function l6(){if(bp)return bp;var a,c=Nv,p=c.length,y,E="value"in ia?ia.value:ia.textContent,A=E.length;for(a=0;a<p&&c[a]===E[a];a++);var O=p-a;for(y=1;y<=O&&c[p-y]===E[A-y];y++);return bp=E.slice(a,1<y?1-y:void 0)}function Sp(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function kp(){return!0}function c6(){return!1}function gs(a){function c(p,y,E,A,O){this._reactName=p,this._targetInst=E,this.type=y,this.nativeEvent=A,this.target=O,this.currentTarget=null;for(var U in a)a.hasOwnProperty(U)&&(p=a[U],this[U]=p?p(A):A[U]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?kp:c6,this.isPropagationStopped=c6,this}return z(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=kp)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=kp)},persist:function(){},isPersistent:kp}),c}var zc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dv=gs(zc),Zd=z({},zc,{view:0,detail:0}),OD=gs(Zd),jv,$v,qd,Ep=z({},Zd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==qd&&(qd&&a.type==="mousemove"?(jv=a.screenX-qd.screenX,$v=a.screenY-qd.screenY):$v=jv=0,qd=a),jv)},movementY:function(a){return"movementY"in a?a.movementY:$v}}),u6=gs(Ep),LD=z({},Ep,{dataTransfer:0}),ND=gs(LD),DD=z({},Zd,{relatedTarget:0}),Fv=gs(DD),jD=z({},zc,{animationName:0,elapsedTime:0,pseudoElement:0}),$D=gs(jD),FD=z({},zc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),VD=gs(FD),HD=z({},zc,{data:0}),d6=gs(HD),zD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UD={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"},BD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function WD(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=BD[a])?!!c[a]:!1}function Vv(){return WD}var ZD=z({},Zd,{key:function(a){if(a.key){var c=zD[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=Sp(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?UD[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vv,charCode:function(a){return a.type==="keypress"?Sp(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Sp(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),qD=gs(ZD),GD=z({},Ep,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),f6=gs(GD),KD=z({},Zd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vv}),YD=gs(KD),XD=z({},zc,{propertyName:0,elapsedTime:0,pseudoElement:0}),QD=gs(XD),JD=z({},Ep,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),ej=gs(JD),tj=[9,13,27,32],Hv=l&&"CompositionEvent"in window,Gd=null;l&&"documentMode"in document&&(Gd=document.documentMode);var nj=l&&"TextEvent"in window&&!Gd,h6=l&&(!Hv||Gd&&8<Gd&&11>=Gd),p6=" ",m6=!1;function g6(a,c){switch(a){case"keyup":return tj.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function v6(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Uc=!1;function rj(a,c){switch(a){case"compositionend":return v6(c);case"keypress":return c.which!==32?null:(m6=!0,p6);case"textInput":return a=c.data,a===p6&&m6?null:a;default:return null}}function sj(a,c){if(Uc)return a==="compositionend"||!Hv&&g6(a,c)?(a=l6(),bp=Nv=ia=null,Uc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return h6&&c.locale!=="ko"?null:c.data;default:return null}}var ij={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 y6(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!ij[a.type]:c==="textarea"}function _6(a,c,p,y){uo(y),c=Rp(c,"onChange"),0<c.length&&(p=new Dv("onChange","change",null,p,y),a.push({event:p,listeners:c}))}var Kd=null,Yd=null;function oj(a){j6(a,0)}function Cp(a){var c=Gc(a);if(ke(c))return a}function aj(a,c){if(a==="change")return c}var w6=!1;if(l){var zv;if(l){var Uv="oninput"in document;if(!Uv){var x6=document.createElement("div");x6.setAttribute("oninput","return;"),Uv=typeof x6.oninput=="function"}zv=Uv}else zv=!1;w6=zv&&(!document.documentMode||9<document.documentMode)}function b6(){Kd&&(Kd.detachEvent("onpropertychange",S6),Yd=Kd=null)}function S6(a){if(a.propertyName==="value"&&Cp(Yd)){var c=[];_6(c,Yd,a,co(a)),qn(oj,c)}}function lj(a,c,p){a==="focusin"?(b6(),Kd=c,Yd=p,Kd.attachEvent("onpropertychange",S6)):a==="focusout"&&b6()}function cj(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Cp(Yd)}function uj(a,c){if(a==="click")return Cp(c)}function dj(a,c){if(a==="input"||a==="change")return Cp(c)}function fj(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var li=typeof Object.is=="function"?Object.is:fj;function Xd(a,c){if(li(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var p=Object.keys(a),y=Object.keys(c);if(p.length!==y.length)return!1;for(y=0;y<p.length;y++){var E=p[y];if(!u.call(c,E)||!li(a[E],c[E]))return!1}return!0}function k6(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function E6(a,c){var p=k6(a);a=0;for(var y;p;){if(p.nodeType===3){if(y=a+p.textContent.length,a<=c&&y>=c)return{node:p,offset:c-a};a=y}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=k6(p)}}function C6(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?C6(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function P6(){for(var a=window,c=dt();c instanceof a.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)a=c.contentWindow;else break;c=dt(a.document)}return c}function Bv(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function hj(a){var c=P6(),p=a.focusedElem,y=a.selectionRange;if(c!==p&&p&&p.ownerDocument&&C6(p.ownerDocument.documentElement,p)){if(y!==null&&Bv(p)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in p)p.selectionStart=c,p.selectionEnd=Math.min(a,p.value.length);else if(a=(c=p.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var E=p.textContent.length,A=Math.min(y.start,E);y=y.end===void 0?A:Math.min(y.end,E),!a.extend&&A>y&&(E=y,y=A,A=E),E=E6(p,A);var O=E6(p,y);E&&O&&(a.rangeCount!==1||a.anchorNode!==E.node||a.anchorOffset!==E.offset||a.focusNode!==O.node||a.focusOffset!==O.offset)&&(c=c.createRange(),c.setStart(E.node,E.offset),a.removeAllRanges(),A>y?(a.addRange(c),a.extend(O.node,O.offset)):(c.setEnd(O.node,O.offset),a.addRange(c)))}}for(c=[],a=p;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<c.length;p++)a=c[p],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var pj=l&&"documentMode"in document&&11>=document.documentMode,Bc=null,Wv=null,Qd=null,Zv=!1;function A6(a,c,p){var y=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Zv||Bc==null||Bc!==dt(y)||(y=Bc,"selectionStart"in y&&Bv(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Qd&&Xd(Qd,y)||(Qd=y,y=Rp(Wv,"onSelect"),0<y.length&&(c=new Dv("onSelect","select",null,c,p),a.push({event:c,listeners:y}),c.target=Bc)))}function Pp(a,c){var p={};return p[a.toLowerCase()]=c.toLowerCase(),p["Webkit"+a]="webkit"+c,p["Moz"+a]="moz"+c,p}var Wc={animationend:Pp("Animation","AnimationEnd"),animationiteration:Pp("Animation","AnimationIteration"),animationstart:Pp("Animation","AnimationStart"),transitionend:Pp("Transition","TransitionEnd")},qv={},T6={};l&&(T6=document.createElement("div").style,"AnimationEvent"in window||(delete Wc.animationend.animation,delete Wc.animationiteration.animation,delete Wc.animationstart.animation),"TransitionEvent"in window||delete Wc.transitionend.transition);function Ap(a){if(qv[a])return qv[a];if(!Wc[a])return a;var c=Wc[a],p;for(p in c)if(c.hasOwnProperty(p)&&p in T6)return qv[a]=c[p];return a}var R6=Ap("animationend"),I6=Ap("animationiteration"),M6=Ap("animationstart"),O6=Ap("transitionend"),L6=new Map,N6="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 oa(a,c){L6.set(a,c),i(c,[a])}for(var Gv=0;Gv<N6.length;Gv++){var Kv=N6[Gv],mj=Kv.toLowerCase(),gj=Kv[0].toUpperCase()+Kv.slice(1);oa(mj,"on"+gj)}oa(R6,"onAnimationEnd"),oa(I6,"onAnimationIteration"),oa(M6,"onAnimationStart"),oa("dblclick","onDoubleClick"),oa("focusin","onFocus"),oa("focusout","onBlur"),oa(O6,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jd="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(" "),vj=new Set("cancel close invalid load scroll toggle".split(" ").concat(Jd));function D6(a,c,p){var y=a.type||"unknown-event";a.currentTarget=p,na(y,c,void 0,a),a.currentTarget=null}function j6(a,c){c=(c&4)!==0;for(var p=0;p<a.length;p++){var y=a[p],E=y.event;y=y.listeners;e:{var A=void 0;if(c)for(var O=y.length-1;0<=O;O--){var U=y[O],K=U.instance,se=U.currentTarget;if(U=U.listener,K!==A&&E.isPropagationStopped())break e;D6(E,U,se),A=K}else for(O=0;O<y.length;O++){if(U=y[O],K=U.instance,se=U.currentTarget,U=U.listener,K!==A&&E.isPropagationStopped())break e;D6(E,U,se),A=K}}}if(Mn)throw a=fl,Mn=!1,fl=null,a}function ln(a,c){var p=c[r1];p===void 0&&(p=c[r1]=new Set);var y=a+"__bubble";p.has(y)||($6(c,a,2,!1),p.add(y))}function Yv(a,c,p){var y=0;c&&(y|=4),$6(p,a,y,c)}var Tp="_reactListening"+Math.random().toString(36).slice(2);function ef(a){if(!a[Tp]){a[Tp]=!0,r.forEach(function(p){p!=="selectionchange"&&(vj.has(p)||Yv(p,!1,a),Yv(p,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[Tp]||(c[Tp]=!0,Yv("selectionchange",!1,c))}}function $6(a,c,p,y){switch(a6(c)){case 1:var E=Sr;break;case 4:E=wp;break;default:E=ho}p=E.bind(null,c,p,a),E=void 0,!qt||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(E=!0),y?E!==void 0?a.addEventListener(c,p,{capture:!0,passive:E}):a.addEventListener(c,p,!0):E!==void 0?a.addEventListener(c,p,{passive:E}):a.addEventListener(c,p,!1)}function Xv(a,c,p,y,E){var A=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var O=y.tag;if(O===3||O===4){var U=y.stateNode.containerInfo;if(U===E||U.nodeType===8&&U.parentNode===E)break;if(O===4)for(O=y.return;O!==null;){var K=O.tag;if((K===3||K===4)&&(K=O.stateNode.containerInfo,K===E||K.nodeType===8&&K.parentNode===E))return;O=O.return}for(;U!==null;){if(O=bl(U),O===null)return;if(K=O.tag,K===5||K===6){y=A=O;continue e}U=U.parentNode}}y=y.return}qn(function(){var se=A,me=co(p),ye=[];e:{var pe=L6.get(a);if(pe!==void 0){var Re=Dv,Ve=a;switch(a){case"keypress":if(Sp(p)===0)break e;case"keydown":case"keyup":Re=qD;break;case"focusin":Ve="focus",Re=Fv;break;case"focusout":Ve="blur",Re=Fv;break;case"beforeblur":case"afterblur":Re=Fv;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Re=u6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Re=ND;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Re=YD;break;case R6:case I6:case M6:Re=$D;break;case O6:Re=QD;break;case"scroll":Re=OD;break;case"wheel":Re=ej;break;case"copy":case"cut":case"paste":Re=VD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Re=f6}var Ue=(c&4)!==0,On=!Ue&&a==="scroll",ee=Ue?pe!==null?pe+"Capture":null:pe;Ue=[];for(var X=se,te;X!==null;){te=X;var Se=te.stateNode;if(te.tag===5&&Se!==null&&(te=Se,ee!==null&&(Se=ps(X,ee),Se!=null&&Ue.push(tf(X,Se,te)))),On)break;X=X.return}0<Ue.length&&(pe=new Re(pe,Ve,null,p,me),ye.push({event:pe,listeners:Ue}))}}if((c&7)===0){e:{if(pe=a==="mouseover"||a==="pointerover",Re=a==="mouseout"||a==="pointerout",pe&&p!==rr&&(Ve=p.relatedTarget||p.fromElement)&&(bl(Ve)||Ve[po]))break e;if((Re||pe)&&(pe=me.window===me?me:(pe=me.ownerDocument)?pe.defaultView||pe.parentWindow:window,Re?(Ve=p.relatedTarget||p.toElement,Re=se,Ve=Ve?bl(Ve):null,Ve!==null&&(On=Ti(Ve),Ve!==On||Ve.tag!==5&&Ve.tag!==6)&&(Ve=null)):(Re=null,Ve=se),Re!==Ve)){if(Ue=u6,Se="onMouseLeave",ee="onMouseEnter",X="mouse",(a==="pointerout"||a==="pointerover")&&(Ue=f6,Se="onPointerLeave",ee="onPointerEnter",X="pointer"),On=Re==null?pe:Gc(Re),te=Ve==null?pe:Gc(Ve),pe=new Ue(Se,X+"leave",Re,p,me),pe.target=On,pe.relatedTarget=te,Se=null,bl(me)===se&&(Ue=new Ue(ee,X+"enter",Ve,p,me),Ue.target=te,Ue.relatedTarget=On,Se=Ue),On=Se,Re&&Ve)t:{for(Ue=Re,ee=Ve,X=0,te=Ue;te;te=Zc(te))X++;for(te=0,Se=ee;Se;Se=Zc(Se))te++;for(;0<X-te;)Ue=Zc(Ue),X--;for(;0<te-X;)ee=Zc(ee),te--;for(;X--;){if(Ue===ee||ee!==null&&Ue===ee.alternate)break t;Ue=Zc(Ue),ee=Zc(ee)}Ue=null}else Ue=null;Re!==null&&F6(ye,pe,Re,Ue,!1),Ve!==null&&On!==null&&F6(ye,On,Ve,Ue,!0)}}e:{if(pe=se?Gc(se):window,Re=pe.nodeName&&pe.nodeName.toLowerCase(),Re==="select"||Re==="input"&&pe.type==="file")var We=aj;else if(y6(pe))if(w6)We=dj;else{We=cj;var et=lj}else(Re=pe.nodeName)&&Re.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(We=uj);if(We&&(We=We(a,se))){_6(ye,We,p,me);break e}et&&et(a,pe,se),a==="focusout"&&(et=pe._wrapperState)&&et.controlled&&pe.type==="number"&&Le(pe,"number",pe.value)}switch(et=se?Gc(se):window,a){case"focusin":(y6(et)||et.contentEditable==="true")&&(Bc=et,Wv=se,Qd=null);break;case"focusout":Qd=Wv=Bc=null;break;case"mousedown":Zv=!0;break;case"contextmenu":case"mouseup":case"dragend":Zv=!1,A6(ye,p,me);break;case"selectionchange":if(pj)break;case"keydown":case"keyup":A6(ye,p,me)}var tt;if(Hv)e:{switch(a){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else Uc?g6(a,p)&&(ot="onCompositionEnd"):a==="keydown"&&p.keyCode===229&&(ot="onCompositionStart");ot&&(h6&&p.locale!=="ko"&&(Uc||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Uc&&(tt=l6()):(ia=me,Nv="value"in ia?ia.value:ia.textContent,Uc=!0)),et=Rp(se,ot),0<et.length&&(ot=new d6(ot,a,null,p,me),ye.push({event:ot,listeners:et}),tt?ot.data=tt:(tt=v6(p),tt!==null&&(ot.data=tt)))),(tt=nj?rj(a,p):sj(a,p))&&(se=Rp(se,"onBeforeInput"),0<se.length&&(me=new d6("onBeforeInput","beforeinput",null,p,me),ye.push({event:me,listeners:se}),me.data=tt))}j6(ye,c)})}function tf(a,c,p){return{instance:a,listener:c,currentTarget:p}}function Rp(a,c){for(var p=c+"Capture",y=[];a!==null;){var E=a,A=E.stateNode;E.tag===5&&A!==null&&(E=A,A=ps(a,p),A!=null&&y.unshift(tf(a,A,E)),A=ps(a,c),A!=null&&y.push(tf(a,A,E))),a=a.return}return y}function Zc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function F6(a,c,p,y,E){for(var A=c._reactName,O=[];p!==null&&p!==y;){var U=p,K=U.alternate,se=U.stateNode;if(K!==null&&K===y)break;U.tag===5&&se!==null&&(U=se,E?(K=ps(p,A),K!=null&&O.unshift(tf(p,K,U))):E||(K=ps(p,A),K!=null&&O.push(tf(p,K,U)))),p=p.return}O.length!==0&&a.push({event:c,listeners:O})}var yj=/\r\n?/g,_j=/\u0000|\uFFFD/g;function V6(a){return(typeof a=="string"?a:""+a).replace(yj,`
40
- `).replace(_j,"")}function Ip(a,c,p){if(c=V6(c),V6(a)!==c&&p)throw Error(n(425))}function Mp(){}var Qv=null,Jv=null;function e1(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var t1=typeof setTimeout=="function"?setTimeout:void 0,wj=typeof clearTimeout=="function"?clearTimeout:void 0,H6=typeof Promise=="function"?Promise:void 0,xj=typeof queueMicrotask=="function"?queueMicrotask:typeof H6<"u"?function(a){return H6.resolve(null).then(a).catch(bj)}:t1;function bj(a){setTimeout(function(){throw a})}function n1(a,c){var p=c,y=0;do{var E=p.nextSibling;if(a.removeChild(p),E&&E.nodeType===8)if(p=E.data,p==="/$"){if(y===0){a.removeChild(E),br(c);return}y--}else p!=="$"&&p!=="$?"&&p!=="$!"||y++;p=E}while(p);br(c)}function aa(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function z6(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var p=a.data;if(p==="$"||p==="$!"||p==="$?"){if(c===0)return a;c--}else p==="/$"&&c++}a=a.previousSibling}return null}var qc=Math.random().toString(36).slice(2),Ri="__reactFiber$"+qc,nf="__reactProps$"+qc,po="__reactContainer$"+qc,r1="__reactEvents$"+qc,Sj="__reactListeners$"+qc,kj="__reactHandles$"+qc;function bl(a){var c=a[Ri];if(c)return c;for(var p=a.parentNode;p;){if(c=p[po]||p[Ri]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(a=z6(a);a!==null;){if(p=a[Ri])return p;a=z6(a)}return c}a=p,p=a.parentNode}return null}function rf(a){return a=a[Ri]||a[po],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Gc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function Op(a){return a[nf]||null}var s1=[],Kc=-1;function la(a){return{current:a}}function cn(a){0>Kc||(a.current=s1[Kc],s1[Kc]=null,Kc--)}function on(a,c){Kc++,s1[Kc]=a.current,a.current=c}var ca={},kr=la(ca),qr=la(!1),Sl=ca;function Yc(a,c){var p=a.type.contextTypes;if(!p)return ca;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var E={},A;for(A in p)E[A]=c[A];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=E),E}function Gr(a){return a=a.childContextTypes,a!=null}function Lp(){cn(qr),cn(kr)}function U6(a,c,p){if(kr.current!==ca)throw Error(n(168));on(kr,c),on(qr,p)}function B6(a,c,p){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return p;y=y.getChildContext();for(var E in y)if(!(E in c))throw Error(n(108,ge(a)||"Unknown",E));return z({},p,y)}function Np(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||ca,Sl=kr.current,on(kr,a),on(qr,qr.current),!0}function W6(a,c,p){var y=a.stateNode;if(!y)throw Error(n(169));p?(a=B6(a,c,Sl),y.__reactInternalMemoizedMergedChildContext=a,cn(qr),cn(kr),on(kr,a)):cn(qr),on(qr,p)}var mo=null,Dp=!1,i1=!1;function Z6(a){mo===null?mo=[a]:mo.push(a)}function Ej(a){Dp=!0,Z6(a)}function ua(){if(!i1&&mo!==null){i1=!0;var a=0,c=$t;try{var p=mo;for($t=1;a<p.length;a++){var y=p[a];do y=y(!0);while(y!==null)}mo=null,Dp=!1}catch(E){throw mo!==null&&(mo=mo.slice(a+1)),pp(ml,ua),E}finally{$t=c,i1=!1}}return null}var Xc=[],Qc=0,jp=null,$p=0,Fs=[],Vs=0,kl=null,go=1,vo="";function El(a,c){Xc[Qc++]=$p,Xc[Qc++]=jp,jp=a,$p=c}function q6(a,c,p){Fs[Vs++]=go,Fs[Vs++]=vo,Fs[Vs++]=kl,kl=a;var y=go;a=vo;var E=32-ms(y)-1;y&=~(1<<E),p+=1;var A=32-ms(c)+E;if(30<A){var O=E-E%5;A=(y&(1<<O)-1).toString(32),y>>=O,E-=O,go=1<<32-ms(c)+E|p<<E|y,vo=A+a}else go=1<<A|p<<E|y,vo=a}function o1(a){a.return!==null&&(El(a,1),q6(a,1,0))}function a1(a){for(;a===jp;)jp=Xc[--Qc],Xc[Qc]=null,$p=Xc[--Qc],Xc[Qc]=null;for(;a===kl;)kl=Fs[--Vs],Fs[Vs]=null,vo=Fs[--Vs],Fs[Vs]=null,go=Fs[--Vs],Fs[Vs]=null}var vs=null,ys=null,hn=!1,ci=null;function G6(a,c){var p=Bs(5,null,null,0);p.elementType="DELETED",p.stateNode=c,p.return=a,c=a.deletions,c===null?(a.deletions=[p],a.flags|=16):c.push(p)}function K6(a,c){switch(a.tag){case 5:var p=a.type;return c=c.nodeType!==1||p.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,vs=a,ys=aa(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,vs=a,ys=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(p=kl!==null?{id:go,overflow:vo}:null,a.memoizedState={dehydrated:c,treeContext:p,retryLane:1073741824},p=Bs(18,null,null,0),p.stateNode=c,p.return=a,a.child=p,vs=a,ys=null,!0):!1;default:return!1}}function l1(a){return(a.mode&1)!==0&&(a.flags&128)===0}function c1(a){if(hn){var c=ys;if(c){var p=c;if(!K6(a,c)){if(l1(a))throw Error(n(418));c=aa(p.nextSibling);var y=vs;c&&K6(a,c)?G6(y,p):(a.flags=a.flags&-4097|2,hn=!1,vs=a)}}else{if(l1(a))throw Error(n(418));a.flags=a.flags&-4097|2,hn=!1,vs=a}}}function Y6(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;vs=a}function Fp(a){if(a!==vs)return!1;if(!hn)return Y6(a),hn=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!e1(a.type,a.memoizedProps)),c&&(c=ys)){if(l1(a))throw X6(),Error(n(418));for(;c;)G6(a,c),c=aa(c.nextSibling)}if(Y6(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var p=a.data;if(p==="/$"){if(c===0){ys=aa(a.nextSibling);break e}c--}else p!=="$"&&p!=="$!"&&p!=="$?"||c++}a=a.nextSibling}ys=null}}else ys=vs?aa(a.stateNode.nextSibling):null;return!0}function X6(){for(var a=ys;a;)a=aa(a.nextSibling)}function Jc(){ys=vs=null,hn=!1}function u1(a){ci===null?ci=[a]:ci.push(a)}var Cj=P.ReactCurrentBatchConfig;function sf(a,c,p){if(a=p.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var y=p.stateNode}if(!y)throw Error(n(147,a));var E=y,A=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===A?c.ref:(c=function(O){var U=E.refs;O===null?delete U[A]:U[A]=O},c._stringRef=A,c)}if(typeof a!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,a))}return a}function Vp(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function Q6(a){var c=a._init;return c(a._payload)}function J6(a){function c(ee,X){if(a){var te=ee.deletions;te===null?(ee.deletions=[X],ee.flags|=16):te.push(X)}}function p(ee,X){if(!a)return null;for(;X!==null;)c(ee,X),X=X.sibling;return null}function y(ee,X){for(ee=new Map;X!==null;)X.key!==null?ee.set(X.key,X):ee.set(X.index,X),X=X.sibling;return ee}function E(ee,X){return ee=ya(ee,X),ee.index=0,ee.sibling=null,ee}function A(ee,X,te){return ee.index=te,a?(te=ee.alternate,te!==null?(te=te.index,te<X?(ee.flags|=2,X):te):(ee.flags|=2,X)):(ee.flags|=1048576,X)}function O(ee){return a&&ee.alternate===null&&(ee.flags|=2),ee}function U(ee,X,te,Se){return X===null||X.tag!==6?(X=ty(te,ee.mode,Se),X.return=ee,X):(X=E(X,te),X.return=ee,X)}function K(ee,X,te,Se){var We=te.type;return We===I?me(ee,X,te.props.children,Se,te.key):X!==null&&(X.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===H&&Q6(We)===X.type)?(Se=E(X,te.props),Se.ref=sf(ee,X,te),Se.return=ee,Se):(Se=u0(te.type,te.key,te.props,null,ee.mode,Se),Se.ref=sf(ee,X,te),Se.return=ee,Se)}function se(ee,X,te,Se){return X===null||X.tag!==4||X.stateNode.containerInfo!==te.containerInfo||X.stateNode.implementation!==te.implementation?(X=ny(te,ee.mode,Se),X.return=ee,X):(X=E(X,te.children||[]),X.return=ee,X)}function me(ee,X,te,Se,We){return X===null||X.tag!==7?(X=Ol(te,ee.mode,Se,We),X.return=ee,X):(X=E(X,te),X.return=ee,X)}function ye(ee,X,te){if(typeof X=="string"&&X!==""||typeof X=="number")return X=ty(""+X,ee.mode,te),X.return=ee,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case T:return te=u0(X.type,X.key,X.props,null,ee.mode,te),te.ref=sf(ee,null,X),te.return=ee,te;case M:return X=ny(X,ee.mode,te),X.return=ee,X;case H:var Se=X._init;return ye(ee,Se(X._payload),te)}if(lt(X)||Q(X))return X=Ol(X,ee.mode,te,null),X.return=ee,X;Vp(ee,X)}return null}function pe(ee,X,te,Se){var We=X!==null?X.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return We!==null?null:U(ee,X,""+te,Se);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case T:return te.key===We?K(ee,X,te,Se):null;case M:return te.key===We?se(ee,X,te,Se):null;case H:return We=te._init,pe(ee,X,We(te._payload),Se)}if(lt(te)||Q(te))return We!==null?null:me(ee,X,te,Se,null);Vp(ee,te)}return null}function Re(ee,X,te,Se,We){if(typeof Se=="string"&&Se!==""||typeof Se=="number")return ee=ee.get(te)||null,U(X,ee,""+Se,We);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case T:return ee=ee.get(Se.key===null?te:Se.key)||null,K(X,ee,Se,We);case M:return ee=ee.get(Se.key===null?te:Se.key)||null,se(X,ee,Se,We);case H:var et=Se._init;return Re(ee,X,te,et(Se._payload),We)}if(lt(Se)||Q(Se))return ee=ee.get(te)||null,me(X,ee,Se,We,null);Vp(X,Se)}return null}function Ve(ee,X,te,Se){for(var We=null,et=null,tt=X,ot=X=0,or=null;tt!==null&&ot<te.length;ot++){tt.index>ot?(or=tt,tt=null):or=tt.sibling;var Dt=pe(ee,tt,te[ot],Se);if(Dt===null){tt===null&&(tt=or);break}a&&tt&&Dt.alternate===null&&c(ee,tt),X=A(Dt,X,ot),et===null?We=Dt:et.sibling=Dt,et=Dt,tt=or}if(ot===te.length)return p(ee,tt),hn&&El(ee,ot),We;if(tt===null){for(;ot<te.length;ot++)tt=ye(ee,te[ot],Se),tt!==null&&(X=A(tt,X,ot),et===null?We=tt:et.sibling=tt,et=tt);return hn&&El(ee,ot),We}for(tt=y(ee,tt);ot<te.length;ot++)or=Re(tt,ee,ot,te[ot],Se),or!==null&&(a&&or.alternate!==null&&tt.delete(or.key===null?ot:or.key),X=A(or,X,ot),et===null?We=or:et.sibling=or,et=or);return a&&tt.forEach(function(_a){return c(ee,_a)}),hn&&El(ee,ot),We}function Ue(ee,X,te,Se){var We=Q(te);if(typeof We!="function")throw Error(n(150));if(te=We.call(te),te==null)throw Error(n(151));for(var et=We=null,tt=X,ot=X=0,or=null,Dt=te.next();tt!==null&&!Dt.done;ot++,Dt=te.next()){tt.index>ot?(or=tt,tt=null):or=tt.sibling;var _a=pe(ee,tt,Dt.value,Se);if(_a===null){tt===null&&(tt=or);break}a&&tt&&_a.alternate===null&&c(ee,tt),X=A(_a,X,ot),et===null?We=_a:et.sibling=_a,et=_a,tt=or}if(Dt.done)return p(ee,tt),hn&&El(ee,ot),We;if(tt===null){for(;!Dt.done;ot++,Dt=te.next())Dt=ye(ee,Dt.value,Se),Dt!==null&&(X=A(Dt,X,ot),et===null?We=Dt:et.sibling=Dt,et=Dt);return hn&&El(ee,ot),We}for(tt=y(ee,tt);!Dt.done;ot++,Dt=te.next())Dt=Re(tt,ee,ot,Dt.value,Se),Dt!==null&&(a&&Dt.alternate!==null&&tt.delete(Dt.key===null?ot:Dt.key),X=A(Dt,X,ot),et===null?We=Dt:et.sibling=Dt,et=Dt);return a&&tt.forEach(function(i7){return c(ee,i7)}),hn&&El(ee,ot),We}function On(ee,X,te,Se){if(typeof te=="object"&&te!==null&&te.type===I&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case T:e:{for(var We=te.key,et=X;et!==null;){if(et.key===We){if(We=te.type,We===I){if(et.tag===7){p(ee,et.sibling),X=E(et,te.props.children),X.return=ee,ee=X;break e}}else if(et.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===H&&Q6(We)===et.type){p(ee,et.sibling),X=E(et,te.props),X.ref=sf(ee,et,te),X.return=ee,ee=X;break e}p(ee,et);break}else c(ee,et);et=et.sibling}te.type===I?(X=Ol(te.props.children,ee.mode,Se,te.key),X.return=ee,ee=X):(Se=u0(te.type,te.key,te.props,null,ee.mode,Se),Se.ref=sf(ee,X,te),Se.return=ee,ee=Se)}return O(ee);case M:e:{for(et=te.key;X!==null;){if(X.key===et)if(X.tag===4&&X.stateNode.containerInfo===te.containerInfo&&X.stateNode.implementation===te.implementation){p(ee,X.sibling),X=E(X,te.children||[]),X.return=ee,ee=X;break e}else{p(ee,X);break}else c(ee,X);X=X.sibling}X=ny(te,ee.mode,Se),X.return=ee,ee=X}return O(ee);case H:return et=te._init,On(ee,X,et(te._payload),Se)}if(lt(te))return Ve(ee,X,te,Se);if(Q(te))return Ue(ee,X,te,Se);Vp(ee,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,X!==null&&X.tag===6?(p(ee,X.sibling),X=E(X,te),X.return=ee,ee=X):(p(ee,X),X=ty(te,ee.mode,Se),X.return=ee,ee=X),O(ee)):p(ee,X)}return On}var eu=J6(!0),e4=J6(!1),Hp=la(null),zp=null,tu=null,d1=null;function f1(){d1=tu=zp=null}function h1(a){var c=Hp.current;cn(Hp),a._currentValue=c}function p1(a,c,p){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===p)break;a=a.return}}function nu(a,c){zp=a,d1=tu=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Kr=!0),a.firstContext=null)}function Hs(a){var c=a._currentValue;if(d1!==a)if(a={context:a,memoizedValue:c,next:null},tu===null){if(zp===null)throw Error(n(308));tu=a,zp.dependencies={lanes:0,firstContext:a}}else tu=tu.next=a;return c}var Cl=null;function m1(a){Cl===null?Cl=[a]:Cl.push(a)}function t4(a,c,p,y){var E=c.interleaved;return E===null?(p.next=p,m1(c)):(p.next=E.next,E.next=p),c.interleaved=p,yo(a,y)}function yo(a,c){a.lanes|=c;var p=a.alternate;for(p!==null&&(p.lanes|=c),p=a,a=a.return;a!==null;)a.childLanes|=c,p=a.alternate,p!==null&&(p.childLanes|=c),p=a,a=a.return;return p.tag===3?p.stateNode:null}var da=!1;function g1(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function n4(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function _o(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function fa(a,c,p){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(It&2)!==0){var E=y.pending;return E===null?c.next=c:(c.next=E.next,E.next=c),y.pending=c,yo(a,p)}return E=y.interleaved,E===null?(c.next=c,m1(y)):(c.next=E.next,E.next=c),y.interleaved=c,yo(a,p)}function Up(a,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,p|=y,c.lanes=p,yl(a,p)}}function r4(a,c){var p=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,p===y)){var E=null,A=null;if(p=p.firstBaseUpdate,p!==null){do{var O={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};A===null?E=A=O:A=A.next=O,p=p.next}while(p!==null);A===null?E=A=c:A=A.next=c}else E=A=c;p={baseState:y.baseState,firstBaseUpdate:E,lastBaseUpdate:A,shared:y.shared,effects:y.effects},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=c:a.next=c,p.lastBaseUpdate=c}function Bp(a,c,p,y){var E=a.updateQueue;da=!1;var A=E.firstBaseUpdate,O=E.lastBaseUpdate,U=E.shared.pending;if(U!==null){E.shared.pending=null;var K=U,se=K.next;K.next=null,O===null?A=se:O.next=se,O=K;var me=a.alternate;me!==null&&(me=me.updateQueue,U=me.lastBaseUpdate,U!==O&&(U===null?me.firstBaseUpdate=se:U.next=se,me.lastBaseUpdate=K))}if(A!==null){var ye=E.baseState;O=0,me=se=K=null,U=A;do{var pe=U.lane,Re=U.eventTime;if((y&pe)===pe){me!==null&&(me=me.next={eventTime:Re,lane:0,tag:U.tag,payload:U.payload,callback:U.callback,next:null});e:{var Ve=a,Ue=U;switch(pe=c,Re=p,Ue.tag){case 1:if(Ve=Ue.payload,typeof Ve=="function"){ye=Ve.call(Re,ye,pe);break e}ye=Ve;break e;case 3:Ve.flags=Ve.flags&-65537|128;case 0:if(Ve=Ue.payload,pe=typeof Ve=="function"?Ve.call(Re,ye,pe):Ve,pe==null)break e;ye=z({},ye,pe);break e;case 2:da=!0}}U.callback!==null&&U.lane!==0&&(a.flags|=64,pe=E.effects,pe===null?E.effects=[U]:pe.push(U))}else Re={eventTime:Re,lane:pe,tag:U.tag,payload:U.payload,callback:U.callback,next:null},me===null?(se=me=Re,K=ye):me=me.next=Re,O|=pe;if(U=U.next,U===null){if(U=E.shared.pending,U===null)break;pe=U,U=pe.next,pe.next=null,E.lastBaseUpdate=pe,E.shared.pending=null}}while(!0);if(me===null&&(K=ye),E.baseState=K,E.firstBaseUpdate=se,E.lastBaseUpdate=me,c=E.shared.interleaved,c!==null){E=c;do O|=E.lane,E=E.next;while(E!==c)}else A===null&&(E.shared.lanes=0);Tl|=O,a.lanes=O,a.memoizedState=ye}}function s4(a,c,p){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var y=a[c],E=y.callback;if(E!==null){if(y.callback=null,y=p,typeof E!="function")throw Error(n(191,E));E.call(y)}}}var of={},Ii=la(of),af=la(of),lf=la(of);function Pl(a){if(a===of)throw Error(n(174));return a}function v1(a,c){switch(on(lf,c),on(af,a),on(Ii,of),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Zn(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=Zn(c,a)}cn(Ii),on(Ii,c)}function ru(){cn(Ii),cn(af),cn(lf)}function i4(a){Pl(lf.current);var c=Pl(Ii.current),p=Zn(c,a.type);c!==p&&(on(af,a),on(Ii,p))}function y1(a){af.current===a&&(cn(Ii),cn(af))}var wn=la(0);function Wp(a){for(var c=a;c!==null;){if(c.tag===13){var p=c.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var _1=[];function w1(){for(var a=0;a<_1.length;a++)_1[a]._workInProgressVersionPrimary=null;_1.length=0}var Zp=P.ReactCurrentDispatcher,x1=P.ReactCurrentBatchConfig,Al=0,xn=null,Kn=null,sr=null,qp=!1,cf=!1,uf=0,Pj=0;function Er(){throw Error(n(321))}function b1(a,c){if(c===null)return!1;for(var p=0;p<c.length&&p<a.length;p++)if(!li(a[p],c[p]))return!1;return!0}function S1(a,c,p,y,E,A){if(Al=A,xn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Zp.current=a===null||a.memoizedState===null?Ij:Mj,a=p(y,E),cf){A=0;do{if(cf=!1,uf=0,25<=A)throw Error(n(301));A+=1,sr=Kn=null,c.updateQueue=null,Zp.current=Oj,a=p(y,E)}while(cf)}if(Zp.current=Yp,c=Kn!==null&&Kn.next!==null,Al=0,sr=Kn=xn=null,qp=!1,c)throw Error(n(300));return a}function k1(){var a=uf!==0;return uf=0,a}function Mi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sr===null?xn.memoizedState=sr=a:sr=sr.next=a,sr}function zs(){if(Kn===null){var a=xn.alternate;a=a!==null?a.memoizedState:null}else a=Kn.next;var c=sr===null?xn.memoizedState:sr.next;if(c!==null)sr=c,Kn=a;else{if(a===null)throw Error(n(310));Kn=a,a={memoizedState:Kn.memoizedState,baseState:Kn.baseState,baseQueue:Kn.baseQueue,queue:Kn.queue,next:null},sr===null?xn.memoizedState=sr=a:sr=sr.next=a}return sr}function df(a,c){return typeof c=="function"?c(a):c}function E1(a){var c=zs(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var y=Kn,E=y.baseQueue,A=p.pending;if(A!==null){if(E!==null){var O=E.next;E.next=A.next,A.next=O}y.baseQueue=E=A,p.pending=null}if(E!==null){A=E.next,y=y.baseState;var U=O=null,K=null,se=A;do{var me=se.lane;if((Al&me)===me)K!==null&&(K=K.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),y=se.hasEagerState?se.eagerState:a(y,se.action);else{var ye={lane:me,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};K===null?(U=K=ye,O=y):K=K.next=ye,xn.lanes|=me,Tl|=me}se=se.next}while(se!==null&&se!==A);K===null?O=y:K.next=U,li(y,c.memoizedState)||(Kr=!0),c.memoizedState=y,c.baseState=O,c.baseQueue=K,p.lastRenderedState=y}if(a=p.interleaved,a!==null){E=a;do A=E.lane,xn.lanes|=A,Tl|=A,E=E.next;while(E!==a)}else E===null&&(p.lanes=0);return[c.memoizedState,p.dispatch]}function C1(a){var c=zs(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var y=p.dispatch,E=p.pending,A=c.memoizedState;if(E!==null){p.pending=null;var O=E=E.next;do A=a(A,O.action),O=O.next;while(O!==E);li(A,c.memoizedState)||(Kr=!0),c.memoizedState=A,c.baseQueue===null&&(c.baseState=A),p.lastRenderedState=A}return[A,y]}function o4(){}function a4(a,c){var p=xn,y=zs(),E=c(),A=!li(y.memoizedState,E);if(A&&(y.memoizedState=E,Kr=!0),y=y.queue,P1(u4.bind(null,p,y,a),[a]),y.getSnapshot!==c||A||sr!==null&&sr.memoizedState.tag&1){if(p.flags|=2048,ff(9,c4.bind(null,p,y,E,c),void 0,null),ir===null)throw Error(n(349));(Al&30)!==0||l4(p,c,E)}return E}function l4(a,c,p){a.flags|=16384,a={getSnapshot:c,value:p},c=xn.updateQueue,c===null?(c={lastEffect:null,stores:null},xn.updateQueue=c,c.stores=[a]):(p=c.stores,p===null?c.stores=[a]:p.push(a))}function c4(a,c,p,y){c.value=p,c.getSnapshot=y,d4(c)&&f4(a)}function u4(a,c,p){return p(function(){d4(c)&&f4(a)})}function d4(a){var c=a.getSnapshot;a=a.value;try{var p=c();return!li(a,p)}catch{return!0}}function f4(a){var c=yo(a,1);c!==null&&hi(c,a,1,-1)}function h4(a){var c=Mi();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:df,lastRenderedState:a},c.queue=a,a=a.dispatch=Rj.bind(null,xn,a),[c.memoizedState,a]}function ff(a,c,p,y){return a={tag:a,create:c,destroy:p,deps:y,next:null},c=xn.updateQueue,c===null?(c={lastEffect:null,stores:null},xn.updateQueue=c,c.lastEffect=a.next=a):(p=c.lastEffect,p===null?c.lastEffect=a.next=a:(y=p.next,p.next=a,a.next=y,c.lastEffect=a)),a}function p4(){return zs().memoizedState}function Gp(a,c,p,y){var E=Mi();xn.flags|=a,E.memoizedState=ff(1|c,p,void 0,y===void 0?null:y)}function Kp(a,c,p,y){var E=zs();y=y===void 0?null:y;var A=void 0;if(Kn!==null){var O=Kn.memoizedState;if(A=O.destroy,y!==null&&b1(y,O.deps)){E.memoizedState=ff(c,p,A,y);return}}xn.flags|=a,E.memoizedState=ff(1|c,p,A,y)}function m4(a,c){return Gp(8390656,8,a,c)}function P1(a,c){return Kp(2048,8,a,c)}function g4(a,c){return Kp(4,2,a,c)}function v4(a,c){return Kp(4,4,a,c)}function y4(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function _4(a,c,p){return p=p!=null?p.concat([a]):null,Kp(4,4,y4.bind(null,c,a),p)}function A1(){}function w4(a,c){var p=zs();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&b1(c,y[1])?y[0]:(p.memoizedState=[a,c],a)}function x4(a,c){var p=zs();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&b1(c,y[1])?y[0]:(a=a(),p.memoizedState=[a,c],a)}function b4(a,c,p){return(Al&21)===0?(a.baseState&&(a.baseState=!1,Kr=!0),a.memoizedState=p):(li(p,c)||(p=Bd(),xn.lanes|=p,Tl|=p,a.baseState=!0),c)}function Aj(a,c){var p=$t;$t=p!==0&&4>p?p:4,a(!0);var y=x1.transition;x1.transition={};try{a(!1),c()}finally{$t=p,x1.transition=y}}function S4(){return zs().memoizedState}function Tj(a,c,p){var y=ga(a);if(p={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null},k4(a))E4(c,p);else if(p=t4(a,c,p,y),p!==null){var E=jr();hi(p,a,y,E),C4(p,c,y)}}function Rj(a,c,p){var y=ga(a),E={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null};if(k4(a))E4(c,E);else{var A=a.alternate;if(a.lanes===0&&(A===null||A.lanes===0)&&(A=c.lastRenderedReducer,A!==null))try{var O=c.lastRenderedState,U=A(O,p);if(E.hasEagerState=!0,E.eagerState=U,li(U,O)){var K=c.interleaved;K===null?(E.next=E,m1(c)):(E.next=K.next,K.next=E),c.interleaved=E;return}}catch{}finally{}p=t4(a,c,E,y),p!==null&&(E=jr(),hi(p,a,y,E),C4(p,c,y))}}function k4(a){var c=a.alternate;return a===xn||c!==null&&c===xn}function E4(a,c){cf=qp=!0;var p=a.pending;p===null?c.next=c:(c.next=p.next,p.next=c),a.pending=c}function C4(a,c,p){if((p&4194240)!==0){var y=c.lanes;y&=a.pendingLanes,p|=y,c.lanes=p,yl(a,p)}}var Yp={readContext:Hs,useCallback:Er,useContext:Er,useEffect:Er,useImperativeHandle:Er,useInsertionEffect:Er,useLayoutEffect:Er,useMemo:Er,useReducer:Er,useRef:Er,useState:Er,useDebugValue:Er,useDeferredValue:Er,useTransition:Er,useMutableSource:Er,useSyncExternalStore:Er,useId:Er,unstable_isNewReconciler:!1},Ij={readContext:Hs,useCallback:function(a,c){return Mi().memoizedState=[a,c===void 0?null:c],a},useContext:Hs,useEffect:m4,useImperativeHandle:function(a,c,p){return p=p!=null?p.concat([a]):null,Gp(4194308,4,y4.bind(null,c,a),p)},useLayoutEffect:function(a,c){return Gp(4194308,4,a,c)},useInsertionEffect:function(a,c){return Gp(4,2,a,c)},useMemo:function(a,c){var p=Mi();return c=c===void 0?null:c,a=a(),p.memoizedState=[a,c],a},useReducer:function(a,c,p){var y=Mi();return c=p!==void 0?p(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=Tj.bind(null,xn,a),[y.memoizedState,a]},useRef:function(a){var c=Mi();return a={current:a},c.memoizedState=a},useState:h4,useDebugValue:A1,useDeferredValue:function(a){return Mi().memoizedState=a},useTransition:function(){var a=h4(!1),c=a[0];return a=Aj.bind(null,a[1]),Mi().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,p){var y=xn,E=Mi();if(hn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),ir===null)throw Error(n(349));(Al&30)!==0||l4(y,c,p)}E.memoizedState=p;var A={value:p,getSnapshot:c};return E.queue=A,m4(u4.bind(null,y,A,a),[a]),y.flags|=2048,ff(9,c4.bind(null,y,A,p,c),void 0,null),p},useId:function(){var a=Mi(),c=ir.identifierPrefix;if(hn){var p=vo,y=go;p=(y&~(1<<32-ms(y)-1)).toString(32)+p,c=":"+c+"R"+p,p=uf++,0<p&&(c+="H"+p.toString(32)),c+=":"}else p=Pj++,c=":"+c+"r"+p.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},Mj={readContext:Hs,useCallback:w4,useContext:Hs,useEffect:P1,useImperativeHandle:_4,useInsertionEffect:g4,useLayoutEffect:v4,useMemo:x4,useReducer:E1,useRef:p4,useState:function(){return E1(df)},useDebugValue:A1,useDeferredValue:function(a){var c=zs();return b4(c,Kn.memoizedState,a)},useTransition:function(){var a=E1(df)[0],c=zs().memoizedState;return[a,c]},useMutableSource:o4,useSyncExternalStore:a4,useId:S4,unstable_isNewReconciler:!1},Oj={readContext:Hs,useCallback:w4,useContext:Hs,useEffect:P1,useImperativeHandle:_4,useInsertionEffect:g4,useLayoutEffect:v4,useMemo:x4,useReducer:C1,useRef:p4,useState:function(){return C1(df)},useDebugValue:A1,useDeferredValue:function(a){var c=zs();return Kn===null?c.memoizedState=a:b4(c,Kn.memoizedState,a)},useTransition:function(){var a=C1(df)[0],c=zs().memoizedState;return[a,c]},useMutableSource:o4,useSyncExternalStore:a4,useId:S4,unstable_isNewReconciler:!1};function ui(a,c){if(a&&a.defaultProps){c=z({},c),a=a.defaultProps;for(var p in a)c[p]===void 0&&(c[p]=a[p]);return c}return c}function T1(a,c,p,y){c=a.memoizedState,p=p(y,c),p=p==null?c:z({},c,p),a.memoizedState=p,a.lanes===0&&(a.updateQueue.baseState=p)}var Xp={isMounted:function(a){return(a=a._reactInternals)?Ti(a)===a:!1},enqueueSetState:function(a,c,p){a=a._reactInternals;var y=jr(),E=ga(a),A=_o(y,E);A.payload=c,p!=null&&(A.callback=p),c=fa(a,A,E),c!==null&&(hi(c,a,E,y),Up(c,a,E))},enqueueReplaceState:function(a,c,p){a=a._reactInternals;var y=jr(),E=ga(a),A=_o(y,E);A.tag=1,A.payload=c,p!=null&&(A.callback=p),c=fa(a,A,E),c!==null&&(hi(c,a,E,y),Up(c,a,E))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var p=jr(),y=ga(a),E=_o(p,y);E.tag=2,c!=null&&(E.callback=c),c=fa(a,E,y),c!==null&&(hi(c,a,y,p),Up(c,a,y))}};function P4(a,c,p,y,E,A,O){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,A,O):c.prototype&&c.prototype.isPureReactComponent?!Xd(p,y)||!Xd(E,A):!0}function A4(a,c,p){var y=!1,E=ca,A=c.contextType;return typeof A=="object"&&A!==null?A=Hs(A):(E=Gr(c)?Sl:kr.current,y=c.contextTypes,A=(y=y!=null)?Yc(a,E):ca),c=new c(p,A),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Xp,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=E,a.__reactInternalMemoizedMaskedChildContext=A),c}function T4(a,c,p,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,y),c.state!==a&&Xp.enqueueReplaceState(c,c.state,null)}function R1(a,c,p,y){var E=a.stateNode;E.props=p,E.state=a.memoizedState,E.refs={},g1(a);var A=c.contextType;typeof A=="object"&&A!==null?E.context=Hs(A):(A=Gr(c)?Sl:kr.current,E.context=Yc(a,A)),E.state=a.memoizedState,A=c.getDerivedStateFromProps,typeof A=="function"&&(T1(a,c,A,p),E.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(c=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),c!==E.state&&Xp.enqueueReplaceState(E,E.state,null),Bp(a,p,E,y),E.state=a.memoizedState),typeof E.componentDidMount=="function"&&(a.flags|=4194308)}function su(a,c){try{var p="",y=c;do p+=ie(y),y=y.return;while(y);var E=p}catch(A){E=`
41
- Error generating stack: `+A.message+`
42
- `+A.stack}return{value:a,source:c,stack:E,digest:null}}function I1(a,c,p){return{value:a,source:null,stack:p??null,digest:c??null}}function M1(a,c){try{console.error(c.value)}catch(p){setTimeout(function(){throw p})}}var Lj=typeof WeakMap=="function"?WeakMap:Map;function R4(a,c,p){p=_o(-1,p),p.tag=3,p.payload={element:null};var y=c.value;return p.callback=function(){s0||(s0=!0,q1=y),M1(a,c)},p}function I4(a,c,p){p=_o(-1,p),p.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var E=c.value;p.payload=function(){return y(E)},p.callback=function(){M1(a,c)}}var A=a.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(p.callback=function(){M1(a,c),typeof y!="function"&&(pa===null?pa=new Set([this]):pa.add(this));var O=c.stack;this.componentDidCatch(c.value,{componentStack:O!==null?O:""})}),p}function M4(a,c,p){var y=a.pingCache;if(y===null){y=a.pingCache=new Lj;var E=new Set;y.set(c,E)}else E=y.get(c),E===void 0&&(E=new Set,y.set(c,E));E.has(p)||(E.add(p),a=Gj.bind(null,a,c,p),c.then(a,a))}function O4(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function L4(a,c,p,y,E){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(c=_o(-1,1),c.tag=2,fa(p,c,1))),p.lanes|=1),a):(a.flags|=65536,a.lanes=E,a)}var Nj=P.ReactCurrentOwner,Kr=!1;function Dr(a,c,p,y){c.child=a===null?e4(c,null,p,y):eu(c,a.child,p,y)}function N4(a,c,p,y,E){p=p.render;var A=c.ref;return nu(c,E),y=S1(a,c,p,y,A,E),p=k1(),a!==null&&!Kr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~E,wo(a,c,E)):(hn&&p&&o1(c),c.flags|=1,Dr(a,c,y,E),c.child)}function D4(a,c,p,y,E){if(a===null){var A=p.type;return typeof A=="function"&&!ey(A)&&A.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(c.tag=15,c.type=A,j4(a,c,A,y,E)):(a=u0(p.type,null,y,c,c.mode,E),a.ref=c.ref,a.return=c,c.child=a)}if(A=a.child,(a.lanes&E)===0){var O=A.memoizedProps;if(p=p.compare,p=p!==null?p:Xd,p(O,y)&&a.ref===c.ref)return wo(a,c,E)}return c.flags|=1,a=ya(A,y),a.ref=c.ref,a.return=c,c.child=a}function j4(a,c,p,y,E){if(a!==null){var A=a.memoizedProps;if(Xd(A,y)&&a.ref===c.ref)if(Kr=!1,c.pendingProps=y=A,(a.lanes&E)!==0)(a.flags&131072)!==0&&(Kr=!0);else return c.lanes=a.lanes,wo(a,c,E)}return O1(a,c,p,y,E)}function $4(a,c,p){var y=c.pendingProps,E=y.children,A=a!==null?a.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},on(ou,_s),_s|=p;else{if((p&1073741824)===0)return a=A!==null?A.baseLanes|p:p,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,on(ou,_s),_s|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=A!==null?A.baseLanes:p,on(ou,_s),_s|=y}else A!==null?(y=A.baseLanes|p,c.memoizedState=null):y=p,on(ou,_s),_s|=y;return Dr(a,c,E,p),c.child}function F4(a,c){var p=c.ref;(a===null&&p!==null||a!==null&&a.ref!==p)&&(c.flags|=512,c.flags|=2097152)}function O1(a,c,p,y,E){var A=Gr(p)?Sl:kr.current;return A=Yc(c,A),nu(c,E),p=S1(a,c,p,y,A,E),y=k1(),a!==null&&!Kr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~E,wo(a,c,E)):(hn&&y&&o1(c),c.flags|=1,Dr(a,c,p,E),c.child)}function V4(a,c,p,y,E){if(Gr(p)){var A=!0;Np(c)}else A=!1;if(nu(c,E),c.stateNode===null)Jp(a,c),A4(c,p,y),R1(c,p,y,E),y=!0;else if(a===null){var O=c.stateNode,U=c.memoizedProps;O.props=U;var K=O.context,se=p.contextType;typeof se=="object"&&se!==null?se=Hs(se):(se=Gr(p)?Sl:kr.current,se=Yc(c,se));var me=p.getDerivedStateFromProps,ye=typeof me=="function"||typeof O.getSnapshotBeforeUpdate=="function";ye||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(U!==y||K!==se)&&T4(c,O,y,se),da=!1;var pe=c.memoizedState;O.state=pe,Bp(c,y,O,E),K=c.memoizedState,U!==y||pe!==K||qr.current||da?(typeof me=="function"&&(T1(c,p,me,y),K=c.memoizedState),(U=da||P4(c,p,U,y,pe,K,se))?(ye||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(c.flags|=4194308)):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=K),O.props=y,O.state=K,O.context=se,y=U):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{O=c.stateNode,n4(a,c),U=c.memoizedProps,se=c.type===c.elementType?U:ui(c.type,U),O.props=se,ye=c.pendingProps,pe=O.context,K=p.contextType,typeof K=="object"&&K!==null?K=Hs(K):(K=Gr(p)?Sl:kr.current,K=Yc(c,K));var Re=p.getDerivedStateFromProps;(me=typeof Re=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(U!==ye||pe!==K)&&T4(c,O,y,K),da=!1,pe=c.memoizedState,O.state=pe,Bp(c,y,O,E);var Ve=c.memoizedState;U!==ye||pe!==Ve||qr.current||da?(typeof Re=="function"&&(T1(c,p,Re,y),Ve=c.memoizedState),(se=da||P4(c,p,se,y,pe,Ve,K)||!1)?(me||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(y,Ve,K),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(y,Ve,K)),typeof O.componentDidUpdate=="function"&&(c.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof O.componentDidUpdate!="function"||U===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Ve),O.props=y,O.state=Ve,O.context=K,y=se):(typeof O.componentDidUpdate!="function"||U===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),y=!1)}return L1(a,c,p,y,A,E)}function L1(a,c,p,y,E,A){F4(a,c);var O=(c.flags&128)!==0;if(!y&&!O)return E&&W6(c,p,!1),wo(a,c,A);y=c.stateNode,Nj.current=c;var U=O&&typeof p.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&O?(c.child=eu(c,a.child,null,A),c.child=eu(c,null,U,A)):Dr(a,c,U,A),c.memoizedState=y.state,E&&W6(c,p,!0),c.child}function H4(a){var c=a.stateNode;c.pendingContext?U6(a,c.pendingContext,c.pendingContext!==c.context):c.context&&U6(a,c.context,!1),v1(a,c.containerInfo)}function z4(a,c,p,y,E){return Jc(),u1(E),c.flags|=256,Dr(a,c,p,y),c.child}var N1={dehydrated:null,treeContext:null,retryLane:0};function D1(a){return{baseLanes:a,cachePool:null,transitions:null}}function U4(a,c,p){var y=c.pendingProps,E=wn.current,A=!1,O=(c.flags&128)!==0,U;if((U=O)||(U=a!==null&&a.memoizedState===null?!1:(E&2)!==0),U?(A=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(E|=1),on(wn,E&1),a===null)return c1(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(O=y.children,a=y.fallback,A?(y=c.mode,A=c.child,O={mode:"hidden",children:O},(y&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=O):A=d0(O,y,0,null),a=Ol(a,y,p,null),A.return=c,a.return=c,A.sibling=a,c.child=A,c.child.memoizedState=D1(p),c.memoizedState=N1,a):j1(c,O));if(E=a.memoizedState,E!==null&&(U=E.dehydrated,U!==null))return Dj(a,c,O,y,U,E,p);if(A){A=y.fallback,O=c.mode,E=a.child,U=E.sibling;var K={mode:"hidden",children:y.children};return(O&1)===0&&c.child!==E?(y=c.child,y.childLanes=0,y.pendingProps=K,c.deletions=null):(y=ya(E,K),y.subtreeFlags=E.subtreeFlags&14680064),U!==null?A=ya(U,A):(A=Ol(A,O,p,null),A.flags|=2),A.return=c,y.return=c,y.sibling=A,c.child=y,y=A,A=c.child,O=a.child.memoizedState,O=O===null?D1(p):{baseLanes:O.baseLanes|p,cachePool:null,transitions:O.transitions},A.memoizedState=O,A.childLanes=a.childLanes&~p,c.memoizedState=N1,y}return A=a.child,a=A.sibling,y=ya(A,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=p),y.return=c,y.sibling=null,a!==null&&(p=c.deletions,p===null?(c.deletions=[a],c.flags|=16):p.push(a)),c.child=y,c.memoizedState=null,y}function j1(a,c){return c=d0({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function Qp(a,c,p,y){return y!==null&&u1(y),eu(c,a.child,null,p),a=j1(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function Dj(a,c,p,y,E,A,O){if(p)return c.flags&256?(c.flags&=-257,y=I1(Error(n(422))),Qp(a,c,O,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(A=y.fallback,E=c.mode,y=d0({mode:"visible",children:y.children},E,0,null),A=Ol(A,E,O,null),A.flags|=2,y.return=c,A.return=c,y.sibling=A,c.child=y,(c.mode&1)!==0&&eu(c,a.child,null,O),c.child.memoizedState=D1(O),c.memoizedState=N1,A);if((c.mode&1)===0)return Qp(a,c,O,null);if(E.data==="$!"){if(y=E.nextSibling&&E.nextSibling.dataset,y)var U=y.dgst;return y=U,A=Error(n(419)),y=I1(A,y,void 0),Qp(a,c,O,y)}if(U=(O&a.childLanes)!==0,Kr||U){if(y=ir,y!==null){switch(O&-O){case 4:E=2;break;case 16:E=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:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(y.suspendedLanes|O))!==0?0:E,E!==0&&E!==A.retryLane&&(A.retryLane=E,yo(a,E),hi(y,a,E,-1))}return J1(),y=I1(Error(n(421))),Qp(a,c,O,y)}return E.data==="$?"?(c.flags|=128,c.child=a.child,c=Kj.bind(null,a),E._reactRetry=c,null):(a=A.treeContext,ys=aa(E.nextSibling),vs=c,hn=!0,ci=null,a!==null&&(Fs[Vs++]=go,Fs[Vs++]=vo,Fs[Vs++]=kl,go=a.id,vo=a.overflow,kl=c),c=j1(c,y.children),c.flags|=4096,c)}function B4(a,c,p){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),p1(a.return,c,p)}function $1(a,c,p,y,E){var A=a.memoizedState;A===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:p,tailMode:E}:(A.isBackwards=c,A.rendering=null,A.renderingStartTime=0,A.last=y,A.tail=p,A.tailMode=E)}function W4(a,c,p){var y=c.pendingProps,E=y.revealOrder,A=y.tail;if(Dr(a,c,y.children,p),y=wn.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&B4(a,p,c);else if(a.tag===19)B4(a,p,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(on(wn,y),(c.mode&1)===0)c.memoizedState=null;else switch(E){case"forwards":for(p=c.child,E=null;p!==null;)a=p.alternate,a!==null&&Wp(a)===null&&(E=p),p=p.sibling;p=E,p===null?(E=c.child,c.child=null):(E=p.sibling,p.sibling=null),$1(c,!1,E,p,A);break;case"backwards":for(p=null,E=c.child,c.child=null;E!==null;){if(a=E.alternate,a!==null&&Wp(a)===null){c.child=E;break}a=E.sibling,E.sibling=p,p=E,E=a}$1(c,!0,p,null,A);break;case"together":$1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Jp(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function wo(a,c,p){if(a!==null&&(c.dependencies=a.dependencies),Tl|=c.lanes,(p&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,p=ya(a,a.pendingProps),c.child=p,p.return=c;a.sibling!==null;)a=a.sibling,p=p.sibling=ya(a,a.pendingProps),p.return=c;p.sibling=null}return c.child}function jj(a,c,p){switch(c.tag){case 3:H4(c),Jc();break;case 5:i4(c);break;case 1:Gr(c.type)&&Np(c);break;case 4:v1(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,E=c.memoizedProps.value;on(Hp,y._currentValue),y._currentValue=E;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(on(wn,wn.current&1),c.flags|=128,null):(p&c.child.childLanes)!==0?U4(a,c,p):(on(wn,wn.current&1),a=wo(a,c,p),a!==null?a.sibling:null);on(wn,wn.current&1);break;case 19:if(y=(p&c.childLanes)!==0,(a.flags&128)!==0){if(y)return W4(a,c,p);c.flags|=128}if(E=c.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),on(wn,wn.current),y)break;return null;case 22:case 23:return c.lanes=0,$4(a,c,p)}return wo(a,c,p)}var Z4,F1,q4,G4;Z4=function(a,c){for(var p=c.child;p!==null;){if(p.tag===5||p.tag===6)a.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===c)break;for(;p.sibling===null;){if(p.return===null||p.return===c)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},F1=function(){},q4=function(a,c,p,y){var E=a.memoizedProps;if(E!==y){a=c.stateNode,Pl(Ii.current);var A=null;switch(p){case"input":E=Lt(a,E),y=Lt(a,y),A=[];break;case"select":E=z({},E,{value:void 0}),y=z({},y,{value:void 0}),A=[];break;case"textarea":E=Je(a,E),y=Je(a,y),A=[];break;default:typeof E.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Mp)}Ns(p,y);var O;p=null;for(se in E)if(!y.hasOwnProperty(se)&&E.hasOwnProperty(se)&&E[se]!=null)if(se==="style"){var U=E[se];for(O in U)U.hasOwnProperty(O)&&(p||(p={}),p[O]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(s.hasOwnProperty(se)?A||(A=[]):(A=A||[]).push(se,null));for(se in y){var K=y[se];if(U=E!=null?E[se]:void 0,y.hasOwnProperty(se)&&K!==U&&(K!=null||U!=null))if(se==="style")if(U){for(O in U)!U.hasOwnProperty(O)||K&&K.hasOwnProperty(O)||(p||(p={}),p[O]="");for(O in K)K.hasOwnProperty(O)&&U[O]!==K[O]&&(p||(p={}),p[O]=K[O])}else p||(A||(A=[]),A.push(se,p)),p=K;else se==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,U=U?U.__html:void 0,K!=null&&U!==K&&(A=A||[]).push(se,K)):se==="children"?typeof K!="string"&&typeof K!="number"||(A=A||[]).push(se,""+K):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(s.hasOwnProperty(se)?(K!=null&&se==="onScroll"&&ln("scroll",a),A||U===K||(A=[])):(A=A||[]).push(se,K))}p&&(A=A||[]).push("style",p);var se=A;(c.updateQueue=se)&&(c.flags|=4)}},G4=function(a,c,p,y){p!==y&&(c.flags|=4)};function hf(a,c){if(!hn)switch(a.tailMode){case"hidden":c=a.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?a.tail=null:p.sibling=null;break;case"collapsed":p=a.tail;for(var y=null;p!==null;)p.alternate!==null&&(y=p),p=p.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function Cr(a){var c=a.alternate!==null&&a.alternate.child===a.child,p=0,y=0;if(c)for(var E=a.child;E!==null;)p|=E.lanes|E.childLanes,y|=E.subtreeFlags&14680064,y|=E.flags&14680064,E.return=a,E=E.sibling;else for(E=a.child;E!==null;)p|=E.lanes|E.childLanes,y|=E.subtreeFlags,y|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=y,a.childLanes=p,c}function $j(a,c,p){var y=c.pendingProps;switch(a1(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cr(c),null;case 1:return Gr(c.type)&&Lp(),Cr(c),null;case 3:return y=c.stateNode,ru(),cn(qr),cn(kr),w1(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(Fp(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,ci!==null&&(Y1(ci),ci=null))),F1(a,c),Cr(c),null;case 5:y1(c);var E=Pl(lf.current);if(p=c.type,a!==null&&c.stateNode!=null)q4(a,c,p,y,E),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return Cr(c),null}if(a=Pl(Ii.current),Fp(c)){y=c.stateNode,p=c.type;var A=c.memoizedProps;switch(y[Ri]=c,y[nf]=A,a=(c.mode&1)!==0,p){case"dialog":ln("cancel",y),ln("close",y);break;case"iframe":case"object":case"embed":ln("load",y);break;case"video":case"audio":for(E=0;E<Jd.length;E++)ln(Jd[E],y);break;case"source":ln("error",y);break;case"img":case"image":case"link":ln("error",y),ln("load",y);break;case"details":ln("toggle",y);break;case"input":sn(y,A),ln("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!A.multiple},ln("invalid",y);break;case"textarea":bt(y,A),ln("invalid",y)}Ns(p,A),E=null;for(var O in A)if(A.hasOwnProperty(O)){var U=A[O];O==="children"?typeof U=="string"?y.textContent!==U&&(A.suppressHydrationWarning!==!0&&Ip(y.textContent,U,a),E=["children",U]):typeof U=="number"&&y.textContent!==""+U&&(A.suppressHydrationWarning!==!0&&Ip(y.textContent,U,a),E=["children",""+U]):s.hasOwnProperty(O)&&U!=null&&O==="onScroll"&&ln("scroll",y)}switch(p){case"input":Fe(y),vn(y,A,!0);break;case"textarea":Fe(y),ft(y);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(y.onclick=Mp)}y=E,c.updateQueue=y,y!==null&&(c.flags|=4)}else{O=E.nodeType===9?E:E.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=wr(p)),a==="http://www.w3.org/1999/xhtml"?p==="script"?(a=O.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=O.createElement(p,{is:y.is}):(a=O.createElement(p),p==="select"&&(O=a,y.multiple?O.multiple=!0:y.size&&(O.size=y.size))):a=O.createElementNS(a,p),a[Ri]=c,a[nf]=y,Z4(a,c,!1,!1),c.stateNode=a;e:{switch(O=fs(p,y),p){case"dialog":ln("cancel",a),ln("close",a),E=y;break;case"iframe":case"object":case"embed":ln("load",a),E=y;break;case"video":case"audio":for(E=0;E<Jd.length;E++)ln(Jd[E],a);E=y;break;case"source":ln("error",a),E=y;break;case"img":case"image":case"link":ln("error",a),ln("load",a),E=y;break;case"details":ln("toggle",a),E=y;break;case"input":sn(a,y),E=Lt(a,y),ln("invalid",a);break;case"option":E=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},E=z({},y,{value:void 0}),ln("invalid",a);break;case"textarea":bt(a,y),E=Je(a,y),ln("invalid",a);break;default:E=y}Ns(p,E),U=E;for(A in U)if(U.hasOwnProperty(A)){var K=U[A];A==="style"?Yt(a,K):A==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&ta(a,K)):A==="children"?typeof K=="string"?(p!=="textarea"||K!=="")&&Dn(a,K):typeof K=="number"&&Dn(a,""+K):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(s.hasOwnProperty(A)?K!=null&&A==="onScroll"&&ln("scroll",a):K!=null&&C(a,A,K,O))}switch(p){case"input":Fe(a),vn(a,y,!1);break;case"textarea":Fe(a),ft(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ce(y.value));break;case"select":a.multiple=!!y.multiple,A=y.value,A!=null?Te(a,!!y.multiple,A,!1):y.defaultValue!=null&&Te(a,!!y.multiple,y.defaultValue,!0);break;default:typeof E.onClick=="function"&&(a.onclick=Mp)}switch(p){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Cr(c),null;case 6:if(a&&c.stateNode!=null)G4(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(p=Pl(lf.current),Pl(Ii.current),Fp(c)){if(y=c.stateNode,p=c.memoizedProps,y[Ri]=c,(A=y.nodeValue!==p)&&(a=vs,a!==null))switch(a.tag){case 3:Ip(y.nodeValue,p,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Ip(y.nodeValue,p,(a.mode&1)!==0)}A&&(c.flags|=4)}else y=(p.nodeType===9?p:p.ownerDocument).createTextNode(y),y[Ri]=c,c.stateNode=y}return Cr(c),null;case 13:if(cn(wn),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(hn&&ys!==null&&(c.mode&1)!==0&&(c.flags&128)===0)X6(),Jc(),c.flags|=98560,A=!1;else if(A=Fp(c),y!==null&&y.dehydrated!==null){if(a===null){if(!A)throw Error(n(318));if(A=c.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));A[Ri]=c}else Jc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Cr(c),A=!1}else ci!==null&&(Y1(ci),ci=null),A=!0;if(!A)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=p,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(wn.current&1)!==0?Yn===0&&(Yn=3):J1())),c.updateQueue!==null&&(c.flags|=4),Cr(c),null);case 4:return ru(),F1(a,c),a===null&&ef(c.stateNode.containerInfo),Cr(c),null;case 10:return h1(c.type._context),Cr(c),null;case 17:return Gr(c.type)&&Lp(),Cr(c),null;case 19:if(cn(wn),A=c.memoizedState,A===null)return Cr(c),null;if(y=(c.flags&128)!==0,O=A.rendering,O===null)if(y)hf(A,!1);else{if(Yn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(O=Wp(a),O!==null){for(c.flags|=128,hf(A,!1),y=O.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=p,p=c.child;p!==null;)A=p,a=y,A.flags&=14680066,O=A.alternate,O===null?(A.childLanes=0,A.lanes=a,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=O.childLanes,A.lanes=O.lanes,A.child=O.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=O.memoizedProps,A.memoizedState=O.memoizedState,A.updateQueue=O.updateQueue,A.type=O.type,a=O.dependencies,A.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),p=p.sibling;return on(wn,wn.current&1|2),c.child}a=a.sibling}A.tail!==null&&_n()>au&&(c.flags|=128,y=!0,hf(A,!1),c.lanes=4194304)}else{if(!y)if(a=Wp(O),a!==null){if(c.flags|=128,y=!0,p=a.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),hf(A,!0),A.tail===null&&A.tailMode==="hidden"&&!O.alternate&&!hn)return Cr(c),null}else 2*_n()-A.renderingStartTime>au&&p!==1073741824&&(c.flags|=128,y=!0,hf(A,!1),c.lanes=4194304);A.isBackwards?(O.sibling=c.child,c.child=O):(p=A.last,p!==null?p.sibling=O:c.child=O,A.last=O)}return A.tail!==null?(c=A.tail,A.rendering=c,A.tail=c.sibling,A.renderingStartTime=_n(),c.sibling=null,p=wn.current,on(wn,y?p&1|2:p&1),c):(Cr(c),null);case 22:case 23:return Q1(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(_s&1073741824)!==0&&(Cr(c),c.subtreeFlags&6&&(c.flags|=8192)):Cr(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function Fj(a,c){switch(a1(c),c.tag){case 1:return Gr(c.type)&&Lp(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return ru(),cn(qr),cn(kr),w1(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return y1(c),null;case 13:if(cn(wn),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Jc()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return cn(wn),null;case 4:return ru(),null;case 10:return h1(c.type._context),null;case 22:case 23:return Q1(),null;case 24:return null;default:return null}}var e0=!1,Pr=!1,Vj=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function iu(a,c){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(y){Tn(a,c,y)}else p.current=null}function V1(a,c,p){try{p()}catch(y){Tn(a,c,y)}}var K4=!1;function Hj(a,c){if(Qv=Ht,a=P6(),Bv(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var y=p.getSelection&&p.getSelection();if(y&&y.rangeCount!==0){p=y.anchorNode;var E=y.anchorOffset,A=y.focusNode;y=y.focusOffset;try{p.nodeType,A.nodeType}catch{p=null;break e}var O=0,U=-1,K=-1,se=0,me=0,ye=a,pe=null;t:for(;;){for(var Re;ye!==p||E!==0&&ye.nodeType!==3||(U=O+E),ye!==A||y!==0&&ye.nodeType!==3||(K=O+y),ye.nodeType===3&&(O+=ye.nodeValue.length),(Re=ye.firstChild)!==null;)pe=ye,ye=Re;for(;;){if(ye===a)break t;if(pe===p&&++se===E&&(U=O),pe===A&&++me===y&&(K=O),(Re=ye.nextSibling)!==null)break;ye=pe,pe=ye.parentNode}ye=Re}p=U===-1||K===-1?null:{start:U,end:K}}else p=null}p=p||{start:0,end:0}}else p=null;for(Jv={focusedElem:a,selectionRange:p},Ht=!1,Ne=c;Ne!==null;)if(c=Ne,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Ne=a;else for(;Ne!==null;){c=Ne;try{var Ve=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Ve!==null){var Ue=Ve.memoizedProps,On=Ve.memoizedState,ee=c.stateNode,X=ee.getSnapshotBeforeUpdate(c.elementType===c.type?Ue:ui(c.type,Ue),On);ee.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var te=c.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Se){Tn(c,c.return,Se)}if(a=c.sibling,a!==null){a.return=c.return,Ne=a;break}Ne=c.return}return Ve=K4,K4=!1,Ve}function pf(a,c,p){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var E=y=y.next;do{if((E.tag&a)===a){var A=E.destroy;E.destroy=void 0,A!==void 0&&V1(c,p,A)}E=E.next}while(E!==y)}}function t0(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&a)===a){var y=p.create;p.destroy=y()}p=p.next}while(p!==c)}}function H1(a){var c=a.ref;if(c!==null){var p=a.stateNode;switch(a.tag){case 5:a=p;break;default:a=p}typeof c=="function"?c(a):c.current=a}}function Y4(a){var c=a.alternate;c!==null&&(a.alternate=null,Y4(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Ri],delete c[nf],delete c[r1],delete c[Sj],delete c[kj])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function X4(a){return a.tag===5||a.tag===3||a.tag===4}function Q4(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||X4(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function z1(a,c,p){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?p.nodeType===8?p.parentNode.insertBefore(a,c):p.insertBefore(a,c):(p.nodeType===8?(c=p.parentNode,c.insertBefore(a,p)):(c=p,c.appendChild(a)),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Mp));else if(y!==4&&(a=a.child,a!==null))for(z1(a,c,p),a=a.sibling;a!==null;)z1(a,c,p),a=a.sibling}function U1(a,c,p){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?p.insertBefore(a,c):p.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(U1(a,c,p),a=a.sibling;a!==null;)U1(a,c,p),a=a.sibling}var fr=null,di=!1;function ha(a,c,p){for(p=p.child;p!==null;)J4(a,c,p),p=p.sibling}function J4(a,c,p){if(js&&typeof js.onCommitFiberUnmount=="function")try{js.onCommitFiberUnmount($c,p)}catch{}switch(p.tag){case 5:Pr||iu(p,c);case 6:var y=fr,E=di;fr=null,ha(a,c,p),fr=y,di=E,fr!==null&&(di?(a=fr,p=p.stateNode,a.nodeType===8?a.parentNode.removeChild(p):a.removeChild(p)):fr.removeChild(p.stateNode));break;case 18:fr!==null&&(di?(a=fr,p=p.stateNode,a.nodeType===8?n1(a.parentNode,p):a.nodeType===1&&n1(a,p),br(a)):n1(fr,p.stateNode));break;case 4:y=fr,E=di,fr=p.stateNode.containerInfo,di=!0,ha(a,c,p),fr=y,di=E;break;case 0:case 11:case 14:case 15:if(!Pr&&(y=p.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){E=y=y.next;do{var A=E,O=A.destroy;A=A.tag,O!==void 0&&((A&2)!==0||(A&4)!==0)&&V1(p,c,O),E=E.next}while(E!==y)}ha(a,c,p);break;case 1:if(!Pr&&(iu(p,c),y=p.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=p.memoizedProps,y.state=p.memoizedState,y.componentWillUnmount()}catch(U){Tn(p,c,U)}ha(a,c,p);break;case 21:ha(a,c,p);break;case 22:p.mode&1?(Pr=(y=Pr)||p.memoizedState!==null,ha(a,c,p),Pr=y):ha(a,c,p);break;default:ha(a,c,p)}}function ek(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new Vj),c.forEach(function(y){var E=Yj.bind(null,a,y);p.has(y)||(p.add(y),y.then(E,E))})}}function fi(a,c){var p=c.deletions;if(p!==null)for(var y=0;y<p.length;y++){var E=p[y];try{var A=a,O=c,U=O;e:for(;U!==null;){switch(U.tag){case 5:fr=U.stateNode,di=!1;break e;case 3:fr=U.stateNode.containerInfo,di=!0;break e;case 4:fr=U.stateNode.containerInfo,di=!0;break e}U=U.return}if(fr===null)throw Error(n(160));J4(A,O,E),fr=null,di=!1;var K=E.alternate;K!==null&&(K.return=null),E.return=null}catch(se){Tn(E,c,se)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)tk(c,a),c=c.sibling}function tk(a,c){var p=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(fi(c,a),Oi(a),y&4){try{pf(3,a,a.return),t0(3,a)}catch(Ue){Tn(a,a.return,Ue)}try{pf(5,a,a.return)}catch(Ue){Tn(a,a.return,Ue)}}break;case 1:fi(c,a),Oi(a),y&512&&p!==null&&iu(p,p.return);break;case 5:if(fi(c,a),Oi(a),y&512&&p!==null&&iu(p,p.return),a.flags&32){var E=a.stateNode;try{Dn(E,"")}catch(Ue){Tn(a,a.return,Ue)}}if(y&4&&(E=a.stateNode,E!=null)){var A=a.memoizedProps,O=p!==null?p.memoizedProps:A,U=a.type,K=a.updateQueue;if(a.updateQueue=null,K!==null)try{U==="input"&&A.type==="radio"&&A.name!=null&&jt(E,A),fs(U,O);var se=fs(U,A);for(O=0;O<K.length;O+=2){var me=K[O],ye=K[O+1];me==="style"?Yt(E,ye):me==="dangerouslySetInnerHTML"?ta(E,ye):me==="children"?Dn(E,ye):C(E,me,ye,se)}switch(U){case"input":pt(E,A);break;case"textarea":Ke(E,A);break;case"select":var pe=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!A.multiple;var Re=A.value;Re!=null?Te(E,!!A.multiple,Re,!1):pe!==!!A.multiple&&(A.defaultValue!=null?Te(E,!!A.multiple,A.defaultValue,!0):Te(E,!!A.multiple,A.multiple?[]:"",!1))}E[nf]=A}catch(Ue){Tn(a,a.return,Ue)}}break;case 6:if(fi(c,a),Oi(a),y&4){if(a.stateNode===null)throw Error(n(162));E=a.stateNode,A=a.memoizedProps;try{E.nodeValue=A}catch(Ue){Tn(a,a.return,Ue)}}break;case 3:if(fi(c,a),Oi(a),y&4&&p!==null&&p.memoizedState.isDehydrated)try{br(c.containerInfo)}catch(Ue){Tn(a,a.return,Ue)}break;case 4:fi(c,a),Oi(a);break;case 13:fi(c,a),Oi(a),E=a.child,E.flags&8192&&(A=E.memoizedState!==null,E.stateNode.isHidden=A,!A||E.alternate!==null&&E.alternate.memoizedState!==null||(Z1=_n())),y&4&&ek(a);break;case 22:if(me=p!==null&&p.memoizedState!==null,a.mode&1?(Pr=(se=Pr)||me,fi(c,a),Pr=se):fi(c,a),Oi(a),y&8192){if(se=a.memoizedState!==null,(a.stateNode.isHidden=se)&&!me&&(a.mode&1)!==0)for(Ne=a,me=a.child;me!==null;){for(ye=Ne=me;Ne!==null;){switch(pe=Ne,Re=pe.child,pe.tag){case 0:case 11:case 14:case 15:pf(4,pe,pe.return);break;case 1:iu(pe,pe.return);var Ve=pe.stateNode;if(typeof Ve.componentWillUnmount=="function"){y=pe,p=pe.return;try{c=y,Ve.props=c.memoizedProps,Ve.state=c.memoizedState,Ve.componentWillUnmount()}catch(Ue){Tn(y,p,Ue)}}break;case 5:iu(pe,pe.return);break;case 22:if(pe.memoizedState!==null){sk(ye);continue}}Re!==null?(Re.return=pe,Ne=Re):sk(ye)}me=me.sibling}e:for(me=null,ye=a;;){if(ye.tag===5){if(me===null){me=ye;try{E=ye.stateNode,se?(A=E.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):(U=ye.stateNode,K=ye.memoizedProps.style,O=K!=null&&K.hasOwnProperty("display")?K.display:null,U.style.display=yn("display",O))}catch(Ue){Tn(a,a.return,Ue)}}}else if(ye.tag===6){if(me===null)try{ye.stateNode.nodeValue=se?"":ye.memoizedProps}catch(Ue){Tn(a,a.return,Ue)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===a)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===a)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===a)break e;me===ye&&(me=null),ye=ye.return}me===ye&&(me=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:fi(c,a),Oi(a),y&4&&ek(a);break;case 21:break;default:fi(c,a),Oi(a)}}function Oi(a){var c=a.flags;if(c&2){try{e:{for(var p=a.return;p!==null;){if(X4(p)){var y=p;break e}p=p.return}throw Error(n(160))}switch(y.tag){case 5:var E=y.stateNode;y.flags&32&&(Dn(E,""),y.flags&=-33);var A=Q4(a);U1(a,A,E);break;case 3:case 4:var O=y.stateNode.containerInfo,U=Q4(a);z1(a,U,O);break;default:throw Error(n(161))}}catch(K){Tn(a,a.return,K)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function zj(a,c,p){Ne=a,nk(a)}function nk(a,c,p){for(var y=(a.mode&1)!==0;Ne!==null;){var E=Ne,A=E.child;if(E.tag===22&&y){var O=E.memoizedState!==null||e0;if(!O){var U=E.alternate,K=U!==null&&U.memoizedState!==null||Pr;U=e0;var se=Pr;if(e0=O,(Pr=K)&&!se)for(Ne=E;Ne!==null;)O=Ne,K=O.child,O.tag===22&&O.memoizedState!==null?ik(E):K!==null?(K.return=O,Ne=K):ik(E);for(;A!==null;)Ne=A,nk(A),A=A.sibling;Ne=E,e0=U,Pr=se}rk(a)}else(E.subtreeFlags&8772)!==0&&A!==null?(A.return=E,Ne=A):rk(a)}}function rk(a){for(;Ne!==null;){var c=Ne;if((c.flags&8772)!==0){var p=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Pr||t0(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!Pr)if(p===null)y.componentDidMount();else{var E=c.elementType===c.type?p.memoizedProps:ui(c.type,p.memoizedProps);y.componentDidUpdate(E,p.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var A=c.updateQueue;A!==null&&s4(c,A,y);break;case 3:var O=c.updateQueue;if(O!==null){if(p=null,c.child!==null)switch(c.child.tag){case 5:p=c.child.stateNode;break;case 1:p=c.child.stateNode}s4(c,O,p)}break;case 5:var U=c.stateNode;if(p===null&&c.flags&4){p=U;var K=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&p.focus();break;case"img":K.src&&(p.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var se=c.alternate;if(se!==null){var me=se.memoizedState;if(me!==null){var ye=me.dehydrated;ye!==null&&br(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Pr||c.flags&512&&H1(c)}catch(pe){Tn(c,c.return,pe)}}if(c===a){Ne=null;break}if(p=c.sibling,p!==null){p.return=c.return,Ne=p;break}Ne=c.return}}function sk(a){for(;Ne!==null;){var c=Ne;if(c===a){Ne=null;break}var p=c.sibling;if(p!==null){p.return=c.return,Ne=p;break}Ne=c.return}}function ik(a){for(;Ne!==null;){var c=Ne;try{switch(c.tag){case 0:case 11:case 15:var p=c.return;try{t0(4,c)}catch(K){Tn(c,p,K)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var E=c.return;try{y.componentDidMount()}catch(K){Tn(c,E,K)}}var A=c.return;try{H1(c)}catch(K){Tn(c,A,K)}break;case 5:var O=c.return;try{H1(c)}catch(K){Tn(c,O,K)}}}catch(K){Tn(c,c.return,K)}if(c===a){Ne=null;break}var U=c.sibling;if(U!==null){U.return=c.return,Ne=U;break}Ne=c.return}}var Uj=Math.ceil,n0=P.ReactCurrentDispatcher,B1=P.ReactCurrentOwner,Us=P.ReactCurrentBatchConfig,It=0,ir=null,Fn=null,hr=0,_s=0,ou=la(0),Yn=0,mf=null,Tl=0,r0=0,W1=0,gf=null,Yr=null,Z1=0,au=1/0,xo=null,s0=!1,q1=null,pa=null,i0=!1,ma=null,o0=0,vf=0,G1=null,a0=-1,l0=0;function jr(){return(It&6)!==0?_n():a0!==-1?a0:a0=_n()}function ga(a){return(a.mode&1)===0?1:(It&2)!==0&&hr!==0?hr&-hr:Cj.transition!==null?(l0===0&&(l0=Bd()),l0):(a=$t,a!==0||(a=window.event,a=a===void 0?16:a6(a.type)),a)}function hi(a,c,p,y){if(50<vf)throw vf=0,G1=null,Error(n(185));$s(a,p,y),((It&2)===0||a!==ir)&&(a===ir&&((It&2)===0&&(r0|=p),Yn===4&&va(a,hr)),Xr(a,y),p===1&&It===0&&(c.mode&1)===0&&(au=_n()+500,Dp&&ua()))}function Xr(a,c){var p=a.callbackNode;Ud(a,c);var y=Vc(a,a===ir?hr:0);if(y===0)p!==null&&pl(p),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(p!=null&&pl(p),c===1)a.tag===0?Ej(ak.bind(null,a)):Z6(ak.bind(null,a)),xj(function(){(It&6)===0&&ua()}),p=null;else{switch(vp(y)){case 1:p=ml;break;case 4:p=Vd;break;case 16:p=jc;break;case 536870912:p=Hd;break;default:p=jc}p=mk(p,ok.bind(null,a))}a.callbackPriority=c,a.callbackNode=p}}function ok(a,c){if(a0=-1,l0=0,(It&6)!==0)throw Error(n(327));var p=a.callbackNode;if(lu()&&a.callbackNode!==p)return null;var y=Vc(a,a===ir?hr:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||c)c=c0(a,y);else{c=y;var E=It;It|=2;var A=ck();(ir!==a||hr!==c)&&(xo=null,au=_n()+500,Il(a,c));do try{Zj();break}catch(U){lk(a,U)}while(!0);f1(),n0.current=A,It=E,Fn!==null?c=0:(ir=null,hr=0,c=Yn)}if(c!==0){if(c===2&&(E=vl(a),E!==0&&(y=E,c=K1(a,E))),c===1)throw p=mf,Il(a,0),va(a,y),Xr(a,_n()),p;if(c===6)va(a,y);else{if(E=a.current.alternate,(y&30)===0&&!Bj(E)&&(c=c0(a,y),c===2&&(A=vl(a),A!==0&&(y=A,c=K1(a,A))),c===1))throw p=mf,Il(a,0),va(a,y),Xr(a,_n()),p;switch(a.finishedWork=E,a.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:Ml(a,Yr,xo);break;case 3:if(va(a,y),(y&130023424)===y&&(c=Z1+500-_n(),10<c)){if(Vc(a,0)!==0)break;if(E=a.suspendedLanes,(E&y)!==y){jr(),a.pingedLanes|=a.suspendedLanes&E;break}a.timeoutHandle=t1(Ml.bind(null,a,Yr,xo),c);break}Ml(a,Yr,xo);break;case 4:if(va(a,y),(y&4194240)===y)break;for(c=a.eventTimes,E=-1;0<y;){var O=31-ms(y);A=1<<O,O=c[O],O>E&&(E=O),y&=~A}if(y=E,y=_n()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*Uj(y/1960))-y,10<y){a.timeoutHandle=t1(Ml.bind(null,a,Yr,xo),y);break}Ml(a,Yr,xo);break;case 5:Ml(a,Yr,xo);break;default:throw Error(n(329))}}}return Xr(a,_n()),a.callbackNode===p?ok.bind(null,a):null}function K1(a,c){var p=gf;return a.current.memoizedState.isDehydrated&&(Il(a,c).flags|=256),a=c0(a,c),a!==2&&(c=Yr,Yr=p,c!==null&&Y1(c)),a}function Y1(a){Yr===null?Yr=a:Yr.push.apply(Yr,a)}function Bj(a){for(var c=a;;){if(c.flags&16384){var p=c.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var y=0;y<p.length;y++){var E=p[y],A=E.getSnapshot;E=E.value;try{if(!li(A(),E))return!1}catch{return!1}}}if(p=c.child,c.subtreeFlags&16384&&p!==null)p.return=c,c=p;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function va(a,c){for(c&=~W1,c&=~r0,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var p=31-ms(c),y=1<<p;a[p]=-1,c&=~y}}function ak(a){if((It&6)!==0)throw Error(n(327));lu();var c=Vc(a,0);if((c&1)===0)return Xr(a,_n()),null;var p=c0(a,c);if(a.tag!==0&&p===2){var y=vl(a);y!==0&&(c=y,p=K1(a,y))}if(p===1)throw p=mf,Il(a,0),va(a,c),Xr(a,_n()),p;if(p===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Ml(a,Yr,xo),Xr(a,_n()),null}function X1(a,c){var p=It;It|=1;try{return a(c)}finally{It=p,It===0&&(au=_n()+500,Dp&&ua())}}function Rl(a){ma!==null&&ma.tag===0&&(It&6)===0&&lu();var c=It;It|=1;var p=Us.transition,y=$t;try{if(Us.transition=null,$t=1,a)return a()}finally{$t=y,Us.transition=p,It=c,(It&6)===0&&ua()}}function Q1(){_s=ou.current,cn(ou)}function Il(a,c){a.finishedWork=null,a.finishedLanes=0;var p=a.timeoutHandle;if(p!==-1&&(a.timeoutHandle=-1,wj(p)),Fn!==null)for(p=Fn.return;p!==null;){var y=p;switch(a1(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Lp();break;case 3:ru(),cn(qr),cn(kr),w1();break;case 5:y1(y);break;case 4:ru();break;case 13:cn(wn);break;case 19:cn(wn);break;case 10:h1(y.type._context);break;case 22:case 23:Q1()}p=p.return}if(ir=a,Fn=a=ya(a.current,null),hr=_s=c,Yn=0,mf=null,W1=r0=Tl=0,Yr=gf=null,Cl!==null){for(c=0;c<Cl.length;c++)if(p=Cl[c],y=p.interleaved,y!==null){p.interleaved=null;var E=y.next,A=p.pending;if(A!==null){var O=A.next;A.next=E,y.next=O}p.pending=y}Cl=null}return a}function lk(a,c){do{var p=Fn;try{if(f1(),Zp.current=Yp,qp){for(var y=xn.memoizedState;y!==null;){var E=y.queue;E!==null&&(E.pending=null),y=y.next}qp=!1}if(Al=0,sr=Kn=xn=null,cf=!1,uf=0,B1.current=null,p===null||p.return===null){Yn=1,mf=c,Fn=null;break}e:{var A=a,O=p.return,U=p,K=c;if(c=hr,U.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var se=K,me=U,ye=me.tag;if((me.mode&1)===0&&(ye===0||ye===11||ye===15)){var pe=me.alternate;pe?(me.updateQueue=pe.updateQueue,me.memoizedState=pe.memoizedState,me.lanes=pe.lanes):(me.updateQueue=null,me.memoizedState=null)}var Re=O4(O);if(Re!==null){Re.flags&=-257,L4(Re,O,U,A,c),Re.mode&1&&M4(A,se,c),c=Re,K=se;var Ve=c.updateQueue;if(Ve===null){var Ue=new Set;Ue.add(K),c.updateQueue=Ue}else Ve.add(K);break e}else{if((c&1)===0){M4(A,se,c),J1();break e}K=Error(n(426))}}else if(hn&&U.mode&1){var On=O4(O);if(On!==null){(On.flags&65536)===0&&(On.flags|=256),L4(On,O,U,A,c),u1(su(K,U));break e}}A=K=su(K,U),Yn!==4&&(Yn=2),gf===null?gf=[A]:gf.push(A),A=O;do{switch(A.tag){case 3:A.flags|=65536,c&=-c,A.lanes|=c;var ee=R4(A,K,c);r4(A,ee);break e;case 1:U=K;var X=A.type,te=A.stateNode;if((A.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(pa===null||!pa.has(te)))){A.flags|=65536,c&=-c,A.lanes|=c;var Se=I4(A,U,c);r4(A,Se);break e}}A=A.return}while(A!==null)}dk(p)}catch(We){c=We,Fn===p&&p!==null&&(Fn=p=p.return);continue}break}while(!0)}function ck(){var a=n0.current;return n0.current=Yp,a===null?Yp:a}function J1(){(Yn===0||Yn===3||Yn===2)&&(Yn=4),ir===null||(Tl&268435455)===0&&(r0&268435455)===0||va(ir,hr)}function c0(a,c){var p=It;It|=2;var y=ck();(ir!==a||hr!==c)&&(xo=null,Il(a,c));do try{Wj();break}catch(E){lk(a,E)}while(!0);if(f1(),It=p,n0.current=y,Fn!==null)throw Error(n(261));return ir=null,hr=0,Yn}function Wj(){for(;Fn!==null;)uk(Fn)}function Zj(){for(;Fn!==null&&!Pv();)uk(Fn)}function uk(a){var c=pk(a.alternate,a,_s);a.memoizedProps=a.pendingProps,c===null?dk(a):Fn=c,B1.current=null}function dk(a){var c=a;do{var p=c.alternate;if(a=c.return,(c.flags&32768)===0){if(p=$j(p,c,_s),p!==null){Fn=p;return}}else{if(p=Fj(p,c),p!==null){p.flags&=32767,Fn=p;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Yn=6,Fn=null;return}}if(c=c.sibling,c!==null){Fn=c;return}Fn=c=a}while(c!==null);Yn===0&&(Yn=5)}function Ml(a,c,p){var y=$t,E=Us.transition;try{Us.transition=null,$t=1,qj(a,c,p,y)}finally{Us.transition=E,$t=y}return null}function qj(a,c,p,y){do lu();while(ma!==null);if((It&6)!==0)throw Error(n(327));p=a.finishedWork;var E=a.finishedLanes;if(p===null)return null;if(a.finishedWork=null,a.finishedLanes=0,p===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var A=p.lanes|p.childLanes;if(gp(a,A),a===ir&&(Fn=ir=null,hr=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||i0||(i0=!0,mk(jc,function(){return lu(),null})),A=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||A){A=Us.transition,Us.transition=null;var O=$t;$t=1;var U=It;It|=4,B1.current=null,Hj(a,p),tk(p,a),hj(Jv),Ht=!!Qv,Jv=Qv=null,a.current=p,zj(p),Av(),It=U,$t=O,Us.transition=A}else a.current=p;if(i0&&(i0=!1,ma=a,o0=E),A=a.pendingLanes,A===0&&(pa=null),zd(p.stateNode),Xr(a,_n()),c!==null)for(y=a.onRecoverableError,p=0;p<c.length;p++)E=c[p],y(E.value,{componentStack:E.stack,digest:E.digest});if(s0)throw s0=!1,a=q1,q1=null,a;return(o0&1)!==0&&a.tag!==0&&lu(),A=a.pendingLanes,(A&1)!==0?a===G1?vf++:(vf=0,G1=a):vf=0,ua(),null}function lu(){if(ma!==null){var a=vp(o0),c=Us.transition,p=$t;try{if(Us.transition=null,$t=16>a?16:a,ma===null)var y=!1;else{if(a=ma,ma=null,o0=0,(It&6)!==0)throw Error(n(331));var E=It;for(It|=4,Ne=a.current;Ne!==null;){var A=Ne,O=A.child;if((Ne.flags&16)!==0){var U=A.deletions;if(U!==null){for(var K=0;K<U.length;K++){var se=U[K];for(Ne=se;Ne!==null;){var me=Ne;switch(me.tag){case 0:case 11:case 15:pf(8,me,A)}var ye=me.child;if(ye!==null)ye.return=me,Ne=ye;else for(;Ne!==null;){me=Ne;var pe=me.sibling,Re=me.return;if(Y4(me),me===se){Ne=null;break}if(pe!==null){pe.return=Re,Ne=pe;break}Ne=Re}}}var Ve=A.alternate;if(Ve!==null){var Ue=Ve.child;if(Ue!==null){Ve.child=null;do{var On=Ue.sibling;Ue.sibling=null,Ue=On}while(Ue!==null)}}Ne=A}}if((A.subtreeFlags&2064)!==0&&O!==null)O.return=A,Ne=O;else e:for(;Ne!==null;){if(A=Ne,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:pf(9,A,A.return)}var ee=A.sibling;if(ee!==null){ee.return=A.return,Ne=ee;break e}Ne=A.return}}var X=a.current;for(Ne=X;Ne!==null;){O=Ne;var te=O.child;if((O.subtreeFlags&2064)!==0&&te!==null)te.return=O,Ne=te;else e:for(O=X;Ne!==null;){if(U=Ne,(U.flags&2048)!==0)try{switch(U.tag){case 0:case 11:case 15:t0(9,U)}}catch(We){Tn(U,U.return,We)}if(U===O){Ne=null;break e}var Se=U.sibling;if(Se!==null){Se.return=U.return,Ne=Se;break e}Ne=U.return}}if(It=E,ua(),js&&typeof js.onPostCommitFiberRoot=="function")try{js.onPostCommitFiberRoot($c,a)}catch{}y=!0}return y}finally{$t=p,Us.transition=c}}return!1}function fk(a,c,p){c=su(p,c),c=R4(a,c,1),a=fa(a,c,1),c=jr(),a!==null&&($s(a,1,c),Xr(a,c))}function Tn(a,c,p){if(a.tag===3)fk(a,a,p);else for(;c!==null;){if(c.tag===3){fk(c,a,p);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(pa===null||!pa.has(y))){a=su(p,a),a=I4(c,a,1),c=fa(c,a,1),a=jr(),c!==null&&($s(c,1,a),Xr(c,a));break}}c=c.return}}function Gj(a,c,p){var y=a.pingCache;y!==null&&y.delete(c),c=jr(),a.pingedLanes|=a.suspendedLanes&p,ir===a&&(hr&p)===p&&(Yn===4||Yn===3&&(hr&130023424)===hr&&500>_n()-Z1?Il(a,0):W1|=p),Xr(a,c)}function hk(a,c){c===0&&((a.mode&1)===0?c=1:(c=sa,sa<<=1,(sa&130023424)===0&&(sa=4194304)));var p=jr();a=yo(a,c),a!==null&&($s(a,c,p),Xr(a,p))}function Kj(a){var c=a.memoizedState,p=0;c!==null&&(p=c.retryLane),hk(a,p)}function Yj(a,c){var p=0;switch(a.tag){case 13:var y=a.stateNode,E=a.memoizedState;E!==null&&(p=E.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),hk(a,p)}var pk;pk=function(a,c,p){if(a!==null)if(a.memoizedProps!==c.pendingProps||qr.current)Kr=!0;else{if((a.lanes&p)===0&&(c.flags&128)===0)return Kr=!1,jj(a,c,p);Kr=(a.flags&131072)!==0}else Kr=!1,hn&&(c.flags&1048576)!==0&&q6(c,$p,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;Jp(a,c),a=c.pendingProps;var E=Yc(c,kr.current);nu(c,p),E=S1(null,c,y,a,E,p);var A=k1();return c.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Gr(y)?(A=!0,Np(c)):A=!1,c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,g1(c),E.updater=Xp,c.stateNode=E,E._reactInternals=c,R1(c,y,a,p),c=L1(null,c,y,!0,A,p)):(c.tag=0,hn&&A&&o1(c),Dr(null,c,E,p),c=c.child),c;case 16:y=c.elementType;e:{switch(Jp(a,c),a=c.pendingProps,E=y._init,y=E(y._payload),c.type=y,E=c.tag=Qj(y),a=ui(y,a),E){case 0:c=O1(null,c,y,a,p);break e;case 1:c=V4(null,c,y,a,p);break e;case 11:c=N4(null,c,y,a,p);break e;case 14:c=D4(null,c,y,ui(y.type,a),p);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ui(y,E),O1(a,c,y,E,p);case 1:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ui(y,E),V4(a,c,y,E,p);case 3:e:{if(H4(c),a===null)throw Error(n(387));y=c.pendingProps,A=c.memoizedState,E=A.element,n4(a,c),Bp(c,y,null,p);var O=c.memoizedState;if(y=O.element,A.isDehydrated)if(A={element:y,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},c.updateQueue.baseState=A,c.memoizedState=A,c.flags&256){E=su(Error(n(423)),c),c=z4(a,c,y,p,E);break e}else if(y!==E){E=su(Error(n(424)),c),c=z4(a,c,y,p,E);break e}else for(ys=aa(c.stateNode.containerInfo.firstChild),vs=c,hn=!0,ci=null,p=e4(c,null,y,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Jc(),y===E){c=wo(a,c,p);break e}Dr(a,c,y,p)}c=c.child}return c;case 5:return i4(c),a===null&&c1(c),y=c.type,E=c.pendingProps,A=a!==null?a.memoizedProps:null,O=E.children,e1(y,E)?O=null:A!==null&&e1(y,A)&&(c.flags|=32),F4(a,c),Dr(a,c,O,p),c.child;case 6:return a===null&&c1(c),null;case 13:return U4(a,c,p);case 4:return v1(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=eu(c,null,y,p):Dr(a,c,y,p),c.child;case 11:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ui(y,E),N4(a,c,y,E,p);case 7:return Dr(a,c,c.pendingProps,p),c.child;case 8:return Dr(a,c,c.pendingProps.children,p),c.child;case 12:return Dr(a,c,c.pendingProps.children,p),c.child;case 10:e:{if(y=c.type._context,E=c.pendingProps,A=c.memoizedProps,O=E.value,on(Hp,y._currentValue),y._currentValue=O,A!==null)if(li(A.value,O)){if(A.children===E.children&&!qr.current){c=wo(a,c,p);break e}}else for(A=c.child,A!==null&&(A.return=c);A!==null;){var U=A.dependencies;if(U!==null){O=A.child;for(var K=U.firstContext;K!==null;){if(K.context===y){if(A.tag===1){K=_o(-1,p&-p),K.tag=2;var se=A.updateQueue;if(se!==null){se=se.shared;var me=se.pending;me===null?K.next=K:(K.next=me.next,me.next=K),se.pending=K}}A.lanes|=p,K=A.alternate,K!==null&&(K.lanes|=p),p1(A.return,p,c),U.lanes|=p;break}K=K.next}}else if(A.tag===10)O=A.type===c.type?null:A.child;else if(A.tag===18){if(O=A.return,O===null)throw Error(n(341));O.lanes|=p,U=O.alternate,U!==null&&(U.lanes|=p),p1(O,p,c),O=A.sibling}else O=A.child;if(O!==null)O.return=A;else for(O=A;O!==null;){if(O===c){O=null;break}if(A=O.sibling,A!==null){A.return=O.return,O=A;break}O=O.return}A=O}Dr(a,c,E.children,p),c=c.child}return c;case 9:return E=c.type,y=c.pendingProps.children,nu(c,p),E=Hs(E),y=y(E),c.flags|=1,Dr(a,c,y,p),c.child;case 14:return y=c.type,E=ui(y,c.pendingProps),E=ui(y.type,E),D4(a,c,y,E,p);case 15:return j4(a,c,c.type,c.pendingProps,p);case 17:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:ui(y,E),Jp(a,c),c.tag=1,Gr(y)?(a=!0,Np(c)):a=!1,nu(c,p),A4(c,y,E),R1(c,y,E,p),L1(null,c,y,!0,a,p);case 19:return W4(a,c,p);case 22:return $4(a,c,p)}throw Error(n(156,c.tag))};function mk(a,c){return pp(a,c)}function Xj(a,c,p,y){this.tag=a,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bs(a,c,p,y){return new Xj(a,c,p,y)}function ey(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Qj(a){if(typeof a=="function")return ey(a)?1:0;if(a!=null){if(a=a.$$typeof,a===D)return 11;if(a===G)return 14}return 2}function ya(a,c){var p=a.alternate;return p===null?(p=Bs(a.tag,c,a.key,a.mode),p.elementType=a.elementType,p.type=a.type,p.stateNode=a.stateNode,p.alternate=a,a.alternate=p):(p.pendingProps=c,p.type=a.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=a.flags&14680064,p.childLanes=a.childLanes,p.lanes=a.lanes,p.child=a.child,p.memoizedProps=a.memoizedProps,p.memoizedState=a.memoizedState,p.updateQueue=a.updateQueue,c=a.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=a.sibling,p.index=a.index,p.ref=a.ref,p}function u0(a,c,p,y,E,A){var O=2;if(y=a,typeof a=="function")ey(a)&&(O=1);else if(typeof a=="string")O=5;else e:switch(a){case I:return Ol(p.children,E,A,c);case R:O=8,E|=8;break;case L:return a=Bs(12,p,c,E|2),a.elementType=L,a.lanes=A,a;case q:return a=Bs(13,p,c,E),a.elementType=q,a.lanes=A,a;case W:return a=Bs(19,p,c,E),a.elementType=W,a.lanes=A,a;case J:return d0(p,E,A,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case j:O=10;break e;case F:O=9;break e;case D:O=11;break e;case G:O=14;break e;case H:O=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=Bs(O,p,c,E),c.elementType=a,c.type=y,c.lanes=A,c}function Ol(a,c,p,y){return a=Bs(7,a,y,c),a.lanes=p,a}function d0(a,c,p,y){return a=Bs(22,a,y,c),a.elementType=J,a.lanes=p,a.stateNode={isHidden:!1},a}function ty(a,c,p){return a=Bs(6,a,null,c),a.lanes=p,a}function ny(a,c,p){return c=Bs(4,a.children!==null?a.children:[],a.key,c),c.lanes=p,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function Jj(a,c,p,y,E){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mp(0),this.expirationTimes=mp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mp(0),this.identifierPrefix=y,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function ry(a,c,p,y,E,A,O,U,K){return a=new Jj(a,c,p,U,K),c===1?(c=1,A===!0&&(c|=8)):c=0,A=Bs(3,null,null,c),a.current=A,A.stateNode=a,A.memoizedState={element:y,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},g1(A),a}function e7(a,c,p){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:y==null?null:""+y,children:a,containerInfo:c,implementation:p}}function gk(a){if(!a)return ca;a=a._reactInternals;e:{if(Ti(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Gr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var p=a.type;if(Gr(p))return B6(a,p,c)}return c}function vk(a,c,p,y,E,A,O,U,K){return a=ry(p,y,!0,a,E,A,O,U,K),a.context=gk(null),p=a.current,y=jr(),E=ga(p),A=_o(y,E),A.callback=c??null,fa(p,A,E),a.current.lanes=E,$s(a,E,y),Xr(a,y),a}function f0(a,c,p,y){var E=c.current,A=jr(),O=ga(E);return p=gk(p),c.context===null?c.context=p:c.pendingContext=p,c=_o(A,O),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=fa(E,c,O),a!==null&&(hi(a,E,O,A),Up(a,E,O)),O}function h0(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function yk(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var p=a.retryLane;a.retryLane=p!==0&&p<c?p:c}}function sy(a,c){yk(a,c),(a=a.alternate)&&yk(a,c)}function t7(){return null}var _k=typeof reportError=="function"?reportError:function(a){console.error(a)};function iy(a){this._internalRoot=a}p0.prototype.render=iy.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));f0(a,c,null,null)},p0.prototype.unmount=iy.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Rl(function(){f0(null,a,null,null)}),c[po]=null}};function p0(a){this._internalRoot=a}p0.prototype.unstable_scheduleHydration=function(a){if(a){var c=Wd();a={blockedOn:null,target:a,priority:c};for(var p=0;p<_e.length&&c!==0&&c<_e[p].priority;p++);_e.splice(p,0,a),p===0&&$e(a)}};function oy(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function m0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function wk(){}function n7(a,c,p,y,E){if(E){if(typeof y=="function"){var A=y;y=function(){var se=h0(O);A.call(se)}}var O=vk(c,y,a,0,null,!1,!1,"",wk);return a._reactRootContainer=O,a[po]=O.current,ef(a.nodeType===8?a.parentNode:a),Rl(),O}for(;E=a.lastChild;)a.removeChild(E);if(typeof y=="function"){var U=y;y=function(){var se=h0(K);U.call(se)}}var K=ry(a,0,!1,null,null,!1,!1,"",wk);return a._reactRootContainer=K,a[po]=K.current,ef(a.nodeType===8?a.parentNode:a),Rl(function(){f0(c,K,p,y)}),K}function g0(a,c,p,y,E){var A=p._reactRootContainer;if(A){var O=A;if(typeof E=="function"){var U=E;E=function(){var K=h0(O);U.call(K)}}f0(c,O,a,E)}else O=n7(p,c,a,E,y);return h0(O)}yp=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var p=gl(c.pendingLanes);p!==0&&(yl(c,p|1),Xr(c,_n()),(It&6)===0&&(au=_n()+500,ua()))}break;case 13:Rl(function(){var y=yo(a,1);if(y!==null){var E=jr();hi(y,a,1,E)}}),sy(a,1)}},Hc=function(a){if(a.tag===13){var c=yo(a,134217728);if(c!==null){var p=jr();hi(c,a,134217728,p)}sy(a,134217728)}},_p=function(a){if(a.tag===13){var c=ga(a),p=yo(a,c);if(p!==null){var y=jr();hi(p,a,c,y)}sy(a,c)}},Wd=function(){return $t},_l=function(a,c){var p=$t;try{return $t=a,c()}finally{$t=p}},ri=function(a,c,p){switch(c){case"input":if(pt(a,p),c=p.name,p.type==="radio"&&c!=null){for(p=a;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<p.length;c++){var y=p[c];if(y!==a&&y.form===a.form){var E=Op(y);if(!E)throw Error(n(90));ke(y),pt(y,E)}}}break;case"textarea":Ke(a,p);break;case"select":c=p.value,c!=null&&Te(a,!!p.multiple,c,!1)}},Ye=X1,Nt=Rl;var r7={usingClientEntryPoint:!1,Events:[rf,Gc,Op,uo,hs,X1]},yf={findFiberByHostInstance:bl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},s7={bundleType:yf.bundleType,version:yf.version,rendererPackageName:yf.rendererPackageName,rendererConfig:yf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=ra(a),a===null?null:a.stateNode},findFiberByHostInstance:yf.findFiberByHostInstance||t7,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 v0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!v0.isDisabled&&v0.supportsFiber)try{$c=v0.inject(s7),js=v0}catch{}}return Qr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r7,Qr.createPortal=function(a,c){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!oy(c))throw Error(n(200));return e7(a,c,null,p)},Qr.createRoot=function(a,c){if(!oy(a))throw Error(n(299));var p=!1,y="",E=_k;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(E=c.onRecoverableError)),c=ry(a,1,!1,null,null,p,!1,y,E),a[po]=c.current,ef(a.nodeType===8?a.parentNode:a),new iy(c)},Qr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=ra(c),a=a===null?null:a.stateNode,a},Qr.flushSync=function(a){return Rl(a)},Qr.hydrate=function(a,c,p){if(!m0(c))throw Error(n(200));return g0(null,a,c,!0,p)},Qr.hydrateRoot=function(a,c,p){if(!oy(a))throw Error(n(405));var y=p!=null&&p.hydratedSources||null,E=!1,A="",O=_k;if(p!=null&&(p.unstable_strictMode===!0&&(E=!0),p.identifierPrefix!==void 0&&(A=p.identifierPrefix),p.onRecoverableError!==void 0&&(O=p.onRecoverableError)),c=vk(c,null,a,1,p??null,E,!1,A,O),a[po]=c.current,ef(a),y)for(a=0;a<y.length;a++)p=y[a],E=p._getVersion,E=E(p._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[p,E]:c.mutableSourceEagerHydrationData.push(p,E);return new p0(c)},Qr.render=function(a,c,p){if(!m0(c))throw Error(n(200));return g0(null,a,c,!1,p)},Qr.unmountComponentAtNode=function(a){if(!m0(a))throw Error(n(40));return a._reactRootContainer?(Rl(function(){g0(null,null,a,!1,function(){a._reactRootContainer=null,a[po]=null})}),!0):!1},Qr.unstable_batchedUpdates=X1,Qr.unstable_renderSubtreeIntoContainer=function(a,c,p,y){if(!m0(p))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return g0(a,c,p,!1,y)},Qr.version="18.3.1-next-f1338f8080-20240426",Qr}var FE;function uI(){if(FE)return Jy.exports;FE=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(),Jy.exports=xU(),Jy.exports}var VE;function bU(){if(VE)return T0;VE=1;var t=uI();return T0.createRoot=t.createRoot,T0.hydrateRoot=t.hydrateRoot,T0}var SU=bU();const kU=Vg(SU),Fo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_SENTRY_DSN:""};function dI(t){return"init"in t}function lw(t){return typeof t.write=="function"}function EU(t){return!!t.onMount}function HE(t){return"v"in t||"e"in t}function lg(t){if("e"in t)throw t.e;if((Fo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function cg(t){return typeof(t==null?void 0:t.then)=="function"}function CU(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 fI(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function hI(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const o=new Set(s);for(const l of i)o.add(l);return o}function PU(t){return!!t.INTERNAL_onInit}const AU=(t,e,n,...r)=>n.read(...r),TU=(t,e,n,...r)=>n.write(...r),RU=(t,e,n)=>n.INTERNAL_onInit(e),IU=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},MU=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const o=t[6],l=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=o.i)==null||r.call(o,n),PU(n)&&l(t,e,n)}return i},OU=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],u=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=h=>{try{h()}catch(m){d.push(m)}};do{l.f&&f(l.f);const h=new Set;for(const m of s){const v=(n=r.get(m))==null?void 0:n.l;if(v)for(const x of v)h.add(x)}s.clear();for(const m of o)h.add(m);o.clear();for(const m of i)h.add(m);i.clear();for(const m of h)f(m);s.size&&u(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},LU=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],o=t[14],l=t[17];if(!s.size)return;const u=[],d=[],f=new WeakSet,h=new WeakSet,m=[],v=[];for(const x of s)m.push(x),v.push(i(t,e,x));for(;m.length;){const x=m.length-1,_=m[x],w=v[x];if(h.has(_)){m.pop(),v.pop();continue}if(f.has(_)){if(r.get(_)===w.n)u.push(_),d.push(w);else if((Fo?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");h.add(_),m.pop(),v.pop();continue}f.add(_);for(const b of hI(_,w,n))f.has(b)||(m.push(b),v.push(i(t,e,b)))}for(let x=u.length-1;x>=0;--x){const _=u[x],w=d[x];let b=!1;for(const k of w.d.keys())if(k!==_&&s.has(k)){b=!0;break}b&&(r.set(_,w.n),o(t,e,_),l(t,e,_)),r.delete(_)}},cw=new WeakSet,NU=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],u=t[6],d=t[7],f=t[11],h=t[12],m=t[13],v=t[14],x=t[16],_=t[17],w=t[20],b=t[26],k=t[28],C=f(t,e,n),P=k[0];if(HE(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===P)return C.m=P,C;let G=!1;for(const[H,J]of C.d)if(v(t,e,H).n!==J){G=!0;break}if(!G)return C.m=P,C}let T=!0;const M=new Set(C.d.keys()),I=()=>{for(const G of M)C.d.delete(G)},R=()=>{if(i.has(n)){const G=!l.size;_(t,e,n),G&&(m(t,e),h(t,e))}},L=G=>{var H;if(G===n){const B=f(t,e,G);if(!HE(B))if(dI(G))w(t,e,G,G.init);else throw new Error("no atom init");return lg(B)}const J=v(t,e,G);try{return lg(J)}finally{M.delete(G),C.d.set(G,J.n),cg(C.v)&&fI(n,C.v,J),i.has(n)&&((H=i.get(G))==null||H.t.add(n)),T||R()}};let j,F;const D={get signal(){return j||(j=new AbortController),j.signal},get setSelf(){return(Fo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Fo?"production":void 0)!=="production"&&!lw(n)&&console.warn("setSelf function cannot be used with read-only atom"),!F&&lw(n)&&(F=(...G)=>{if((Fo?"production":void 0)!=="production"&&T&&console.warn("setSelf function cannot be called in sync"),!T)try{return x(t,e,n,G)}finally{m(t,e),h(t,e)}}),F}},q=C.n,W=o.get(n)===q;try{(Fo?"production":void 0)!=="production"&&cw.delete(e);const G=d(t,e,n,L,D);if((Fo?"production":void 0)!=="production"&&cw.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),w(t,e,n,G),cg(G)){b(t,e,G,()=>j==null?void 0:j.abort());const H=()=>{I(),R()};G.then(H,H)}else I();return(r=u.r)==null||r.call(u,n),C.m=P,C}catch(G){if(CU(G))throw G;return delete C.v,C.e=G,++C.n,C.m=P,C}finally{T=!1,C.n!==q&&W&&(o.set(n,C.n),l.add(n),(s=u.c)==null||s.call(u,n))}},DU=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],o=[n];for(;o.length;){const l=o.pop(),u=i(t,e,l);for(const d of hI(l,u,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},jU=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],u=t[12],d=t[13],f=t[14],h=t[15],m=t[16],v=t[17],x=t[20],_=t[28];let w=!0;const b=C=>lg(f(t,e,C)),k=(C,...P)=>{var T;const M=l(t,e,C);try{if(C===n){if(!dI(C))throw new Error("atom not writable");(Fo?"production":void 0)!=="production"&&cw.add(e);const I=M.n,R=P[0];x(t,e,C,R),v(t,e,C),I!==M.n&&(++_[0],s.add(C),h(t,e,C),(T=i.c)==null||T.call(i,C));return}else return m(t,e,C,P)}finally{w||(d(t,e),u(t,e))}};try{return o(t,e,n,b,k,...r)}finally{w=!1}},$U=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],u=t[15],d=t[18],f=t[19],h=l(t,e,n),m=s.get(n);if(m&&h.d.size>0){for(const[v,x]of h.d)if(!m.d.has(v)){const _=l(t,e,v);d(t,e,v).t.add(n),m.d.add(v),x!==_.n&&(i.add(v),u(t,e,v),(r=o.c)==null||r.call(o,v))}for(const v of m.d)if(!h.d.has(v)){m.d.delete(v);const x=f(t,e,v);x==null||x.t.delete(n)}}},FU=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],u=t[11],d=t[12],f=t[13],h=t[14],m=t[16],v=t[18],x=u(t,e,n);let _=s.get(n);if(!_){h(t,e,n);for(const w of x.d.keys())v(t,e,w).t.add(n);if(_={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,_),lw(n)&&EU(n)){const w=()=>{let b=!0;const k=(...C)=>{try{return m(t,e,n,C)}finally{b||(f(t,e),d(t,e))}};try{const C=l(t,e,n,k);C&&(_.u=()=>{b=!0;try{C()}finally{b=!1}})}finally{b=!1}};i.add(w)}(r=o.m)==null||r.call(o,n)}return _},VU=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],u=t[11],d=t[19],f=u(t,e,n);let h=i.get(n);if(!h||h.l.size)return h;let m=!1;for(const v of h.t)if((r=i.get(v))!=null&&r.d.has(n)){m=!0;break}if(!m){h.u&&o.add(h.u),h=void 0,i.delete(n);for(const v of f.d.keys()){const x=d(t,e,v);x==null||x.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return h},HU=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,u=o.v;if(cg(r))for(const d of o.d.keys())fI(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(u,o.v))&&(++o.n,cg(u)&&i(t,e,u))},zU=(t,e,n)=>{const r=t[14];return lg(r(t,e,n))},UU=(t,e,n,...r)=>{const s=t[3],i=t[12],o=t[13],l=t[16],u=s.size;try{return l(t,e,n,r)}finally{s.size!==u&&(o(t,e),i(t,e))}},BU=(t,e,n,r)=>{const s=t[12],i=t[13],o=t[18],l=t[19],d=o(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),l(t,e,n),i(t,e),s(t,e)}},WU=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const o=()=>s.delete(n);n.then(o,o)}i.add(r)},ZU=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},pI=new WeakMap;function qU(t){const e=pI.get(t);if((Fo?"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 GU(...t){const e={get(o){return r(n,e,o)},set(o,...l){return s(n,e,o,...l)},sub(o,l){return i(n,e,o,l)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},AU,TU,RU,IU,MU,OU,LU,NU,DU,jU,$U,FU,VU,HU,zU,UU,BU,void 0,new WeakMap,WU,ZU,[0]].map((o,l)=>t[l]||o);pI.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const mI={};let KU=0;function Zt(t,e){const n=`atom${++KU}`,r={toString(){return(mI?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=YU,r.write=XU),r}function YU(t){return t(this)}function XU(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function QU(){return GU()}let If;function JU(){return If||(If=QU(),(mI?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=If),globalThis.__JOTAI_DEFAULT_STORE__!==If&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),If}const eB={},tB=g.createContext(void 0);function mb(t){return g.useContext(tB)||JU()}const uw=t=>typeof(t==null?void 0:t.then)=="function",dw=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},nB=we.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(dw(t),t)}),n_=new WeakMap,zE=(t,e,n)=>{const r=qU(t),s=r[26];let i=n_.get(e);return i||(i=new Promise((o,l)=>{let u=e;const d=m=>v=>{u===m&&o(v)},f=m=>v=>{u===m&&l(v)},h=()=>{try{const m=n();uw(m)?(n_.set(m,i),u=m,m.then(d(m),f(m)),s(r,t,m,h)):o(m)}catch(m){l(m)}};e.then(d(e),f(e)),s(r,t,e,h)}),n_.set(e,i)),i};function ut(t,e){const{delay:n,unstable_promiseStatus:r=!we.use}={},s=mb(),[[i,o,l],u]=g.useReducer(f=>{const h=s.get(t);return Object.is(f[0],h)&&f[1]===s&&f[2]===t?f:[h,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((o!==s||l!==t)&&(u(),d=s.get(t)),g.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const h=s.get(t);uw(h)&&dw(zE(s,h,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
43
-
44
- Migration guide:
45
-
46
- Create a custom hook like the following.
47
-
48
- function useAtomValueWithDelay<Value>(
49
- atom: Atom<Value>,
50
- options: { delay: number },
51
- ): Value {
52
- const { delay } = options
53
- const store = useStore(options)
54
- const [value, setValue] = useState(() => store.get(atom))
55
- useEffect(() => {
56
- const unsub = store.sub(atom, () => {
57
- setTimeout(() => setValue(store.get(atom)), delay)
58
- })
59
- return unsub
60
- }, [store, atom, delay])
61
- return value
62
- }
63
- `),setTimeout(u,n);return}u()});return u(),f},[s,t,n,r]),g.useDebugValue(d),uw(d)){const f=zE(s,d,()=>s.get(t));return r&&dw(f),nB(f)}return d}function wt(t,e){const n=mb();return g.useCallback((...s)=>{if((eB?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function gI(t,e){return[ut(t),wt(t)]}const gb=g.createContext({});function vb(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const rB=typeof window<"u",yb=rB?g.useLayoutEffect:g.useEffect,qg=g.createContext(null);function _b(t,e){t.indexOf(e)===-1&&t.push(e)}function ug(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ro=(t,e,n)=>n>e?e:n<t?t:n;let Gg=()=>{};const Ka={},vI=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),yI=t=>typeof t=="object"&&t!==null,_I=t=>/^0[^.\s]+$/u.test(t);function wI(t){let e;return()=>(e===void 0&&(e=t()),e)}const ei=t=>t,tp=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Th=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class wb{constructor(){this.subscriptions=[]}add(e){return _b(this.subscriptions,e),()=>ug(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ps=t=>t*1e3,Ys=t=>t/1e3,xI=(t,e)=>e?t*(1e3/e):0,bI=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,sB=1e-7,iB=12;function oB(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=bI(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>sB&&++l<iB);return o}function np(t,e,n,r){if(t===e&&n===r)return ei;const s=i=>oB(i,0,1,t,n);return i=>i===0||i===1?i:bI(s(i),e,r)}const SI=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,kI=t=>e=>1-t(1-e),EI=np(.33,1.53,.69,.99),xb=kI(EI),CI=SI(xb),PI=t=>t>=1?1:(t*=2)<1?.5*xb(t):.5*(2-Math.pow(2,-10*(t-1))),bb=t=>1-Math.sin(Math.acos(t)),AI=kI(bb),TI=SI(bb),aB=np(.42,0,1,1),lB=np(0,0,.58,1),RI=np(.42,0,.58,1),cB=t=>Array.isArray(t)&&typeof t[0]!="number",II=t=>Array.isArray(t)&&typeof t[0]=="number",uB={linear:ei,easeIn:aB,easeInOut:RI,easeOut:lB,circIn:bb,circInOut:TI,circOut:AI,backIn:xb,backInOut:CI,backOut:EI,anticipate:PI},dB=t=>typeof t=="string",UE=t=>{if(II(t)){Gg(t.length===4);const[e,n,r,s]=t;return np(e,n,r,s)}else if(dB(t))return uB[t];return t},R0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function fB(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(u.schedule(d),t()),d(o)}const u={schedule:(d,f=!1,h=!1)=>{const v=h&&r?e:n;return f&&i.add(d),v.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(o=d,r){s=!0;return}r=!0;const f=e;e=n,n=f,e.forEach(l),e.clear(),r=!1,s&&(s=!1,u.process(d))}};return u}const hB=40;function MI(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=R0.reduce((C,P)=>(C[P]=fB(i),C),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:f,update:h,preRender:m,render:v,postRender:x}=o,_=()=>{const C=Ka.useManualTiming,P=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(P-s.timestamp,hB),1)),s.timestamp=P,s.isProcessing=!0,l.process(s),u.process(s),d.process(s),f.process(s),h.process(s),m.process(s),v.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},w=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:R0.reduce((C,P)=>{const T=o[P];return C[P]=(M,I=!1,R=!1)=>(n||w(),T.schedule(M,I,R)),C},{}),cancel:C=>{for(let P=0;P<R0.length;P++)o[R0[P]].cancel(C)},state:s,steps:o}}const{schedule:rn,cancel:Ya,state:pr,steps:r_}=MI(typeof requestAnimationFrame<"u"?requestAnimationFrame:ei,!0);let cm;function pB(){cm=void 0}const Ur={now:()=>(cm===void 0&&Ur.set(pr.isProcessing||Ka.useManualTiming?pr.timestamp:performance.now()),cm),set:t=>{cm=t,queueMicrotask(pB)}},OI=t=>e=>typeof e=="string"&&e.startsWith(t),LI=OI("--"),mB=OI("var(--"),Sb=t=>mB(t)?gB.test(t.split("/*")[0].trim()):!1,gB=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function BE(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Ad={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Rh={...Ad,transform:t=>ro(0,1,t)},I0={...Ad,default:1},ih=t=>Math.round(t*1e5)/1e5,kb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vB(t){return t==null}const yB=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Eb=(t,e)=>n=>!!(typeof n=="string"&&yB.test(n)&&n.startsWith(t)||e&&!vB(n)&&Object.prototype.hasOwnProperty.call(n,e)),NI=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(kb);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},_B=t=>ro(0,255,t),s_={...Ad,transform:t=>Math.round(_B(t))},Jl={test:Eb("rgb","red"),parse:NI("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+s_.transform(t)+", "+s_.transform(e)+", "+s_.transform(n)+", "+ih(Rh.transform(r))+")"};function wB(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 fw={test:Eb("#"),parse:wB,transform:Jl.transform},rp=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Io=rp("deg"),Ji=rp("%"),He=rp("px"),xB=rp("vh"),bB=rp("vw"),WE={...Ji,parse:t=>Ji.parse(t)/100,transform:t=>Ji.transform(t*100)},Iu={test:Eb("hsl","hue"),parse:NI("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Ji.transform(ih(e))+", "+Ji.transform(ih(n))+", "+ih(Rh.transform(r))+")"},Un={test:t=>Jl.test(t)||fw.test(t)||Iu.test(t),parse:t=>Jl.test(t)?Jl.parse(t):Iu.test(t)?Iu.parse(t):fw.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Jl.transform(t):Iu.transform(t),getAnimatableNone:t=>{const e=Un.parse(t);return e.alpha=0,Un.transform(e)}},SB=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kB(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(kb))==null?void 0:e.length)||0)+(((n=t.match(SB))==null?void 0:n.length)||0)>0}const DI="number",jI="color",EB="var",CB="var(",ZE="${}",PB=/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 gd(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(PB,u=>(Un.test(u)?(r.color.push(i),s.push(jI),n.push(Un.parse(u))):u.startsWith(CB)?(r.var.push(i),s.push(EB),n.push(u)):(r.number.push(i),s.push(DI),n.push(parseFloat(u))),++i,ZE)).split(ZE);return{values:n,split:l,indexes:r,types:s}}function AB(t){return gd(t).values}function $I({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const o=e[i];o===DI?s+=ih(r[i]):o===jI?s+=Un.transform(r[i]):s+=r[i]}return s}}function TB(t){return $I(gd(t))}const RB=t=>typeof t=="number"?0:Un.test(t)?Un.getAnimatableNone(t):t,IB=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:RB(t);function MB(t){const e=gd(t);return $I(e)(e.values.map((r,s)=>IB(r,e.split[s])))}const Ei={test:kB,parse:AB,createTransformer:TB,getAnimatableNone:MB};function i_(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 OB({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const l=n<.5?n*(1+e):n+e-n*e,u=2*n-l;s=i_(u,l,t+1/3),i=i_(u,l,t),o=i_(u,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function dg(t,e){return n=>n>0?e:t}const nn=(t,e,n)=>t+(e-t)*n,o_=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},LB=[fw,Jl,Iu],NB=t=>LB.find(e=>e.test(t));function qE(t){const e=NB(t);if(!e)return!1;let n=e.parse(t);return e===Iu&&(n=OB(n)),n}const GE=(t,e)=>{const n=qE(t),r=qE(e);if(!n||!r)return dg(t,e);const s={...n};return i=>(s.red=o_(n.red,r.red,i),s.green=o_(n.green,r.green,i),s.blue=o_(n.blue,r.blue,i),s.alpha=nn(n.alpha,r.alpha,i),Jl.transform(s))},hw=new Set(["none","hidden"]);function DB(t,e){return hw.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function jB(t,e){return n=>nn(t,e,n)}function Cb(t){return typeof t=="number"?jB:typeof t=="string"?Sb(t)?dg:Un.test(t)?GE:VB:Array.isArray(t)?FI:typeof t=="object"?Un.test(t)?GE:$B:dg}function FI(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>Cb(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function $B(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Cb(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function FB(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],o=t.indexes[i][r[i]],l=t.values[o]??0;n[s]=l,r[i]++}return n}const VB=(t,e)=>{const n=Ei.createTransformer(e),r=gd(t),s=gd(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?hw.has(t)&&!s.values.length||hw.has(e)&&!r.values.length?DB(t,e):tp(FI(FB(r,s),s.values),n):dg(t,e)};function VI(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?nn(t,e,n):Cb(t)(t,e)}const HB=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>rn.update(e,n),stop:()=>Ya(e),now:()=>pr.isProcessing?pr.timestamp:Ur.now()}},HI=(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)})`},fg=2e4;function Pb(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<fg;)e+=n,r=t.next(e);return e>=fg?1/0:e}function zB(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Pb(r),fg);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Ys(s)}}const Rn={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 pw(t,e){return t*Math.sqrt(1-e*e)}const UB=12;function BB(t,e,n){let r=n;for(let s=1;s<UB;s++)r=r-t(r)/e(r);return r}const a_=.001;function WB({duration:t=Rn.duration,bounce:e=Rn.bounce,velocity:n=Rn.velocity,mass:r=Rn.mass}){let s,i,o=1-e;o=ro(Rn.minDamping,Rn.maxDamping,o),t=ro(Rn.minDuration,Rn.maxDuration,Ys(t)),o<1?(s=d=>{const f=d*o,h=f*t,m=f-n,v=pw(d,o),x=Math.exp(-h);return a_-m/v*x},i=d=>{const h=d*o*t,m=h*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,x=Math.exp(-h),_=pw(Math.pow(d,2),o);return(-s(d)+a_>0?-1:1)*((m-v)*x)/_}):(s=d=>{const f=Math.exp(-d*t),h=(d-n)*t+1;return-a_+f*h},i=d=>{const f=Math.exp(-d*t),h=(n-d)*(t*t);return f*h});const l=5/t,u=BB(s,i,l);if(t=Ps(t),isNaN(u))return{stiffness:Rn.stiffness,damping:Rn.damping,duration:t};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const ZB=["duration","bounce"],qB=["stiffness","damping","mass"];function KE(t,e){return e.some(n=>t[n]!==void 0)}function GB(t){let e={velocity:Rn.velocity,stiffness:Rn.stiffness,damping:Rn.damping,mass:Rn.mass,isResolvedFromDuration:!1,...t};if(!KE(t,qB)&&KE(t,ZB))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ro(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Rn.mass,stiffness:s,damping:i}}else{const n=WB({...t,velocity:0});e={...e,...n,mass:Rn.mass},e.isResolvedFromDuration=!0}return e}function hg(t=Rn.visualDuration,e=Rn.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:u,damping:d,mass:f,duration:h,velocity:m,isResolvedFromDuration:v}=GB({...n,velocity:-Ys(n.velocity||0)}),x=m||0,_=d/(2*Math.sqrt(u*f)),w=o-i,b=Ys(Math.sqrt(u/f)),k=Math.abs(w)<5;r||(r=k?Rn.restSpeed.granular:Rn.restSpeed.default),s||(s=k?Rn.restDelta.granular:Rn.restDelta.default);let C,P,T,M,I,R;if(_<1)T=pw(b,_),M=(x+_*b*w)/T,C=j=>{const F=Math.exp(-_*b*j);return o-F*(M*Math.sin(T*j)+w*Math.cos(T*j))},I=_*b*M+w*T,R=_*b*w-M*T,P=j=>Math.exp(-_*b*j)*(I*Math.sin(T*j)+R*Math.cos(T*j));else if(_===1){C=F=>o-Math.exp(-b*F)*(w+(x+b*w)*F);const j=x+b*w;P=F=>Math.exp(-b*F)*(b*j*F-x)}else{const j=b*Math.sqrt(_*_-1);C=W=>{const G=Math.exp(-_*b*W),H=Math.min(j*W,300);return o-G*((x+_*b*w)*Math.sinh(H)+j*w*Math.cosh(H))/j};const F=(x+_*b*w)/j,D=_*b*F-w*j,q=_*b*w-F*j;P=W=>{const G=Math.exp(-_*b*W),H=Math.min(j*W,300);return G*(D*Math.sinh(H)+q*Math.cosh(H))}}const L={calculatedDuration:v&&h||null,velocity:j=>Ps(P(j)),next:j=>{if(!v&&_<1){const D=Math.exp(-_*b*j),q=Math.sin(T*j),W=Math.cos(T*j),G=o-D*(M*q+w*W),H=Ps(D*(I*q+R*W));return l.done=Math.abs(H)<=r&&Math.abs(o-G)<=s,l.value=l.done?o:G,l}const F=C(j);if(v)l.done=j>=h;else{const D=Ps(P(j));l.done=Math.abs(D)<=r&&Math.abs(o-F)<=s}return l.value=l.done?o:F,l},toString:()=>{const j=Math.min(Pb(L),fg),F=HI(D=>L.next(j*D).value,j,30);return j+"ms "+F},toTransition:()=>{}};return L}hg.applyToOptions=t=>{const e=zB(t,100,hg);return t.ease=e.ease,t.duration=Ps(e.duration),t.type="keyframes",t};const KB=5;function zI(t,e,n){const r=Math.max(e-KB,0);return xI(n-t(r),e-r)}function mw({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:u,restDelta:d=.5,restSpeed:f}){const h=t[0],m={done:!1,value:h},v=R=>l!==void 0&&R<l||u!==void 0&&R>u,x=R=>l===void 0?u:u===void 0||Math.abs(l-R)<Math.abs(u-R)?l:u;let _=n*e;const w=h+_,b=o===void 0?w:o(w);b!==w&&(_=b-h);const k=R=>-_*Math.exp(-R/r),C=R=>b+k(R),P=R=>{const L=k(R),j=C(R);m.done=Math.abs(L)<=d,m.value=m.done?b:j};let T,M;const I=R=>{v(m.value)&&(T=R,M=hg({keyframes:[m.value,x(m.value)],velocity:zI(C,R,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return I(0),{calculatedDuration:null,next:R=>{let L=!1;return!M&&T===void 0&&(L=!0,P(R),I(R)),T!==void 0&&R>=T?M.next(R-T):(!L&&P(R),m)}}}function YB(t,e,n){const r=[],s=n||Ka.mix||VI,i=t.length-1;for(let o=0;o<i;o++){let l=s(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||ei:e;l=tp(u,l)}r.push(l)}return r}function XB(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Gg(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=YB(e,r,s),u=l.length,d=f=>{if(o&&f<t[0])return e[0];let h=0;if(u>1)for(;h<t.length-2&&!(f<t[h+1]);h++);const m=Th(t[h],t[h+1],f);return l[h](m)};return n?f=>d(ro(t[0],t[i-1],f)):d}function QB(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Th(0,e,r);t.push(nn(n,1,s))}}function JB(t){const e=[0];return QB(e,t.length-1),e}function eW(t,e){return t.map(n=>n*e)}function tW(t,e){return t.map(()=>e||RI).splice(0,t.length-1)}function oh({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=cB(r)?r.map(UE):UE(r),i={done:!1,value:e[0]},o=eW(n&&n.length===e.length?n:JB(e),t),l=XB(o,e,{ease:Array.isArray(s)?s:tW(e,s)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const nW=t=>t!==null;function Kg(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(nW),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const rW={decay:mw,inertia:mw,tween:oh,keyframes:oh,spring:hg};function UI(t){typeof t.type=="string"&&(t.type=rW[t.type])}class Ab{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 sW=t=>t/100;class pg extends Ab{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!==Ur.now()&&this.tick(Ur.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;UI(e);const{type:n=oh,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=n||oh;u!==oh&&typeof l[0]!="number"&&(this.mixKeyframes=tp(sW,VI(l[0],l[1])),l=[0,100]);const d=u({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Pb(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:h,repeatType:m,repeatDelay:v,type:x,onUpdate:_,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-d*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,P=r;if(h){const R=Math.min(this.currentTime,s)/l;let L=Math.floor(R),j=R%1;!j&&R>=1&&(j=1),j===1&&L--,L=Math.min(L,h+1),!!(L%2)&&(m==="reverse"?(j=1-j,v&&(j-=v/l)):m==="mirror"&&(P=o)),C=ro(0,1,j)*l}let T;k?(this.delayState.value=f[0],T=this.delayState):T=P.next(C),i&&!k&&(T.value=i(T.value));let{done:M}=T;!k&&u!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return I&&x!==mw&&(T.value=Kg(f,this.options,w,this.speed)),_&&_(T.value),I&&this.finish(),T}then(e,n){return this.finished.then(e,n)}get duration(){return Ys(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ys(e)}get time(){return Ys(this.currentTime)}set time(e){e=Ps(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 zI(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(Ur.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Ys(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=HB,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ur.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 iW(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ec=t=>t*180/Math.PI,gw=t=>{const e=ec(Math.atan2(t[1],t[0]));return vw(e)},oW={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:gw,rotateZ:gw,skewX:t=>ec(Math.atan(t[1])),skewY:t=>ec(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},vw=t=>(t=t%360,t<0&&(t+=360),t),YE=gw,XE=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),QE=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),aW={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:XE,scaleY:QE,scale:t=>(XE(t)+QE(t))/2,rotateX:t=>vw(ec(Math.atan2(t[6],t[5]))),rotateY:t=>vw(ec(Math.atan2(-t[2],t[0]))),rotateZ:YE,rotate:YE,skewX:t=>ec(Math.atan(t[4])),skewY:t=>ec(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function yw(t){return t.includes("scale")?1:0}function _w(t,e){if(!t||t==="none")return yw(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=aW,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=oW,s=l}if(!s)return yw(e);const i=r[e],o=s[1].split(",").map(cW);return typeof i=="function"?i(o):o[i]}const lW=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return _w(n,e)};function cW(t){return parseFloat(t.trim())}const Td=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Rd=new Set([...Td,"pathRotation"]),JE=t=>t===Ad||t===He,uW=new Set(["x","y","z"]),dW=Td.filter(t=>!uW.has(t));function fW(t){const e=[];return dW.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const $a={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})=>_w(e,"x"),y:(t,{transform:e})=>_w(e,"y")};$a.translateX=$a.x;$a.translateY=$a.y;const mc=new Set;let ww=!1,xw=!1,bw=!1;function BI(){if(xw){const t=Array.from(mc).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=fW(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))==null||l.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}xw=!1,ww=!1,mc.forEach(t=>t.complete(bw)),mc.clear()}function WI(){mc.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xw=!0)})}function hW(){bw=!0,WI(),BI(),bw=!1}class Tb{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(mc.add(this),ww||(ww=!0,rn.read(WI),rn.resolveKeyframes(BI))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const l=r.readValue(n,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}iW(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),mc.delete(this)}cancel(){this.state==="scheduled"&&(mc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const pW=t=>t.startsWith("--");function ZI(t,e,n){pW(e)?t.style.setProperty(e,n):t.style[e]=n}const mW={};function qI(t,e){const n=wI(t);return()=>mW[e]??n()}const gW=qI(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),GI=qI(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Uf=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,eC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Uf([0,.65,.55,1]),circOut:Uf([.55,0,1,.45]),backIn:Uf([.31,.01,.66,-.59]),backOut:Uf([.33,1.53,.69,.99])};function KI(t,e){if(t)return typeof t=="function"?GI()?HI(t,e):"ease-out":II(t)?Uf(t):Array.isArray(t)?t.map(n=>KI(n,e)||eC.easeOut):eC[t]}function vW(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:u}={},d=void 0){const f={[e]:n};u&&(f.offset=u);const h=KI(l,s);Array.isArray(h)&&(f.easing=h);const m={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(f,m)}function YI(t){return typeof t=="function"&&"applyToOptions"in t}function yW({type:t,...e}){return YI(t)&&GI()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class XI extends Ab{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:u}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,Gg(typeof e.type!="string");const d=yW(e);this.animation=vW(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=Kg(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),ZI(n,r,f),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Ys(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ys(e)}get time(){return Ys(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ps(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&&gW()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),ei):s(this)}}const QI={anticipate:PI,backInOut:CI,circInOut:TI};function _W(t){return t in QI}function wW(t){typeof t.ease=="string"&&_W(t.ease)&&(t.ease=QI[t.ease])}const l_=10;class xW extends XI{constructor(e){wW(e),UI(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const l=new pg({...o,autoplay:!1}),u=Math.max(l_,Ur.now()-this.startTime),d=ro(0,l_,u-l_),f=l.sample(u).value,{name:h}=this.options;i&&h&&ZI(i,h,f),n.setWithVelocity(l.sample(Math.max(0,u-d)).value,f,d),l.stop()}}const tC=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ei.test(t)||t==="0")&&!t.startsWith("url("));function bW(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 SW(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=tC(s,e),l=tC(i,e);return!o||!l?!1:bW(t)||(n==="spring"||YI(n))&&r}function Sw(t){t.duration=0,t.type="keyframes"}const JI=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),kW=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function EW(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&kW.test(t[e]))return!0;return!1}const CW=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),PW=wI(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function AW(t){var h;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,u=(h=e==null?void 0:e.owner)==null?void 0:h.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return PW()&&n&&(JI.has(n)||CW.has(n)&&EW(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const TW=40;class RW extends Ab{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:u,motionValue:d,element:f,...h}){var x;super(),this.stop=()=>{var _,w;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=Ur.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:f,...h},v=(f==null?void 0:f.KeyframeResolver)||Tb;this.keyframeResolver=new v(l,(_,w,b)=>this.onKeyframesResolved(_,w,m,!b),u,d,f),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,n,r,s){var b,k;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:u,isHandoff:d,onUpdate:f}=r;this.resolvedAt=Ur.now();let h=!0;SW(e,i,o,l)||(h=!1,(Ka.instantAnimations||!u)&&(f==null||f(Kg(e,r,n))),e[0]=e[e.length-1],Sw(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>TW?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=h&&!d&&AW(v),_=(k=(b=v.motionValue)==null?void 0:b.owner)==null?void 0:k.current;let w;if(x)try{w=new xW({...v,element:_})}catch{w=new pg(v)}else w=new pg(v);w.finished.then(()=>{this.notifyFinished()}).catch(ei),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),hW()),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 eM(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,f)=>d.sortNodePosition(f)).indexOf(e),o=t.size,l=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:l-i*r}const nC=30,IW=t=>!isNaN(parseFloat(t));class MW{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Ur.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ur.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=IW(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 wb);const r=this.events[e].add(n);return e==="change"?()=>{r(),rn.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=Ur.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>nC)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,nC);return xI(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 vd(t,e){return new MW(t,e)}function tM(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Rb(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?tM(n,t):n}const OW={type:"spring",stiffness:500,damping:25,restSpeed:10},LW=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),NW={type:"keyframes",duration:.8},DW={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},jW=(t,{keyframes:e})=>e.length>2?NW:Rd.has(t)?t.startsWith("scale")?LW(e[1]):OW:DW,$W=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function FW(t){for(const e in t)if(!$W.has(e))return!0;return!1}const Ib=(t,e,n,r={},s,i)=>o=>{const l=Rb(r,t)||{},u=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Ps(u);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:m=>{e.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};FW(l)||Object.assign(f,jW(t,f)),f.duration&&(f.duration=Ps(f.duration)),f.repeatDelay&&(f.repeatDelay=Ps(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let h=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(Sw(f),f.delay===0&&(h=!0)),(Ka.instantAnimations||Ka.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(h=!0,Sw(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,h&&!i&&e.get()!==void 0){const m=Kg(f.keyframes,l);if(m!==void 0){rn.update(()=>{f.onUpdate(m),f.onComplete()});return}}return l.isSync?new pg(f):new RW(f)},VW=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function HW(t){const e=VW.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function nM(t,e,n=1){const[r,s]=HW(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return vI(o)?parseFloat(o):o}return Sb(s)?nM(s,e,n+1):s}function rC(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Mb(t,e,n,r){if(typeof e=="function"){const[s,i]=rC(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]=rC(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function gc(t,e,n){const r=t.getProps();return Mb(r,e,n!==void 0?n:r.custom,t)}const rM=new Set(["width","height","top","left","right","bottom",...Td]),kw=t=>Array.isArray(t);function zW(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,vd(n))}function UW(t){return kw(t)?t[t.length-1]||0:t}function BW(t,e){const n=gc(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=UW(i[o]);zW(t,o,l)}}const yr=t=>!!(t&&t.getVelocity);function WW(t){return!!(yr(t)&&t.add)}function Ew(t,e){const n=t.getValue("willChange");if(WW(n))return n.add(e);if(!n&&Ka.WillChange){const r=new Ka.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Ob(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ZW="framerAppearId",sM="data-"+Ob(ZW);function iM(t){return t.props[sM]}function qW({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function oM(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const u=t.getDefaultTransition();i=i?tM(i,u):u;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],m=s&&t.animationState&&t.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(t,l,i,n,h);for(const x in l){const _=t.getValue(x,t.latestValues[x]??null),w=l[x];if(w===void 0||m&&qW(m,x))continue;const b={delay:n,...Rb(i||{},x)};f&&(b.skipAnimations=!0);const k=_.get();if(k!==void 0&&!_.isAnimating()&&!Array.isArray(w)&&w===k&&!b.velocity){rn.update(()=>_.set(w));continue}let C=!1;if(window.MotionHandoffAnimation){const M=iM(t);if(M){const I=window.MotionHandoffAnimation(M,x,rn);I!==null&&(b.startTime=I,C=!0)}}Ew(t,x);const P=d??t.shouldReduceMotion;_.start(Ib(x,_,w,P&&rM.has(x)?{type:!1}:b,t,C));const T=_.animation;T&&h.push(T)}if(o){const x=()=>rn.update(()=>{o&&BW(t,o)});h.length?Promise.all(h).then(x):x()}return h}function Cw(t,e,n={}){var u;const r=gc(t,e,n.type==="exit"?(u=t.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(oM(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:m}=s;return GW(t,e,d,f,h,m,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,f]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function GW(t,e,n=0,r=0,s=0,i=1,o){const l=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),l.push(Cw(u,e,{...o,delay:n+(typeof r=="function"?0:r)+eM(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function KW(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Cw(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Cw(t,e,n);else{const s=typeof e=="function"?gc(t,e,n.custom):e;r=Promise.all(oM(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const YW={test:t=>t==="auto",parse:t=>t},aM=t=>e=>e.test(t),lM=[Ad,He,Ji,Io,bB,xB,YW],sC=t=>lM.find(aM(t));function XW(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||_I(t):!0}const QW=new Set(["brightness","contrast","saturate","opacity"]);function JW(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(kb)||[];if(!r)return t;const s=n.replace(r,"");let i=QW.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const eZ=/\b([a-z-]*)\(.*?\)/gu,Pw={...Ei,getAnimatableNone:t=>{const e=t.match(eZ);return e?e.map(JW).join(" "):t}},Aw={...Ei,getAnimatableNone:t=>{const e=Ei.parse(t);return Ei.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},iC={...Ad,transform:Math.round},tZ={rotate:Io,pathRotation:Io,rotateX:Io,rotateY:Io,rotateZ:Io,scale:I0,scaleX:I0,scaleY:I0,scaleZ:I0,skew:Io,skewX:Io,skewY:Io,distance:He,translateX:He,translateY:He,translateZ:He,x:He,y:He,z:He,perspective:He,transformPerspective:He,opacity:Rh,originX:WE,originY:WE,originZ:He},mg={borderWidth:He,borderTopWidth:He,borderRightWidth:He,borderBottomWidth:He,borderLeftWidth:He,borderRadius:He,borderTopLeftRadius:He,borderTopRightRadius:He,borderBottomRightRadius:He,borderBottomLeftRadius:He,width:He,maxWidth:He,height:He,maxHeight:He,top:He,right:He,bottom:He,left:He,inset:He,insetBlock:He,insetBlockStart:He,insetBlockEnd:He,insetInline:He,insetInlineStart:He,insetInlineEnd:He,padding:He,paddingTop:He,paddingRight:He,paddingBottom:He,paddingLeft:He,paddingBlock:He,paddingBlockStart:He,paddingBlockEnd:He,paddingInline:He,paddingInlineStart:He,paddingInlineEnd:He,margin:He,marginTop:He,marginRight:He,marginBottom:He,marginLeft:He,marginBlock:He,marginBlockStart:He,marginBlockEnd:He,marginInline:He,marginInlineStart:He,marginInlineEnd:He,fontSize:He,backgroundPositionX:He,backgroundPositionY:He,...tZ,zIndex:iC,fillOpacity:Rh,strokeOpacity:Rh,numOctaves:iC},nZ={...mg,color:Un,backgroundColor:Un,outlineColor:Un,fill:Un,stroke:Un,borderColor:Un,borderTopColor:Un,borderRightColor:Un,borderBottomColor:Un,borderLeftColor:Un,filter:Pw,WebkitFilter:Pw,mask:Aw,WebkitMask:Aw},cM=t=>nZ[t],rZ=new Set([Pw,Aw]);function uM(t,e){let n=cM(t);return rZ.has(n)||(n=Ei),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const sZ=new Set(["auto","none","0"]);function iZ(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!sZ.has(i)&&gd(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=uM(n,s)}class oZ extends Tb{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f<e.length;f++){let h=e[f];if(typeof h=="string"&&(h=h.trim(),Sb(h))){const m=nM(h,n.current);m!==void 0&&(e[f]=m),f===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!rM.has(r)||e.length!==2)return;const[s,i]=e,o=sC(s),l=sC(i),u=BE(s),d=BE(i);if(u!==d&&$a[r]){this.needsMeasurement=!0;return}if(o!==l)if(JE(o)&&JE(l))for(let f=0;f<e.length;f++){const h=e[f];typeof h=="string"&&(e[f]=parseFloat(h))}else $a[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||XW(e[s]))&&r.push(s);r.length&&iZ(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=$a[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=$a[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([u,d])=>{e.getValue(u).set(d)}),this.resolveNoneKeyframes()}}const Lb=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function dM(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 Tw=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function um(t){return yI(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Nb}=MI(queueMicrotask,!1),yi={x:!1,y:!1};function fM(){return yi.x||yi.y}function aZ(t){return t==="x"||t==="y"?yi[t]?null:(yi[t]=!0,()=>{yi[t]=!1}):yi.x||yi.y?null:(yi.x=yi.y=!0,()=>{yi.x=yi.y=!1})}function hM(t,e){const n=dM(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function lZ(t){return!(t.pointerType==="touch"||fM())}function cZ(t,e,n={}){const[r,s,i]=hM(t,n);return r.forEach(o=>{let l=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",x)},h=w=>{d&&(d(w),d=void 0),f()},m=w=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,h(w))},v=()=>{l=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},x=w=>{if(w.pointerType!=="touch"){if(l){u=!0;return}h(w)}},_=w=>{if(!lZ(w))return;u=!1;const b=e(o,w);typeof b=="function"&&(d=b,o.addEventListener("pointerleave",x,s))};o.addEventListener("pointerenter",_,s),o.addEventListener("pointerdown",v,s)}),i}const pM=(t,e)=>e?t===e?!0:pM(t,e.parentElement):!1,Db=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,uZ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function dZ(t){return uZ.has(t.tagName)||t.isContentEditable===!0}const fZ=new Set(["INPUT","SELECT","TEXTAREA"]);function hZ(t){return fZ.has(t.tagName)||t.isContentEditable===!0}const dm=new WeakSet;function oC(t){return e=>{e.key==="Enter"&&t(e)}}function c_(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const pZ=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=oC(()=>{if(dm.has(n))return;c_(n,"down");const s=oC(()=>{c_(n,"up")}),i=()=>c_(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 aC(t){return Db(t)&&!fM()}const lC=new WeakSet;function mZ(t,e,n={}){const[r,s,i]=hM(t,n),o=l=>{const u=l.currentTarget;if(!aC(l)||lC.has(l))return;dm.add(u),n.stopPropagation&&lC.add(l);const d=e(u,l),f={...s,capture:!0},h=(x,_)=>{window.removeEventListener("pointerup",m,f),window.removeEventListener("pointercancel",v,f),dm.has(u)&&dm.delete(u),aC(x)&&typeof d=="function"&&d(x,{success:_})},m=x=>{h(x,u===window||u===document||n.useGlobalTarget||pM(u,x.target))},v=x=>{h(x,!1)};window.addEventListener("pointerup",m,f),window.addEventListener("pointercancel",v,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),um(l)&&(l.addEventListener("focus",d=>pZ(d,s)),!dZ(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function jb(t){return yI(t)&&"ownerSVGElement"in t}const fm=new WeakMap;let Ea;const mM=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:jb(r)&&"getBBox"in r?r.getBBox()[e]:r[n],gZ=mM("inline","width","offsetWidth"),vZ=mM("block","height","offsetHeight");function yZ({target:t,borderBoxSize:e}){var n;(n=fm.get(t))==null||n.forEach(r=>{r(t,{get width(){return gZ(t,e)},get height(){return vZ(t,e)}})})}function _Z(t){t.forEach(yZ)}function wZ(){typeof ResizeObserver>"u"||(Ea=new ResizeObserver(_Z))}function xZ(t,e){Ea||wZ();const n=dM(t);return n.forEach(r=>{let s=fm.get(r);s||(s=new Set,fm.set(r,s)),s.add(e),Ea==null||Ea.observe(r)}),()=>{n.forEach(r=>{const s=fm.get(r);s==null||s.delete(e),s!=null&&s.size||Ea==null||Ea.unobserve(r)})}}const hm=new Set;let Mu;function bZ(){Mu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};hm.forEach(e=>e(t))},window.addEventListener("resize",Mu)}function SZ(t){return hm.add(t),Mu||bZ(),()=>{hm.delete(t),!hm.size&&typeof Mu=="function"&&(window.removeEventListener("resize",Mu),Mu=void 0)}}function cC(t,e){return typeof t=="function"?SZ(t):xZ(t,e)}function kZ(t){return jb(t)&&t.tagName==="svg"}const EZ=[...lM,Un,Ei],CZ=t=>EZ.find(aM(t)),uC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ou=()=>({x:uC(),y:uC()}),dC=()=>({min:0,max:0}),Jn=()=>({x:dC(),y:dC()}),PZ=new WeakMap;function Yg(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ih(t){return typeof t=="string"||Array.isArray(t)}const $b=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fb=["initial",...$b];function Xg(t){return Yg(t.animate)||Fb.some(e=>Ih(t[e]))}function gM(t){return!!(Xg(t)||t.variants)}function AZ(t,e,n){for(const r in e){const s=e[r],i=n[r];if(yr(s))t.addValue(r,s);else if(yr(i))t.addValue(r,vd(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,vd(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const gg={current:null},Vb={current:!1},TZ=typeof window<"u";function vM(){if(Vb.current=!0,!!TZ)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>gg.current=t.matches;t.addEventListener("change",e),e()}else gg.current=!1}const fC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let vg={};function yM(t){vg=t}function RZ(){return vg}class IZ{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Tb,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=Ur.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,rn.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Xg(n),this.isVariantNode=gM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in m){const x=m[v];d[v]!==void 0&&yr(x)&&x.set(d[v])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,PZ.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:(Vb.current||vM(),this.shouldReduceMotion=gg.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(),Ya(this.notifyUpdate),Ya(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&&JI.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:u,ease:d,duration:f}=n.accelerate,h=new XI({element:this.current,name:e,keyframes:l,times:u,ease:d,duration:Ps(f)}),m=o(h);this.valueSubscriptions.set(e,()=>{m(),h.cancel()});return}const r=Rd.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&rn.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 vg){const n=vg[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):Jn()}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<fC.length;r++){const s=fC[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=AZ(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=vd(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"&&(vI(r)||_I(r))?r=parseFloat(r):!CZ(r)&&Ei.test(n)&&(r=uM(e,n)),this.setBaseTarget(e,yr(r)?r.get():r)),yr(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Mb(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!yr(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 wb),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Nb.render(this.render)}}class _M extends IZ{constructor(){super(...arguments),this.KeyframeResolver=oZ}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;yr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class sl{constructor(e){this.isMounted=!1,this.node=e}update(){}}function wM({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function MZ({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function OZ(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 u_(t){return t===void 0||t===1}function Rw({scale:t,scaleX:e,scaleY:n}){return!u_(t)||!u_(e)||!u_(n)}function Yl(t){return Rw(t)||xM(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function xM(t){return hC(t.x)||hC(t.y)}function hC(t){return t&&t!=="0%"}function yg(t,e,n){const r=t-n,s=e*r;return n+s}function pC(t,e,n,r,s){return s!==void 0&&(t=yg(t,s,r)),yg(t,n,r)+e}function Iw(t,e=0,n=1,r,s){t.min=pC(t.min,e,n,r,s),t.max=pC(t.max,e,n,r,s)}function bM(t,{x:e,y:n}){Iw(t.x,e.translate,e.scale,e.originPoint),Iw(t.y,n.translate,n.scale,n.originPoint)}const mC=.999999999999,gC=1.0000000000001;function LZ(t,e,n,r=!1){var l;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let u=0;u<s;u++){i=n[u],o=i.projectionDelta;const{visualElement:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Zi(t.x,-i.scroll.offset.x),Zi(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,bM(t,o)),r&&Yl(i.latestValues)&&pm(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<gC&&e.x>mC&&(e.x=1),e.y<gC&&e.y>mC&&(e.y=1)}function Zi(t,e){t.min+=e,t.max+=e}function vC(t,e,n,r,s=.5){const i=nn(t.min,t.max,s);Iw(t,e,n,i,r)}function yC(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function pm(t,e,n){const r=n??t;vC(t.x,yC(e.x,r.x),e.scaleX,e.scale,e.originX),vC(t.y,yC(e.y,r.y),e.scaleY,e.scale,e.originY)}function SM(t,e){return wM(OZ(t.getBoundingClientRect(),e))}function NZ(t,e,n){const r=SM(t,n),{scroll:s}=e;return s&&(Zi(r.x,s.offset.x),Zi(r.y,s.offset.y)),r}const DZ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jZ=Td.length;function $Z(t,e,n){let r="",s=!0;for(let o=0;o<jZ;o++){const l=Td[o],u=t[l];if(u===void 0)continue;let d=!0;if(typeof u=="number")d=u===(l.startsWith("scale")?1:0);else{const f=parseFloat(u);d=l.startsWith("scale")?f===1:f===0}if(!d||n){const f=Tw(u,mg[l]);if(!d){s=!1;const h=DZ[l]||l;r+=`${h}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${Tw(i,mg.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function Hb(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,l=!1;for(const u in e){const d=e[u];if(Rd.has(u)){o=!0;continue}else if(LI(u)){s[u]=d;continue}else{const f=Tw(d,mg[u]);u.startsWith("origin")?(l=!0,i[u]=f):r[u]=f}}if(e.transform||(o||n?r.transform=$Z(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:u="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${u} ${d} ${f}`}}function kM(t,{style:e,vars:n},r,s){const i=t.style;let o;for(o in e)i[o]=e[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function _C(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Mf={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(He.test(t))t=parseFloat(t);else return t;const n=_C(t,e.target.x),r=_C(t,e.target.y);return`${n}% ${r}%`}},FZ={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Ei.parse(t);if(s.length>5)return r;const i=Ei.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=u;const d=nn(l,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},Mw={borderRadius:{...Mf,applyTo:[...Lb]},borderTopLeftRadius:Mf,borderTopRightRadius:Mf,borderBottomLeftRadius:Mf,borderBottomRightRadius:Mf,boxShadow:FZ};function EM(t,{layout:e,layoutId:n}){return Rd.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Mw[t]||t==="opacity")}function zb(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const l in r)(yr(r[l])||s&&yr(s[l])||EM(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function VZ(t){return window.getComputedStyle(t)}class HZ extends _M{constructor(){super(...arguments),this.type="html",this.renderInstance=kM}mount(e){Gg(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(Rd.has(n))return(r=this.projection)!=null&&r.isProjecting?yw(n):lW(e,n);{const s=VZ(e),i=(LI(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return SM(e,n)}build(e,n,r){Hb(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return zb(e,n,r)}}const zZ={offset:"stroke-dashoffset",array:"stroke-dasharray"},UZ={offset:"strokeDashoffset",array:"strokeDasharray"};function BZ(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?zZ:UZ;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const WZ=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function CM(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},u,d,f){if(Hb(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:m}=t;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete h.transformBox);for(const v of WZ)h[v]!==void 0&&(m[v]=h[v],delete h[v]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&BZ(h,s,i,o,!1)}const PM=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"]),AM=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ZZ(t,e,n,r){kM(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(PM.has(s)?s:Ob(s),e.attrs[s])}function TM(t,e,n){const r=zb(t,e,n);for(const s in t)if(yr(t[s])||yr(e[s])){const i=Td.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class qZ extends _M{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Jn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Rd.has(n)){const r=cM(n);return r&&r.default||0}return n=PM.has(n)?n:Ob(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return TM(e,n,r)}build(e,n,r){CM(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){ZZ(e,n,r,s)}mount(e){this.isSVGTag=AM(e.tagName),super.mount(e)}}const GZ=Fb.length;function RM(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?RM(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<GZ;n++){const r=Fb[n],s=t.props[r];(Ih(s)||s===!1)&&(e[r]=s)}return e}function IM(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 KZ=[...$b].reverse(),YZ=$b.length;function XZ(t){return e=>Promise.all(e.map(({animation:n,options:r})=>KW(t,n,r)))}function QZ(t){let e=XZ(t),n=wC(),r=!0,s=!1;const i=d=>(f,h)=>{var v;const m=gc(t,h,d==="exit"?(v=t.presenceContext)==null?void 0:v.custom:void 0);if(m){const{transition:x,transitionEnd:_,...w}=m;f={...f,...w,..._}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,h=RM(t.parent)||{},m=[],v=new Set;let x={},_=1/0;for(let b=0;b<YZ;b++){const k=KZ[b],C=n[k],P=f[k]!==void 0?f[k]:h[k],T=Ih(P),M=k===d?C.isActive:null;M===!1&&(_=b);let I=P===h[k]&&P!==f[k]&&T;if(I&&(r||s)&&t.manuallyAnimateOnMount&&(I=!1),C.protectedKeys={...x},!C.isActive&&M===null||!P&&!C.prevProp||Yg(P)||typeof P=="boolean")continue;if(k==="exit"&&C.isActive&&M!==!0){C.prevResolvedValues&&(x={...x,...C.prevResolvedValues});continue}const R=JZ(C.prevProp,P);let L=R||k===d&&C.isActive&&!I&&T||b>_&&T,j=!1;const F=Array.isArray(P)?P:[P];let D=F.reduce(i(k),{});M===!1&&(D={});const{prevResolvedValues:q={}}=C,W={...q,...D},G=B=>{L=!0,v.has(B)&&(j=!0,v.delete(B)),C.needsAnimating[B]=!0;const Q=t.getValue(B);Q&&(Q.liveStyle=!1)};for(const B in W){const Q=D[B],z=q[B];if(x.hasOwnProperty(B))continue;let N=!1;kw(Q)&&kw(z)?N=!IM(Q,z)||R:N=Q!==z,N?Q!=null?G(B):v.add(B):Q!==void 0&&v.has(B)?G(B):C.protectedKeys[B]=!0}C.prevProp=P,C.prevResolvedValues=D,C.isActive&&(x={...x,...D}),(r||s)&&t.blockInitialAnimation&&(L=!1);const H=I&&R;L&&(!H||j)&&m.push(...F.map(B=>{const Q={type:k};if(typeof B=="string"&&(r||s)&&!H&&t.manuallyAnimateOnMount&&t.parent){const{parent:z}=t,N=gc(z,B);if(z.enteringChildren&&N){const{delayChildren:Y}=N.transition||{};Q.delay=eM(z.enteringChildren,t,Y)}}return{animation:B,options:Q}}))}if(v.size){const b={};if(typeof f.initial!="boolean"){const k=gc(t,Array.isArray(f.initial)?f.initial[0]:f.initial);k&&k.transition&&(b.transition=k.transition)}v.forEach(k=>{const C=t.getBaseTarget(k),P=t.getValue(k);P&&(P.liveStyle=!0),b[k]=C??null}),m.push({animation:b})}let w=!!m.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?e(m):Promise.resolve()}function u(d,f){var m;if(n[d].isActive===f)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(v=>{var x;return(x=v.animationState)==null?void 0:x.setActive(d,f)}),n[d].isActive=f;const h=l(d);for(const v in n)n[v].protectedKeys={};return h}return{animateChanges:l,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=wC(),s=!0}}}function JZ(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!IM(e,t):!1}function $l(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wC(){return{animate:$l(!0),whileInView:$l(),whileHover:$l(),whileTap:$l(),whileDrag:$l(),whileFocus:$l(),exit:$l()}}function Ow(t,e){t.min=e.min,t.max=e.max}function gi(t,e){Ow(t.x,e.x),Ow(t.y,e.y)}function xC(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const MM=1e-4,eq=1-MM,tq=1+MM,OM=.01,nq=0-OM,rq=0+OM;function Br(t){return t.max-t.min}function sq(t,e,n){return Math.abs(t-e)<=n}function bC(t,e,n,r=.5){t.origin=r,t.originPoint=nn(e.min,e.max,t.origin),t.scale=Br(n)/Br(e),t.translate=nn(n.min,n.max,t.origin)-t.originPoint,(t.scale>=eq&&t.scale<=tq||isNaN(t.scale))&&(t.scale=1),(t.translate>=nq&&t.translate<=rq||isNaN(t.translate))&&(t.translate=0)}function ah(t,e,n,r){bC(t.x,e.x,n.x,r?r.originX:void 0),bC(t.y,e.y,n.y,r?r.originY:void 0)}function SC(t,e,n,r=0){const s=r?nn(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Br(e)}function iq(t,e,n,r){SC(t.x,e.x,n.x,r==null?void 0:r.x),SC(t.y,e.y,n.y,r==null?void 0:r.y)}function kC(t,e,n,r=0){const s=r?nn(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Br(e)}function _g(t,e,n,r){kC(t.x,e.x,n.x,r==null?void 0:r.x),kC(t.y,e.y,n.y,r==null?void 0:r.y)}function EC(t,e,n,r,s){return t-=e,t=yg(t,1/n,r),s!==void 0&&(t=yg(t,1/s,r)),t}function oq(t,e=0,n=1,r=.5,s,i=t,o=t){if(Ji.test(e)&&(e=parseFloat(e),e=nn(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=nn(i.min,i.max,r);t===i&&(l-=e),t.min=EC(t.min,e,n,l,s),t.max=EC(t.max,e,n,l,s)}function CC(t,e,[n,r,s],i,o){oq(t,e[n],e[r],e[s],e.scale,i,o)}const aq=["x","scaleX","originX"],lq=["y","scaleY","originY"];function PC(t,e,n,r){CC(t.x,e,aq,n?n.x:void 0,r?r.x:void 0),CC(t.y,e,lq,n?n.y:void 0,r?r.y:void 0)}function AC(t){return t.translate===0&&t.scale===1}function LM(t){return AC(t.x)&&AC(t.y)}function TC(t,e){return t.min===e.min&&t.max===e.max}function cq(t,e){return TC(t.x,e.x)&&TC(t.y,e.y)}function RC(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function NM(t,e){return RC(t.x,e.x)&&RC(t.y,e.y)}function IC(t){return Br(t.x)/Br(t.y)}function MC(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Hi(t){return[t("x"),t("y")]}function uq(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:h,rotateX:m,rotateY:v,skewX:x,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),v&&(r+=`rotateY(${v}deg) `),x&&(r+=`skewX(${x}deg) `),_&&(r+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,u=t.y.scale*e.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const dq=Lb.length,OC=t=>typeof t=="string"?parseFloat(t):t,LC=t=>typeof t=="number"||He.test(t);function fq(t,e,n,r,s,i){s?(t.opacity=nn(0,n.opacity??1,hq(r)),t.opacityExit=nn(e.opacity??1,0,pq(r))):i&&(t.opacity=nn(e.opacity??1,n.opacity??1,r));for(let o=0;o<dq;o++){const l=Lb[o];let u=NC(e,l),d=NC(n,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||LC(u)===LC(d)?(t[l]=Math.max(nn(OC(u),OC(d),r),0),(Ji.test(d)||Ji.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=nn(e.rotate||0,n.rotate||0,r))}function NC(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const hq=DM(0,.5,AI),pq=DM(.5,.95,ei);function DM(t,e,n){return r=>r<t?0:r>e?1:n(Th(t,e,r))}function mq(t,e,n){const r=yr(t)?t:vd(t);return r.start(Ib("",r,e,n)),r.animation}function Mh(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const gq=(t,e)=>t.depth-e.depth;class vq{constructor(){this.children=[],this.isDirty=!1}add(e){_b(this.children,e),this.isDirty=!0}remove(e){ug(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(gq),this.isDirty=!1,this.children.forEach(e)}}function yq(t,e){const n=Ur.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Ya(r),t(i-e))};return rn.setup(r,!0),()=>Ya(r)}function mm(t){return yr(t)?t.get():t}class _q{constructor(){this.members=[]}add(e){_b(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&&(ug(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(ug(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const gm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},d_=["","X","Y","Z"],wq=1e3;let xq=0;function f_(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function jM(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=iM(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",rn,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&jM(r)}function $M({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=xq++,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(kq),this.nodes.forEach(Rq),this.nodes.forEach(Iq),this.nodes.forEach(Eq)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new vq)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new wb),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const u=this.eventHandlers.get(o);u&&u.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=jb(o)&&!kZ(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),t){let f,h=0;const m=()=>this.root.updateBlockedByResize=!1;rn.read(()=>{h=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==h&&(h=v,this.root.updateBlockedByResize=!0,f&&f(),f=yq(m,250),gm.hasAnimatedSinceResize&&(gm.hasAnimatedSinceResize=!1,this.nodes.forEach($C)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||Dq,{onLayoutAnimationStart:_,onLayoutAnimationComplete:w}=d.getProps(),b=!this.targetLayout||!NM(this.targetLayout,v),k=!h&&m;if(this.options.layoutRoot||this.resumeFrom||k||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Rb(x,"layout"),onPlay:_,onComplete:w};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(f,k,C.path)}else h||$C(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ya(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(Mq),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jM(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const h=this.path[f];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(Pq),this.nodes.forEach(DC);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(jC);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Aq),this.nodes.forEach(Tq),this.nodes.forEach(bq),this.nodes.forEach(Sq)):this.nodes.forEach(jC),this.clearAllSnapshots();const l=Ur.now();pr.delta=ro(0,1e3/60,l-pr.timestamp),pr.timestamp=l,pr.isProcessing=!0,r_.update.process(pr),r_.preRender.process(pr),r_.render.process(pr),pr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Nb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Cq),this.sharedNodes.forEach(Oq)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Br(this.snapshot.measuredBox.x)&&!Br(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Jn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!LM(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||Yl(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return o&&(u=this.removeTransform(u)),jq(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Jn();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some($q))){const{scroll:f}=this.root;f&&(Zi(l.x,f.offset.x),Zi(l.y,f.offset.y))}return l}removeElementScroll(o){var u;const l=Jn();if(gi(l,o),(u=this.scroll)!=null&&u.wasRoot)return l;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:h,options:m}=f;f!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&gi(l,o),Zi(l.x,h.offset.x),Zi(l.y,h.offset.y))}return l}applyTransform(o,l=!1,u){var f,h;const d=u||Jn();gi(d,o);for(let m=0;m<this.path.length;m++){const v=this.path[m];!l&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Zi(d.x,-v.scroll.offset.x),Zi(d.y,-v.scroll.offset.y)),Yl(v.latestValues)&&pm(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return Yl(this.latestValues)&&pm(d,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),d}removeTransform(o){var u;const l=Jn();gi(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!Yl(f.latestValues))continue;let h;f.instance&&(Rw(f.latestValues)&&f.updateSnapshot(),h=Jn(),gi(h,f.measurePageBox())),PC(l,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,h)}return Yl(this.latestValues)&&PC(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==pr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!this.layout||!(f||h))return;this.resolvedRelativeTargetAt=pr.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Jn(),this.targetWithTransforms=Jn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),iq(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):gi(this.target,this.layout.layoutBox),bM(this.target,this.targetDelta)):gi(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Rw(this.parent.latestValues)||xM(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Jn(),this.relativeTargetOrigin=Jn(),_g(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),gi(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===pr.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;gi(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;LZ(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Jn());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xC(this.prevProjectionDelta.x,this.projectionDelta.x),xC(this.prevProjectionDelta.y,this.projectionDelta.y)),ah(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!MC(this.projectionDelta.x,this.prevProjectionDelta.x)||!MC(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ou(),this.projectionDelta=Ou(),this.projectionDeltaWithTransform=Ou()}setAnimationOrigin(o,l=!1,u){const d=this.snapshot,f=d?d.latestValues:{},h={...this.latestValues},m=Ou();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=Jn(),x=d?d.source:void 0,_=this.layout?this.layout.source:void 0,w=x!==_,b=this.getStack(),k=!b||b.members.length<=1,C=!!(w&&!k&&this.options.crossfade===!0&&!this.path.some(Nq));this.animationProgress=0;let P;const T=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=M=>{const I=M/1e3,R=T==null?void 0:T(I);R?(m.x.translate=R.x,m.x.scale=nn(o.x.scale,1,I),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=R.y,m.y.scale=nn(o.y.scale,1,I),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(FC(m.x,o.x,I),FC(m.y,o.y,I)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_g(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Lq(this.relativeTarget,this.relativeTargetOrigin,v,I),P&&cq(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=Jn()),gi(P,this.relativeTarget)),w&&(this.animationValues=h,fq(h,f,this.latestValues,I,C,k)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,u,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Ya(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rn.update(()=>{gm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=vd(0)),this.motionValue.jump(0,!1),this.currentAnimation=mq(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(wq),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:u,layout:d,latestValues:f}=o;if(!(!l||!u||!d)){if(this!==o&&this.layout&&d&&FM(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||Jn();const h=Br(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+h;const m=Br(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+m}gi(l,u),pm(l,f),ah(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new _q),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:u}={}){const d=this.getStack();d&&d.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const d={};u.z&&f_("z",o,d,this.animationValues);for(let f=0;f<d_.length;f++)f_(`rotate${d_[f]}`,o,d,this.animationValues),f_(`skew${d_[f]}`,o,d,this.animationValues);o.render();for(const f in d)o.setStaticValue(f,d[f]),this.animationValues&&(this.animationValues[f]=d[f]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=mm(l==null?void 0:l.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=mm(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Yl(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let h=uq(this.projectionDeltaWithTransform,this.treeScale,f);u&&(h=u(f,h)),o.transform=h;const{x:m,y:v}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,d.animationValues?o.opacity=d===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:o.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const x in Mw){if(f[x]===void 0)continue;const{correct:_,applyTo:w,isCSSVariable:b}=Mw[x],k=h==="none"?f[x]:_(f[x],d);if(w){const C=w.length;for(let P=0;P<C;P++)o[w[P]]=k}else b?this.options.visualElement.renderState.vars[x]=k:o[x]=k}this.options.layoutId&&(o.pointerEvents=d===this?mm(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(DC),this.root.sharedNodes.clear()}}}function bq(t){t.updateLayout()}function Sq(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Hi(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],v=Br(m);m.min=r[h].min,m.max=m.min+v});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";Ow(o?e.measuredBox[h]:e.layoutBox[h],r[h])}else FM(i,e.layoutBox,r)&&Hi(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],v=Br(r[h]);m.max=m.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+v)});const l=Ou();ah(l,r,e.layoutBox);const u=Ou();o?ah(u,t.applyTransform(s,!0),e.measuredBox):ah(u,r,e.layoutBox);const d=!LM(l);let f=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:v}=h;if(m&&v){const x=t.options.layoutAnchor||void 0,_=Jn();_g(_,e.layoutBox,m.layoutBox,x);const w=Jn();_g(w,r,v.layoutBox,x),NM(_,w)||(f=!0),h.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=_,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function kq(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 Eq(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Cq(t){t.clearSnapshot()}function DC(t){t.clearMeasurements()}function Pq(t){t.isLayoutDirty=!0,t.updateLayout()}function jC(t){t.isLayoutDirty=!1}function Aq(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Tq(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function $C(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Rq(t){t.resolveTargetDelta()}function Iq(t){t.calcProjection()}function Mq(t){t.resetSkewAndRotation()}function Oq(t){t.removeLeadSnapshot()}function FC(t,e,n){t.translate=nn(e.translate,0,n),t.scale=nn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function VC(t,e,n,r){t.min=nn(e.min,n.min,r),t.max=nn(e.max,n.max,r)}function Lq(t,e,n,r){VC(t.x,e.x,n.x,r),VC(t.y,e.y,n.y,r)}function Nq(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Dq={duration:.45,ease:[.4,0,.1,1]},HC=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),zC=HC("applewebkit/")&&!HC("chrome/")?Math.round:ei;function UC(t){t.min=zC(t.min),t.max=zC(t.max)}function jq(t){UC(t.x),UC(t.y)}function FM(t,e,n){return t==="position"||t==="preserve-aspect"&&!sq(IC(e),IC(n),.2)}function $q(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Fq=$M({attachResizeListener:(t,e)=>Mh(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}),h_={current:void 0},VM=$M({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!h_.current){const t=new Fq({});t.mount(window),t.setOptions({layoutScroll:!0}),h_.current=t}return h_.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Ub=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function BC(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Vq(...t){return e=>{let n=!1;const r=t.map(s=>{const i=BC(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():BC(t[s],null)}}}}function Hq(...t){return g.useCallback(Vq(...t),t)}class zq extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(um(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=um(r)&&r.offsetWidth||0,i=um(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=i-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Uq({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const o=g.useId(),l=g.useRef(null),u=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=g.useContext(Ub),f=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,h=Hq(l,f);return g.useInsertionEffect(()=>{const{width:v,height:x,top:_,left:w,right:b,bottom:k,direction:C}=u.current;if(e||i===!1||!l.current||!v||!x)return;const P=C==="rtl",T=n==="left"?P?`right: ${b}`:`left: ${w}`:P?`left: ${w}`:`right: ${b}`,M=r==="bottom"?`bottom: ${k}`:`top: ${_}`;l.current.dataset.motionPopId=o;const I=document.createElement("style");d&&(I.nonce=d);const R=s??document.head;return R.appendChild(I),I.sheet&&I.sheet.insertRule(`
64
- [data-motion-pop-id="${o}"] {
65
- position: absolute !important;
66
- width: ${v}px !important;
67
- height: ${x}px !important;
68
- ${T}px !important;
69
- ${M}px !important;
70
- }
71
- `),()=>{var L;(L=l.current)==null||L.removeAttribute("data-motion-pop-id"),R.contains(I)&&R.removeChild(I)}},[e]),S.jsx(zq,{isPresent:e,childRef:l,sizeRef:u,pop:i,children:i===!1?t:g.cloneElement(t,{ref:h})})}const Bq=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:u,root:d})=>{const f=vb(Wq),h=g.useId(),m=g.useRef(n),v=g.useRef(r);yb(()=>{m.current=n,v.current=r});let x=!0,_=g.useMemo(()=>(x=!1,{id:h,initial:e,isPresent:n,custom:s,onExitComplete:w=>{f.set(w,!0);for(const b of f.values())if(!b)return;r&&r()},register:w=>(f.set(w,!1),()=>{var b;f.delete(w),!m.current&&!f.size&&((b=v.current)==null||b.call(v))})}),[n,f,r]);return i&&x&&(_={..._}),g.useMemo(()=>{f.forEach((w,b)=>f.set(b,!1))},[n]),g.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=S.jsx(Uq,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:d,children:t}),S.jsx(qg.Provider,{value:_,children:t})};function Wq(){return new Map}function HM(t=!0){const e=g.useContext(qg);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 o=g.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const M0=t=>t.key||"";function WC(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const As=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:u="top",root:d})=>{const[f,h]=HM(o),m=g.useMemo(()=>WC(t),[t]),v=o&&!f?[]:m.map(M0),x=g.useRef(!0),_=g.useRef(m),w=vb(()=>new Map),b=g.useRef(new Set),[k,C]=g.useState(m),[P,T]=g.useState(m);yb(()=>{x.current=!1,_.current=m;for(let R=0;R<P.length;R++){const L=M0(P[R]);v.includes(L)?(w.delete(L),b.current.delete(L)):w.get(L)!==!0&&w.set(L,!1)}},[P,v.length,v.join("-")]);const M=[];if(m!==k){let R=[...m];for(let L=0;L<P.length;L++){const j=P[L],F=M0(j);v.includes(F)||(R.splice(L,0,j),M.push(j))}return i==="wait"&&M.length&&(R=M),T(WC(R)),C(m),null}const{forceRender:I}=g.useContext(gb);return S.jsx(S.Fragment,{children:P.map(R=>{const L=M0(R),j=o&&!f?!1:m===P||v.includes(L),F=()=>{if(b.current.has(L))return;if(w.has(L))b.current.add(L),w.set(L,!0);else return;let D=!0;w.forEach(q=>{q||(D=!1)}),D&&(I==null||I(),T(_.current),o&&(h==null||h()),r&&r())};return S.jsx(Bq,{isPresent:j,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:j?void 0:F,anchorX:l,anchorY:u,children:R},L)})})},zM=g.createContext({strict:!1}),ZC={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 qC=!1;function Zq(){if(qC)return;const t={};for(const e in ZC)t[e]={isEnabled:n=>ZC[e].some(r=>!!n[r])};yM(t),qC=!0}function UM(){return Zq(),RZ()}function qq(t){const e=UM();for(const n in t)e[n]={...e[n],...t[n]};yM(e)}const Gq=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 wg(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Gq.has(t)}let BM=t=>!wg(t);function Kq(t){typeof t=="function"&&(BM=e=>e.startsWith("on")?!wg(e):t(e))}try{Kq(require("@emotion/is-prop-valid").default)}catch{}function Yq(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||yr(t[s])||(BM(s)||n===!0&&wg(s)||!e&&!wg(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Qg=g.createContext({});function Xq(t,e){if(Xg(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Ih(n)?n:void 0,animate:Ih(r)?r:void 0}}return t.inherit!==!1?e:{}}function Qq(t){const{initial:e,animate:n}=Xq(t,g.useContext(Qg));return g.useMemo(()=>({initial:e,animate:n}),[GC(e),GC(n)])}function GC(t){return Array.isArray(t)?t.join(" "):t}const Bb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function WM(t,e,n){for(const r in e)!yr(e[r])&&!EM(r,n)&&(t[r]=e[r])}function Jq({transformTemplate:t},e){return g.useMemo(()=>{const n=Bb();return Hb(n,e,t),Object.assign({},n.vars,n.style)},[e])}function eG(t,e){const n=t.style||{},r={};return WM(r,n,t),Object.assign(r,Jq(t,e)),r}function tG(t,e){const n={},r=eG(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 ZM=()=>({...Bb(),attrs:{}});function nG(t,e,n,r){const s=g.useMemo(()=>{const i=ZM();return CM(i,e,AM(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};WM(i,t.style,t),s.style={...i,...s.style}}return s}const rG=["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 Wb(t){return typeof t!="string"||t.includes("-")?!1:!!(rG.indexOf(t)>-1||/[A-Z]/u.test(t))}function sG(t,e,n,{latestValues:r},s,i=!1,o){const u=(o??Wb(t)?nG:tG)(e,r,s,t),d=Yq(e,typeof t=="string",i),f=t!==g.Fragment?{...d,...u,ref:n}:{},{children:h}=e,m=g.useMemo(()=>yr(h)?h.get():h,[h]);return g.createElement(t,{...f,children:m})}function iG({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:oG(n,r,s,t),renderState:e()}}function oG(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=mm(i[m]);let{initial:o,animate:l}=t;const u=Xg(t),d=gM(t);e&&d&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const h=f?l:o;if(h&&typeof h!="boolean"&&!Yg(h)){const m=Array.isArray(h)?h:[h];for(let v=0;v<m.length;v++){const x=Mb(t,m[v]);if(x){const{transitionEnd:_,transition:w,...b}=x;for(const k in b){let C=b[k];if(Array.isArray(C)){const P=f?C.length-1:0;C=C[P]}C!==null&&(s[k]=C)}for(const k in _)s[k]=_[k]}}}return s}const qM=t=>(e,n)=>{const r=g.useContext(Qg),s=g.useContext(qg),i=()=>iG(t,e,r,s);return n?i():vb(i)},aG=qM({scrapeMotionValuesFromProps:zb,createRenderState:Bb}),lG=qM({scrapeMotionValuesFromProps:TM,createRenderState:ZM}),cG=Symbol.for("motionComponentSymbol");function uG(t,e,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var l;i&&((l=t.onMount)==null||l.call(t,i)),e&&(i?e.mount(i):e.unmount());const o=r.current;if(typeof o=="function")if(i){const u=o(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const GM=g.createContext({});function Eu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function dG(t,e,n,r,s,i){var C,P;const{visualElement:o}=g.useContext(Qg),l=g.useContext(zM),u=g.useContext(qg),d=g.useContext(Ub),f=d.reducedMotion,h=d.skipAnimations,m=g.useRef(null),v=g.useRef(!1);r=r||l.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:h,isSVG:i}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,_=g.useContext(GM);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&fG(m.current,n,s,_);const w=g.useRef(!1);g.useInsertionEffect(()=>{x&&w.current&&x.update(n,u)});const b=n[sM],k=g.useRef(!!b&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,b))&&((P=window.MotionHasOptimisedAnimation)==null?void 0:P.call(window,b)));return yb(()=>{v.current=!0,x&&(w.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),k.current&&x.animationState&&x.animationState.animateChanges())}),g.useEffect(()=>{x&&(!k.current&&x.animationState&&x.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,b)}),k.current=!1),x.enteringChildren=void 0)}),x}function fG(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:u,layoutRoot:d,layoutAnchor:f,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:KM(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&Eu(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function KM(t){if(t)return t.options.allowProjection!==!1?t.projection:KM(t.parent)}function p_(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&qq(r);const i=n?n==="svg":Wb(t),o=i?lG:aG;function l(d,f){let h;const m={...g.useContext(Ub),...d,layoutId:hG(d)},{isStatic:v}=m,x=Qq(d),_=o(d,v);if(!v&&typeof window<"u"){pG();const w=mG(m);h=w.MeasureLayout,x.visualElement=dG(t,_,m,s,w.ProjectionNode,i)}return S.jsxs(Qg.Provider,{value:x,children:[h&&x.visualElement?S.jsx(h,{visualElement:x.visualElement,...m}):null,sG(t,d,uG(_,x.visualElement,f),_,v,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=g.forwardRef(l);return u[cG]=t,u}function hG({layoutId:t}){const e=g.useContext(gb).id;return e&&t!==void 0?e+"-"+t:t}function pG(t,e){g.useContext(zM).strict}function mG(t){const e=UM(),{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 gG(t,e){if(typeof Proxy>"u")return p_;const n=new Map,r=(i,o)=>p_(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,p_(o,void 0,t,e)),n.get(o))})}const vG=(t,e)=>e.isSVG??Wb(t)?new qZ(e):new HZ(e,{allowProjection:t!==g.Fragment});class yG extends sl{constructor(e){super(e),e.animationState||(e.animationState=QZ(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Yg(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 _G=0;class wG extends sl{constructor(){super(...arguments),this.id=_G++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const u=gc(this.node,o,l);if(u){const{transition:d,transitionEnd:f,...h}=u;for(const m in h)(i=this.node.getValue(m))==null||i.jump(h[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const xG={animation:{Feature:yG},exit:{Feature:wG}};function sp(t){return{point:{x:t.pageX,y:t.pageY}}}const bG=t=>e=>Db(e)&&t(e,sp(e));function lh(t,e,n,r){return Mh(t,e,bG(n),r)}const YM=({current:t})=>t?t.ownerDocument.defaultView:null,KC=(t,e)=>Math.abs(t-e);function SG(t,e){const n=KC(t.x,e.x),r=KC(t.y,e.y);return Math.sqrt(n**2+r**2)}const YC=new Set(["auto","scroll"]);class XM{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=O0(this.lastRawMoveEventInfo,this.transformPagePoint));const x=m_(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,w=SG(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!w)return;const{point:b}=x,{timestamp:k}=pr;this.history.push({...b,timestamp:k});const{onStart:C,onMove:P}=this.handlers;_||(C&&C(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,x)},this.handlePointerMove=(x,_)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=O0(_,this.transformPagePoint),rn.update(this.updatePoint,!0)},this.handlePointerUp=(x,_)=>{this.end();const{onEnd:w,onSessionEnd:b,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=m_(x.type==="pointercancel"?this.lastMoveEventInfo:O0(_,this.transformPagePoint),this.history);this.startEvent&&w&&w(x,C),b&&b(x,C)},!Db(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=sp(e),d=O0(u,this.transformPagePoint),{point:f}=d,{timestamp:h}=pr;this.history=[{...f,timestamp:h}];const{onSessionStart:m}=n;m&&m(e,m_(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=tp(lh(this.contextWindow,"pointermove",this.handlePointerMove,v),lh(this.contextWindow,"pointerup",this.handlePointerUp,v),lh(this.contextWindow,"pointercancel",this.handlePointerUp,v)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(YC.has(r.overflowX)||YC.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),rn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ya(this.updatePoint)}}function O0(t,e){return e?{point:e(t.point)}:t}function XC(t,e){return{x:t.x-e.x,y:t.y-e.y}}function m_({point:t},e){return{point:t,delta:XC(t,QM(e)),offset:XC(t,kG(e)),velocity:EG(e,.1)}}function kG(t){return t[0]}function QM(t){return t[t.length-1]}function EG(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=QM(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Ps(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Ps(e)*2&&(r=t[1]);const i=Ys(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function CG(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?nn(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?nn(n,t,r.max):Math.min(t,n)),t}function QC(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 PG(t,{top:e,left:n,bottom:r,right:s}){return{x:QC(t.x,n,s),y:QC(t.y,e,r)}}function JC(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 AG(t,e){return{x:JC(t.x,e.x),y:JC(t.y,e.y)}}function TG(t,e){let n=.5;const r=Br(t),s=Br(e);return s>r?n=Th(e.min,e.max-r,t.min):r>s&&(n=Th(t.min,t.max-s,e.min)),ro(0,1,n)}function RG(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 Lw=.35;function IG(t=Lw){return t===!1?t=0:t===!0&&(t=Lw),{x:eP(t,"left","right"),y:eP(t,"top","bottom")}}function eP(t,e,n){return{min:tP(t,e),max:tP(t,n)}}function tP(t,e){return typeof t=="number"?t:t[e]||0}const MG=new WeakMap;class OG{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=Jn(),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=h=>{n&&this.snapToCursor(sp(h).point),this.stopAnimation()},o=(h,m)=>{const{drag:v,dragPropagation:x,onDragStart:_}=this.getProps();if(v&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=aZ(v),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Hi(b=>{let k=this.getAxisMotionValue(b).get()||0;if(Ji.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[b];P&&(k=Br(P)*(parseFloat(k)/100))}}this.originPoint[b]=k}),_&&rn.update(()=>_(h,m),!1,!0),Ew(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:x,onDirectionLock:_,onDrag:w}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:b}=m;if(x&&this.currentDirection===null){this.currentDirection=NG(b),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",m.point,b),this.updateAxis("y",m.point,b),this.visualElement.render(),w&&rn.update(()=>w(h,m),!1,!0)},u=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new XM(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:YM(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&rn.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!L0(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=CG(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&Eu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=PG(r.layoutBox,e):this.constraints=!1,this.elastic=IG(n),s!==this.constraints&&!Eu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Hi(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=RG(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Eu(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=NZ(r,s.root,this.visualElement.getTransformPagePoint());let o=AG(s.layout.layoutBox,i);if(n){const l=n(MZ(o));this.hasMutatedConstraints=!!l,l&&(o=wM(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=Hi(f=>{if(!L0(f,n,this.currentDirection))return;let h=u&&u[f]||{};(o===!0||o===f)&&(h={min:0,max:0});const m=s?200:1e6,v=s?40:1e7,x={type:"inertia",velocity:r?e[f]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(f,x)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Ew(this.visualElement,e),r.start(Ib(e,r,0,n,this.visualElement,!1))}stopAnimation(){Hi(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){Hi(n=>{const{drag:r}=this.getProps();if(!L0(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],u=i.get()||0;i.set(e[n]-nn(o,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Eu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Hi(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();s[o]=TG({min:u,max:u},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Hi(o=>{if(!L0(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(nn(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;MG.set(this.visualElement,this);const e=this.visualElement.current,n=lh(e,"pointerdown",d=>{const{drag:f,dragListener:h=!0}=this.getProps(),m=d.target,v=m!==e&&hZ(m);f&&h&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();Eu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=LG(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),rn.read(s);const l=Mh(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Hi(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=d[h].translate,m.set(m.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Lw,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function nP(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function LG(t,e,n){const r=cC(t,nP(n)),s=cC(e,nP(n));return()=>{r(),s()}}function L0(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function NG(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class DG extends sl{constructor(e){super(e),this.removeGroupControls=ei,this.removeListeners=ei,this.controls=new OG(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ei}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 g_=t=>(e,n)=>{t&&rn.update(()=>t(e,n),!1,!0)};class jG extends sl{constructor(){super(...arguments),this.removePointerDownListener=ei}onPointerDown(e){this.session=new XM(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:YM(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:g_(e),onStart:g_(n),onMove:g_(r),onEnd:(i,o)=>{delete this.session,s&&rn.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=lh(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 v_=!1;class $G 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),v_&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),gm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),v_=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||rn.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Nb.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;v_=!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 JM(t){const[e,n]=HM(),r=g.useContext(gb);return S.jsx($G,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(GM),isPresent:e,safeToRemove:n})}const FG={pan:{Feature:jG},drag:{Feature:DG,ProjectionNode:VM,MeasureLayout:JM}};function rP(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&&rn.postRender(()=>i(e,sp(e)))}class VG extends sl{mount(){const{current:e}=this.node;e&&(this.unmount=cZ(e,(n,r)=>(rP(this.node,r,"Start"),s=>rP(this.node,s,"End"))))}unmount(){}}class HG extends sl{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=tp(Mh(this.node.current,"focus",()=>this.onFocus()),Mh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function sP(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&&rn.postRender(()=>i(e,sp(e)))}class zG extends sl{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=mZ(e,(s,i)=>(sP(this.node,i,"Start"),(o,{success:l})=>sP(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Nw=new WeakMap,y_=new WeakMap,UG=t=>{const e=Nw.get(t.target);e&&e(t)},BG=t=>{t.forEach(UG)};function WG({root:t,...e}){const n=t||document;y_.has(n)||y_.set(n,{});const r=y_.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(BG,{root:t,...e})),r[s]}function ZG(t,e,n){const r=WG(e);return Nw.set(t,n),r.observe(t),()=>{Nw.delete(t),r.unobserve(t)}}const qG={some:0,all:1};class GG extends sl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:qG[s]},l=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),v=f?h:m;v&&v(d)};this.stopObserver=ZG(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(KG(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function KG({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const YG={inView:{Feature:GG},tap:{Feature:zG},focus:{Feature:HG},hover:{Feature:VG}},XG={layout:{ProjectionNode:VM,MeasureLayout:JM}},QG={...xG,...YG,...FG,...XG},Uo=gG(QG,vG);function JG(){!Vb.current&&vM();const[t]=g.useState(gg.current);return t}const Ci=Uo;var ip=uI();const eK=Vg(ip);function tK(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 nK=t=>{switch(t){case"success":return iK;case"info":return aK;case"warning":return oK;case"error":return lK;default:return null}},rK=Array(12).fill(0),sK=({visible:t,className:e})=>we.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},we.createElement("div",{className:"sonner-spinner"},rK.map((n,r)=>we.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),iK=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),oK=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),aK=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),lK=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),cK=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},we.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),we.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),uK=()=>{const[t,e]=we.useState(document.hidden);return we.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let dK=1;const fK=100,iP=t=>{var e;return typeof(t==null?void 0:t.id)=="number"||(t==null||(e=t.id)==null?void 0:e.length)>0?t.id:dK++};class hK{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(n=>e(n)),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-fK;e<=0||(this.toasts=this.toasts.filter(n=>e>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),e--,!1):!0))},this.create=e=>{const{message:n,...r}=e,s=iP(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const o=this.dismissedToasts.has(s),l=e.dismissible===void 0?!0:e.dismissible;return o&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(o?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:l,title:n}):d):this.addToast({title:n,...r,dismissible:l,id:s}),s},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(r=>r({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,o;const l=s.then(async d=>{if(o=["resolve",d],we.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(mK(d)&&!d.ok){i=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,x=typeof h=="object"&&!we.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,...x})}else if(d instanceof Error){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,x=typeof h=="object"&&!we.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,...x})}else if(n.success!==void 0){i=!1;const h=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,x=typeof h=="object"&&!we.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:m,...x})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!we.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,f)=>l.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=iP(n);return this.create({...n,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Jr=new hK,pK=(t,e)=>Jr.message(t,e),mK=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",gK=pK,vK=()=>Jr.toasts,yK=()=>Jr.getActiveToasts(),Tt=Object.assign(gK,{success:Jr.success,info:Jr.info,warning:Jr.warning,error:Jr.error,custom:Jr.custom,message:Jr.message,promise:Jr.promise,dismiss:Jr.dismiss,loading:Jr.loading},{getHistory:vK,getToasts:yK});tK("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function N0(t){return t.label!==void 0}const _K=3,wK="24px",xK="16px",oP=4e3,bK=356,SK=14,kK=45,EK=200;function Ni(...t){return t.filter(Boolean).join(" ")}function CK(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const PK=t=>{var e,n,r,s,i,o,l,u,d;const{invert:f,toast:h,unstyled:m,interacting:v,setHeights:x,visibleToasts:_,heights:w,index:b,toasts:k,expanded:C,removeToast:P,defaultRichColors:T,closeButton:M,style:I,cancelButtonStyle:R,actionButtonStyle:L,className:j="",descriptionClassName:F="",duration:D,position:q,gap:W,expandByDefault:G,classNames:H,icons:J,closeButtonAriaLabel:B="Close toast"}=t,[Q,z]=we.useState(null),[N,Y]=we.useState(null),[oe,ne]=we.useState(!1),[ie,de]=we.useState(!1),[ge,ce]=we.useState(!1),[re,Ce]=we.useState(!1),[Fe,ke]=we.useState(!1),[dt,Lt]=we.useState(0),[sn,jt]=we.useState(0),pt=we.useRef(h.duration||D||oP),vn=we.useRef(null),Le=we.useRef(null),lt=b===0,Te=b+1<=_,Je=h.type,bt=Je??"default",Ke=h.dismissible!==!1,ft=h.className||"",wr=h.descriptionClassName||"",Zn=we.useMemo(()=>w.findIndex(Ye=>Ye.toastId===h.id)||0,[w,h.id]),Me=we.useMemo(()=>{var Ye;return(Ye=h.closeButton)!=null?Ye:M},[h.closeButton,M]),ta=we.useMemo(()=>h.duration||D||oP,[h.duration,D]),Dn=we.useRef(0),nr=we.useRef(0),ul=we.useRef(0),yn=we.useRef(null),[Yt,Dd]=q.split("-"),Ns=we.useMemo(()=>w.reduce((Ye,Nt,Vt)=>Vt>=Zn?Ye:Ye+Nt.height,0),[w,Zn]),fs=uK(),rr=we.useMemo(()=>{var Ye;return(Ye=t.swipeDirections)!=null?Ye:CK(q)},[t.swipeDirections,q]),co=h.invert||f,ri=Je==="loading";nr.current=we.useMemo(()=>Zn*W+Ns,[Zn,Ns]),we.useEffect(()=>{pt.current=ta},[ta]),we.useEffect(()=>{ne(!0)},[]),we.useEffect(()=>{const Ye=Le.current;if(Ye){const Nt=Ye.getBoundingClientRect().height;return jt(Nt),x(Vt=>[{toastId:h.id,height:Nt,position:h.position},...Vt]),()=>x(Vt=>Vt.filter(qn=>qn.toastId!==h.id))}},[x,h.id]),we.useLayoutEffect(()=>{if(!oe)return;const Ye=Le.current,Nt=Ye.style.height;Ye.style.height="auto";const Vt=Ye.getBoundingClientRect().height;Ye.style.height=Nt,jt(Vt),x(qn=>qn.find(qt=>qt.toastId===h.id)?qn.map(qt=>qt.toastId===h.id?{...qt,height:Vt}:qt):[{toastId:h.id,height:Vt,position:h.position},...qn])},[oe,h.title,h.description,x,h.id,h.jsx,h.action,h.cancel]);const jn=we.useCallback(()=>{de(!0),Lt(nr.current),x(Ye=>Ye.filter(Nt=>Nt.toastId!==h.id)),setTimeout(()=>{P(h)},EK)},[h,P,x,nr]);we.useEffect(()=>{if(h.promise&&Je==="loading"||h.duration===1/0||h.type==="loading")return;let Ye;return C||v||fs?(()=>{if(ul.current<Dn.current){const qn=new Date().getTime()-Dn.current;pt.current=pt.current-qn}ul.current=new Date().getTime()})():(()=>{pt.current!==1/0&&(Dn.current=new Date().getTime(),Ye=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),jn()},pt.current))})(),()=>clearTimeout(Ye)},[C,v,h,Je,fs,jn]),we.useEffect(()=>{h.delete&&(jn(),h.onDismiss==null||h.onDismiss.call(h,h))},[jn,h.delete]);function Ds(){var Ye;if(J!=null&&J.loading){var Nt;return we.createElement("div",{className:Ni(H==null?void 0:H.loader,h==null||(Nt=h.classNames)==null?void 0:Nt.loader,"sonner-loader"),"data-visible":Je==="loading"},J.loading)}return we.createElement(sK,{className:Ni(H==null?void 0:H.loader,h==null||(Ye=h.classNames)==null?void 0:Ye.loader),visible:Je==="loading"})}const dl=h.icon||(J==null?void 0:J[Je])||nK(Je);var uo,hs;return we.createElement("li",{tabIndex:0,ref:Le,className:Ni(j,ft,H==null?void 0:H.toast,h==null||(e=h.classNames)==null?void 0:e.toast,H==null?void 0:H[bt],h==null||(n=h.classNames)==null?void 0:n[bt]),"data-sonner-toast":"","data-rich-colors":(uo=h.richColors)!=null?uo:T,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":oe,"data-promise":!!h.promise,"data-swiped":Fe,"data-removed":ie,"data-visible":Te,"data-y-position":Yt,"data-x-position":Dd,"data-index":b,"data-front":lt,"data-swiping":ge,"data-dismissible":Ke,"data-type":Je,"data-invert":co,"data-swipe-out":re,"data-swipe-direction":N,"data-expanded":!!(C||G&&oe),"data-testid":h.testId,style:{"--index":b,"--toasts-before":b,"--z-index":k.length-b,"--offset":`${ie?dt:nr.current}px`,"--initial-height":G?"auto":`${sn}px`,...I,...h.style},onDragEnd:()=>{ce(!1),z(null),yn.current=null},onPointerDown:Ye=>{Ye.button!==2&&(ri||!Ke||(vn.current=new Date,Lt(nr.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(ce(!0),yn.current={x:Ye.clientX,y:Ye.clientY})))},onPointerUp:()=>{var Ye,Nt,Vt;if(re||!Ke)return;yn.current=null;const qn=Number(((Ye=Le.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ps=Number(((Nt=Le.current)==null?void 0:Nt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qt=new Date().getTime()-((Vt=vn.current)==null?void 0:Vt.getTime()),$n=Q==="x"?qn:ps,Zr=Math.abs($n)/qt;if((Q==="x"?rr.includes(qn>0?"right":"left"):rr.includes(ps>0?"bottom":"top"))&&(Math.abs($n)>=kK||Zr>.11)){Lt(nr.current),h.onDismiss==null||h.onDismiss.call(h,h),Y(Q==="x"?qn>0?"right":"left":ps>0?"down":"up"),jn(),Ce(!0);return}else{var dr,Mn;(dr=Le.current)==null||dr.style.setProperty("--swipe-amount-x","0px"),(Mn=Le.current)==null||Mn.style.setProperty("--swipe-amount-y","0px")}ke(!1),ce(!1),z(null)},onPointerMove:Ye=>{var Nt,Vt,qn;if(!yn.current||!Ke||((Nt=window.getSelection())==null?void 0:Nt.toString().length)>0)return;const qt=Ye.clientY-yn.current.y,$n=Ye.clientX-yn.current.x;!Q&&(Math.abs($n)>1||Math.abs(qt)>1)&&z(Math.abs($n)>Math.abs(qt)?"x":"y");let Zr={x:0,y:0};const si=dr=>1/(1.5+Math.abs(dr)/20);if(Q==="y"){if(rr.includes("top")||rr.includes("bottom"))if(rr.includes("top")&&qt<0||rr.includes("bottom")&&qt>0)Zr.y=qt;else{const dr=qt*si(qt);Zr.y=Math.abs(dr)<Math.abs(qt)?dr:qt}}else if(Q==="x"&&(rr.includes("left")||rr.includes("right")))if(rr.includes("left")&&$n<0||rr.includes("right")&&$n>0)Zr.x=$n;else{const dr=$n*si($n);Zr.x=Math.abs(dr)<Math.abs($n)?dr:$n}(Math.abs(Zr.x)>0||Math.abs(Zr.y)>0)&&ke(!0),(Vt=Le.current)==null||Vt.style.setProperty("--swipe-amount-x",`${Zr.x}px`),(qn=Le.current)==null||qn.style.setProperty("--swipe-amount-y",`${Zr.y}px`)}},Me&&!h.jsx&&Je!=="loading"?we.createElement("button",{"aria-label":B,"data-disabled":ri,"data-close-button":!0,onClick:ri||!Ke?()=>{}:()=>{jn(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Ni(H==null?void 0:H.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(hs=J==null?void 0:J.close)!=null?hs:cK):null,(Je||h.icon||h.promise)&&h.icon!==null&&((J==null?void 0:J[Je])!==null||h.icon)?we.createElement("div",{"data-icon":"",className:Ni(H==null?void 0:H.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},Je==="loading"?h.icon||Ds():h.promise?Ds():null,Je!=="loading"?dl:null):null,we.createElement("div",{"data-content":"",className:Ni(H==null?void 0:H.content,h==null||(i=h.classNames)==null?void 0:i.content)},we.createElement("div",{"data-title":"",className:Ni(H==null?void 0:H.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?we.createElement("div",{"data-description":"",className:Ni(F,wr,H==null?void 0:H.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),we.isValidElement(h.cancel)?h.cancel:h.cancel&&N0(h.cancel)?we.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||R,onClick:Ye=>{N0(h.cancel)&&Ke&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ye),jn())},className:Ni(H==null?void 0:H.cancelButton,h==null||(u=h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,we.isValidElement(h.action)?h.action:h.action&&N0(h.action)?we.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:Ye=>{N0(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ye),!Ye.defaultPrevented&&jn())},className:Ni(H==null?void 0:H.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function aP(){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 AK(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?xK:wK;function u(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}const TK=we.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:f,mobileOffset:h,theme:m="light",richColors:v,duration:x,style:_,visibleToasts:w=_K,toastOptions:b,dir:k=aP(),gap:C=SK,icons:P,customAriaLabel:T,containerAriaLabel:M="Notifications"}=e,[I,R]=we.useState([]),L=we.useMemo(()=>r?I.filter(ne=>ne.toasterId===r):I.filter(ne=>!ne.toasterId),[I,r]),j=we.useMemo(()=>Array.from(new Set([i].concat(L.filter(ne=>ne.position).map(ne=>ne.position)))),[L,i]),[F,D]=we.useState([]),[q,W]=we.useState(!1),[G,H]=we.useState(!1),[J,B]=we.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=we.useRef(null),z=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=we.useRef(null),Y=we.useRef(!1),oe=we.useCallback(ne=>{R(ie=>{var de;return(de=ie.find(ge=>ge.id===ne.id))!=null&&de.delete||Jr.dismiss(ne.id),ie.filter(({id:ge})=>ge!==ne.id)})},[]);return we.useEffect(()=>Jr.subscribe(ne=>{if(ne.dismiss){requestAnimationFrame(()=>{R(ie=>ie.map(de=>de.id===ne.id?{...de,delete:!0}:de))});return}setTimeout(()=>{eK.flushSync(()=>{R(ie=>{const de=ie.findIndex(ge=>ge.id===ne.id);return de!==-1?[...ie.slice(0,de),{...ie[de],...ne},...ie.slice(de+1)]:[ne,...ie]})})})}),[]),we.useEffect(()=>{if(m!=="system"){B(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:ie})=>{B(ie?"dark":"light")})}catch{ne.addListener(({matches:de})=>{try{B(de?"dark":"light")}catch(ge){console.error(ge)}})}},[m]),we.useEffect(()=>{I.length<=1&&W(!1)},[I]),we.useEffect(()=>{const ne=ie=>{var de;if(o.length>0&&o.every(re=>ie[re]||ie.code===re)){var ce;W(!0),(ce=Q.current)==null||ce.focus()}ie.code==="Escape"&&(document.activeElement===Q.current||(de=Q.current)!=null&&de.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[o]),we.useEffect(()=>{if(Q.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,Y.current=!1)}},[Q.current]),we.createElement("section",{ref:n,"aria-label":T??`${M} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},j.map((ne,ie)=>{var de;const[ge,ce]=ne.split("-");return L.length?we.createElement("ol",{key:ne,dir:k==="auto"?aP():k,tabIndex:-1,ref:Q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":J,"data-y-position":ge,"data-x-position":ce,style:{"--front-toast-height":`${((de=F[0])==null?void 0:de.height)||0}px`,"--width":`${bK}px`,"--gap":`${C}px`,..._,...AK(f,h)},onBlur:re=>{Y.current&&!re.currentTarget.contains(re.relatedTarget)&&(Y.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,N.current=re.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{G||W(!1)},onDragEnd:()=>W(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},L.filter(re=>!re.position&&ie===0||re.position===ne).map((re,Ce)=>{var Fe,ke;return we.createElement(PK,{key:re.id,icons:P,index:Ce,toast:re,defaultRichColors:v,duration:(Fe=b==null?void 0:b.duration)!=null?Fe:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:w,closeButton:(ke=b==null?void 0:b.closeButton)!=null?ke:u,interacting:G,position:ne,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:oe,toasts:L.filter(dt=>dt.position==re.position),heights:F.filter(dt=>dt.position==re.position),setHeights:D,expandByDefault:l,gap:C,expanded:q,swipeDirections:e.swipeDirections})})):null}))}),RK=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"}))]]),IK=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"}))]]),MK=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"}))]]),OK=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),g.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),LK=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"}))]]),NK=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"}))]]),DK=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"}))]]),jK=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"}))]]),$K=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),g.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),FK=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M248.23,112.31A20,20,0,0,0,232,104H220V88a20,20,0,0,0-20-20H132L105.34,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V208a12,12,0,0,0,12,12H211.1a12,12,0,0,0,11.33-8l28.49-81.47.06-.17A20,20,0,0,0,248.23,112.31ZM92,68l28.8,21.6A12,12,0,0,0,128,92h68v12H69.77a20,20,0,0,0-18.94,13.58L44,137.15V68ZM202.59,196H48.89l23.72-68H226.37Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,88v24H69.77a8,8,0,0,0-7.59,5.47L32,208V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h72A8,8,0,0,1,208,88Z",opacity:"0.2"}),g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M243.36,111.81A14,14,0,0,0,232,106H214V88a14,14,0,0,0-14-14H130L101.74,52.8a14.06,14.06,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V208a6,6,0,0,0,6,6H211.1a6,6,0,0,0,5.69-4.1l28.49-85.47A14,14,0,0,0,243.36,111.81ZM40,62H93.34a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h72a2,2,0,0,1,2,2v18H69.77a14,14,0,0,0-13.28,9.57L38,171V64A2,2,0,0,1,40,62Zm193.9,58.63L206.78,202H40.33l27.54-82.63a2,2,0,0,1,1.9-1.37H232a2,2,0,0,1,1.9,2.63Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M241.72,113a11.88,11.88,0,0,0-9.73-5H212V88a12,12,0,0,0-12-12H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V208a4,4,0,0,0,4,4H211.09a4,4,0,0,0,3.79-2.74l28.49-85.47A11.86,11.86,0,0,0,241.72,113ZM40,60H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h72a4,4,0,0,1,4,4v20H69.76a12,12,0,0,0-11.38,8.21L36,183.35V64A4,4,0,0,1,40,60Zm195.78,61.26L208.2,204H37.55L66,118.74A4,4,0,0,1,69.76,116H232a4,4,0,0,1,3.79,5.26Z"}))]]),VK=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),g.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),HK=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"}))]]),zK=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"}))]]),UK=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M238.15,78.54,177.46,17.86a20,20,0,0,0-28.3,0L97.2,70c-12.43-3.33-36.68-5.72-61.74,14.5a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.91,228c.46,0,.93,0,1.4-.05A20,20,0,0,0,171.87,220c4.69-6.23,11-16.13,14.44-28s3.45-22.88.16-33.4l51.7-51.87A20,20,0,0,0,238.15,78.54Zm-74.26,68.79a12,12,0,0,0-2.23,13.84c3.43,6.86,6.9,21-6.28,40.65L54.08,100.53c21.09-14.59,39.53-6.64,41-6a11.67,11.67,0,0,0,13.81-2.29l54.43-54.61,55,55Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,98.34,172.39,155.8c11.46,22.93-1.72,45.86-10.11,57a8,8,0,0,1-12,.83L42.34,105.76A8,8,0,0,1,43,93.85c29.65-23.92,57.4-10,57.4-10l57.27-57.46a8,8,0,0,1,11.31,0L229.66,87A8,8,0,0,1,229.66,98.34Z",opacity:"0.2"}),g.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.33,104l-53.47,53.65c4.56,12.67,6.45,33.89-13.19,60A15.93,15.93,0,0,1,157,224c-.38,0-.75,0-1.13,0a16,16,0,0,1-11.32-4.69L96.29,171,53.66,213.66a8,8,0,0,1-11.32-11.32L85,159.71l-48.3-48.3A16,16,0,0,1,38,87.63c25.42-20.51,49.75-16.48,60.4-13.14L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.33,104Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M233.91,82.79,173.22,22.1a14,14,0,0,0-19.81,0L98.93,76.77c-9.52-3.25-34-8.34-59.71,12.41A14,14,0,0,0,38.1,110l49.71,49.71-44.05,44a6,6,0,1,0,8.48,8.48l44.05-44.05L146,217.89a14,14,0,0,0,9.9,4.11q.49,0,1,0a14,14,0,0,0,10.19-5.54c19.72-26.21,17.15-47.23,12.46-59.3l54.37-54.55A14,14,0,0,0,233.91,82.79ZM225.42,94.1h0l-57.27,57.46a6,6,0,0,0-1.11,6.92c9.94,19.88-1.71,40.32-9.54,50.72a2,2,0,0,1-3,.2L46.58,101.51a2,2,0,0,1,.18-3c12.5-10.09,24.5-12.76,33.7-12.76a42.13,42.13,0,0,1,17.25,3.41A6,6,0,0,0,104.64,88L161.9,30.59a2,2,0,0,1,2.83,0l60.69,60.68A2,2,0,0,1,225.42,94.1Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,84.2,171.8,23.51a12,12,0,0,0-17,0L99.45,79.07c-8.08-3-32.79-9.45-59,11.67a12,12,0,0,0-1,17.84l51.13,51.13L45.17,205.17a4,4,0,0,0,5.66,5.66l45.46-45.47,51.12,51.12A12,12,0,0,0,155.9,220c.28,0,.57,0,.85,0a12,12,0,0,0,8.73-4.74c19.83-26.36,16.51-47.18,11.71-58.57l55.3-55.49A12,12,0,0,0,232.49,84.2Zm-5.66,11.31h0L169.56,153a4,4,0,0,0-.75,4.61c10.43,20.85-1.62,42-9.73,52.83a4,4,0,0,1-6,.4L45.17,102.93a4,4,0,0,1,.33-6C58.44,86.53,70.86,83.74,80.44,83.74A43.9,43.9,0,0,1,98.6,87.38a4,4,0,0,0,4.62-.75l57.27-57.46a4,4,0,0,1,5.66,0l60.68,60.69A4,4,0,0,1,226.83,95.51Z"}))]]),BK=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"}))]]),WK=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M144.49,136.49l-40,40a12,12,0,0,1-17-17L107,140H24a12,12,0,0,1,0-24h83L87.51,96.49a12,12,0,0,1,17-17l40,40A12,12,0,0,1,144.49,136.49ZM200,28H136a12,12,0,0,0,0,24h52V204H136a12,12,0,0,0,0,24h64a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,40V216H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40Z",opacity:"0.2"}),g.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M141.66,133.66l-40,40A8,8,0,0,1,88,168V136H24a8,8,0,0,1,0-16H88V88a8,8,0,0,1,13.66-5.66l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M140.24,132.24l-40,40a6,6,0,0,1-8.48-8.48L121.51,134H24a6,6,0,0,1,0-12h97.51L91.76,92.24a6,6,0,0,1,8.48-8.48l40,40A6,6,0,0,1,140.24,132.24ZM200,34H136a6,6,0,0,0,0,12h58V210H136a6,6,0,0,0,0,12h64a6,6,0,0,0,6-6V40A6,6,0,0,0,200,34Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M138.83,130.83l-40,40a4,4,0,0,1-5.66-5.66L126.34,132H24a4,4,0,0,1,0-8H126.34L93.17,90.83a4,4,0,0,1,5.66-5.66l40,40A4,4,0,0,1,138.83,130.83ZM200,36H136a4,4,0,0,0,0,8h60V212H136a4,4,0,0,0,0,8h64a4,4,0,0,0,4-4V40A4,4,0,0,0,200,36Z"}))]]),ZK=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"}))]]),qK=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"}))]]),GK=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z",opacity:"0.2"}),g.createElement("path",{d:"M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z"}))]]),KK=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"}))]]),YK=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"}))]]),XK=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),g.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"}))]]),QK=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"}))]]),JK=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M218.12,209.56l-61-95.8,59.72-65.69a12,12,0,0,0-17.76-16.14L143.81,92.77,106.12,33.56A12,12,0,0,0,96,28H48A12,12,0,0,0,37.88,46.44l61,95.8L39.12,207.93a12,12,0,1,0,17.76,16.14l55.31-60.84,37.69,59.21A12,12,0,0,0,160,228h48a12,12,0,0,0,10.12-18.44ZM166.59,204,69.86,52H89.41l96.73,152Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,216H160L48,40H96Z",opacity:"0.2"}),g.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M215,219.85a8,8,0,0,1-7,4.15H160a8,8,0,0,1-6.75-3.71l-40.49-63.63L53.92,221.38a8,8,0,0,1-11.84-10.76l61.77-68L41.25,44.3A8,8,0,0,1,48,32H96a8,8,0,0,1,6.75,3.71l40.49,63.63,58.84-64.72a8,8,0,0,1,11.84,10.76l-61.77,67.95,62.6,98.38A8,8,0,0,1,215,219.85Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.06,212.78l-63.42-99.66L212.44,44A6,6,0,1,0,203.56,36L143,102.62l-41.9-65.84A6,6,0,0,0,96,34H48a6,6,0,0,0-5.06,9.22l63.42,99.66L43.56,212A6,6,0,0,0,52.44,220L113,153.38l41.9,65.84A6,6,0,0,0,160,222h48a6,6,0,0,0,5.06-9.22ZM163.29,210,58.93,46H92.71L197.07,210Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M211.37,213.85,147.13,112.9,211,42.69A4,4,0,0,0,205,37.31L142.68,105.9,99.38,37.85A4,4,0,0,0,96,36H48a4,4,0,0,0-3.37,6.15L108.87,143.1,45,213.31A4,4,0,1,0,51,218.69l62.36-68.59,43.3,68.05A4,4,0,0,0,160,220h48a4,4,0,0,0,3.37-6.15ZM162.2,212,55.29,44H93.8L200.71,212Z"}))]]),eY=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),fn=g.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:u,...d}=t,{color:f="currentColor",size:h,weight:m="regular",mirrored:v=!1,...x}=g.useContext(eY);return g.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??h,height:s??h,fill:r??f,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,...x,...d},!!n&&g.createElement("title",null,n),l,u.get(i??m))});fn.displayName="IconBase";const e3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:RK}));e3.displayName="ArrowLeftIcon";const tY=e3,t3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:IK}));t3.displayName="ArrowUpIcon";const nY=t3,n3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:MK}));n3.displayName="CaretDownIcon";const rY=n3,r3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:OK}));r3.displayName="CaretRightIcon";const sY=r3,s3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:LK}));s3.displayName="ChatCircleIcon";const iY=s3,i3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:NK}));i3.displayName="CheckIcon";const oY=i3,o3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:DK}));o3.displayName="CircleNotchIcon";const Jg=o3,a3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:jK}));a3.displayName="CopyIcon";const Oh=a3,l3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:$K}));l3.displayName="DotsThreeIcon";const aY=l3,c3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:FK}));c3.displayName="FolderOpenIcon";const lY=c3,u3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:VK}));u3.displayName="FolderSimpleIcon";const cY=u3,d3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:HK}));d3.displayName="MagnifyingGlassIcon";const uY=d3,f3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:zK}));f3.displayName="PencilSimpleIcon";const h3=f3,p3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:UK}));p3.displayName="PushPinIcon";const Dw=p3,m3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:BK}));m3.displayName="SidebarSimpleIcon";const dY=m3,g3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:WK}));g3.displayName="SignInIcon";const fY=g3,v3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:ZK}));v3.displayName="SignOutIcon";const hY=v3,y3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:qK}));y3.displayName="SparkleIcon";const __=y3,_3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:GK}));_3.displayName="SquaresFourIcon";const pY=_3,w3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:KK}));w3.displayName="SwatchesIcon";const x3=w3,b3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:YK}));b3.displayName="TrashIcon";const S3=b3,k3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:XK}));k3.displayName="UserIcon";const mY=k3,E3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:QK}));E3.displayName="XIcon";const Zb=E3,C3=g.forwardRef((t,e)=>g.createElement(fn,{ref:e,...t,weights:JK}));C3.displayName="XLogoIcon";const gY=C3,vY="/assets/arena-Db0j1set.png",yY="data:image/svg+xml,%3csvg%20width='38'%20height='42'%20viewBox='0%200%2038%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2543_2)'%3e%3cmask%20id='mask0_2543_2'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='38'%20height='42'%3e%3cpath%20d='M0%200H38V42H0V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2543_2)'%3e%3cpath%20d='M19.025%2011.898C22.321%2011.898%2024.995%209.237%2024.995%205.949C24.995%202.661%2022.324%200%2019.025%200C15.726%200%2013.055%202.662%2013.055%205.95C13.055%209.237%2015.726%2011.898%2019.025%2011.898ZM19.025%2041.945C22.321%2041.945%2024.995%2039.283%2024.995%2035.995C24.995%2032.708%2022.324%2030.046%2019.025%2030.046C15.726%2030.046%2013.055%2032.708%2013.055%2035.996C13.055%2039.283%2015.726%2041.945%2019.025%2041.945ZM5.97%2019.41C9.266%2019.41%2011.94%2016.748%2011.94%2013.46C11.94%2010.173%209.268%207.511%205.97%207.511C2.67%207.511%200%2010.175%200%2013.463C0%2016.752%202.67%2019.413%205.97%2019.413V19.41ZM32.08%2034.434C35.376%2034.434%2038.05%2031.772%2038.05%2028.484C38.05%2025.197%2035.379%2022.535%2032.08%2022.535C28.781%2022.535%2026.11%2025.197%2026.11%2028.485C26.11%2031.772%2028.781%2034.434%2032.08%2034.434ZM32.08%2019.41C35.376%2019.41%2038.05%2016.748%2038.05%2013.46C38.05%2010.174%2035.379%207.512%2032.08%207.512C28.781%207.512%2026.11%2010.174%2026.11%2013.461C26.11%2016.748%2028.781%2019.41%2032.08%2019.41ZM5.97%2034.433C9.266%2034.433%2011.94%2031.771%2011.94%2028.483C11.94%2025.196%209.268%2022.535%205.97%2022.535C2.67%2022.535%200%2025.202%200%2028.486C0%2031.771%202.67%2034.436%205.97%2034.436V34.433Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2543_2'%3e%3crect%20width='38'%20height='42'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function P3(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=P3(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function A3(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=P3(t))&&(r&&(r+=" "),r+=e);return r}const _Y=(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},wY=(t,e)=>({classGroupId:t,validator:e}),T3=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),xg="-",lP=[],xY="arbitrary..",bY=t=>{const e=kY(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return SY(o);const l=o.split(xg),u=l[0]===""&&l.length>1?1:0;return R3(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?_Y(d,u):u:d||lP}return n[o]||lP}}},R3=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=R3(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(xg):t.slice(e).join(xg),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},SY=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?xY+r:void 0})(),kY=t=>{const{theme:e,classGroups:n}=t;return EY(n,e)},EY=(t,e)=>{const n=T3();for(const r in t){const s=t[r];qb(s,n,r,e)}return n},qb=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];CY(o,e,n,r)}},CY=(t,e,n,r)=>{if(typeof t=="string"){PY(t,e,n);return}if(typeof t=="function"){AY(t,e,n,r);return}TY(t,e,n,r)},PY=(t,e,n)=>{const r=t===""?e:I3(e,t);r.classGroupId=n},AY=(t,e,n,r)=>{if(RY(t)){qb(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(wY(n,t))},TY=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,u]=s[o];qb(u,I3(e,l),n,r)}},I3=(t,e)=>{let n=t;const r=e.split(xg),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=T3(),n.nextPart.set(o,l)),n=l}return n},RY=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,IY=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=r[i])!==void 0)return s(i,o),o},set(i,o){i in n?n[i]=o:s(i,o)}}},jw="!",cP=":",MY=[],uP=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),OY=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let o=0,l=0,u=0,d;const f=s.length;for(let _=0;_<f;_++){const w=s[_];if(o===0&&l===0){if(w===cP){i.push(s.slice(u,_)),u=_+1;continue}if(w==="/"){d=_;continue}}w==="["?o++:w==="]"?o--:w==="("?l++:w===")"&&l--}const h=i.length===0?s:s.slice(u);let m=h,v=!1;h.endsWith(jw)?(m=h.slice(0,-1),v=!0):h.startsWith(jw)&&(m=h.slice(1),v=!0);const x=d&&d>u?d-u:void 0;return uP(i,v,m,x)};if(e){const s=e+cP,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):uP(MY,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},LY=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const o=n[i],l=o[0]==="[",u=e.has(o);l||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},NY=t=>({cache:IY(t.cacheSize),parseClassName:OY(t),sortModifiers:LY(t),postfixLookupClassGroupIds:DY(t),...bY(t)}),DY=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},jY=/\s+/,$Y=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(jY);let d="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{isExternal:m,modifiers:v,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:w}=n(h);if(m){d=h+(d.length>0?" "+d:d);continue}let b=!!w,k;if(b){const I=_.substring(0,w);k=r(I);const R=k&&o[k]?r(_):void 0;R&&R!==k&&(k=R,b=!1)}else k=r(_);if(!k){if(!b){d=h+(d.length>0?" "+d:d);continue}if(k=r(_),!k){d=h+(d.length>0?" "+d:d);continue}b=!1}const C=v.length===0?"":v.length===1?v[0]:i(v).join(":"),P=x?C+jw:C,T=P+k;if(l.indexOf(T)>-1)continue;l.push(T);const M=s(k,b);for(let I=0;I<M.length;++I){const R=M[I];l.push(P+R)}d=h+(d.length>0?" "+d:d)}return d},FY=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=M3(n))&&(s&&(s+=" "),s+=r);return s},M3=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=M3(t[r]))&&(n&&(n+=" "),n+=e);return n},VY=(t,...e)=>{let n,r,s,i;const o=u=>{const d=e.reduce((f,h)=>h(f),t());return n=NY(d),r=n.cache.get,s=n.cache.set,i=l,l(u)},l=u=>{const d=r(u);if(d)return d;const f=$Y(u,n);return s(u,f),f};return i=o,(...u)=>i(FY(...u))},HY=[],Xn=t=>{const e=n=>n[t]||HY;return e.isThemeGetter=!0,e.themeKey=t,e},O3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,L3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zY=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,UY=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,BY=/\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$/,WY=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,ZY=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qY=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ba=t=>zY.test(t),gt=t=>!!t&&!Number.isNaN(Number(t)),Di=t=>!!t&&Number.isInteger(Number(t)),w_=t=>t.endsWith("%")&&gt(t.slice(0,-1)),ko=t=>UY.test(t),N3=()=>!0,GY=t=>BY.test(t)&&!WY.test(t),Gb=()=>!1,KY=t=>ZY.test(t),YY=t=>qY.test(t),XY=t=>!Oe(t)&&!De(t),QY=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)),JY=t=>il(t,$3,Gb),Oe=t=>O3.test(t),Fl=t=>il(t,F3,GY),dP=t=>il(t,aX,gt),eX=t=>il(t,H3,N3),tX=t=>il(t,V3,Gb),fP=t=>il(t,D3,Gb),nX=t=>il(t,j3,YY),D0=t=>il(t,z3,KY),De=t=>L3.test(t),Of=t=>Oc(t,F3),rX=t=>Oc(t,V3),hP=t=>Oc(t,D3),sX=t=>Oc(t,$3),iX=t=>Oc(t,j3),j0=t=>Oc(t,z3,!0),oX=t=>Oc(t,H3,!0),il=(t,e,n)=>{const r=O3.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Oc=(t,e,n=!1)=>{const r=L3.exec(t);return r?r[1]?e(r[1]):n:!1},D3=t=>t==="position"||t==="percentage",j3=t=>t==="image"||t==="url",$3=t=>t==="length"||t==="size"||t==="bg-size",F3=t=>t==="length",aX=t=>t==="number",V3=t=>t==="family-name",H3=t=>t==="number"||t==="weight",z3=t=>t==="shadow",lX=()=>{const t=Xn("color"),e=Xn("font"),n=Xn("text"),r=Xn("font-weight"),s=Xn("tracking"),i=Xn("leading"),o=Xn("breakpoint"),l=Xn("container"),u=Xn("spacing"),d=Xn("radius"),f=Xn("shadow"),h=Xn("inset-shadow"),m=Xn("text-shadow"),v=Xn("drop-shadow"),x=Xn("blur"),_=Xn("perspective"),w=Xn("aspect"),b=Xn("ease"),k=Xn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...P(),De,Oe],M=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],R=()=>[De,Oe,u],L=()=>[ba,"full","auto",...R()],j=()=>[Di,"none","subgrid",De,Oe],F=()=>["auto",{span:["full",Di,De,Oe]},Di,De,Oe],D=()=>[Di,"auto",De,Oe],q=()=>["auto","min","max","fr",De,Oe],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],J=()=>[ba,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],B=()=>[l,ba,"screen","full","dvw","lvw","svw","min","max","fit",...R()],Q=()=>[ba,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],z=()=>[t,De,Oe],N=()=>[...P(),hP,fP,{position:[De,Oe]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",sX,JY,{size:[De,Oe]}],ne=()=>[w_,Of,Fl],ie=()=>["","none","full",d,De,Oe],de=()=>["",gt,Of,Fl],ge=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[gt,w_,hP,fP],Ce=()=>["","none",x,De,Oe],Fe=()=>["none",gt,De,Oe],ke=()=>["none",gt,De,Oe],dt=()=>[gt,De,Oe],Lt=()=>[ba,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ko],breakpoint:[ko],color:[N3],container:[ko],"drop-shadow":[ko],ease:["in","out","in-out"],font:[XY],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ko],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ko],shadow:[ko],spacing:["px",gt],text:[ko],"text-shadow":[ko],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ba,Oe,De,w]}],container:["container"],"container-type":[{"@container":["","normal","size",De,Oe]}],"container-named":[QY],columns:[{columns:[gt,"auto",Oe,De,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Di,"auto",De,Oe]}],basis:[{basis:[ba,"full","auto",l,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gt,ba,"auto","initial","none",Oe]}],grow:[{grow:["",gt,De,Oe]}],shrink:[{shrink:["",gt,De,Oe]}],order:[{order:[Di,"first","last","none",De,Oe]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...J()]}],"min-w":[{"min-w":[l,"screen","none",...J()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh","none",...J()]}],"font-size":[{text:["base",n,Of,Fl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,oX,eX]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",w_,Oe]}],"font-family":[{font:[rX,tX,e]}],"font-features":[{"font-features":[Oe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,De,Oe]}],"line-clamp":[{"line-clamp":[gt,"none",De,dP]}],leading:[{leading:["none",i,...R()]}],"list-image":[{"list-image":["none",De,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[gt,"from-font","auto",De,Fl]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[gt,"auto",De,Oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[Di,De,Oe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,Oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",De,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Di,De,Oe],radial:["",De,Oe],conic:["",Di,De,Oe]},iX,nX]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[gt,De,Oe]}],"outline-w":[{outline:["",gt,Of,Fl]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","inner","none",f,j0,D0]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",h,j0,D0]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[gt,Fl]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",m,j0,D0]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[gt,De,Oe]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[gt]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[De,Oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[gt]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Oe]}],filter:[{filter:["","none",De,Oe]}],blur:[{blur:Ce()}],brightness:[{brightness:[gt,De,Oe]}],contrast:[{contrast:[gt,De,Oe]}],"drop-shadow":[{"drop-shadow":["","none",v,j0,D0]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",gt,De,Oe]}],"hue-rotate":[{"hue-rotate":[gt,De,Oe]}],invert:[{invert:["",gt,De,Oe]}],saturate:[{saturate:[gt,De,Oe]}],sepia:[{sepia:["",gt,De,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Oe]}],"backdrop-blur":[{"backdrop-blur":Ce()}],"backdrop-brightness":[{"backdrop-brightness":[gt,De,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[gt,De,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gt,De,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gt,De,Oe]}],"backdrop-invert":[{"backdrop-invert":["",gt,De,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[gt,De,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[gt,De,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",gt,De,Oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gt,"initial",De,Oe]}],ease:[{ease:["linear","initial",b,De,Oe]}],delay:[{delay:[gt,De,Oe]}],animate:[{animate:["none",k,De,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,De,Oe]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:ke()}],"scale-x":[{"scale-x":ke()}],"scale-y":[{"scale-y":ke()}],"scale-z":[{"scale-z":ke()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[De,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Lt()}],"translate-x":[{"translate-x":Lt()}],"translate-y":[{"translate-y":Lt()}],"translate-z":[{"translate-z":Lt()}],"translate-none":["translate-none"],zoom:[{zoom:[Di,De,Oe]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",De,Oe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",De,Oe]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[gt,Of,Fl,dP]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},cX=VY(lX);function Wt(...t){return cX(A3(t))}const ch=({provider:t,className:e})=>{if(t==="x")return S.jsx(gY,{className:Wt("h-6 w-6",e),"aria-hidden":"true"});if(t==="pinterest")return S.jsx("svg",{viewBox:"0 0 24 24",className:Wt("h-6 w-6",e),"aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})});const n=t==="cosmos"?yY:vY;return S.jsx("span",{"aria-hidden":"true",className:Wt("h-6 w-6",t==="cosmos"?"bg-current":"bg-[#b1b1b1]",e),style:{WebkitMaskImage:`url("${n}")`,maskImage:`url("${n}")`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}})},uX=gn({hash:Ge().regex(/^[a-f0-9]{64}$/),mimeType:lr(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),dX=gn({id:Ge().min(1),title:Ge().trim().min(1),url:Ge().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:Ge().optional(),image:uX.optional().catch(void 0)}).refine(t=>!!(t.url||t.image),{message:"A reference requires a public URL or an image"}),fX=(...t)=>{const e=[],n=new Set,r=new Set;for(const s of t.flatMap(i=>i??[])){const i=dX.safeParse(s);if(!i.success)continue;const o=i.data,l=o.url?new URL(o.url).href:void 0;if(n.has(o.id)||l&&r.has(l)){const u=e.find(d=>d.url===l&&(l!==void 0||d.id===o.id));u&&!u.image&&o.image&&(u.id===o.id||!n.has(o.id))&&(u.id=o.id,u.image=o.image,n.add(o.id));continue}e.push({...o,...l?{url:l}:{}}),n.add(o.id),l&&r.add(l)}return e.length?e:void 0},hX=t=>{const e=new URL(t).hostname.replace(/^www\./,"");return e==="are.na"?"arena":e==="pinterest.com"||e==="pin.it"?"pinterest":e==="x.com"?"x":e==="cosmos.so"?"cosmos":null},pX=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=g.useState(!1),i=!!e&&!r,o=t.url?hX(t.url):null,l=t.url??(i?e:void 0),u=l?"a":"span",d=i&&t.url?new URL(t.url).hostname:t.title;return S.jsxs(u,{href:l,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,"aria-label":t.title,onPointerDown:f=>f.stopPropagation(),onKeyDown:f=>{(f.key!=="ArrowUp"&&f.key!=="ArrowDown"||f.altKey||f.ctrlKey||f.metaKey||f.shiftKey)&&f.stopPropagation()},onClick:f=>{f.stopPropagation(),l&&n()},className:Wt("border-main-border bg-main-input text-content hover:border-content-muted/50 flex max-w-full min-w-0 shrink-0 items-center gap-1.5 overflow-hidden rounded-md border pr-1.5 text-xs focus-visible:outline-2 focus-visible:-outline-offset-2",!i&&"py-1.5 pl-2"),children:[i?S.jsx("img",{src:e,alt:"",className:"h-8 w-12 shrink-0 object-contain",width:48,height:32,onError:()=>s(!0)}):null,o&&(i||o==="cosmos")?S.jsx(ch,{provider:o,className:Wt("h-3.5 w-3.5 shrink-0",o==="pinterest"&&"text-[#e60023]")}):null,!i||!o?S.jsx("span",{className:"max-w-40 truncate",children:d}):null]})},mX=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=ni(),l=fX(t);return l?S.jsx("div",{className:Wt("ph-no-capture flex min-w-0 flex-nowrap gap-1.5 overflow-x-auto pr-3 pb-2",i),"aria-label":"References",children:l.map(u=>{var h;const d=s?`?${new URLSearchParams({projectPath:s})}`:"",f=u.image&&n&&r?`/api/variants/${encodeURIComponent(n)}/${encodeURIComponent(r)}/references/${encodeURIComponent(u.id)}/image${d}`:void 0;return S.jsx(pX,{reference:u,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:e,reference_count:l.length})},`${u.id}:${((h=u.image)==null?void 0:h.hash)??""}:${f??""}`)})}):null},Yae=t=>{const e=t.pathname.split("/").filter(Boolean).map(decodeURIComponent),n=e[3];if(e[2]==="references")return{kind:"references"};if(e[2]!=="projects"||!n)return{kind:"library"};const r=e[4]==="variants"?e[5]:void 0,s=e[4]==="variants"?e[6]:void 0,i=new URLSearchParams(t.search);return r&&s&&i.get("edit")!=="1"?{kind:"preview",projectId:n,sessionId:r,variantId:s}:{kind:"workspace",projectId:n,sessionId:r,variantId:s}},Xae=t=>{if(t.kind==="references")return"/rivet/library/references";if(t.kind==="library"||!t.projectId)return"/rivet/library";const e=`/rivet/library/projects/${encodeURIComponent(t.projectId)}`;return t.sessionId&&t.variantId?`${e}/variants/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${t.kind==="workspace"?"?edit=1":""}`:e},gX=t=>{const e=new URLSearchParams(t),n=e.get("historySession"),r=e.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},Or=(t,e=String(t))=>t instanceof Error?t.message:e,pP=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,mP=A3,vX=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return mP(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],h=i==null?void 0:i[d];if(f===null)return null;const m=pP(f)||pP(h);return s[d][m]}),l=n&&Object.entries(n).reduce((d,f)=>{let[h,m]=f;return m===void 0||(d[h]=m),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:h,className:m,...v}=f;return Object.entries(v).every(x=>{let[_,w]=x;return Array.isArray(w)?w.includes({...i,...l}[_]):{...i,...l}[_]===w})?[...d,h,m]:d},[]);return mP(t,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},U3={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"}},B3=g.createContext(null);function op(){const t=g.useContext(B3);return t?t.classes:U3.pill}function yX(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function _X({children:t,defaultShape:e="pill"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{yX(()=>r(i))},[]);return S.jsx(B3.Provider,{value:{shape:n,setShape:s,classes:U3[n]},children:t})}const wX=vX(["group/button relative isolate inline-flex cursor-pointer items-center justify-center outline-none","transition-colors duration-80 motion-reduce:transition-none","disabled:pointer-events-none disabled:opacity-50","focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]"],{variants:{variant:{primary:"text-background",secondary:"text-foreground",tertiary:"text-foreground",ghost:"text-muted-foreground hover:text-foreground aria-expanded:text-foreground aria-pressed:text-foreground"},size:{default:"h-9 gap-1.5 px-4 text-[13px]",compact:"h-7 gap-1 px-3 text-[12px]",icon:"h-9 w-9 p-0 [&_svg]:h-4 [&_svg]:w-4","icon-compact":"h-7 w-7 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5"},iconLeft:{true:""},iconRight:{true:""}},compoundVariants:[{size:"compact",iconLeft:!0,className:"pl-2"},{size:"default",iconLeft:!0,className:"pl-3"},{size:"compact",iconRight:!0,className:"pr-2"},{size:"default",iconRight:!0,className:"pr-3"}],defaultVariants:{variant:"secondary",size:"default"}}),gP={default:16,compact:14},xX={primary:"[--btn-bg:var(--foreground)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-active/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",secondary:"[--btn-bg:var(--accent)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--accent)_80%,var(--background))] group-active/button:[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",tertiary:"bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover/button:bg-hover group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]",ghost:"bg-transparent shadow-[0_0_0_1px_transparent] group-hover/button:bg-hover group-hover/button:shadow-[0_0_0_1px_var(--hover)] group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--active)] group-aria-expanded/button:bg-active group-aria-expanded/button:shadow-[0_0_0_0px_var(--active)] group-aria-pressed/button:bg-active group-aria-pressed/button:shadow-[0_0_0_0px_var(--active)]"},W3=g.forwardRef(({className:t,variant:e,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:l,type:u="button",...d},f)=>{const h=e??"secondary",m=n??"default",v=m==="icon"||m==="icon-compact",x=m==="compact"||m==="icon-compact",_=x?gP.compact:gP.default,w=op();return S.jsxs("button",{...d,ref:f,type:u,disabled:o||r,"aria-busy":r||d["aria-busy"],className:Wt(wX({variant:h,size:m,iconLeft:!v&&!!s,iconRight:!v&&!!i}),w.button,t),children:[S.jsx("span",{"aria-hidden":!0,className:Wt("absolute inset-px rounded-[inherit] transition-[box-shadow,background-color] [transition-duration:180ms,80ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1),ease] group-active/button:[transition-duration:80ms,80ms] motion-reduce:transition-none",xX[h])}),S.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[S.jsxs("span",{className:Wt("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!v?S.jsx(s,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null,S.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:l}),i&&!v?S.jsx(i,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null]}),r?S.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:S.jsx("svg",{className:x?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:S.jsx("path",{d:"M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",stroke:"currentColor",strokeWidth:"1.125",strokeLinecap:"round",pathLength:"100",className:"motion-safe:animate-[spinner-move_2s_linear_infinite,spinner-dash_4s_ease-in-out_infinite]",style:{strokeDasharray:"15 85"}})})}):null]})]})});W3.displayName="Button";var bX=Object.defineProperty,Id=(t,e)=>bX(t,"name",{value:e,configurable:!0}),Z3=!!(typeof window<"u"&&window.document&&window.document.createElement);function Gt(t,e,{checkForDefaultPrevented:n=!0}={}){return Id(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}Id(Gt,"composeEventHandlers");function SX(t){var e;if(!Z3)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}Id(SX,"getOwnerWindow");function $w(t){if(!Z3)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Id($w,"getOwnerDocument");function q3(t,e=!1){const{activeElement:n}=$w(t);if(!(n!=null&&n.nodeName))return null;if(G3(n)&&n.contentDocument)return q3(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=$w(n).getElementById(r);if(s)return s}}return n}Id(q3,"getActiveElement");function G3(t){return t.tagName==="IFRAME"}Id(G3,"isFrame");var kX=Object.defineProperty,Kb=(t,e)=>kX(t,"name",{value:e,configurable:!0});function Fw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Kb(Fw,"setRef");function K3(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Fw(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():Fw(t[s],null)}}}}Kb(K3,"composeRefs");function Kt(...t){return g.useCallback(K3(...t),t)}Kb(Kt,"useComposedRefs");var EX=Object.defineProperty,Ks=(t,e)=>EX(t,"name",{value:e,configurable:!0});function CX(t,e){const n=g.createContext(e);n.displayName=t+"Context";const r=Ks(i=>{const{children:o,...l}=i,u=g.useMemo(()=>l,Object.values(l));return S.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,u=g.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Ks(s,"useContext"),[r,s]}Ks(CX,"createContext");function ao(t,e=[]){let n=[];function r(i,o){const l=g.createContext(o);l.displayName=i+"Context";const u=n.length;n=[...n,o];const d=Ks(h=>{var b;const{scope:m,children:v,...x}=h,_=((b=m==null?void 0:m[t])==null?void 0:b[u])||l,w=g.useMemo(()=>x,Object.values(x));return S.jsx(_.Provider,{value:w,children:v})},"Provider");d.displayName=i+"Provider";function f(h,m,v={}){var b;const{optional:x=!1}=v,_=((b=m==null?void 0:m[t])==null?void 0:b[u])||l,w=g.useContext(_);if(w)return w;if(o!==void 0)return o;if(!x)throw new Error(`\`${h}\` must be used within \`${i}\``)}return Ks(f,"useContext"),[d,f]}Ks(r,"createContext");const s=Ks(()=>{const i=n.map(o=>g.createContext(o));return Ks(function(l){const u=(l==null?void 0:l[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return s.scopeName=t,[r,Y3(s,...e)]}Ks(ao,"createContextScope");function Y3(...t){const e=t[0];if(t.length===1)return e;const n=Ks(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Ks(function(i){const o=r.reduce((l,{useScope:u,scopeName:d})=>{const h=u(i)[`__scope${d}`];return{...l,...h}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Ks(Y3,"composeContextScopes");var PX=Object.defineProperty,Os=(t,e)=>PX(t,"name",{value:e,configurable:!0});function Xa(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const u=[];s=rO(s),g.Children.forEach(s,m=>{var v;if(tO(m)){l=!0;const x=m;let _="child"in x.props?x.props.child:x.props.children;for(;Yb(_)&&typeof bg=="function";)_=bg(_._payload);o=AX(x,_),u.push((v=o==null?void 0:o.props)==null?void 0:v.children)}else u.push(m)}),o?o=g.cloneElement(o,void 0,u):!l&&g.Children.count(s)===1&&g.isValidElement(s)&&(o=s);const d=o?eO(o):void 0,f=Kt(r,d);if(!o){if(s||s===0)throw new Error(l?IX(t):RX(t));return s}const h=J3(i,o.props??{});return o.type!==g.Fragment&&(h.ref=r?f:d),g.cloneElement(o,h)});return e.displayName=`${t}.Slot`,e}Os(Xa,"createSlot");var X3=Symbol.for("radix.slottable");function Q3(t){const e=Os(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=X3,e}Os(Q3,"createSlottable");var AX=Os((t,e)=>"child"in t.props?g.isValidElement(e)?g.cloneElement(e,void 0,t.props.children(e.props.children)):null:g.isValidElement(e)?e:null,"getSlottableElementFromSlottable");function J3(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const u=i(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"?n[r]=[s,i].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=sO(i,s))}return{...t,...n}}Os(J3,"mergeProps");function eO(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)}Os(eO,"getElementRef");function tO(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===X3}Os(tO,"isSlottable");var TX=Symbol.for("react.lazy");function Yb(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===TX&&"_payload"in t&&nO(t._payload)}Os(Yb,"isLazyComponent");function nO(t){return typeof t=="object"&&t!==null&&"then"in t}Os(nO,"isPromiseLike");function rO(t){let e=t;for(;Yb(e)&&typeof bg=="function";)e=bg(e._payload);return e}Os(rO,"useUnwrappedLazy");function sO(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}Os(sO,"concatAriaDescribedby");var RX=Os(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),IX=Os(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),bg=Cd[" use ".trim().toString()],MX=Object.defineProperty,OX=(t,e)=>MX(t,"name",{value:e,configurable:!0}),LX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],An=LX.reduce((t,e)=>{const n=Xa(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:o,...l}=s,u=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function iO(t,e){t&&ip.flushSync(()=>t.dispatchEvent(e))}OX(iO,"dispatchDiscreteCustomEvent");var Lr=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},NX=Object.defineProperty,DX=(t,e)=>NX(t,"name",{value:e,configurable:!0}),vP=Cd[" useInsertionEffect ".trim().toString()];function Tc(t){const e=g.useRef(t);return typeof vP=="function"?vP(()=>{e.current=t}):Lr(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}DX(Tc,"useCallbackRef");var jX=Object.defineProperty,cr=(t,e)=>jX(t,"name",{value:e,configurable:!0}),Vw="dismissableLayer.update",$X="dismissableLayer.pointerDownOutside",FX="dismissableLayer.focusOutside",yP,oO=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Xb=g.forwardRef(cr(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...f}=e,h=g.useContext(oO),[m,v]=g.useState(null),x=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=g.useState({}),w=Kt(n,v),b=Array.from(h.layers),[k]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=k?b.indexOf(k):-1,P=m?b.indexOf(m):-1,T=h.layersWithOutsidePointerEventsDisabled.size>0,M=P>=C,I=g.useRef(!1),R=lO(D=>{o==null||o(D),u==null||u(D),D.defaultPrevented||d==null||d()},{ownerDocument:x,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(D=>{if(!(D instanceof Node))return!1;const q=[...h.branches].some(W=>W.contains(D));return M&&!q},[h.branches,M])}),L=cO(D=>{if(s&&I.current)return;const q=D.target;[...h.branches].some(G=>G.contains(q))||(l==null||l(D),u==null||u(D),D.defaultPrevented||d==null||d())},x),j=m?P===b.length-1:!1,F=Tc(D=>{D.key==="Escape"&&(i==null||i(D),!D.defaultPrevented&&d&&(D.preventDefault(),d()))});return g.useEffect(()=>{if(j)return x.addEventListener("keydown",F,{capture:!0}),()=>x.removeEventListener("keydown",F,{capture:!0})},[x,j,F]),g.useEffect(()=>{if(m)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(yP=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),Hw(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(m),h.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=yP))}},[m,x,r,h]),g.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),Hw())},[m,h]),g.useEffect(()=>{const D=cr(()=>_({}),"handleUpdate");return document.addEventListener(Vw,D),()=>document.removeEventListener(Vw,D)},[]),S.jsx(An.div,{...f,ref:w,style:{pointerEvents:T?M?"auto":"none":void 0,...e.style},onFocusCapture:Gt(e.onFocusCapture,L.onFocusCapture),onBlurCapture:Gt(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Gt(e.onPointerDownCapture,R.onPointerDownCapture)})},"DismissableLayer"));function aO(){const t=g.useContext(oO),[e,n]=g.useState(null);return g.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}cr(aO,"useDismissableLayerSurface");var VX=cr(()=>!0,"IS_TRUE");function lO(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=VX}=e,l=Tc(t),u=g.useRef(!1),d=g.useRef(!1),f=g.useRef(new Map),h=g.useRef(()=>{});return g.useEffect(()=>{function m(){d.current=!1,s.current=!1,f.current.clear()}cr(m,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}cr(v,"isOutsideInteractionIntercepted");function x(C){if(!d.current)return;const P=C.target;P instanceof Node&&[...i].some(M=>M.contains(P))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&h.current()},0)}cr(x,"handleInteractionCapture");function _(C){d.current&&f.current.set(C.type,!1)}cr(_,"handleInteractionBubble");const w=cr(C=>{if(C.target&&!u.current){let P=function(){n.removeEventListener("click",h.current);const M=v();m(),M||Qb($X,l,T,{discrete:!0})};if(cr(P,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",h.current),m(),u.current=!1;return}const T={originalEvent:C};d.current=!0,s.current=r&&C.button===0,f.current.clear(),!r||C.button!==0?P():(n.removeEventListener("click",h.current),h.current=P,n.addEventListener("click",h.current,{once:!0}))}else n.removeEventListener("click",h.current),m();u.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of b)n.addEventListener(C,x,!0),n.addEventListener(C,_);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",w),n.removeEventListener("click",h.current);for(const C of b)n.removeEventListener(C,x,!0),n.removeEventListener(C,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:cr(()=>u.current=!0,"onPointerDownCapture")}}cr(lO,"usePointerDownOutside");function cO(t,e=globalThis==null?void 0:globalThis.document){const n=Tc(t),r=g.useRef(!1);return g.useEffect(()=>{const s=cr(i=>{i.target&&!r.current&&Qb(FX,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:cr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:cr(()=>r.current=!1,"onBlurCapture")}}cr(cO,"useFocusOutside");function Hw(){const t=new CustomEvent(Vw);document.dispatchEvent(t)}cr(Hw,"dispatchUpdate");function Qb(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?iO(s,i):s.dispatchEvent(i)}cr(Qb,"handleAndDispatchCustomEvent");var HX=Object.defineProperty,Wn=(t,e)=>HX(t,"name",{value:e,configurable:!0}),x_="focusScope.autoFocusOnMount",b_="focusScope.autoFocusOnUnmount",_P={bubbles:!1,cancelable:!0},uO=g.forwardRef(Wn(function(e,n){const{loop:r=!1,trapped:s=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[d,f]=g.useState(null),h=Tc(o),m=Tc(l),v=g.useRef(null),x=Kt(n,f),_=g.useRef(i);g.useEffect(()=>{_.current=i});const w=g.useCallback(C=>{var P;return C?d!=null&&d.contains(C)?!0:!!((P=_.current)!=null&&P.some(T=>T.contains(C))):!1},[d]),b=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let C=function(I){if(b.paused||!d)return;const R=I.target;w(R)?v.current=R:Mo(v.current,{select:!0})},P=function(I){if(b.paused||!d)return;const R=I.relatedTarget;R!==null&&(w(R)||Mo(v.current,{select:!0}))},T=function(I){if(document.activeElement===document.body)for(const L of I)L.removedNodes.length>0&&Mo(d)};Wn(C,"handleFocusIn"),Wn(P,"handleFocusOut"),Wn(T,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",P);const M=new MutationObserver(T);return d&&M.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",P),M.disconnect()}}},[s,d,b.paused,w]),g.useEffect(()=>{if(d){wP.add(b);const C=document.activeElement;if(!d.contains(C)){const T=new CustomEvent(x_,_P);d.addEventListener(x_,h),d.dispatchEvent(T),T.defaultPrevented||(fO(vO(nS(d)),{select:!0}),document.activeElement===C&&Mo(d))}return()=>{d.removeEventListener(x_,h);const T=d.ownerDocument,M=CustomEvent;setTimeout(()=>{const I=new M(b_,_P);d.addEventListener(b_,m),d.dispatchEvent(I),I.defaultPrevented||Mo(C??T.body,{select:!0}),d.removeEventListener(b_,m),wP.remove(b)},0)}}},[d,h,m,b]);const k=g.useCallback(C=>{if(!r&&!s||b.paused)return;const P=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,T=document.activeElement;if(P&&T){const M=C.currentTarget,[I,R]=hO(M);I&&R?!C.shiftKey&&T===R?(C.preventDefault(),r&&Mo(I,{select:!0})):C.shiftKey&&T===I&&(C.preventDefault(),r&&Mo(R,{select:!0})):T===M&&C.preventDefault()}},[r,s,b.paused]);return S.jsx(An.div,{tabIndex:-1,...u,ref:x,onKeyDown:k})},"FocusScope")),dO=g.createContext(null);function Jb({registry:t,children:e}){return t?S.jsx(dO.Provider,{value:t,children:e}):e}Wn(Jb,"FocusScopeBranchProvider");function eS(){const[t,e]=g.useState([]),n=g.useMemo(()=>({add:Wn(r=>e(s=>s.includes(r)?s:[...s,r]),"add"),remove:Wn(r=>e(s=>s.filter(i=>i!==r)),"remove")}),[]);return{nodes:t,registry:n}}Wn(eS,"useFocusScopeBranchRegistry");function tS(t){const e=g.useContext(dO);g.useEffect(()=>{if(!(!t||!e))return e.add(t),()=>e.remove(t)},[t,e])}Wn(tS,"useFocusScopeBranch");function fO(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Mo(r,{select:e}),document.activeElement!==n)return}Wn(fO,"focusFirst");function hO(t){const e=nS(t),n=zw(e,t),r=zw(e.reverse(),t);return[n,r]}Wn(hO,"getTabbableEdges");function nS(t){const e=[],r=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Wn(s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)e.push(r.currentNode);return e}Wn(nS,"getTabbableCandidates");function zw(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):pO(r,{upTo:e})))return r}Wn(zw,"findVisible");function pO(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}Wn(pO,"isHidden");function mO(t){return t.tagName==="INPUT"&&typeof t.select=="function"}Wn(mO,"isSelectableInput");function Mo(t,{select:e=!1}={}){if(t&&t.focus){const r=(t.ownerDocument??document).activeElement;t.focus({preventScroll:!0}),t!==r&&mO(t)&&e&&t.select()}}Wn(Mo,"focus");var wP=gO();function gO(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Uw(t,e),t.unshift(e)},remove(e){var n;t=Uw(t,e),(n=t[0])==null||n.resume()}}}Wn(gO,"createFocusScopesStack");function Uw(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Wn(Uw,"arrayRemove");function vO(t){return t.filter(e=>e.tagName!=="A")}Wn(vO,"removeLinks");var zX=Object.defineProperty,UX=(t,e)=>zX(t,"name",{value:e,configurable:!0}),BX=Cd[" useId ".trim().toString()]||(()=>{}),WX=0;function eo(t){const[e,n]=g.useState(BX());return Lr(()=>{t||n(r=>r??String(WX++))},[t]),t||(e?`radix-${e}`:"")}UX(eo,"useId");const ZX=["top","right","bottom","left"],Qa=Math.min,Bo=Math.max,Sg=Math.round,$0=Math.floor,Wo=t=>({x:t,y:t}),qX={left:"right",right:"left",bottom:"top",top:"bottom"};function yO(t,e,n){return Bo(t,Qa(e,n))}function Ko(t,e){return typeof t=="function"?t(e):t}function Ja(t){return t.split("-")[0]}function Md(t){return t.split("-")[1]}function rS(t){return t==="x"?"y":"x"}function sS(t){return t==="y"?"height":"width"}function Yi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function iS(t){return rS(Yi(t))}function GX(t,e,n){n===void 0&&(n=!1);const r=Md(t),s=iS(t),i=sS(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=kg(o)),[o,kg(o)]}function KX(t){const e=kg(t);return[Bw(t),e,Bw(e)]}function Bw(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const xP=["left","right"],bP=["right","left"],YX=["top","bottom"],XX=["bottom","top"];function QX(t,e,n){switch(t){case"top":case"bottom":return n?e?bP:xP:e?xP:bP;case"left":case"right":return e?YX:XX;default:return[]}}function JX(t,e,n,r){const s=Md(t);let i=QX(Ja(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Bw)))),i}function kg(t){const e=Ja(t);return qX[e]+t.slice(e.length)}function eQ(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 _O(t){return typeof t!="number"?eQ(t):{top:t,right:t,bottom:t,left:t}}function Eg(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 SP(t,e,n){let{reference:r,floating:s}=t;const i=Yi(e),o=iS(e),l=sS(o),u=Ja(e),d=i==="y",f=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,m=r[l]/2-s[l]/2;let v;switch(u){case"top":v={x:f,y:r.y-s.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:h};break;case"left":v={x:r.x-s.width,y:h};break;default:v={x:r.x,y:r.y}}const x=Md(e);return x&&(v[o]+=m*(x==="end"?1:-1)*(n&&d?-1:1)),v}async function tQ(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:v=0}=Ko(e,t),x=_O(v),w=l[m?h==="floating"?"reference":"floating":h],b=Eg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),k=h==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),P=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},T=Eg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:C,strategy:u}):k);return{top:(b.top-T.top+x.top)/P.y,bottom:(T.bottom-b.bottom+x.bottom)/P.y,left:(b.left-T.left+x.left)/P.x,right:(T.right-b.right+x.right)/P.x}}const nQ=50,rQ=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:tQ},u=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:h}=SP(d,r,u),m=r,v=0;const x={};for(let _=0;_<i.length;_++){const w=i[_];if(!w)continue;const{name:b,fn:k}=w,{x:C,y:P,data:T,reset:M}=await k({x:f,y:h,initialPlacement:r,placement:m,strategy:s,middlewareData:x,rects:d,platform:l,elements:{reference:t,floating:e}});f=C??f,h=P??h,x[b]={...x[b],...T},M&&v<nQ&&(v++,typeof M=="object"&&(M.placement&&(m=M.placement),M.rects&&(d=M.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):M.rects),{x:f,y:h}=SP(d,m,u)),_=-1)}return{x:f,y:h,placement:m,strategy:s,middlewareData:x}},sQ=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=Ko(t,e)||{};if(d==null)return{};const h=_O(f),m={x:n,y:r},v=iS(s),x=sS(v),_=await o.getDimensions(d),w=v==="y",b=w?"top":"left",k=w?"bottom":"right",C=w?"clientHeight":"clientWidth",P=i.reference[x]+i.reference[v]-m[v]-i.floating[x],T=m[v]-i.reference[v],M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let I=M?M[C]:0;(!I||!await(o.isElement==null?void 0:o.isElement(M)))&&(I=l.floating[C]||i.floating[x]);const R=P/2-T/2,L=I/2-_[x]/2-1,j=Qa(h[b],L),F=Qa(h[k],L),D=I-_[x]-F,q=I/2-_[x]/2+R,W=yO(j,q,D),G=!u.arrow&&Md(s)!=null&&q!==W&&i.reference[x]/2-(q<j?j:F)-_[x]/2<0,H=G?q<j?q-j:q-D:0;return{[v]:m[v]+H,data:{[v]:W,centerOffset:q-W-H,...G&&{alignmentOffset:H}},reset:G}}}),iQ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:_=!0,...w}=Ko(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Ja(s),k=Yi(l),C=Ja(l)===l,P=await(u.isRTL==null?void 0:u.isRTL(d.floating)),T=m||(C||!_?[kg(l)]:KX(l)),M=x!=="none";!m&&M&&T.push(...JX(l,_,x,P));const I=[l,...T],R=await u.detectOverflow(e,w),L=[];let j=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&L.push(R[b]),h){const W=GX(s,o,P);L.push(R[W[0]],R[W[1]])}if(j=[...j,{placement:s,overflows:L}],!L.every(W=>W<=0)){var F,D;const W=(((F=i.flip)==null?void 0:F.index)||0)+1,G=I[W];if(G&&(!(h==="alignment"?k!==Yi(G):!1)||j.every(B=>Yi(B.placement)===k?B.overflows[0]>0:!0)))return{data:{index:W,overflows:j},reset:{placement:G}};let H=(D=j.filter(J=>J.overflows[0]<=0).sort((J,B)=>J.overflows[1]-B.overflows[1])[0])==null?void 0:D.placement;if(!H)switch(v){case"bestFit":{var q;const J=(q=j.filter(B=>{if(M){const Q=Yi(B.placement);return Q===k||Q==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(Q=>Q>0).reduce((Q,z)=>Q+z,0)]).sort((B,Q)=>B[1]-Q[1])[0])==null?void 0:q[0];J&&(H=J);break}case"initialPlacement":H=l;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function kP(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function EP(t){return ZX.some(e=>t[e]>=0)}const oQ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=Ko(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=kP(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:EP(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=kP(o,n.floating);return{data:{escapedOffsets:l,escaped:EP(l)}}}default:return{}}}}},wO=new Set(["left","top"]);async function aQ(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Ja(n),l=Md(n),u=Yi(n)==="y",d=wO.has(o)?-1:1,f=i&&u?-1:1,h=Ko(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof x=="number"&&(v=l==="end"?x*-1:x),u?{x:v*f,y:m*d}:{x:m*d,y:v*f}}const lQ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:l}=e,u=await aQ(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:o}}}}},cQ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:k=>{let{x:C,y:P}=k;return{x:C,y:P}}},...d}=Ko(t,e),f={x:n,y:r},h=await i.detectOverflow(e,d),m=Yi(s),v=rS(m);let x=f[v],_=f[m];const w=(k,C)=>yO(C+h[k==="y"?"top":"left"],C,C-h[k==="y"?"bottom":"right"]);o&&(x=w(v,x)),l&&(_=w(m,_));const b=u.fn({...e,[v]:x,[m]:_});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[v]:o,[m]:l}}}}}},uQ=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=Ko(t,e),m={x:s,y:i},v=Yi(o),x=rS(v);let _=m[x],w=m[v];const b=Ko(d,e),k=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(n=b.mainAxis)!=null?n:0,crossAxis:(r=b.crossAxis)!=null?r:0};if(f){const T=x==="y"?"height":"width",M=l.reference[x]-l.floating[T]+k.mainAxis,I=l.reference[x]+l.reference[T]-k.mainAxis;_<M?_=M:_>I&&(_=I)}if(h){var C,P;const T=x==="y"?"width":"height",M=wO.has(Ja(o)),I=l.reference[v]-l.floating[T]+(M&&((C=u.offset)==null?void 0:C[v])||0)+(M?0:k.crossAxis),R=l.reference[v]+l.reference[T]+(M?0:((P=u.offset)==null?void 0:P[v])||0)-(M?k.crossAxis:0);w<I?w=I:w>R&&(w=R)}return{[x]:_,[v]:w}}}},dQ=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...l}=Ko(t,e),u=await s.detectOverflow(e,l),d=Ja(n),f=Md(n),h=Yi(n)==="y",{width:m,height:v}=r.floating;let x,_;d==="top"||d==="bottom"?(x=d,_=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,x=f==="end"?"top":"bottom");const w=v-u.top-u.bottom,b=m-u.left-u.right,k=Qa(v-u[x],w),C=Qa(m-u[_],b),P=e.middlewareData.shift,T=!P;let M=k,I=C;P!=null&&P.enabled.x&&(I=b),P!=null&&P.enabled.y&&(M=w),T&&!f&&(h?I=m-2*Bo(u.left,u.right):M=v-2*Bo(u.top,u.bottom)),await o({...e,availableWidth:I,availableHeight:M});const R=await s.getDimensions(i.floating);return m!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function ev(){return typeof window<"u"}function Od(t){return xO(t)?(t.nodeName||"").toLowerCase():"#document"}function is(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Jo(t){var e;return(e=(xO(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function xO(t){return ev()?t instanceof Node||t instanceof is(t).Node:!1}function so(t){return ev()?t instanceof Element||t instanceof is(t).Element:!1}function ol(t){return ev()?t instanceof HTMLElement||t instanceof is(t).HTMLElement:!1}function CP(t){return!ev()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof is(t).ShadowRoot}function tv(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=io(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function fQ(t){return/^(table|td|th)$/.test(Od(t))}function nv(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const hQ=/transform|translate|scale|rotate|perspective|filter/,pQ=/paint|layout|strict|content/,Vl=t=>!!t&&t!=="none";let S_;function oS(t){const e=so(t)?io(t):t;return Vl(e.transform)||Vl(e.translate)||Vl(e.scale)||Vl(e.rotate)||Vl(e.perspective)||!aS()&&(Vl(e.backdropFilter)||Vl(e.filter))||hQ.test(e.willChange||"")||pQ.test(e.contain||"")}function mQ(t){let e=Rc(t);for(;ol(e)&&!Lh(e);){if(oS(e))return e;if(nv(e))return null;e=Rc(e)}return null}function aS(){return S_==null&&(S_=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),S_}function Lh(t){return/^(html|body|#document)$/.test(Od(t))}function io(t){return is(t).getComputedStyle(t)}function rv(t){return so(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Rc(t){if(Od(t)==="html")return t;const e=t.assignedSlot||t.parentNode||CP(t)&&t.host||Jo(t);return CP(e)?e.host:e}function bO(t){const e=Rc(t);return Lh(e)?(t.ownerDocument||t).body:ol(e)&&tv(e)?e:bO(e)}function Nh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=bO(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=is(s);if(i){const l=Ww(o);return e.concat(o,o.visualViewport||[],tv(s)?s:[],l&&n?Nh(l):[])}else return e.concat(s,Nh(s,[],n))}function Ww(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function SO(t){const e=io(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=ol(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=Sg(n)!==i||Sg(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function lS(t){return so(t)?t:t.contextElement}function Vu(t){const e=lS(t);if(!ol(e))return Wo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=SO(e);let o=(i?Sg(n.width):n.width)/r,l=(i?Sg(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const gQ=Wo(0);function kO(t){const e=is(t);return!aS()||!e.visualViewport?gQ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function vQ(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===is(t)}function Ic(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=lS(t);let o=Wo(1);e&&(r?so(r)&&(o=Vu(r)):o=Vu(t));const l=vQ(i,n,r)?kO(i):Wo(0);let u=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,f=s.width/o.x,h=s.height/o.y;if(i&&r){const m=is(i),v=so(r)?is(r):r;let x=m,_=Ww(x);for(;_&&v!==x;){const w=Vu(_),b=_.getBoundingClientRect(),k=io(_),C=b.left+(_.clientLeft+parseFloat(k.paddingLeft))*w.x,P=b.top+(_.clientTop+parseFloat(k.paddingTop))*w.y;u*=w.x,d*=w.y,f*=w.x,h*=w.y,u+=C,d+=P,x=is(_),_=Ww(x)}}return Eg({width:f,height:h,x:u,y:d})}function sv(t,e){const n=rv(t).scrollLeft;return e?e.left+n:Ic(Jo(t)).left+n}function EO(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-sv(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function yQ(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Jo(r),l=e?nv(e.floating):!1;if(r===o||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Wo(1);const f=Wo(0),h=ol(r);if((h||!i)&&((Od(r)!=="body"||tv(o))&&(u=rv(r)),h)){const v=Ic(r);d=Vu(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const m=o&&!h&&!i?EO(o,u):Wo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-u.scrollTop*d.y+f.y+m.y}}function _Q(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function wQ(t){const e=rv(t),n=t.ownerDocument.body,r=Bo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Bo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+sv(t);const o=-e.scrollTop;return io(n).direction==="rtl"&&(i+=Bo(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const xQ=25;function bQ(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=is(t),i=Jo(t),o=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const m=!aS()||e==="fixed";r?m||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,u=o.height,m&&(d=o.offsetLeft,f=o.offsetTop))}if(sv(i)<=0){const m=i.ownerDocument,v=m.body,x=getComputedStyle(v),_=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(i.clientWidth-v.clientWidth-_),b=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;b<=xQ&&(l-=b)}return{width:l,height:u,x:d,y:f}}function SQ(t,e){const n=Ic(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Vu(t),o=t.clientWidth*i.x,l=t.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:o,height:l,x:u,y:d}}function PP(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=bQ(t,n,e);else if(e==="document")r=wQ(Jo(t));else if(so(e))r=SQ(e,n);else{const s=kO(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Eg(r)}function kQ(t,e){const n=e.get(t);if(n)return n;let r=Nh(t,[],!1).filter(l=>so(l)&&Od(l)!=="body"),s=null;const i=io(t).position==="fixed";let o=i?Rc(t):t;for(;so(o)&&!Lh(o);){const l=io(o),u=oS(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(h=>h!==o):s=l,o=Rc(o)}return e.set(t,r),r}function EQ(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?nv(e)?[]:kQ(e,this._c):[].concat(n),r],l=PP(e,o[0],s);let u=l.top,d=l.right,f=l.bottom,h=l.left;for(let m=1;m<o.length;m++){const v=PP(e,o[m],s);u=Bo(v.top,u),d=Qa(v.right,d),f=Qa(v.bottom,f),h=Bo(v.left,h)}return{width:d-h,height:f-u,x:h,y:u}}function CQ(t){const{width:e,height:n}=SO(t);return{width:e,height:n}}function PQ(t,e,n){const r=ol(e),s=Jo(e),i=n==="fixed",o=Ic(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=Wo(0);if((r||!i)&&((Od(e)!=="body"||tv(s))&&(l=rv(e)),r)){const m=Ic(e,!0,i,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}!r&&s&&(u.x=sv(s));const d=s&&!r&&!i?EO(s,l):Wo(0),f=o.left+l.scrollLeft-u.x-d.x,h=o.top+l.scrollTop-u.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function k_(t){return io(t).position==="static"}function AP(t,e){if(!ol(t)||io(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Jo(t)===n&&(n=n.ownerDocument.body),n}function CO(t,e){const n=is(t);if(nv(t))return n;if(!ol(t)){let s=Rc(t);for(;s&&!Lh(s);){if(so(s)&&!k_(s))return s;s=Rc(s)}return n}let r=AP(t,e);for(;r&&fQ(r)&&k_(r);)r=AP(r,e);return r&&Lh(r)&&k_(r)&&!oS(r)?n:r||mQ(t)||n}const AQ=async function(t){const e=this.getOffsetParent||CO,n=this.getDimensions,r=await n(t.floating);return{reference:PQ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function TQ(t){return io(t).direction==="rtl"}const RQ={convertOffsetParentRelativeRectToViewportRelativeRect:yQ,getDocumentElement:Jo,getClippingRect:EQ,getOffsetParent:CO,getElementRects:AQ,getClientRects:_Q,getDimensions:CQ,getScale:Vu,isElement:so,isRTL:TQ};function PO(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function IQ(t,e,n){let r=null,s;const i=Jo(t);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function l(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),o();const m=t.getBoundingClientRect(),{left:v,top:x,width:_,height:w}=m;if(f||e(),!_||!w)return;const b=$0(x),k=$0(i.clientWidth-(v+_)),C=$0(i.clientHeight-(x+w)),P=$0(v),M={rootMargin:-b+"px "+-k+"px "+-C+"px "+-P+"px",threshold:Bo(0,Qa(1,h))||1};let I=!0;function R(L){const j=L[0].intersectionRatio;if(!PO(m,t.getBoundingClientRect()))return l();if(j!==h){if(!I)return l();j?l(!1,j):s=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(R,{...M,root:i.ownerDocument})}catch{r=new IntersectionObserver(R,M)}r.observe(t)}const u=is(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),o()}}function MQ(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=lS(t),f=s||i?[...d?Nh(d):[],...e?Nh(e):[]]:[];f.forEach(b=>{s&&b.addEventListener("scroll",n),i&&b.addEventListener("resize",n)});const h=d&&l?IQ(d,n,i):null;let m=-1,v=null;o&&(v=new ResizeObserver(b=>{let[k]=b;k&&k.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(e)})),n()}),d&&!u&&v.observe(d),e&&v.observe(e));let x,_=u?Ic(t):null;u&&w();function w(){const b=Ic(t);_&&!PO(_,b)&&n(),_=b,x=requestAnimationFrame(w)}return n(),()=>{var b;f.forEach(k=>{s&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),h==null||h(),(b=v)==null||b.disconnect(),v=null,u&&cancelAnimationFrame(x)}}const OQ=lQ,LQ=cQ,NQ=iQ,DQ=dQ,jQ=oQ,TP=sQ,$Q=uQ,FQ=(t,e,n)=>{const r=new Map,s=n??{},i={...RQ,...s.platform,_c:r};return rQ(t,e,{...s,platform:i})};var VQ=typeof document<"u",HQ=function(){},vm=VQ?g.useLayoutEffect:HQ;function Cg(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(!Cg(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)&&!Cg(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function AO(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function RP(t,e){const n=AO(t);return Math.round(e*n)/n}function E_(t){const e=g.useRef(t);return vm(()=>{e.current=t}),e}function zQ(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[f,h]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=g.useState(r);Cg(m,r)||v(r);const[x,_]=g.useState(null),[w,b]=g.useState(null),k=g.useCallback(B=>{B!==M.current&&(M.current=B,_(B))},[]),C=g.useCallback(B=>{B!==I.current&&(I.current=B,b(B))},[]),P=i||x,T=o||w,M=g.useRef(null),I=g.useRef(null),R=g.useRef(f),L=u!=null,j=E_(u),F=E_(s),D=E_(d),q=g.useCallback(()=>{if(!M.current||!I.current)return;const B={placement:e,strategy:n,middleware:m};F.current&&(B.platform=F.current),FQ(M.current,I.current,B).then(Q=>{const z={...Q,isPositioned:D.current!==!1};W.current&&!Cg(R.current,z)&&(R.current=z,ip.flushSync(()=>{h(z)}))})},[m,e,n,F,D]);vm(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(B=>({...B,isPositioned:!1})))},[d]);const W=g.useRef(!1);vm(()=>(W.current=!0,()=>{W.current=!1}),[]),vm(()=>{if(P&&(M.current=P),T&&(I.current=T),P&&T){if(j.current)return j.current(P,T,q);q()}},[P,T,q,j,L]);const G=g.useMemo(()=>({reference:M,floating:I,setReference:k,setFloating:C}),[k,C]),H=g.useMemo(()=>({reference:P,floating:T}),[P,T]),J=g.useMemo(()=>{const B={position:n,left:0,top:0};if(!H.floating)return B;const Q=RP(H.floating,f.x),z=RP(H.floating,f.y);return l?{...B,transform:"translate("+Q+"px, "+z+"px)",...AO(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:z}},[n,l,H.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:q,refs:G,elements:H,floatingStyles:J}),[f,q,G,H,J])}const UQ=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?TP({element:r.current,padding:s}).fn(n):{}:r?TP({element:r,padding:s}).fn(n):{}}}},BQ=(t,e)=>{const n=OQ(t);return{name:n.name,fn:n.fn,options:[t,e]}},WQ=(t,e)=>{const n=LQ(t);return{name:n.name,fn:n.fn,options:[t,e]}},ZQ=(t,e)=>({fn:$Q(t).fn,options:[t,e]}),qQ=(t,e)=>{const n=NQ(t);return{name:n.name,fn:n.fn,options:[t,e]}},GQ=(t,e)=>{const n=DQ(t);return{name:n.name,fn:n.fn,options:[t,e]}},KQ=(t,e)=>{const n=jQ(t);return{name:n.name,fn:n.fn,options:[t,e]}},YQ=(t,e)=>{const n=UQ(t);return{name:n.name,fn:n.fn,options:[t,e]}};var XQ=Object.defineProperty,QQ=(t,e)=>XQ(t,"name",{value:e,configurable:!0});function cS(t){const[e,n]=g.useState(void 0);return Lr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});let r=0;const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=t.offsetWidth,u=t.offsetHeight;n({width:l,height:u})})});return s.observe(t,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}else n(void 0)},[t]),e}QQ(cS,"useSize");var JQ=Object.defineProperty,Ba=(t,e)=>JQ(t,"name",{value:e,configurable:!0}),IP={Partial:"partial"},MP={Optimized:"optimized",Always:"always"},TO="Popper",[RO,iv]=ao(TO),[eJ,IO]=RO(TO),MO=Ba(t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null),[i,o]=g.useState(void 0);return S.jsx(eJ,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),tJ="PopperAnchor",OO=g.forwardRef(Ba(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=IO(tJ,r),l=g.useRef(null),u=o.onAnchorChange,d=g.useCallback(_=>{l.current=_,_&&u(_)},[u]),f=Kt(n,d),h=g.useRef(null);g.useEffect(()=>{if(!s)return;const _=h.current;h.current=s.current,_!==h.current&&u(h.current)});const m=o.placementState&&ov(o.placementState),v=m==null?void 0:m[0],x=m==null?void 0:m[1];return s?null:S.jsx(An.div,{"data-radix-popper-side":v,"data-radix-popper-align":x,...i,ref:f})},"PopperAnchor")),LO="PopperContent",[nJ,Qae]=RO(LO),NO=g.forwardRef(Ba(function(e,n){var re,Ce,Fe,ke,dt,Lt,sn;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:m=IP.Partial,hideWhenDetached:v=!1,updatePositionStrategy:x=MP.Optimized,onPlaced:_,...w}=e,b=IO(LO,r),[k,C]=g.useState(null),P=Kt(n,C),[T,M]=g.useState(null),I=cS(T),R=(I==null?void 0:I.width)??0,L=(I==null?void 0:I.height)??0,j=s+(o!=="center"?"-"+o:""),F=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},D=Array.isArray(f)?f:[f],q=D.length>0,W={padding:F,boundary:D.filter(DO),altBoundary:q},{refs:G,floatingStyles:H,placement:J,isPositioned:B,middlewareData:Q}=zQ({strategy:"fixed",placement:j,whileElementsMounted:Ba((...jt)=>MQ(...jt,{animationFrame:x===MP.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[BQ({mainAxis:i+L,alignmentAxis:l}),d&&WQ({mainAxis:!0,crossAxis:!1,...m===IP.Partial?{limiter:ZQ()}:{},...W}),d&&qQ({...W}),GQ({...W,apply:Ba(({elements:jt,rects:pt,availableWidth:vn,availableHeight:Le})=>{const{width:lt,height:Te}=pt.reference,Je=jt.floating.style;Je.setProperty("--radix-popper-available-width",`${vn}px`),Je.setProperty("--radix-popper-available-height",`${Le}px`),Je.setProperty("--radix-popper-anchor-width",`${lt}px`),Je.setProperty("--radix-popper-anchor-height",`${Te}px`)},"apply")}),T&&YQ({element:T,padding:u}),rJ({arrowWidth:R,arrowHeight:L}),v&&KQ(q?{strategy:"referenceHidden",...W}:{strategy:"referenceHidden",padding:W.padding,altBoundary:W.altBoundary})]}),z=b.setPlacementState;Lr(()=>(z(J),()=>{z(void 0)}),[J,z]);const[N,Y]=ov(J),oe=Tc(_);Lr(()=>{B&&(oe==null||oe())},[B,oe]);const ne=(re=Q.arrow)==null?void 0:re.x,ie=(Ce=Q.arrow)==null?void 0:Ce.y,de=((Fe=Q.arrow)==null?void 0:Fe.centerOffset)!==0,[ge,ce]=g.useState();return Lr(()=>{k&&ce(window.getComputedStyle(k).zIndex)},[k]),S.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:B?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(ke=Q.transformOrigin)==null?void 0:ke.x,(dt=Q.transformOrigin)==null?void 0:dt.y].join(" "),...((Lt=Q.hide)==null?void 0:Lt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(nJ,{scope:r,placedSide:N,placedAlign:Y,onArrowChange:M,arrowX:ne,arrowY:ie,shouldHideArrow:de,children:S.jsx(An.div,{"data-side":N,"data-align":Y,...w,ref:P,style:{...w.style,animation:B?(sn=w.style)==null?void 0:sn.animation:"none"}})})})},"PopperContent"));function DO(t){return t!==null}Ba(DO,"isNotNull");var rJ=Ba(t=>({name:"transformOrigin",options:t,fn(e){var w,b,k;const{placement:n,rects:r,middlewareData:s}=e,o=((w=s.arrow)==null?void 0:w.centerOffset)!==0,l=o?0:t.arrowWidth,u=o?0:t.arrowHeight,[d,f]=ov(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,v=(((k=s.arrow)==null?void 0:k.y)??0)+u/2;let x="",_="";return d==="bottom"?(x=o?h:`${m}px`,_=`${-u}px`):d==="top"?(x=o?h:`${m}px`,_=`${r.floating.height+u}px`):d==="right"?(x=`${-u}px`,_=o?h:`${v}px`):d==="left"&&(x=`${r.floating.width+u}px`,_=o?h:`${v}px`),{data:{x,y:_}}}}),"transformOrigin");function ov(t){const[e,n="center"]=t.split("-");return[e,n]}Ba(ov,"getSideAndAlignFromPlacement");var sJ=Object.defineProperty,iJ=(t,e)=>sJ(t,"name",{value:e,configurable:!0}),uS=g.forwardRef(iJ(function(e,n){var u;const{container:r,...s}=e,[i,o]=g.useState(!1);Lr(()=>o(!0),[]);const l=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?ip.createPortal(S.jsx(An.div,{...s,ref:n}),l):null},"Portal")),oJ=Object.defineProperty,Yo=(t,e)=>oJ(t,"name",{value:e,configurable:!0});function jO(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}Yo(jO,"useStateMachine");var al=Yo(t=>{const{present:e,children:n}=t,r=$O(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=FO(r.ref,VO(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null},"Presence");function $O(t){const[e,n]=g.useState(),r=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),o=g.useRef(void 0),l=t?"mounted":"unmounted",[u,d]=jO(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{u==="mounted"?(i.current=o.current??Cu(r.current),o.current=void 0):i.current="none"},[u]),Lr(()=>{const f=r.current,h=s.current;if(h!==t){const v=i.current,x=Cu(f);t?(o.current=x,d("MOUNT")):x==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&v!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Lr(()=>{if(e){let f;const h=e.ownerDocument.defaultView??window,m=Yo(x=>{const w=Cu(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&w&&(d("ANIMATION_END"),!s.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",f=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},"handleAnimationEnd"),v=Yo(x=>{x.target===e&&(i.current=Cu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{h.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:g.useCallback(f=>{if(f){const h=getComputedStyle(f);r.current=h,o.current=Cu(h)}else r.current=null;n(f)},[])}}Yo($O,"usePresence");function Zw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Yo(Zw,"setRef");function FO(...t){const e=g.useRef(t);return e.current=t,g.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=Zw(o,n);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<i.length;o++){const l=i[o];typeof l=="function"?l():Zw(r[o],null)}}},[])}Yo(FO,"useStableComposedRefs");function Cu(t){return(t==null?void 0:t.animationName)||"none"}Yo(Cu,"getAnimationName");function VO(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)}Yo(VO,"getElementRef");var aJ=Object.defineProperty,lJ=(t,e)=>aJ(t,"name",{value:e,configurable:!0}),OP=Cd[" useEffectEvent ".trim().toString()],LP=Cd[" useInsertionEffect ".trim().toString()];function HO(t){if(typeof OP=="function")return OP(t);const e=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof LP=="function"?LP(()=>{e.current=t}):Lr(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}lJ(HO,"useEffectEvent");var cJ=Object.defineProperty,ap=(t,e)=>cJ(t,"name",{value:e,configurable:!0}),uJ=Cd[" useInsertionEffect ".trim().toString()]||Lr;function ll({prop:t,defaultProp:e,onChange:n=ap(()=>{},"onChange"),caller:r}){const[s,i,o]=zO({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s,d=g.useCallback(f=>{var h;if(l){const m=UO(f)?f(t):f;m!==t&&((h=o.current)==null||h.call(o,m))}else i(f)},[l,t,i,o]);return[u,d]}ap(ll,"useControllableState");function zO({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return uJ(()=>{i.current=e},[e]),g.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}ap(zO,"useUncontrolledState");function UO(t){return typeof t=="function"}ap(UO,"isFunction");var NP=Symbol("RADIX:SYNC_STATE");function dJ(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,u=s!==void 0,d=HO(o),f=[{...n,state:i}];r&&f.push(r);const[h,m]=g.useReducer((w,b)=>{if(b.type===NP)return{...w,state:b.state};const k=t(w,b);return u&&!Object.is(k.state,w.state)&&d(k.state),k},...f),v=h.state,x=g.useRef(v);g.useEffect(()=>{x.current!==v&&(x.current=v,u||d(v))},[v,x,u]);const _=g.useMemo(()=>s!==void 0?{...h,state:s}:h,[h,s]);return g.useEffect(()=>{u&&!Object.is(s,h.state)&&m({type:NP,state:s})},[s,h.state,u]),[_,m]}ap(dJ,"useControllableStateReducer");var fJ=Object.defineProperty,hJ=(t,e)=>fJ(t,"name",{value:e,configurable:!0}),pJ=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"}),mJ=g.forwardRef(hJ(function(e,n){return S.jsx(An.span,{...e,ref:n,style:{...pJ,...e.style}})},"VisuallyHidden")),gJ=Object.defineProperty,tr=(t,e)=>gJ(t,"name",{value:e,configurable:!0}),[dS,Jae]=ao("Tooltip",[iv]),fS=iv(),vJ="TooltipProvider",yJ=700,qw="tooltip.open",[_J,hS]=dS(vJ),wJ=tr(t=>{const{__scopeTooltip:e,delayDuration:n=yJ,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=g.useRef(!0),l=g.useRef(!1),u=g.useRef(0);return g.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),S.jsx(_J,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(u.current),o.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),Gw="Tooltip",[xJ,lp]=dS(Gw),bJ=tr(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=hS(Gw,t.__scopeTooltip),d=fS(e),[f,h]=g.useState(null),[m,v]=g.useState(void 0),x=eo(),_=g.useRef(0),w=o??u.disableHoverableContent,b=l??u.delayDuration,k=g.useRef(!1),[C,P]=ll({prop:r,defaultProp:s??!1,onChange:tr(j=>{j?(u.onOpen(),document.dispatchEvent(new CustomEvent(qw))):u.onClose(),i==null||i(j)},"onChange"),caller:Gw}),T=g.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),M=g.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k.current=!1,P(!0)},[P]),I=g.useCallback(()=>{window.clearTimeout(_.current),_.current=0,P(!1)},[P]),R=g.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{k.current=!0,P(!0),_.current=0},b)},[b,P]);g.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const L=m??x;return S.jsx(MO,{...d,children:S.jsx(xJ,{scope:e,contentId:L,setContentId:v,open:C,stateAttribute:T,trigger:f,onTriggerChange:h,onTriggerEnter:g.useCallback(()=>{u.isOpenDelayedRef.current?R():M()},[u.isOpenDelayedRef,R,M]),onTriggerLeave:g.useCallback(()=>{w?I():(window.clearTimeout(_.current),_.current=0)},[I,w]),onOpen:M,onClose:I,disableHoverableContent:w,children:n})})},"Tooltip"),DP="TooltipTrigger",SJ=g.forwardRef(tr(function(e,n){const{__scopeTooltip:r,"aria-describedby":s,...i}=e,o=lp(DP,r),l=hS(DP,r),u=fS(r),d=g.useRef(null),f=Kt(n,d,o.onTriggerChange),h=g.useRef(!1),m=g.useRef(!1),v=g.useCallback(()=>h.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),S.jsx(OO,{asChild:!0,...u,children:S.jsx(An.button,{"aria-describedby":o.open?QO(s,o.contentId):s,"data-state":o.stateAttribute,...i,ref:f,onPointerMove:Gt(e.onPointerMove,x=>{x.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:Gt(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:Gt(e.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Gt(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:Gt(e.onBlur,o.onClose),onClick:Gt(e.onClick,o.onClose)})})},"TooltipTrigger")),BO="TooltipPortal",[kJ,EJ]=dS(BO,{forceMount:void 0}),CJ=tr(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=lp(BO,e);return S.jsx(kJ,{scope:e,forceMount:n,children:S.jsx(al,{present:n||i.open,children:S.jsx(uS,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),Dh="TooltipContent",PJ=g.forwardRef(tr(function(e,n){const r=EJ(Dh,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=lp(Dh,e.__scopeTooltip);return S.jsx(al,{present:s||l.open,children:l.disableHoverableContent?S.jsx(WO,{side:i,...o,ref:n}):S.jsx(AJ,{side:i,...o,ref:n})})},"TooltipContent")),AJ=g.forwardRef(tr(function(e,n){const r=lp(Dh,e.__scopeTooltip),s=hS(Dh,e.__scopeTooltip),i=g.useRef(null),o=Kt(n,i),[l,u]=g.useState(null),{trigger:d,onClose:f}=r,h=i.current,{onPointerInTransitChange:m}=s,v=g.useCallback(()=>{u(null),m(!1)},[m]),x=g.useCallback((_,w)=>{const b=_.currentTarget,k={x:_.clientX,y:_.clientY},C=ZO(k,b.getBoundingClientRect()),P=qO(k,C),T=GO(w.getBoundingClientRect()),M=YO([...P,...T]);u(M),m(!0)},[m]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(d&&h){const _=tr(b=>x(b,h),"handleTriggerLeave"),w=tr(b=>x(b,d),"handleContentLeave");return d.addEventListener("pointerleave",_),h.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",_),h.removeEventListener("pointerleave",w)}}},[d,h,x,v]),g.useEffect(()=>{if(l){const _=tr(w=>{const b=w.target,k={x:w.clientX,y:w.clientY},C=(d==null?void 0:d.contains(b))||(h==null?void 0:h.contains(b)),P=!KO(k,l);C?v():P&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,h,l,f,v]),S.jsx(WO,{...e,ref:o})},"TooltipContentHoverable")),TJ=Q3("TooltipContent"),WO=g.forwardRef(tr(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=lp(Dh,r),h=fS(r),{onClose:m}=f,[v,x]=g.useState(null),_=Kt(n,x);tS(v),g.useEffect(()=>(document.addEventListener(qw,m),()=>document.removeEventListener(qw,m)),[m]),g.useEffect(()=>{if(f.trigger){const b=tr(k=>{k.target instanceof Node&&k.target.contains(f.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[f.trigger,m]);const{setContentId:w}=f;return Lr(()=>(w(o),()=>{w(void 0)}),[o,w]),S.jsx(Xb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:b=>b.preventDefault(),onDismiss:m,children:S.jsxs(NO,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...h,...d,ref:_,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(TJ,{children:s}),i?S.jsx(mJ,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function ZO(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")}}tr(ZO,"getExitSideFromRect");function qO(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}tr(qO,"getPaddedExitPoints");function GO(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}]}tr(GO,"getPointsFromRect");function KO(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],u=e[o],d=l.x,f=l.y,h=u.x,m=u.y;f>r!=m>r&&n<(h-d)*(r-f)/(m-f)+d&&(s=!s)}return s}tr(KO,"isPointInPolygon");function YO(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),XO(e)}tr(YO,"getHull");function XO(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}tr(XO,"getHullPresorted");function QO(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}tr(QO,"concatAriaDescribedby");const uh={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},JO=g.createContext(null);function e9({value:t,children:e}){return S.jsx(JO.Provider,{value:t,children:e})}function RJ(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function pS({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[u,d]=g.useState(!1),f=o!==void 0?o:u,[h,m]=g.useState(!1),v=op(),x=g.useContext(JO);g.useEffect(()=>{f&&m(!0)},[f]);const _=()=>{f||m(!1)},w=RJ(n);return S.jsx(wJ,{delayDuration:s,children:S.jsxs(bJ,{open:f,onOpenChange:b=>{d(b),l==null||l(b)},children:[S.jsx(SJ,{asChild:!0,children:e}),h&&S.jsx(CJ,{forceMount:!0,container:x??void 0,children:S.jsx(PJ,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(Uo.div,{className:Wt("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",v.bg,i),style:{fontVariationSettings:uh.medium},initial:{opacity:0,scale:.8,...w},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const to=g.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=S.jsx(W3,{ref:r,...n});return t?S.jsx(pS,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:t}),e?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:e}):null]}),children:s}):s});to.displayName="Button";var IJ=Object.defineProperty,mS=(t,e)=>IJ(t,"name",{value:e,configurable:!0}),F0=0,ji=null;function MJ(t){return av(),t.children}mS(MJ,"FocusGuards");function av(){g.useEffect(()=>{ji||(ji={start:Kw(),end:Kw()});const{start:t,end:e}=ji;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),F0++,()=>{F0===1&&(ji==null||ji.start.remove(),ji==null||ji.end.remove(),ji=null),F0=Math.max(0,F0-1)}},[])}mS(av,"useFocusGuards");function Kw(){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}mS(Kw,"createFocusGuard");var qi=function(){return qi=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},qi.apply(this,arguments)};function t9(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 OJ(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 ym="right-scroll-bar-position",_m="width-before-scroll-bar",LJ="with-scroll-bars-hidden",NJ="--removed-body-scroll-bar-size";function C_(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function DJ(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 jJ=typeof window<"u"?g.useLayoutEffect:g.useEffect,jP=new WeakMap;function $J(t,e){var n=DJ(null,function(r){return t.forEach(function(s){return C_(s,r)})});return jJ(function(){var r=jP.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||C_(l,null)}),i.forEach(function(l){s.has(l)||C_(l,o)})}jP.set(n,t)},[t]),n}function FJ(t){return t}function VJ(t,e){e===void 0&&(e=FJ);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var u=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function HJ(t){t===void 0&&(t={});var e=VJ(null);return e.options=qi({async:!0,ssr:!1},t),e}var n9=function(t){var e=t.sideCar,n=t9(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,qi({},n))};n9.isSideCarExport=!0;function zJ(t,e){return t.useMedium(e),n9}var r9=HJ(),P_=function(){},lv=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:P_,onWheelCapture:P_,onTouchMoveCapture:P_}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,h=t.shards,m=t.sideCar,v=t.noRelative,x=t.noIsolation,_=t.inert,w=t.allowPinchZoom,b=t.as,k=b===void 0?"div":b,C=t.gapMode,P=t9(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=m,M=$J([n,e]),I=qi(qi({},P),s);return g.createElement(g.Fragment,null,f&&g.createElement(T,{sideCar:r9,removeScrollBar:d,shards:h,noRelative:v,noIsolation:x,inert:_,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:C}),o?g.cloneElement(g.Children.only(l),qi(qi({},I),{ref:M})):g.createElement(k,qi({},I,{className:u,ref:M}),l))});lv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};lv.classNames={fullWidth:_m,zeroRight:ym};var UJ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BJ(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=UJ();return e&&t.setAttribute("nonce",e),t}function WJ(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function ZJ(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var qJ=function(){var t=0,e=null;return{add:function(n){t==0&&(e=BJ())&&(WJ(e,n),ZJ(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},GJ=function(){var t=qJ();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},s9=function(){var t=GJ(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},KJ={left:0,top:0,right:0,gap:0},A_=function(t){return parseInt(t||"",10)||0},YJ=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[A_(n),A_(r),A_(s)]},XJ=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return KJ;var e=YJ(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])}},QJ=s9(),Hu="data-scroll-locked",JJ=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
72
- .`.concat(LJ,` {
73
- overflow: hidden `).concat(r,`;
74
- padding-right: `).concat(l,"px ").concat(r,`;
75
- }
76
- body[`).concat(Hu,`] {
77
- overflow: hidden `).concat(r,`;
78
- overscroll-behavior: contain;
79
- `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
80
- padding-left: `.concat(s,`px;
81
- padding-top: `).concat(i,`px;
82
- padding-right: `).concat(o,`px;
83
- margin-left:0;
84
- margin-top:0;
85
- margin-right: `).concat(l,"px ").concat(r,`;
86
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
87
- }
88
-
89
- .`).concat(ym,` {
90
- right: `).concat(l,"px ").concat(r,`;
91
- }
92
-
93
- .`).concat(_m,` {
94
- margin-right: `).concat(l,"px ").concat(r,`;
95
- }
96
-
97
- .`).concat(ym," .").concat(ym,` {
98
- right: 0 `).concat(r,`;
99
- }
100
-
101
- .`).concat(_m," .").concat(_m,` {
102
- margin-right: 0 `).concat(r,`;
103
- }
104
-
105
- body[`).concat(Hu,`] {
106
- `).concat(NJ,": ").concat(l,`px;
107
- }
108
- `)},$P=function(){var t=parseInt(document.body.getAttribute(Hu)||"0",10);return isFinite(t)?t:0},eee=function(){g.useEffect(function(){return document.body.setAttribute(Hu,($P()+1).toString()),function(){var t=$P()-1;t<=0?document.body.removeAttribute(Hu):document.body.setAttribute(Hu,t.toString())}},[])},tee=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;eee();var i=g.useMemo(function(){return XJ(s)},[s]);return g.createElement(QJ,{styles:JJ(i,!e,s,n?"":"!important")})},Yw=!1;if(typeof window<"u")try{var V0=Object.defineProperty({},"passive",{get:function(){return Yw=!0,!0}});window.addEventListener("test",V0,V0),window.removeEventListener("test",V0,V0)}catch{Yw=!1}var yu=Yw?{passive:!1}:!1,nee=function(t){return t.tagName==="TEXTAREA"},i9=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!nee(t)&&n[e]==="visible")},ree=function(t){return i9(t,"overflowY")},see=function(t){return i9(t,"overflowX")},FP=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=o9(t,r);if(s){var i=a9(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},iee=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},oee=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},o9=function(t,e){return t==="v"?ree(e):see(e)},a9=function(t,e){return t==="v"?iee(e):oee(e)},aee=function(t,e){return t==="h"&&e==="rtl"?-1:1},lee=function(t,e,n,r,s){var i=aee(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,u=e.contains(l),d=!1,f=o>0,h=0,m=0;do{if(!l)break;var v=a9(t,l),x=v[0],_=v[1],w=v[2],b=_-w-i*x;(x||b)&&o9(t,l)&&(h+=b,m+=x);var k=l.parentNode;l=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(h)<1||!f&&Math.abs(m)<1)&&(d=!0),d},H0=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},VP=function(t){return[t.deltaX,t.deltaY]},HP=function(t){return t&&"current"in t?t.current:t},cee=function(t,e){return t[0]===e[0]&&t[1]===e[1]},uee=function(t){return`
109
- .block-interactivity-`.concat(t,` {pointer-events: none;}
110
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
111
- `)},dee=0,_u=[];function fee(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(dee++)[0],i=g.useState(s9)[0],o=g.useRef(t);g.useEffect(function(){o.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=OJ([t.lockRef.current],(t.shards||[]).map(HP),!0).filter(Boolean);return _.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=g.useCallback(function(_,w){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var b=H0(_),k=n.current,C="deltaX"in _?_.deltaX:k[0]-b[0],P="deltaY"in _?_.deltaY:k[1]-b[1],T,M=_.target,I=Math.abs(C)>Math.abs(P)?"h":"v";if("touches"in _&&I==="h"&&M.type==="range")return!1;var R=window.getSelection(),L=R&&R.anchorNode,j=L?L===M||L.contains(M):!1;if(j)return!1;var F=FP(I,M);if(!F)return!0;if(F?T=I:(T=I==="v"?"h":"v",F=FP(I,M)),!F)return!1;if(!r.current&&"changedTouches"in _&&(C||P)&&(r.current=T),!T)return!0;var D=r.current||T;return lee(D,w,_,D==="h"?C:P)},[]),u=g.useCallback(function(_){var w=_;if(!(!_u.length||_u[_u.length-1]!==i)){var b="deltaY"in w?VP(w):H0(w),k=e.current.filter(function(T){return T.name===w.type&&(T.target===w.target||w.target===T.shadowParent)&&cee(T.delta,b)})[0];if(k&&k.should){w.cancelable&&w.preventDefault();return}if(!k){var C=(o.current.shards||[]).map(HP).filter(Boolean).filter(function(T){return T.contains(w.target)}),P=C.length>0?l(w,C[0]):!o.current.noIsolation;P&&w.cancelable&&w.preventDefault()}}},[]),d=g.useCallback(function(_,w,b,k){var C={name:_,delta:w,target:b,should:k,shadowParent:hee(b)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(P){return P!==C})},1)},[]),f=g.useCallback(function(_){n.current=H0(_),r.current=void 0},[]),h=g.useCallback(function(_){d(_.type,VP(_),_.target,l(_,t.lockRef.current))},[]),m=g.useCallback(function(_){d(_.type,H0(_),_.target,l(_,t.lockRef.current))},[]);g.useEffect(function(){return _u.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",u,yu),document.addEventListener("touchmove",u,yu),document.addEventListener("touchstart",f,yu),function(){_u=_u.filter(function(_){return _!==i}),document.removeEventListener("wheel",u,yu),document.removeEventListener("touchmove",u,yu),document.removeEventListener("touchstart",f,yu)}},[]);var v=t.removeScrollBar,x=t.inert;return g.createElement(g.Fragment,null,x?g.createElement(i,{styles:uee(s)}):null,v?g.createElement(tee,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function hee(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const pee=zJ(r9,fee);var gS=g.forwardRef(function(t,e){return g.createElement(lv,qi({},t,{ref:e,sideCar:pee}))});gS.classNames=lv.classNames;var mee=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},wu=new WeakMap,z0=new WeakMap,U0={},T_=0,l9=function(t){return t&&(t.host||l9(t.parentNode))},gee=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=l9(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})},vee=function(t,e,n,r){var s=gee(e,Array.isArray(t)?t:[t]);U0[n]||(U0[n]=new WeakMap);var i=U0[n],o=[],l=new Set,u=new Set(s),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};s.forEach(d);var f=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(m){if(l.has(m))f(m);else try{var v=m.getAttribute(r),x=v!==null&&v!=="false",_=(wu.get(m)||0)+1,w=(i.get(m)||0)+1;wu.set(m,_),i.set(m,w),o.push(m),_===1&&x&&z0.set(m,!0),w===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",m,b)}})};return f(e),l.clear(),T_++,function(){o.forEach(function(h){var m=wu.get(h)-1,v=i.get(h)-1;wu.set(h,m),i.set(h,v),m||(z0.has(h)||h.removeAttribute(r),z0.delete(h)),v||h.removeAttribute(n)}),T_--,T_||(wu=new WeakMap,wu=new WeakMap,z0=new WeakMap,U0={})}},c9=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=mee(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),vee(r,s,n,"aria-hidden")):function(){return null}},yee=Object.defineProperty,ds=(t,e)=>yee(t,"name",{value:e,configurable:!0}),vS="Dialog",[u9,ele]=ao(vS),[_ee,Ai]=u9(vS),cv=ds(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=g.useRef(null),u=g.useRef(null),{nodes:d,registry:f}=eS(),[h,m]=ll({prop:r,defaultProp:s??!1,onChange:i,caller:vS}),[v,x]=g.useState(0),[_,w]=g.useState(0);return S.jsx(_ee,{scope:e,triggerRef:l,contentRef:u,contentId:eo(),titleId:eo(),descriptionId:eo(),titlePresent:v>0,descriptionPresent:_>0,setTitleCount:x,setDescriptionCount:w,open:h,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(b=>!b),[m]),modal:o,branchNodes:d,branchRegistry:f,children:n})},"Dialog"),wee="DialogTrigger",tle=g.forwardRef(ds(function(e,n){const{__scopeDialog:r,...s}=e,i=Ai(wee,r),o=Kt(n,i.triggerRef);return S.jsx(An.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":mv(i.open),...s,ref:o,onClick:Gt(e.onClick,i.onOpenToggle)})},"DialogTrigger")),d9="DialogPortal",[xee,f9]=u9(d9,{forceMount:void 0}),uv=ds(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Ai(d9,e);return S.jsx(xee,{scope:e,forceMount:n,children:g.Children.map(r,o=>S.jsx(al,{present:n||i.open,children:S.jsx(uS,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),Xw="DialogOverlay",dv=g.forwardRef(ds(function(e,n){const r=f9(Xw,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Ai(Xw,e.__scopeDialog);return o.modal?S.jsx(al,{present:s||o.open,children:S.jsx(See,{...i,ref:n})}):null},"DialogOverlay")),bee=Xa("DialogOverlay.RemoveScroll"),See=g.forwardRef(ds(function(e,n){const{__scopeDialog:r,...s}=e,i=Ai(Xw,r),o=aO(),l=Kt(n,o);return S.jsx(gS,{as:bee,allowPinchZoom:!0,shards:g.useMemo(()=>[i.contentRef,...i.branchNodes.map(u=>({current:u}))],[i.contentRef,i.branchNodes]),children:S.jsx(An.div,{"data-state":mv(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),jh="DialogContent",fv=g.forwardRef(ds(function(e,n){const r=f9(jh,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=Ai(jh,e.__scopeDialog);return S.jsx(al,{present:s||o.open,children:o.modal?S.jsx(kee,{...i,ref:n}):S.jsx(Eee,{...i,ref:n})})},"DialogContent")),kee=g.forwardRef(ds(function(e,n){const r=Ai(jh,e.__scopeDialog),s=g.useRef(null),i=Kt(n,r.contentRef,s);return g.useEffect(()=>{const o=s.current;if(o)return c9(o)},[]),S.jsx(h9,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Gt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Gt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Gt(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),Eee=g.forwardRef(ds(function(e,n){const r=Ai(jh,e.__scopeDialog),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(h9,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),h9=g.forwardRef(ds(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,"aria-describedby":l,children:u,...d}=e,f=Ai(jh,r);return av(),S.jsx(Jb,{registry:f.branchRegistry,children:S.jsx(uO,{asChild:!0,loop:!0,trapped:s,branches:f.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Xb,{role:"dialog",id:f.contentId,"aria-labelledby":f.titlePresent?f.titleId:void 0,"aria-describedby":f.descriptionPresent?p9(l,f.descriptionId):l,"data-state":mv(f.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1),children:u})})})},"DialogContentImpl")),hv=g.forwardRef(ds(function(e,n){const{__scopeDialog:r,...s}=e,i=Ai("DialogTitle",r),{setTitleCount:o}=i;return Lr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(An.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),pv=g.forwardRef(ds(function(e,n){const{__scopeDialog:r,...s}=e,i=Ai("DialogDescription",r),{setDescriptionCount:o}=i;return Lr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(An.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),Cee="DialogClose",nle=g.forwardRef(ds(function(e,n){const{__scopeDialog:r,...s}=e,i=Ai(Cee,r);return S.jsx(An.button,{type:"button",...s,ref:n,onClick:Gt(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function p9(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}ds(p9,"concatAriaDescribedby");function mv(t){return t?"open":"closed"}ds(mv,"getState");var Pee=Object.defineProperty,ea=(t,e)=>Pee(t,"name",{value:e,configurable:!0}),yS="Popover",[m9,rle]=ao(yS,[iv]),_S=iv(),[Aee,Ld]=m9(yS),wS=ea(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=_S(e),u=g.useRef(null),[d,f]=g.useState(!1),[h,m]=g.useState(0),[v,x]=g.useState(0),[_,w]=ll({prop:r,defaultProp:s??!1,onChange:i,caller:yS});return S.jsx(MO,{...l,children:S.jsx(Aee,{scope:e,contentId:eo(),titleId:eo(),descriptionId:eo(),titlePresent:h>0,descriptionPresent:v>0,setTitleCount:m,setDescriptionCount:x,triggerRef:u,open:_,onOpenChange:w,onOpenToggle:g.useCallback(()=>w(b=>!b),[w]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>f(!0),[]),onCustomAnchorRemove:g.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),Tee="PopoverTrigger",xS=g.forwardRef(ea(function(e,n){const{__scopePopover:r,...s}=e,i=Ld(Tee,r),o=_S(r),l=Kt(n,i.triggerRef),u=S.jsx(An.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":kS(i.open),...s,ref:l,onClick:Gt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(OO,{asChild:!0,...o,children:u})},"PopoverTrigger")),g9="PopoverPortal",[Ree,Iee]=m9(g9,{forceMount:void 0}),bS=ea(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=Ld(g9,e);return S.jsx(Ree,{scope:e,forceMount:n,children:S.jsx(al,{present:n||i.open,children:S.jsx(uS,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),$h="PopoverContent",SS=g.forwardRef(ea(function(e,n){const r=Iee($h,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=Ld($h,e.__scopePopover);return S.jsx(al,{present:s||o.open,children:o.modal?S.jsx(Oee,{...i,ref:n}):S.jsx(Lee,{...i,ref:n})})},"PopoverContent")),Mee=Xa("PopoverContent.RemoveScroll"),Oee=g.forwardRef(ea(function(e,n){const r=Ld($h,e.__scopePopover),s=g.useRef(null),i=Kt(n,s),o=g.useRef(!1),{nodes:l,registry:u}=eS();return g.useEffect(()=>{const d=s.current;if(d)return c9(d)},[]),S.jsx(gS,{as:Mee,allowPinchZoom:!0,shards:g.useMemo(()=>[s,...l.map(d=>({current:d}))],[s,l]),children:S.jsx(v9,{...e,ref:i,branchNodes:l,branchRegistry:u,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Gt(e.onCloseAutoFocus,d=>{var f;d.preventDefault(),o.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Gt(e.onPointerDownOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,m=f.button===2||h;o.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Gt(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Lee=g.forwardRef(ea(function(e,n){const r=Ld($h,e.__scopePopover),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(v9,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"PopoverContentNonModal")),v9=g.forwardRef(ea(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,"aria-describedby":m,branchNodes:v,branchRegistry:x,..._}=e,w=Ld($h,r),b=_S(r),[k,C]=g.useState(null),P=Kt(n,C);return tS(k),av(),S.jsx(Jb,{registry:x,children:S.jsx(uO,{asChild:!0,loop:!0,trapped:s,branches:v,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Xb,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>w.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(NO,{"data-state":kS(w.open),role:"dialog",id:w.contentId,"aria-labelledby":w.titlePresent?w.titleId:void 0,"aria-describedby":w.descriptionPresent?y9(m,w.descriptionId):m,...b,..._,ref:P,style:{..._.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function kS(t){return t?"open":"closed"}ea(kS,"getState");function y9(...t){const e=new Set;for(const n of t)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&e.add(r);return e.size>0?Array.from(e).join(" "):void 0}ea(y9,"concatAriaDescribedby");const Fh={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},Nee="data-hover-dead-zone";function _9(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=g.useRef(new Map),[i,o]=g.useState(null),[l,u]=g.useState([]),d=g.useRef([]),f=g.useRef(0),h=g.useRef(null),m=g.useRef(null),v=g.useCallback(()=>{const C=[];return s.current.forEach((P,T)=>{C[T]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),C},[]),x=g.useCallback(()=>{if(!t.current)return;const P=v();d.current=P,u(P)},[t,v]),_=g.useCallback((C,P)=>{P?s.current.set(C,P):s.current.delete(C),m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{m.current=null,x()})},[x]),w=g.useCallback(C=>{const P=C.clientX,T=C.clientY,M=C.target instanceof Element&&C.target.closest(`[${Nee}]`)!==null;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const I=t.current;if(!I)return;if(M){o(null);return}const R=v(),L=d.current;(R.length!==L.length||R.some((oe,ne)=>{const ie=L[ne];return!ie||!oe||oe.top!==ie.top||oe.height!==ie.height||oe.left!==ie.left||oe.width!==ie.width}))&&(d.current=R,u(R));const F=I.getBoundingClientRect(),D=n==="x"?P:T;let q=null,W=1/0,G=null;const H=d.current,J=n==="x"?I.scrollLeft:I.scrollTop,B=n==="x"?I.clientLeft:I.clientTop,Q=n==="x"?F.left:F.top,z=n==="x"?I.offsetWidth:I.offsetHeight,N=n==="x"?F.width:F.height,Y=z>0?N/z:1;for(let oe=0;oe<H.length;oe++){const ne=H[oe];if(!ne)continue;const ie=n==="x"?ne.left:ne.top,de=Q+(B+ie-J)*Y,ge=(n==="x"?ne.width:ne.height)*Y,ce=de+ge;D>=de&&D<=ce&&(G=oe);let re=0;D<de?re=de-D:D>ce&&(re=D-ce),re<W&&(W=re,q=oe)}o(G??(W<=r?q:null))})},[n,t,r,v]),b=g.useCallback(()=>{f.current+=1,x()},[x]),k=g.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),o(null)},[]);return g.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),m.current!==null&&cancelAnimationFrame(m.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:w,onMouseEnter:b,onMouseLeave:k},registerItem:_,measureItems:x}}function Dee(t,e,n){g.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}let wm=0;const jee=()=>{wm+=1;let t=!1;return()=>{t||(t=!0,wm=Math.max(0,wm-1))}},$ee=()=>wm>0,Fee='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',w9=({itemSelector:t=Fee,loop:e=!1,onDismiss:n}={})=>{const r=g.useRef(null),s=g.useRef(null),i=g.useRef(n),o=g.useRef(!1);i.current=n;const l=g.useCallback(f=>{var h;if(r.current=f,f){o.current=!1;const m=jee(),v=f.ownerDocument.defaultView;let x;const _=()=>{v==null||v.clearTimeout(x),x=v==null?void 0:v.setTimeout(()=>{const w=f.ownerDocument.activeElement;(w==null?void 0:w.tagName)==="IFRAME"&&!f.contains(w)&&i.current&&(o.current=!0,i.current())})};v==null||v.addEventListener("blur",_),s.current=()=>{v==null||v.removeEventListener("blur",_),v==null||v.clearTimeout(x),m()}}else(h=s.current)==null||h.call(s),s.current=null},[]),u=f=>{o.current&&f.preventDefault()},d=g.useCallback(f=>{var k;const{key:h}=f;if(h!=="ArrowDown"&&h!=="ArrowUp"&&h!=="Home"&&h!=="End")return;const m=r.current;if(!m)return;const v=Array.from(m.querySelectorAll(t));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const x=v.indexOf(document.activeElement),_=v.length-1,w=C=>{if(x===-1)return C===1?0:_;const P=x+C;return e?(P+v.length)%v.length:Math.min(Math.max(P,0),_)};let b;h==="Home"?b=0:h==="End"?b=_:h==="ArrowDown"?b=w(1):b=w(-1),(k=v[b])==null||k.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:u}};var xm={exports:{}},Vee=xm.exports,zP;function Hee(){return zP||(zP=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(Vee,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},o=null;function l(_,w){var b=_[w];if(typeof b.bind=="function")return b.bind(_);try{return Function.prototype.bind.call(b,_)}catch{return function(){return Function.prototype.apply.apply(b,[_,arguments])}}}function u(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?u:console[_]!==void 0?l(console,_):console.log!==void 0?l(console,"log"):e}function f(){for(var _=this.getLevel(),w=0;w<s.length;w++){var b=s[w];this[b]=w<_?e:this.methodFactory(b,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function h(_){return function(){typeof console!==n&&(f.call(this),this[_].apply(this,arguments))}}function m(_,w,b){return d(_)||h.apply(this,arguments)}function v(_,w){var b=this,k,C,P,T="loglevel";typeof _=="string"?T+=":"+_:typeof _=="symbol"&&(T=void 0);function M(F){var D=(s[F]||"silent").toUpperCase();if(!(typeof window===n||!T)){try{window.localStorage[T]=D;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+D+";"}catch{}}}function I(){var F;if(!(typeof window===n||!T)){try{F=window.localStorage[T]}catch{}if(typeof F===n)try{var D=window.document.cookie,q=encodeURIComponent(T),W=D.indexOf(q+"=");W!==-1&&(F=/^([^;]+)/.exec(D.slice(W+q.length+1))[1])}catch{}return b.levels[F]===void 0&&(F=void 0),F}}function R(){if(!(typeof window===n||!T)){try{window.localStorage.removeItem(T)}catch{}try{window.document.cookie=encodeURIComponent(T)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function L(F){var D=F;if(typeof D=="string"&&b.levels[D.toUpperCase()]!==void 0&&(D=b.levels[D.toUpperCase()]),typeof D=="number"&&D>=0&&D<=b.levels.SILENT)return D;throw new TypeError("log.setLevel() called with invalid level: "+F)}b.name=_,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=w||m,b.getLevel=function(){return P??C??k},b.setLevel=function(F,D){return P=L(F),D!==!1&&M(P),f.call(b)},b.setDefaultLevel=function(F){C=L(F),I()||b.setLevel(F,!1)},b.resetLevel=function(){P=null,R(),f.call(b)},b.enableAll=function(F){b.setLevel(b.levels.TRACE,F)},b.disableAll=function(F){b.setLevel(b.levels.SILENT,F)},b.rebuild=function(){if(o!==b&&(k=L(o.getLevel())),f.call(b),o===b)for(var F in i)i[F].rebuild()},k=L(o?o.getLevel():"WARN");var j=I();j!=null&&(P=L(j)),f.call(b)}o=new v,o.getLogger=function(w){if(typeof w!="symbol"&&typeof w!="string"||w==="")throw new TypeError("You must supply a name when creating a logger.");var b=i[w];return b||(b=i[w]=new v(w,o.methodFactory)),b};var x=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=x),o},o.getLoggers=function(){return i},o.default=o,o})})(xm)),xm.exports}var zee=Hee();const _i=Vg(zee),Uee="INFO",Bee=Uee.toUpperCase();_i.setLevel(_i.levels[Bee]||_i.levels.INFO);const Ls=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>_i.trace(`${e}${n}`,...r),debug:(n,...r)=>_i.debug(`${e}${n}`,...r),info:(n,...r)=>_i.info(`${e}${n}`,...r),warn:(n,...r)=>_i.warn(`${e}${n}`,...r),error:(n,...r)=>{_i.error(`${e}${n}`,...r);try{const i=r.map(l=>Or(l)).join(" ").slice(0,512),o={source:"ui",error_message:n,service:t??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Ie.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>_i.info(`${e}API: ${n}`,...r),hook:(n,...r)=>_i.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>_i.debug(`${e}Mount: ${n}`,...r)}},UP=Ls("useVariantsUiState"),Wee={groups:[],rows:{}},B0={pinned:[],order:Wee},Bf="pinned",Zee="top",R_=t=>`rows:${t}`,BP=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},qee=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),Gee=(t,e)=>n=>{if(t===Bf){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===Zee?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},Kee=t=>{const e=t?`?projectPath=${encodeURIComponent(t)}`:"",[n,r]=g.useState(B0),s=g.useRef(n);s.current=n;const i=g.useRef(!1),o=g.useRef([]),l=g.useCallback(v=>{t&&_t(`/api/variants/ui-state${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:v})}).catch(x=>{UP.warn("persist failed — arrangement kept for this session only",x)})},[t,e]);g.useEffect(()=>{if(r(B0),s.current=B0,i.current=!1,o.current=[],!t)return;let v=!1;return(async()=>{try{const x=await _t(`/api/variants/ui-state${e}`);if(!x.ok||v)return;const _=await x.json();if(v)return;let w=_.uiState??B0;const b=o.current;o.current=[];for(const k of b)w=k(w);i.current=!0,s.current=w,r(w),b.length>0&&l(w)}catch(x){UP.warn("load failed — arrangement is session-local until reload",x)}})(),()=>{v=!0}},[t,e,l]);const u=g.useCallback(v=>{const x=v(s.current);s.current=x,r(x),i.current?l(x):o.current.push(v)},[l]),d=g.useCallback(v=>{const x=!s.current.pinned.includes(v);u(x?BP(v):qee(v))},[u]),f=g.useCallback(v=>{s.current.pinned.includes(v)||u(BP(v))},[u]),h=g.useCallback((v,x)=>{u(Gee(v,x))},[u]),m=g.useMemo(()=>new Set(n.pinned),[n.pinned]);return{pinnedKeys:n.pinned,pinnedKeySet:m,listOrder:n.order,togglePin:d,pinItem:f,reorder:h}},Yee=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=g.useState(null),u=g.useCallback(h=>{const m=e.current;return m?Array.from(m.querySelectorAll(`[data-reorder-container="${CSS.escape(h)}"]`)):[]},[e]),d=g.useCallback(h=>{if(!n){o&&l(null);return}const m=e.current;if(!m)return;if(r){const b=m.querySelector(r);if(b){const k=b.getBoundingClientRect();if(h.clientY>=k.top&&h.clientY<=k.bottom){o&&l(null);return}}}if(s){const b=m.querySelector(s),k=b==null?void 0:b.getBoundingClientRect();if(!k||h.clientY<k.top||h.clientY>k.bottom){o&&l(null);return}}const v=u(n.container);if(v.length===0){o&&l(null);return}const x=m.getBoundingClientRect().top;let _=v.length;for(let b=0;b<v.length;b++){const k=v[b].getBoundingClientRect();if(h.clientY<k.top+k.height/2){_=b;break}}let w;_===0?w=v[0].getBoundingClientRect().top-x-1:_===v.length?w=v[v.length-1].getBoundingClientRect().bottom-x:w=(v[_-1].getBoundingClientRect().bottom+v[_].getBoundingClientRect().top)/2-x,(!o||o.index!==_||o.container!==n.container)&&l({container:n.container,index:_,top:w})},[e,n,o,u,r,s]),f=g.useCallback(()=>{if(!n||!o)return;l(null);const h=u(o.container).map(x=>x.dataset.reorderKey).filter(x=>!!x),m=h.indexOf(n.key);if(m===-1)return;h.splice(m,1);const v=o.index>m?o.index-1:o.index;h.splice(v,0,n.key),i(o.container,h)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},Xee={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},share:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},variantSend:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},inspectorUndoRedo:{default:!1}},x9=Object.fromEntries(Object.entries(Xee).map(([t,e])=>[t,{isEnabled:e.default}])),b9=Zt(!0),S9=Zt(null),k9=Zt(0),Qee=Zt({name:null,email:null}),Qw=Zt(0),Pg=Zt(null),Jw=Zt(!1),ex=Zt(null),E9=Zt(!1),C9=Zt(!1),tx=Zt(null),bm=Zt(null),yd=Zt(null),ES=Zt(null),el=Zt(null),P9=Zt(!1),cp=Zt({active:!1}),A9=Zt([]),nx=Zt(x9),Jee=Zt(!1),gv=Zt(null),T9=Zt(null),vv=Zt(!0),ete=Zt(!1),R9=Zt(!1),I9=Zt(null),tte=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},yv=Zt(tte()),nte=Zt(null);function rte(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const ste=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],CS=({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:ste.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),ite=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?S.jsx(Oh,{size:12,weight:"bold"}):null,o]})]})},M9=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:u})=>{const[d,f]=g.useState(!1),h=i?o??t:t,m=u.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,h]}),m?S.jsxs(wS,{open:d,onOpenChange:f,children:[S.jsx(xS,{asChild:!0,children:S.jsx("button",{"aria-label":l,disabled:s||i,title:l,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(rY,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(bS,{children:S.jsx(SS,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:u.map(v=>{const x=v.icon;return S.jsxs("button",{onClick:()=>{v.isDisabled||(v.onClick(),f(!1))},disabled:v.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[x?S.jsx(x,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})})]}):null]})},Mc=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(pS,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),ote=32,ate=2048,O9=Ge().max(ate).refine(t=>{let e;try{e=decodeURIComponent(t.split(/[?#]/)[0])}catch{return!1}return t.startsWith("/")&&!t.startsWith("//")&&!t.includes("\\")&&!/^\/%(?:2f|5c)/i.test(t)&&!e.includes("\\")&&!e.split("/").some(n=>n==="."||n==="..")&&![...t].some(n=>n<=" "||n==="")},"Expected an app-relative preview route");Ac(O9).min(1).max(ote).transform(t=>[...new Set(t)]);const _v="/__rivet/preview",WP=`${_v}/variant/`,ZP=`${_v}/history/`,L9=t=>t?t.startsWith("/")?t:`/${t}`:"/",N9=(t,e)=>{if(!e)return t;const n=O9.parse(e);if(t.includes("?")||t.includes("#"))throw new Error("Preview target must not contain an application query or hash");return t.replace(/\/$/,"")+n},qP=(t,e)=>{const n=new URLSearchParams(e);return n.set("targetAddressed","1"),`/api/variants/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}/run?${n}`},I_=t=>{const e="/api/variants/history/"+encodeURIComponent(t.sessionId)+"/"+encodeURIComponent(t.variantId);return t.routePath?N9(e+"/site/"+encodeURIComponent(t.projectPath??"current"),t.routePath):e+"/preview"+(t.projectPath?"?projectPath="+encodeURIComponent(t.projectPath):"")},lte=t=>`${_v}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${L9(t.routePath)}`,GP=t=>`${_v}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${L9(t.routePath)}`,KP=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(WP)||e.pathname.startsWith(ZP)}catch{return t.startsWith(WP)||t.startsWith(ZP)}},vc=t=>{var s,i,o,l,u,d;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?N9(n.preview.url,(i=n.previewRoutes)==null?void 0:i[0]):e&&(((o=n.preview)==null?void 0:o.kind)==="dev_server"||typeof n.port=="number")?lte({sessionId:e,variantId:n.workItemId,routePath:((l=n.previewRoutes)==null?void 0:l[0])??((r==null?void 0:r.kind)==="fresh"?"/":t.routePath)}):e&&(r==null?void 0:r.kind)==="fresh"&&((u=r.executionPlan)==null?void 0:u.mode)!=="vite_app"&&((d=n.preview)==null?void 0:d.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},YP="/rivet/",D9=t=>{if(!t.startsWith(YP))return null;const e=t.slice(YP.length);return!e||e==="/"?null:`/${e}`},_d=(t,e=_t)=>{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(()=>{})},cte=(t,e=_t)=>{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),_d(r,e))}},Ag=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},XP=6,j9="original",PS="Original",$9="The original state of your app before any variants were generated.",QP=200,F9="h-6 w-6 rounded",rx=[.33,1,.68,1],sx=.22,Hn=Ls("AgentVariantsPanel"),M_=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},xu=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},ute=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function O_(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const dte=(t,e)=>{if(t.kind==="original")return null;const n=t.kind==="active"?t.variant.runLabel:t.entry.runLabel,r=n==null?void 0:n.trim();return r?t.kind==="active"?e?{label:r,run:t.variant.requestId?{sessionId:e,requestId:t.variant.requestId}:{sessionId:e,runLabel:r}}:null:{label:r,run:t.entry.requestId?{sessionId:t.entry.sessionId,requestId:t.entry.requestId}:{sessionId:t.entry.sessionId,runLabel:r}}:null},V9=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},fte="original",ix="pinned-section";function H9(t){return`rivet:collapsedRuns:${t}`}function W0(t){try{const e=window.localStorage.getItem(H9(t)),n=e?JSON.parse(e):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function L_(t,e){try{window.localStorage.setItem(H9(t),JSON.stringify([...e]))}catch{}}const JP=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=dte(s,e);let o="";s.kind==="original"?o=fte:i&&(o=V9(i.run));let l=r.get(o);l||(l={key:o,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(o,l),n.push(l)),l.rows.push(s)}return n};async function $i(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 hte=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},dh=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")},z9=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},pte=t=>t.status==="succeeded"&&!dh(t)&&(!t.previewUnavailable||z9(t)),N_=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"},eA=(t,e,n)=>{const r=new URL(t,window.location.origin);return r.searchParams.set(e,n),`${r.pathname}${r.search}${r.hash}`},mte=t=>{var e;return hte(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},tA=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),gte=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,o;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.requestId===s.requestId&&n.label===s.label&&n.brief===s.brief&&JSON.stringify(n.references)===JSON.stringify(s.references)&&n.runLabel===s.runLabel&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((o=s.serve)==null?void 0:o.kind)&&n.hasTree===s.hasTree}),vte=()=>{var xl,ii,oi,ai;const t=mb(),e=ut(cp),n=ut(P9),r=g.useRef(!1),s=ut(A9),i=ut(gv),o=ut(vv),l=ut(nx),u=((xl=l.share)==null?void 0:xl.isEnabled)??!1,d=((ii=l.deployPrototype)==null?void 0:ii.isEnabled)??!1,f=((oi=l.canvasShare)==null?void 0:oi.isEnabled)??!1,h=((ai=l.variantSend)==null?void 0:ai.isEnabled)??!1,m=ut(R9),v=ut(I9),x=wt(Qw),_=wt(Pg),w=wt(Jw),b=wt(ex),k=wt(E9),C=wt(C9),P=wt(yd),T=ut(yd),M=wt(ES),I=wt(S9);g.useEffect(()=>(I("Directions"),()=>I(null)),[I]);const R=ut(el),L=wt(el),j=g.useCallback((V=!1)=>{if(cte(R),L(null),V&&R){const ue=Ag("ended",R);Ie.capture(ue.event,ue.properties)}},[L,R]),F=ut(tx),D=wt(tx),q=ut(bm),W=wt(bm),G=q?`${q.sessionId}:${q.variantId}`:null,[H,J]=g.useState(""),[B,Q]=g.useReducer(V=>V+1,0),z=g.useMemo(()=>i!==null?W0(i):new Set,[i,B]),N=g.useCallback(V=>{if(i===null)return;const ue=new Set(W0(i));ue.delete(V)||ue.add(V),L_(i,ue),Q()},[i]),[Y,oe]=g.useState(null),[ne,ie]=g.useState(null),[de,ge]=g.useState(!1),[ce,re]=g.useState({}),[Ce,Fe]=g.useState(null),[ke,dt]=g.useState({}),[Lt,sn]=g.useState(null),[jt,pt]=g.useState([]),vn=g.useRef([]);vn.current=jt;const[Le,lt]=g.useState(!1),[Te]=g.useState(()=>gX(window.location.search)),Je=g.useRef(!1),bt=g.useRef(!1);bt.current=Te!==null||q!==null||F!==null||Le;const Ke=g.useMemo(()=>e.active?e.variants:[],[e]),ft=g.useMemo(()=>Ke.filter(mte),[Ke]),wr=g.useMemo(()=>tA(ft,ce),[ft,ce]),Zn=(Ce==null?void 0:Ce.key)===wr?Ce.shareUrl:null,Me=e.active?e.sessionId:null,ta=g.useMemo(()=>{const V=new Set;for(const ue of Ke)ue.adoptedSource&&V.add(`${ue.adoptedSource.sessionId}:${ue.adoptedSource.variantId}`);return V},[Ke]),Dn=g.useMemo(()=>[...jt.filter(ue=>ue.sessionId!==Me&&!ta.has(`${ue.sessionId}:${ue.variantId}`))].sort((ue,_e)=>{const ve=new Date(ue.createdAt).getTime(),be=new Date(_e.createdAt).getTime();return(Number.isNaN(be)?0:be)-(Number.isNaN(ve)?0:ve)}),[ta,jt,Me]),nr=g.useMemo(()=>q?Ke.find(V=>{var ue,_e;return((ue=V.adoptedSource)==null?void 0:ue.sessionId)===q.sessionId&&((_e=V.adoptedSource)==null?void 0:_e.variantId)===q.variantId})??null:null,[q,Ke]),ul=g.useMemo(()=>q?Dn.find(V=>V.sessionId===q.sessionId&&V.variantId===q.variantId)??null:null,[q,Dn]),yn=e.active?e.projectContext:null,Yt=(yn==null?void 0:yn.kind)==="fresh"?yn.workspacePath:i,Dd=!e.active&&Dn.length>0&&Dn.every(V=>V.projectKind==="fresh"),Ns=e.active?ute(yn):!!i&&!Dd,fs=g.useMemo(()=>Yt?`?projectPath=${encodeURIComponent(Yt)}`:"",[Yt]),{pinnedKeys:rr,pinnedKeySet:co,listOrder:ri,togglePin:jn,pinItem:Ds,reorder:dl}=Kee(Yt),uo=g.useRef(null),hs=g.useRef(null),Ye=typeof window>"u"?"/":D9(window.location.pathname)??"/",Nt=g.useRef(null),Vt=g.useRef(!1),qn=g.useCallback((V,ue)=>{ue.button!==0&&ue.pointerType==="mouse"||(ue.preventDefault(),M_(),Nt.current={kind:"live",variantId:V,startX:ue.clientX,startY:ue.clientY,committed:!1})},[]),ps=g.useCallback((V,ue)=>{ue.button!==0&&ue.pointerType==="mouse"||(ue.preventDefault(),M_(),Nt.current={kind:"past",entry:V,startX:ue.clientX,startY:ue.clientY,committed:!1})},[]);g.useEffect(()=>{const V=ve=>{var $e,Xt;const be=Nt.current;if(!be)return;const fe=ve.clientX-be.startX,Xe=ve.clientY-be.startY;if(!be.committed){if(fe*fe+Xe*Xe<XP*XP)return;if(M_(),be.kind==="live"){const mt=Ke.find(Gn=>Gn.workItemId===be.variantId);if(!mt||mt.status!=="succeeded"){Nt.current=null;return}const xr=vc({sessionId:Me,variant:mt,projectContext:yn,routePath:Ye});P({sessionId:Me??"",variantId:mt.workItemId,label:mt.label||"Direction",url:xr,source:"live",runLabel:mt.runLabel,description:mt.description})}else{const{entry:mt}=be,xr=xu(mt),Gn=xr?GP({sessionId:mt.sessionId,variantId:mt.variantId,routePath:(($e=mt.previewRoutes)==null?void 0:$e[0])??Ye}):I_({sessionId:mt.sessionId,variantId:mt.variantId,projectPath:Yt,routePath:(Xt=mt.previewRoutes)==null?void 0:Xt[0]});if(P({sessionId:mt.sessionId,variantId:mt.variantId,label:mt.label||"Direction",url:Gn,source:xr?"history-dev-server":"history-static",runLabel:mt.runLabel,description:mt.brief}),xr){const br=qP(mt,fs);(async()=>{try{if(!(await _t(br,{method:"POST"})).ok)return;const Ht=eA(Gn,"replay",String(Date.now()));P(Sr=>!Sr||Sr.sessionId!==mt.sessionId||Sr.variantId!==mt.variantId||Sr.source!=="history-dev-server"?Sr:{...Sr,url:Ht}),L(Sr=>{if(!Sr)return Sr;const wp=ho=>!ho||ho.sessionId!==mt.sessionId||ho.variantId!==mt.variantId?ho:{...ho,url:Ht};return{...Sr,left:wp(Sr.left),right:wp(Sr.right)}})}catch(St){Hn.warn("history replay drag boot failed",St)}})()}}be.committed=!0}M({x:ve.clientX,y:ve.clientY})},ue=()=>{const ve=Nt.current;ve!=null&&ve.committed&&(Vt.current=!0,window.setTimeout(()=>{Vt.current=!1},0)),Nt.current=null,M(null)},_e=ve=>{if(ve.key!=="Escape")return;const be=Nt.current;be!=null&&be.committed&&(be.kind==="past"&&xu(be.entry)&&_d({sessionId:be.entry.sessionId,variantId:be.entry.variantId,source:"history-dev-server"}),Nt.current=null,P(null),M(null))};return window.addEventListener("pointermove",V),window.addEventListener("pointerup",ue),window.addEventListener("pointercancel",ue),window.addEventListener("keydown",_e),()=>{window.removeEventListener("pointermove",V),window.removeEventListener("pointerup",ue),window.removeEventListener("pointercancel",ue),window.removeEventListener("keydown",_e)}},[Ke,Me,yn,Ye,fs,Yt,P,M,L]);const qt=g.useCallback(()=>{var V;(V=Nt.current)!=null&&V.committed&&(Vt.current=!0,window.setTimeout(()=>{Vt.current=!1},0)),Nt.current=null,M(null),T&&(T.source==="history-dev-server"&&_d({sessionId:T.sessionId,variantId:T.variantId,source:"history-dev-server"}),P(null))},[T,P,M]),$n=g.useCallback((V,ue)=>{const _e=!co.has(V);Ie.capture(_e?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:ue}),jn(V)},[co,jn]),Zr=g.useCallback(()=>{T&&(Ie.capture("variants_panel.direction_pinned",{method:"drag"}),Ds(`row:past:${T.sessionId}:${T.variantId}`),qt())},[T,qt,Ds]),si=g.useCallback(V=>{Ie.capture("variants_panel.direction_unpinned",{method:"drag"}),jn(V),qt()},[jn,qt]),dr=g.useCallback((V,ue)=>{dl(V,ue),qt()},[dl,qt]),Mn=g.useMemo(()=>{var ue;if(Le||G)return null;const V=F?Ke.find(_e=>_e.workItemId===F):null;return F&&!V?null:V?dh(V)?V.workItemId:null:e.active?((ue=Ke.find(_e=>{var ve,be;return dh(_e)&&(((ve=_e.preview)==null?void 0:ve.kind)==="static_artifact"||((be=_e.preview)==null?void 0:be.kind)==="dev_server")}))==null?void 0:ue.workItemId)??null:null},[F,G,Le,e,Ke]),fl=Le||Ns&&F===null&&G===null&&Mn===null,Nc=g.useCallback(async V=>{var _e,ve,be,fe,Xe;if(!Me)return;const ue=(V==null?void 0:V.workItemId)??null;oe({kind:"switch",variantId:ue??void 0});try{if(((_e=V==null?void 0:V.preview)==null?void 0:_e.kind)==="static_artifact"){const Xt=vc({sessionId:Me,variant:V,projectContext:e.active?e.projectContext:null})??V.preview.url;w(!1),b(null),((ve=V.refinement)==null?void 0:ve.status)==="succeeded"&&!((be=V.previewRoutes)!=null&&be.length)?_(eA(Xt,"refinement",V.refinement.workItemId)):_(Xt);return}if(ue&&Me&&e.active&&e.projectContext.kind==="fresh"&&((fe=e.projectContext.executionPlan)==null?void 0:fe.mode)!=="vite_app"&&((Xe=V==null?void 0:V.preview)==null?void 0:Xe.kind)!=="dev_server"){w(!1),b(null),_(`/api/variants/${Me}/static/${ue}`);return}const $e=V&&ue?vc({sessionId:Me,variant:V,projectContext:e.active?e.projectContext:null,routePath:Ye}):null;if($e){w(!1),b(null),_($e);return}Ie.capture("variants_panel.preview_display_failed",{sessionId:Me,variantId:ue,previewKind:V?N_(V):"none",hasPreview:!!(V!=null&&V.preview),hasPort:typeof(V==null?void 0:V.port)=="number",errorMessage:"No addressable dev-server preview URL"}),w(!1),b(null)}catch($e){Hn.warn("preview display failed",$e),Ie.capture("variants_panel.preview_display_failed",{sessionId:Me,variantId:ue,previewKind:V?N_(V):"none",hasPreview:!!(V!=null&&V.preview),hasPort:typeof(V==null?void 0:V.port)=="number",errorMessage:$e instanceof Error?$e.message:String($e)}),w(!1),b(null)}finally{oe(null)}},[Me,e,Ye,_,w,b]),fo=g.useRef(0),na=g.useCallback(()=>{fo.current++,oe(V=>(V==null?void 0:V.kind)==="switch"?null:V),k(!1),C(!1)},[k,C]),Ti=g.useCallback(async V=>{if(Me){oe({kind:"switch",variantId:V.workItemId});try{const ue=await _t(`/api/variants/${Me}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:V.workItemId})});if(!ue.ok){const _e=await $i(ue);throw new Error(_e.message??`Preview restoration failed (${ue.status})`)}}catch(ue){Hn.warn("preview restoration failed",ue),Ie.capture("variants_panel.preview_display_failed",{sessionId:Me,variantId:V.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:ue instanceof Error?ue.message:String(ue)})}finally{oe(null)}}},[Me]),hl=g.useCallback(V=>{var fe,Xe,$e,Xt,mt;if(Vt.current){Vt.current=!1;return}const ue=dh(V),_e=V.status==="pending"||V.status==="running"||pte(V);na();const ve=N_(V),be=Ke.find(xr=>xr.workItemId===F);Ie.capture("variants_panel.preview_requested",{sessionId:Me,fromVariantId:be==null?void 0:be.workItemId,toVariantId:V.workItemId,variantStatus:V.status,isPreviewReady:ue,isArmed:_e,previewKind:ve,hasPreview:!!V.preview,hasPort:typeof V.port=="number",viewEnabled:((Xe=(fe=V.actions)==null?void 0:fe.view)==null?void 0:Xe.enabled)??null,previewUnavailableReason:(($e=V.previewUnavailable)==null?void 0:$e.reason)??null}),D(V.workItemId),W(null),ue?(hs.current=V.workItemId,lt(!1),j(!0),Nc(V)):(hs.current=null,lt(!1),_(null),w(!1),_e&&Ie.capture("variants_panel.preview_armed",{sessionId:Me,fromVariantId:be==null?void 0:be.workItemId,toVariantId:V.workItemId,variantStatus:V.status,previewKind:ve,hasPreview:!!V.preview,hasPort:typeof V.port=="number",viewEnabled:((mt=(Xt=V.actions)==null?void 0:Xt.view)==null?void 0:mt.enabled)??null}),z9(V)&&Ti(V)),Ie.capture("variants_panel.preview_switched",{sessionId:Me,fromVariantId:be==null?void 0:be.workItemId,toVariantId:V.workItemId,armed:_e})},[F,Me,j,D,W,na,Ti,Nc,Ke,_,w]),jd=e.active?`${e.sessionId}:${e.stage}`:"inactive",$d=g.useRef(!1);g.useEffect(()=>{if(o)return;let V=!1;return(async()=>{var ue;try{const _e=await _t(`/api/variants/history${fs}`,{credentials:"same-origin"});if(!_e.ok)return;const ve=await _e.json();if(V)return;const be=(ve.variants??[]).filter(fe=>{var Xe,$e;return((Xe=fe.preview)==null?void 0:Xe.kind)==="static"||(($e=fe.serve)==null?void 0:$e.kind)==="static"||xu(fe)});if(!$d.current&&!bt.current&&jd==="inactive"&&be.length>0&&be.every(fe=>fe.projectKind==="fresh")){const fe=[...be].sort((Xe,$e)=>new Date($e.createdAt).getTime()-new Date(Xe.createdAt).getTime()).find(Xe=>!xu(Xe));fe&&($d.current=!0,W({sessionId:fe.sessionId,variantId:fe.variantId,previewKind:"static",references:fe.references,projectPath:Yt??void 0}),lt(!1),_(I_({sessionId:fe.sessionId,variantId:fe.variantId,projectPath:Yt,routePath:(ue=fe.previewRoutes)==null?void 0:ue[0]})))}if(W(fe=>{if(!fe)return fe;const Xe=be.find($e=>$e.sessionId===fe.sessionId&&$e.variantId===fe.variantId);return!Xe||JSON.stringify(fe.references)===JSON.stringify(Xe.references)?fe:{...fe,references:Xe.references}}),gte(vn.current,be))return;vn.current=be,pt(be)}catch(_e){Hn.warn("Failed to load past variants",_e)}})(),()=>{V=!0}},[o,Yt,jd,fs,_,W]);const ra=g.useCallback(V=>{var ue;if(Vt.current){Vt.current=!1;return}if(j(!0),W({sessionId:V.sessionId,variantId:V.variantId,previewKind:xu(V)?"dev_server":"static",references:V.references,projectPath:Yt??void 0}),D(null),lt(!1),xu(V)){const _e=++fo.current;k(!0),C(!0),(async()=>{var be;oe({kind:"switch"}),Ie.capture("variants_panel.history_replay_started",{sessionId:V.sessionId,variantId:V.variantId});const ve=(fe,Xe)=>{Ie.capture("variants_panel.history_replay_failed",{sessionId:V.sessionId,variantId:V.variantId,...Xe}),k(!1),C(!1),W($e=>$e?{...$e,previewError:fe}:null),_(null)};try{const fe=await _t(qP(V,fs),{method:"POST"});if(_e!==fo.current)return;if(!fe.ok){const{message:$e,errorCode:Xt}=await $i(fe);if(_e!==fo.current)return;Hn.warn(`history replay failed: HTTP ${fe.status} ${Xt??""}`),ve($e??`Preview startup failed (${fe.status})`,{httpStatus:fe.status,errorCode:Xt});return}const Xe=await fe.json();if(_e!==fo.current)return;C(!1),w(!1),b(null),_(GP({sessionId:V.sessionId,variantId:V.variantId,routePath:((be=V.previewRoutes)==null?void 0:be[0])??Ye})),Xe.alreadyRunning||x($e=>$e+1),Ie.capture("variants_panel.history_replay_ready",{sessionId:V.sessionId,variantId:V.variantId})}catch(fe){if(_e!==fo.current)return;Hn.warn("history replay failed",fe);const Xe=Or(fe,"Preview startup failed");ve(Xe,{errorMessage:Xe})}finally{_e===fo.current&&oe(null)}})();return}na(),w(!1),b(null),_(I_({sessionId:V.sessionId,variantId:V.variantId,projectPath:Yt,routePath:(ue=V.previewRoutes)==null?void 0:ue[0]}))},[Yt,Ye,oe,k,C,x,W,D,_,b,j,w,na,fs]);g.useEffect(()=>{if(!Te||Je.current)return;const V=jt.find(ue=>ue.sessionId===Te.sessionId&&ue.variantId===Te.variantId);V&&(Je.current=!0,ra(V))},[Te,jt,ra]);const Dc=g.useCallback(async()=>{na();const V=()=>{j(!0),D(null),W(null),lt(!0),hs.current=null,w(!1),b(null),_(null)};if(!Me){V();return}oe({kind:"switch"});try{const ue=await _t(`/api/variants/${Me}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!ue.ok){Hn.warn(`switch to original failed: HTTP ${ue.status}`);return}V(),w(!0),Ie.capture("variants_panel.preview_switched",{sessionId:Me,fromVariantId:F,toVariantId:null,target:"original",armed:!1})}catch(ue){Hn.warn("preview-port original switch failed",ue)}finally{oe(null)}},[F,Me,D,W,_,b,j,w,na]),pp=g.useCallback(async V=>{var _e,ve;const ue=((ve=(_e=V.actions)==null?void 0:_e.commit)==null?void 0:ve.enabled)??V.status==="succeeded";if(!(!Me||!ue)){Ie.capture("variants_panel.commit_clicked",{sessionId:Me,variantId:V.workItemId,variantLabel:V.label}),oe({kind:"commit",variantId:V.workItemId});try{const be=await _t(`/api/variants/${Me}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:V.workItemId})});if(!be.ok){const{message:Xe,errorCode:$e}=await $i(be);Hn.warn(`commit failed: HTTP ${be.status} ${$e??""} ${Xe??""}`),Ie.capture("variants_panel.commit_failed",{sessionId:Me,variantId:V.workItemId,httpStatus:be.status,errorCode:$e??null,errorMessage:Xe??null}),Tt.error("Couldn't send direction",{description:Xe??`The server rejected the request (HTTP ${be.status}). Try again, or pick a different direction.`});return}const fe=await be.json().catch(()=>null);Ie.capture("variants_panel.commit_succeeded",{sessionId:Me,variantId:V.workItemId,payloadKind:(fe==null?void 0:fe.payloadKind)??null,duplicate:(fe==null?void 0:fe.duplicate)??!1}),Tt.success(`Sent "${V.label}" to your project`,{description:(fe==null?void 0:fe.payloadKind)==="project-created"?`Project created at ${(fe==null?void 0:fe.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(fe==null?void 0:fe.payloadKind)!=="project-created"&&(_(null),w(!1),x(Xe=>Xe+1))}catch(be){Hn.warn("commit failed",be),Ie.capture("variants_panel.commit_failed",{sessionId:Me,variantId:V.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:be instanceof Error?be.message:String(be)}),Tt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{oe(null)}}},[Me,x,_,w]),pl=g.useCallback(async(V,ue,_e)=>{Ie.capture("variants_panel.deploy_clicked",{sessionId:V,variantId:ue,variantLabel:_e});try{const ve=await _t(`/api/variants/${V}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:ue,...i?{projectPath:i}:{}})});if(!ve.ok){const{message:Xe,errorCode:$e}=await $i(ve);return Hn.warn(`deploy failed: HTTP ${ve.status} ${$e??""} ${Xe??""}`),Ie.capture("variants_panel.deploy_failed",{sessionId:V,variantId:ue,httpStatus:ve.status,errorCode:$e??null,errorMessage:Xe??null}),Tt.error("Couldn't deploy this direction",{description:Xe??`The server rejected the request (HTTP ${ve.status}). Try again.`}),null}const be=await ve.json().catch(()=>null),fe=be==null?void 0:be.shareUrl;return fe?(await navigator.clipboard.writeText(fe).catch(()=>{}),Ie.capture("variants_panel.deploy_succeeded",{sessionId:V,variantId:ue}),Tt.success(`"${_e}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(fe,"_blank","noopener")}}),fe):(Tt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(ve){return Hn.warn("deploy failed",ve),Ie.capture("variants_panel.deploy_failed",{sessionId:V,variantId:ue,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:ve instanceof Error?ve.message:String(ve)}),Tt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),Pv=g.useCallback(async V=>{if(!Me)return;const ue=ce[V.workItemId];if(ue){await navigator.clipboard.writeText(ue).catch(()=>{}),Tt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ue,"_blank","noopener")}});return}oe({kind:"deploy",variantId:V.workItemId});try{const _e=await pl(Me,V.workItemId,V.label);_e&&re(ve=>({...ve,[V.workItemId]:_e}))}finally{oe(null)}},[Me,ce,pl]),Av=g.useCallback(async()=>{if(!(!Me||ft.length===0)){if(Zn){await navigator.clipboard.writeText(Zn).catch(()=>{}),Tt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(Zn,"_blank","noopener")}});return}Ie.capture("variants_panel.deploy_clicked",{sessionId:Me,variantId:"canvas",variantLabel:"Canvas",variantCount:ft.length}),oe({kind:"deploy-canvas"});try{const V=await _t(`/api/variants/${Me}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:ft.map(fe=>fe.workItemId),...i?{projectPath:i}:{}})});if(!V.ok){const{message:fe,errorCode:Xe}=await $i(V);Hn.warn(`canvas deploy failed: HTTP ${V.status} ${Xe??""} ${fe??""}`),Ie.capture("variants_panel.deploy_failed",{sessionId:Me,variantId:"canvas",httpStatus:V.status,errorCode:Xe??null,errorMessage:fe??null,variantCount:ft.length}),Tt.error("Couldn't share this canvas",{description:fe??`The server rejected the request (HTTP ${V.status}). Try again.`});return}const ue=await V.json().catch(()=>null),_e=ue==null?void 0:ue.shareUrl;if(!_e){Tt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const ve=Object.fromEntries(((ue==null?void 0:ue.variants)??[]).filter(fe=>typeof fe.variantId=="string"&&typeof fe.shareUrl=="string").map(fe=>[fe.variantId,fe.shareUrl])),be=Object.keys(ve).length>0?{...ce,...ve}:ce;be!==ce&&re(be),await navigator.clipboard.writeText(_e).catch(()=>{}),Fe({key:tA(ft,be),shareUrl:_e}),Ie.capture("variants_panel.deploy_succeeded",{sessionId:Me,variantId:"canvas",variantCount:ft.length}),Tt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(_e,"_blank","noopener")}})}catch(V){Hn.warn("canvas deploy failed",V),Ie.capture("variants_panel.deploy_failed",{sessionId:Me,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:V instanceof Error?V.message:String(V),variantCount:ft.length}),Tt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{oe(null)}}},[Zn,ft,ce,i,Me]),_n=g.useCallback(async V=>{const ue=`${V.sessionId}:${V.variantId}`,_e=ke[ue];if(_e){await navigator.clipboard.writeText(_e).catch(()=>{}),Tt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(_e,"_blank","noopener")}});return}sn(ue);try{const ve=await pl(V.sessionId,V.variantId,V.label);ve&&dt(be=>({...be,[ue]:ve}))}finally{sn(null)}},[ke,pl]),Fd=g.useCallback(async V=>{if(Me){Ie.capture("variants_panel.remove_clicked",{sessionId:Me,variantId:V.workItemId,variantLabelLength:V.label.length}),oe({kind:"remove",variantId:V.workItemId});try{const ue=await _t(`/api/variants/${Me}/${V.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!ue.ok){const{message:_e}=await $i(ue);Hn.warn(`remove failed: HTTP ${ue.status} ${_e??""}`),Tt.error("Couldn't remove direction",{description:_e??`The server rejected the request (HTTP ${ue.status}). Try again.`});return}(V.workItemId===Mn||V.workItemId===F)&&(D(null),_(null),w(!1),x(_e=>_e+1))}catch(ue){Hn.warn("remove failed",ue),Tt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{oe(null)}}},[Me,F,Mn,D,_,w,x]),ml=g.useCallback(async V=>{if(!Yt){Tt.error("Couldn't remove direction",{description:"No project path available."});return}Ie.capture("variants_panel.remove_past_clicked",{sessionId:V.sessionId,variantId:V.variantId});const ue=`${V.sessionId}:${V.variantId}`,_e=ve=>ve.sessionId===V.sessionId&&ve.variantId===V.variantId;oe({kind:"remove",variantId:ue}),pt(ve=>ve.filter(be=>!_e(be))),G===ue&&(W(null),_(null),w(!1),x(ve=>ve+1));try{const ve=await _t(`/api/variants/history/${encodeURIComponent(V.sessionId)}/${encodeURIComponent(V.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:Yt})});if(!ve.ok){const{message:be}=await $i(ve);pt(fe=>fe.some(_e)?fe:[...fe,V]),Tt.error("Couldn't remove direction",{description:be??`The server rejected the request (HTTP ${ve.status}). Try again.`})}}catch(ve){Hn.warn("remove past failed",ve),pt(be=>be.some(_e)?be:[...be,V]),Tt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{oe(null)}},[Yt,G,W,_,w,x]),Vd=g.useCallback(V=>{ie(V)},[]),jc=g.useCallback(V=>{if(!V.label||!V.run)return;const ue=V.rows.flatMap(ve=>ve.kind==="active"?[ve.variant]:[]),_e=V.rows.flatMap(ve=>ve.kind==="past"?[ve.entry]:[]);ue.length===0&&_e.length===0||ie({kind:"run",label:V.label,variants:ue,entries:_e})},[]),Tv=g.useCallback(async()=>{if(!(!ne||de)){ge(!0);try{if(ne.kind==="active")await Fd(ne.variant);else if(ne.kind==="past")await ml(ne.entry);else{for(const V of ne.variants)await Fd(V);for(const V of ne.entries)await ml(V)}}finally{ge(!1),ie(null)}}},[ne,de,Fd,ml]),[Hd,$c]=g.useState(null),[js,zd]=g.useState(null),ms=g.useCallback(V=>{zd(V)},[]),Rv=g.useCallback(()=>{zd(null)},[]),Iv=g.useCallback(async V=>{const ue=V.trim();if(ue)try{await navigator.clipboard.writeText(ue),Tt.success("Copied")}catch{Tt.error("Couldn't copy")}},[]),Mv=g.useCallback(async(V,ue)=>{zd(null);const _e=ue.trim();if(!_e||V.kind==="original")return;if(V.kind==="active"){if(!Me||_e===V.variant.label)return;Ie.capture("variants_panel.rename",{sessionId:Me,variantId:V.variant.workItemId,labelLength:_e.length,past:!1});try{const fe=await _t(`/api/variants/${Me}/${V.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:_e})});if(!fe.ok){const{message:Xe}=await $i(fe);Tt.error("Couldn't rename direction",{description:Xe??`The server rejected the request (HTTP ${fe.status}). Try again.`})}}catch(fe){Hn.warn("rename failed",fe),Tt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:ve}=V;if(_e===ve.label.trim())return;if(!Yt){Tt.error("Couldn't rename direction",{description:"No project path available."});return}Ie.capture("variants_panel.rename",{sessionId:ve.sessionId,variantId:ve.variantId,labelLength:_e.length,past:!0});const be=fe=>fe.sessionId===ve.sessionId&&fe.variantId===ve.variantId;pt(fe=>fe.map(Xe=>be(Xe)?{...Xe,label:_e}:Xe));try{const fe=await _t(`/api/variants/history/${encodeURIComponent(ve.sessionId)}/${encodeURIComponent(ve.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:_e,projectPath:Yt})});if(!fe.ok){const{message:Xe}=await $i(fe);pt($e=>$e.map(Xt=>be(Xt)?{...Xt,label:ve.label}:Xt)),Tt.error("Couldn't rename direction",{description:Xe??`The server rejected the request (HTTP ${fe.status}). Try again.`})}}catch(fe){Hn.warn("rename failed",fe),pt(Xe=>Xe.map($e=>be($e)?{...$e,label:ve.label}:$e)),Tt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Me,Yt]),[Fc,sa]=g.useState(null),gl=g.useCallback(V=>{sa(V)},[]),Vc=g.useCallback(()=>{sa(null)},[]),Ov=g.useCallback(async(V,ue)=>{if(sa(null),!V.label||!V.run)return;const _e=V.label,ve=ue.trim();if(!ve||ve===_e)return;Ie.capture("variants_panel.rename_run",{runLabelLength:ve.length});const be="requestId"in V.run?V.run.requestId:void 0,fe=be?V.key:V9({sessionId:V.run.sessionId,runLabel:ve}),Xe=fe!==V.key;let $e=!1,Xt=!1;if(i!==null&&Xe){const St=W0(i);$e=St.has(V.key),Xt=St.has(fe),$e&&(St.add(fe),L_(i,St),Q())}const mt=St=>{if(i===null||!Xe)return;const Ht=W0(i);St?Ht.delete(V.key):($e?Ht.add(V.key):Ht.delete(V.key),Xt?Ht.add(fe):Ht.delete(fe)),L_(i,Ht),Q()},xr=new Set(V.rows.flatMap(St=>St.kind==="past"?[`${St.entry.sessionId}:${St.entry.variantId}`]:[])),Gn=St=>xr.has(`${St.sessionId}:${St.variantId}`);pt(St=>St.map(Ht=>Gn(Ht)?{...Ht,runLabel:ve}:Ht));const br=()=>pt(St=>St.map(Ht=>Gn(Ht)?{...Ht,runLabel:_e}:Ht));try{const St=await _t("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:V.run.sessionId,...be?{requestId:be}:{},runLabel:_e,label:ve,...Yt?{projectPath:Yt}:{}})});if(St.ok)mt(!0);else{const{message:Ht}=await $i(St);br(),mt(!1),Tt.error("Couldn't rename run",{description:Ht??`The server rejected the request (HTTP ${St.status}). Try again.`})}}catch(St){Hn.warn("run rename failed",St),br(),mt(!1),Tt.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[Yt,i,pt]);g.useEffect(()=>{const V=n&&!r.current;if(r.current=n,uo.current!==Me){const _e=uo.current===null;uo.current=Me;const ve=t.get(bm);if(V&&Te&&(ve==null?void 0:ve.sessionId)===Te.sessionId&&(ve==null?void 0:ve.variantId)===Te.variantId||(hs.current=null,Fe(null),_(null),w(!1),b(null),j(),D(null),W(null),lt(!1),$d.current=!1,!_e))return}if(G||Le||!Mn||e.active!==!0||hs.current===Mn)return;const ue=Ke.find(_e=>_e.workItemId===Mn);ue&&(hs.current=Mn,j(),Nc(ue))},[Me,n,Te,t,G,Le,Mn,e,Ke,Nc,j,D,W,_,b,w]),g.useEffect(()=>{!q||!nr||(hs.current=null,W(null),D(nr.workItemId),lt(!1))},[nr,q,Me,D,W]),g.useEffect(()=>{!q||nr||ul||W(null)},[nr,q,ul,Me,W,Dn]),g.useEffect(()=>{const V=H.trim().toLowerCase(),ue=[...Ke.map($e=>({kind:"active",variant:$e})),...Dn.map($e=>({kind:"past",entry:$e})),...Ns?[{kind:"original"}]:[]],_e=V?ue.filter($e=>nA($e,V)):ue,{pinned:ve,unpinned:be}=rA(iA(JP(_e,Me),ri),rr,Me),fe=[...z.has(ix)?[]:ve,...be.flatMap($e=>$e.key!==""&&z.has($e.key)?[]:$e.rows)];return fe.length===0?void 0:vU($e=>{if($ee())return;if($e.key==="Enter"){const Ht=Ke.find(Sr=>Sr.workItemId===Hd);Ht&&($e.preventDefault(),hl(Ht));return}if($e.key!=="ArrowUp"&&$e.key!=="ArrowDown")return;$e.preventDefault();const Xt=F??Mn;let mt=Xt?`live:${Xt}`:null;G?mt=`past:${G}`:fl&&(mt=j9);const xr=mt?fe.findIndex(Ht=>wd(Ht)===mt):-1;let Gn;if(xr===-1?Gn=$e.key==="ArrowDown"?0:fe.length-1:$e.key==="ArrowDown"?Gn=Math.min(xr+1,fe.length-1):Gn=Math.max(xr-1,0),Gn===xr)return;const br=fe[Gn];br.kind==="active"?hl(br.variant):br.kind==="past"?ra(br.entry):Dc();const St=document.querySelector(`[data-variant-key="${wd(br)}"]`);St instanceof HTMLElement&&St.focus({preventScroll:!0})})},[Ke,Dn,H,Ns,z,rr,ri,Me,F,G,fl,Mn,Hd,hl,ra,Dc]);const Ud=Ke.find(V=>V.workItemId===Mn)??null,vl=G?Dn.find(V=>`${V.sessionId}:${V.variantId}`===G)??null:null,Bd=!!vl,$s=[...(e.active?Ke:[]).map(V=>({kind:"active",variant:V})),...Dn.map(V=>({kind:"past",entry:V})),...Ns?[{kind:"original"}]:[]],gp=H.trim().toLowerCase(),yl=gp?$s.filter(V=>nA(V,gp)):$s,$t=iA(JP(yl,Me),ri),{pinned:vp,unpinned:yp}=rA($t,rr,Me);let Hc=null;T&&(Hc=T.source==="live"?`live:${T.variantId}`:`past:${T.sessionId}:${T.variantId}`);const _p=new Set(Ke.map(V=>V.requestId).filter(Boolean)),Wd=s.filter(V=>!_p.has(V.requestId)),_l=Wd.length>0,wl=o&&!_l&&$s.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[$s.length>0?S.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:S.jsxs("div",{className:"relative",children:[S.jsx(uY,{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:H,onChange:V=>J(V.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2",children:[_l?S.jsx(Pte,{groups:Wd}):null,wl?S.jsx(Ate,{}):null,e.active&&$s.length===0&&!_l&&!wl?S.jsx(Tte,{}):null,!e.active&&!_l&&!wl&&Dn.length===0&&!Ns?S.jsx(Rte,{isMCPSession:m,mcpEditor:v}):null,$s.length>0&&yl.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",H.trim(),"”."]}):null,yl.length>0?S.jsx(Ste,{groups:yp,pinned:vp,pinnedKeys:co,draggedRowKey:Hc,onDropPin:Zr,onDropUnpin:si,onTogglePin:$n,onReorder:dr,collapsedRuns:z,onToggleRun:N,activeVariantId:F??Mn,activePastKey:G,isOriginalSelected:fl,busy:Y,editingKey:js,onSelectActive:hl,onSelectPast:ra,onSelectOriginal:Dc,onActivePointerDown:qn,onPastPointerDown:ps,onHover:$c,onRemove:V=>Vd({kind:"active",variant:V}),onRemovePast:V=>Vd({kind:"past",entry:V}),onStartRename:ms,onCommitRename:Mv,onCancelRename:Rv,editingRunKey:Fc,onStartRunRename:gl,onCommitRunRename:Ov,onCancelRunRename:Vc,onRemoveRun:jc,onCopyVariantContext:Iv,activeSessionId:e.active?e.sessionId:null,projectPath:Yt}):null]}),u&&Bd&&vl?S.jsx(ite,{entry:vl,deploying:Lt===G,deployedUrl:G?ke[G]??null:null,onDeploy:_n,isDeployDisabled:!d}):null,!Bd&&e.active?S.jsx(Cte,{selectedVariant:Ud,busy:Y,onSend:pp,onDeploy:Pv,onDeployCanvas:Av,canShare:u,canDeploy:d&&(yn==null?void 0:yn.kind)==="fresh",canDeployCanvas:d&&f&&(yn==null?void 0:yn.kind)==="fresh",canSendToAgent:h,canvasVariantCount:ft.length,canvasDeployedUrl:Zn,deployedUrl:Ud?ce[Ud.workItemId]??null:null}):null,S.jsx(_te,{target:ne,isConfirming:de,onCancel:()=>ie(null),onConfirm:Tv})]})},yte=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",_te=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=yte(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return S.jsx(cv,{open:!0,onOpenChange:u=>{!u&&!e&&n()},children:S.jsxs(uv,{children:[S.jsx(dv,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(fv,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(hv,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),S.jsx(pv,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${o} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":l})]})]})})]})})},wd=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:j9,nA=(t,e)=>t.kind==="active"?O_(e,t.variant.label,t.variant.runLabel):t.kind==="past"?O_(e,t.entry.label,t.entry.runLabel,t.entry.brief):O_(e,PS,$9),U9=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,B9=(t,e)=>U9(wd(t),e),rA=(t,e,n)=>{if(e.length===0)return{pinned:[],unpinned:t};const r=new Set(e),s=new Map,i=[];for(const l of t){const u=[];for(const d of l.rows){const f=B9(d,n);r.has(f)?s.set(f,d):u.push(d)}u.length>0&&i.push(u.length===l.rows.length?l:{...l,rows:u})}return{pinned:e.flatMap(l=>{const u=s.get(l);return u?[u]:[]}),unpinned:i}},sA=(t,e,n)=>{if(!e||e.length===0)return t;const r=new Map(e.map((o,l)=>[o,l])),s=t.filter(o=>!r.has(n(o)));if(s.length===t.length)return t;const i=t.flatMap(o=>{const l=r.get(n(o));return l===void 0?[]:[{item:o,index:l}]}).sort((o,l)=>o.index-l.index).map(({item:o})=>o);return[...s,...i]},iA=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:sA(r.rows,s,wd)}});return sA(n,e.groups,r=>r.key)},wte=t=>t.length<=QP?t:`${t.slice(0,QP-1)}…`,xte=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,bte=t=>{var s,i;const e=[t.label.trim(),(s=t.description)==null?void 0:s.trim()].filter(o=>!!o).join(`
112
- `);if(!t.reference)return e;if(t.projectId)return`rivet variants get ${t.projectId}/${t.reference}`;const n=((i=t.projectPath)==null?void 0:i.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"";return`rivet variants get ${t.reference}${r}`},Ste=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:u,onToggleRun:d,activeVariantId:f,activePastKey:h,isOriginalSelected:m,busy:v,editingKey:x,onSelectActive:_,onSelectPast:w,onSelectOriginal:b,onActivePointerDown:k,onPastPointerDown:C,onHover:P,onRemove:T,onRemovePast:M,onStartRename:I,onCommitRename:R,onCancelRename:L,editingRunKey:j,onStartRunRename:F,onCommitRunRename:D,onCancelRunRename:q,onRemoveRun:W,onCopyVariantContext:G,activeSessionId:H,projectPath:J})=>{const B=g.useRef(null),{activeIndex:Q,itemRects:z,sessionRef:N,handlers:Y,registerItem:oe}=_9(B,{snapTolerancePx:5}),[ne,ie]=g.useState(!1),[de,ge]=g.useState(!1),ce=u.has(ix),re=r!==null,Ce=g.useMemo(()=>{if(!r)return null;const Te=U9(r,H);if(n.has(Te))return{container:Bf,key:Te};const Je=t.find(bt=>bt.rows.some(Ke=>wd(Ke)===r));return Je?{container:R_(Je.key),key:r}:null},[r,n,t,H]),Fe=(Ce==null?void 0:Ce.container)===Bf,{dropTarget:ke,onPointerMove:dt,onPointerUp:Lt}=Yee({containerRef:B,dragged:Ce,yieldToSelector:Fe?void 0:"[data-pinned-drop-zone]",restrictToSelector:Fe?"[data-pinned-drop-zone]":void 0,onReorder:l}),sn=Q!==null?z[Q]:null,jt=Te=>Te.kind==="active"?Te.variant.workItemId===f:Te.kind==="past"?`${Te.entry.sessionId}:${Te.entry.variantId}`===h:m,pt=(Te,Je,bt,Ke)=>{const ft=wd(Te),wr=B9(Te,H);return S.jsx(Ete,{rowKey:ft,row:Te,index:Je,isSelected:jt(Te),isEditing:x===ft,isPinned:n.has(wr),onTogglePin:Zn=>o(wr,Zn),reorderContainer:bt,reorderKey:bt===Bf?wr:ft,isNested:Ke,busy:v,registerItem:oe,onSelectActive:_,onSelectPast:w,onSelectOriginal:b,onActivePointerDown:k,onPastPointerDown:C,onHover:P,onRemove:T,onRemovePast:M,onStartRename:I,onCommitRename:R,onCancelRename:L,onCopyVariantContext:G,activeSessionId:H,projectPath:J},ft)};let vn=0;const Le=Te=>{if(Te.key==="")return Te.rows.map(ft=>pt(ft,vn++,R_(Te.key),!1));const Je=u.has(Te.key),bt=Je?null:Te.rows.map(ft=>pt(ft,vn++,R_(Te.key),!0)),Ke=Te.label;return S.jsx(kte,{label:Ke??PS,collapsed:Je,onToggle:()=>d(Te.key),directionCount:Te.rows.length,isEditing:Ke!==null&&j===Te.key,onStartRename:Ke!==null?()=>F(Te.key):void 0,onCommitRename:Ke!==null?ft=>D(Te,ft):void 0,onCancelRename:q,onRemove:Ke!==null?()=>W(Te):void 0,children:bt},Te.key)},lt=e.length>0||re;return S.jsxs("div",{ref:B,className:"relative",onMouseEnter:Y.onMouseEnter,onMouseMove:Y.onMouseMove,onMouseLeave:Y.onMouseLeave,onPointerMove:dt,onPointerUp:Te=>{var Je;if(Fe&&Ce){const bt=(Je=B.current)==null?void 0:Je.querySelector("[data-pinned-drop-zone]"),Ke=bt==null?void 0:bt.getBoundingClientRect();if(!(Ke!==void 0&&Te.clientY>=Ke.top&&Te.clientY<=Ke.bottom)){i(Ce.key);return}}Lt()},children:[Ce&&ke?S.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:ke.top}}):null,S.jsx(As,{children:sn&&S.jsx(Ci.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:sn.top,left:sn.left,width:sn.width,height:sn.height},animate:{opacity:1,top:sn.top,left:sn.left,width:sn.width,height:sn.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Fh.fast,opacity:{duration:.08}}},N.current)}),S.jsxs("ul",{className:"relative flex flex-col gap-2",children:[S.jsx(As,{initial:!1,children:lt?S.jsxs(Ci.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:sx,ease:rx},"data-pinned-drop-zone":"",className:Wt("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",re&&"ring-content-muted/30 ring-1",re&&ne&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:re?()=>ie(!0):void 0,onPointerLeave:re?()=>ie(!1):void 0,onPointerUp:re?()=>{ie(!1),s()}:void 0,children:[S.jsx("div",{"data-hover-dead-zone":"",children:S.jsxs("button",{type:"button",onClick:()=>d(ix),"aria-expanded":!ce,"aria-label":`${ce?"Expand":"Collapse"} pinned items`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[S.jsx(Dw,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),S.jsx(As,{initial:!1,children:!ce&&S.jsx(Ci.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:sx,ease:rx},className:"overflow-hidden",children:e.length>0?S.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Te=>pt(Te,vn++,Bf,!1))}):null},"body")})]},"pinned-section"):null}),lt&&t.length>0?S.jsxs("li",{className:Wt("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",Fe&&"ring-content-muted/30 ring-1",Fe&&de&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:Fe?()=>ge(!0):void 0,onPointerLeave:Fe?()=>ge(!1):void 0,onPointerUp:Fe?()=>ge(!1):void 0,children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[S.jsx(pY,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),S.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Te=>Le(Te))})]}):t.map(Te=>Le(Te))]})]})},W9=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=w9({onDismiss:()=>e(!1)});return S.jsxs(wS,{open:t,onOpenChange:e,children:[S.jsx(Mc,{label:n,children:S.jsx(xS,{asChild:!0,children:S.jsx(to,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:F9,children:S.jsx(aY,{size:15,weight:"bold"})})})}),S.jsx(bS,{children:S.jsx(SS,{ref:s,onKeyDown:i,role:"menu",side:"bottom",align:"end",sideOffset:4,onCloseAutoFocus:o=>o.preventDefault(),className:"bg-popover shadow-surface-4 z-[60] min-w-[160px] rounded-lg p-1",children:r.map(o=>S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,disabled:o.disabled,onClick:l=>{l.stopPropagation(),e(!1),o.onSelect()},onPointerDown:l=>l.stopPropagation(),className:"text-content hover:bg-hover focus:bg-hover flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[o.icon,o.label]},o.key))})})]})},kte=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:u,children:d})=>{const f=ni(),[h,m]=g.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:S.jsx(h3,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:S.jsx(S3,{size:13,weight:"bold"}),onSelect:u}]:[]],x=e?S.jsx(cY,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):S.jsx(lY,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&l?S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[x,S.jsx("span",{className:"min-w-0 flex-1",children:S.jsx(Z9,{initial:t,onCommit:o,onCancel:l})})]}),S.jsx(As,{initial:!1,children:!e&&S.jsx(Ci.ul,{className:"overflow-hidden",children:d},"body")})]}):S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[S.jsxs("button",{type:"button",onClick:_=>{if((_.metaKey||_.ctrlKey)&&v.length>0){m(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[x,S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),v.length>0&&S.jsx("div",{className:Wt("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",h&&"pointer-events-auto opacity-100"),children:S.jsx(W9,{open:h,onOpenChange:m,triggerLabel:`${t} run actions`,actions:v})})]}),S.jsx(As,{initial:!1,children:!e&&S.jsx(Ci.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:sx,ease:rx},className:"overflow-hidden",children:d},"body")})]})},Ete=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:u,isNested:d,busy:f,registerItem:h,onSelectActive:m,onSelectPast:v,onSelectOriginal:x,onActivePointerDown:_,onPastPointerDown:w,onHover:b,onRemove:k,onRemovePast:C,onStartRename:P,onCommitRename:T,onCancelRename:M,onCopyVariantContext:I,activeSessionId:R,projectPath:L})=>{var Ce,Fe;const j=ut(T9),F=g.useRef(null);Dee(h,n,F);const[D,q]=g.useState(!1),W=e.kind==="active",G=e.kind==="original",H=e.kind==="active"?e.variant:null,J=e.kind==="past"?e.entry:null,B=H?H.status==="succeeded":!0,Q=H?dh(H):!0,z=H!==null&&(H.status==="pending"||H.status==="running"),N=(H==null?void 0:H.status)==="failed",Y=(H==null?void 0:H.status)==="cancelled",oe=H!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===H.workItemId,ne=H!==null&&(((Ce=H.refinement)==null?void 0:Ce.status)==="pending"||((Fe=H.refinement)==null?void 0:Fe.status)==="running");let ie=PS;H?ie=H.label||`Direction ${n+1}`:J&&(ie=J.label.trim()||"Untitled direction");let de=$9;H?de=H.description:J&&(de=J.brief);const ge=de?wte(de):null,ce=xte(e,R),re=ce?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:F,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:S.jsx("div",{className:Wt("bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(Z9,{initial:ie,onCommit:ke=>T(e,ke),onCancel:M}),ge&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:ge})]})})}):S.jsxs("li",{ref:F,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:Wt("group relative z-10 rounded-md",r&&"bg-main-input"),onMouseEnter:H?()=>b(H.workItemId):void 0,onMouseLeave:W?()=>b(null):void 0,children:[S.jsx("div",{role:"button",tabIndex:0,"data-variant-id":H==null?void 0:H.workItemId,"data-variant-key":t,onClick:ke=>{if(ke.metaKey||ke.ctrlKey){q(!0);return}const dt=window.getSelection();dt&&!dt.isCollapsed||(e.kind==="active"?m(e.variant):e.kind==="past"?v(e.entry):x())},onKeyDown:ke=>{(ke.key==="Enter"||ke.key===" ")&&(ke.preventDefault(),ke.stopPropagation(),e.kind==="active"?m(e.variant):e.kind==="past"?v(e.entry):x())},onPointerDown:ke=>{ke.metaKey||ke.ctrlKey||(e.kind==="active"?Q&&_(e.variant.workItemId,ke):e.kind==="past"&&w(e.entry,ke))},"aria-pressed":r,"aria-disabled":W?!1:void 0,"aria-busy":z||ne,className:Wt("flex w-full items-start gap-2 rounded-md py-2 pr-3 text-left transition-colors focus:outline-none",d?"pl-[33px]":"pl-3",Q&&"cursor-grab active:cursor-grabbing",!Q&&"cursor-pointer"),style:Q?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(z||ne)&&S.jsx(CS,{className:"text-content-muted shrink-0 text-sm","data-testid":ne&&!z?"variant-refining":void 0}),S.jsx(Mc,{label:"Double-click to rename",disabled:G,children:S.jsx("span",{onDoubleClick:ke=>{ke.stopPropagation(),G||P(t)},className:Wt("min-w-0 flex-1 truncate text-sm font-medium select-text",G?"cursor-default":"cursor-text",B||r?"text-content":"text-content-muted"),children:ie})}),N&&S.jsx(Mc,{label:(H==null?void 0:H.errorMessage)??(H==null?void 0:H.errorCode)??"Failed",disabled:!(H!=null&&H.errorMessage)&&!(H!=null&&H.errorCode),children:S.jsx("span",{className:"shrink-0",children:S.jsx(oA,{label:"Failed"})})}),Y&&S.jsx(oA,{label:"Cancelled"})]}),ge&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:ge})]})}),G?null:S.jsx(mX,{references:(H==null?void 0:H.references)??(J==null?void 0:J.references),source:W?"active":"history",sessionId:(J==null?void 0:J.sessionId)??R,variantId:(J==null?void 0:J.variantId)??(H==null?void 0:H.workItemId),projectPath:L,className:d?"pl-[33px]":"pl-3"}),S.jsxs("div",{className:Wt("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150 motion-reduce:transition-none","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",D&&"pointer-events-auto opacity-100"),children:[S.jsx(to,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:ke=>ke.stopPropagation(),onKeyDown:ke=>{(ke.key!=="ArrowUp"&&ke.key!=="ArrowDown"||ke.altKey||ke.ctrlKey||ke.metaKey||ke.shiftKey)&&ke.stopPropagation()},onClick:ke=>{ke.stopPropagation(),o("button")},className:F9,children:S.jsx(Dw,{weight:i?"fill":"bold"})}),S.jsx(W9,{open:D,onOpenChange:q,triggerLabel:"Direction actions",actions:[...de||ce?[{key:"copy",label:re,icon:S.jsx(Oh,{size:13,weight:"bold"}),onSelect:()=>I(bte({label:ie,description:de,reference:ce,projectId:j,projectPath:L}))}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:S.jsx(Dw,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...G?[]:[{key:"rename",label:"Rename",icon:S.jsx(h3,{size:13,weight:"bold"}),onSelect:()=>P(t)},{key:"remove",label:"Remove",icon:S.jsx(S3,{size:13,weight:"bold"}),disabled:oe,onSelect:()=>{e.kind==="active"?k(e.variant):e.kind==="past"&&C(e.entry)}}]]})]})]})},Z9=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=g.useState(t),i=g.useRef(!1),o=g.useCallback(u=>{u&&(u.focus(),u.select())},[]),l=u=>{i.current||(i.current=!0,u?e(r):n())};return S.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:u=>s(u.target.value),onKeyDown:u=>{u.stopPropagation(),u.key==="Enter"?(u.preventDefault(),l(!0)):u.key==="Escape"&&(u.preventDefault(),l(!1))},onBlur:()=>l(!0),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},oA=({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}),Cte=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canShare:i,canDeploy:o,canDeployCanvas:l,canSendToAgent:u,canvasVariantCount:d,canvasDeployedUrl:f,deployedUrl:h})=>{var R,L,j,F;const m=t?((L=(R=t.actions)==null?void 0:R.commit)==null?void 0:L.enabled)??t.status==="succeeded":!1,v=m&&e===null,x=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),w=(e==null?void 0:e.kind)==="deploy-canvas",b=!o||!m||e!==null,k=l&&d>0,P=_?"Deploying…":h?"Copy link":"Share",M=w?"Sharing…":f?"Copy canvas link":"Share canvas",I=x?"Applying…":"Apply to project";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),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:[i?S.jsx(M9,{primaryLabel:P,primaryIcon:h&&!_?Oh:void 0,primaryAction:()=>{t&&r(t)},isDisabled:b,isDropdownDisabled:e!==null,isLoading:_,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:k?[{label:M,icon:f&&!w?Oh:void 0,onClick:s,isDisabled:e!==null}]:[]}):null,u?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!v,title:(F=(j=t==null?void 0:t.actions)==null?void 0:j.commit)==null?void 0:F.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:I}):null]})]})},q9=()=>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(CS,{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"})})]})}),Pte=({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(q9,{},`${e.requestId}-${r}`)))}),Ate=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(q9,{},e))}),Tte=()=>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."})]}),aA="Try different ways to create a dropdown that feels fluid and dynamic",Rte=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=g.useState(!1),s=rte(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(aA).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:["“",aA,"”"]}),S.jsx("button",{type:"button",onClick:o,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?S.jsx(oY,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(Oh,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},Ite="rivet:show-projects",Mte=t=>{const e=new URLSearchParams(t),n=e.get("libraryOrigin");if(e.get("library")!=="1"||!n)return null;try{const r=new URL(n);return r.protocol!=="http:"&&r.protocol!=="https:"?null:r.origin}catch{return null}},Ote=gn({url:Ge().url()}),Lte=({onClose:t,libraryOrigin:e})=>{const n=ni(),r=ut(S9),s=ut(gv),i=Mte(window.location.search),o=window.parent!==window&&i!==null,l=(s==null?void 0:s.split(/[\\/]/).filter(Boolean).pop())??"Project";if(!t)return null;let u=r?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:r,children:r}):S.jsx("span",{});if(o||e){const d=S.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[S.jsx("li",{className:"shrink-0",children:S.jsx("button",{type:"button",onClick:async()=>{if(o&&i)window.parent.postMessage(Ite,i);else{try{const f=await _t("/api/library/browser-launches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({view:"projects"})});if(!f.ok)throw new Error("The project library could not be opened.");const{url:h}=Ote.parse(await f.json());window.location.assign(h)}catch{Tt.error("Could not open the project library. Please try again.");return}n==null||n.capture("library_view_changed",{view:"projects"})}},className:"text-content-subtle hover:bg-main-input hover:text-content focus-visible:outline-content rounded px-1 py-1 focus-visible:outline focus-visible:outline-2",children:"Projects"})}),S.jsx("li",{"aria-hidden":!0,className:"text-content-subtle shrink-0",children:S.jsx(sY,{className:"h-3 w-3"})}),S.jsx("li",{className:"min-w-0",children:S.jsx("span",{"aria-current":"page",title:l,className:"text-content block truncate font-medium",children:l})})]});u=S.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:d})}return S.jsxs("div",{className:"border-main-border bg-main-light z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b px-2.5 py-2.5",children:[u,S.jsx(Mc,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,"aria-label":"Close panel",className:"text-content-subtle hover:bg-main-input hover:text-content flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 transition-colors",children:S.jsx(dY,{className:"h-4 w-4",weight:"bold"})})})]})},Nte=5e3,Dte=()=>{const t=window.location.pathname.startsWith("/rivet/library");return Ph({queryKey:["rivet-account"],queryFn:async({signal:e})=>{const n=await _t(t?"/api/account":"/api/config",{signal:e});if(!n.ok)throw new Error("Could not load your account.");if(t)return n.json();const r=await n.json();return{isAuthenticated:r.agentModeAvailable,name:r.name,email:r.email,userId:r.userId}},refetchInterval:Nte,retry:!1})},Tg="rivet_just_signed_in",ox="https://rivet-proxy.onrender.com",jte=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},D_=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s,entryPoint:i="editor_gate"})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:i,method:"google_oauth",...s?{failure_reason:s}:{}}}),lA=Ls("useLogin"),$te=2e3,Fte=60,cA="Connecting to Google...",Vte=`<!doctype html>
113
- <html lang="en">
114
- <head>
115
- <meta charset="utf-8" />
116
- <meta name="viewport" content="width=device-width, initial-scale=1" />
117
- <title>${cA}</title>
118
- <style>
119
- :root { color-scheme: light dark; }
120
- body {
121
- margin: 0;
122
- min-height: 100vh;
123
- display: grid;
124
- place-items: center;
125
- font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
126
- background: #111215;
127
- color: #f3f4f6;
128
- }
129
- .panel {
130
- border: 1px solid rgba(255, 255, 255, 0.16);
131
- border-radius: 12px;
132
- padding: 18px 22px;
133
- background: rgba(255, 255, 255, 0.06);
134
- font-size: 14px;
135
- }
136
- </style>
137
- </head>
138
- <body>
139
- <div class="panel">${cA}</div>
140
- </body>
141
- </html>`,Hte=gn({success:Ua(),authUrl:Ge().optional(),sessionId:Ge().optional(),pollSecret:Ge().optional(),error:Ge().optional(),message:Ge().optional()}),zte=gn({success:Ua(),token:Ge().optional(),refreshToken:Ge().optional(),user:gn({id:Ge().optional(),email:Ge().optional()}).optional(),error:Ge().optional(),message:Ge().optional()}),Ute="/api/auth/install-ref",Bte=gn({installRef:Ge().nullable()}),Wte=async()=>{try{const t=await fetch(Ute);if(!t.ok)return;const e=Bte.safeParse(await t.json());return e.success?e.data.installRef??void 0:void 0}catch{return}},G9=(t="editor_gate",e)=>{const n=ni(),[r,s]=g.useState(!1),[i,o]=g.useState(null);return{startLogin:g.useCallback(async()=>{var m;const u=globalThis.crypto.randomUUID(),d=Date.now();s(!0),o(null);const f=D_({outcome:"started",authAttemptId:u,entryPoint:t,startedAt:d,now:d});n==null||n.capture(f.event,f.properties);let h=null;try{if(h=window.open("","_blank"),!h)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{h.document.open(),h.document.write(Vte),h.document.close()}catch(b){lA.warn("Failed to render loading state in auth popup:",b)}const v=await Wte(),x=await fetch(`${ox}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core",...v?{ref:v}:{}})}),_=Hte.safeParse(await x.json());if(!_.success)throw new Error("Invalid Google login response");const w=_.data;if(!x.ok||!w.success||!w.authUrl||!w.sessionId||!w.pollSecret)throw new Error(w.error||w.message||"Failed to start Google login");if(h.closed)throw new Error("Sign-in window was closed before Google login started.");h.location.href=w.authUrl;for(let b=0;b<Fte;b+=1){if(h.closed)throw new Error("Sign-in window was closed before authentication completed.");const k=await fetch(`${ox}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:w.sessionId,pollSecret:w.pollSecret})}),C=zte.safeParse(await k.json());if(!C.success)throw new Error("Invalid Google token response");const P=C.data;if(P.success&&P.token&&((m=P.user)!=null&&m.email)){const T={email:P.user.email,token:P.token,refreshToken:P.refreshToken,userId:P.user.id,...v?{installRef:v}:{}};if(e)await e(T);else if(!(await _t("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})).ok)throw new Error("Signed in, but failed to store session locally.");h.close(),window.sessionStorage.setItem(Tg,"1");const M=D_({outcome:"completed",authAttemptId:u,entryPoint:t,startedAt:d,now:Date.now()});n==null||n.capture(M.event,M.properties),window.location.reload();return}if(P.error&&P.error!=="Pending")throw new Error(P.error||"Google login failed");await new Promise(T=>setTimeout(T,$te))}throw new Error("Authentication timed out. Please try again.")}catch(v){h&&!h.closed&&h.close();const x=Or(v,"Failed to start login flow");lA.warn("Login failed:",x);const _=D_({outcome:"failed",authAttemptId:u,entryPoint:t,startedAt:d,now:Date.now(),failureReason:jte(x)});n==null||n.capture(_.event,_.properties),o(x),s(!1)}},[n,t,e]),isStartingLogin:r,loginError:i}},Zte=Ls("useIntegrations"),qte=gn({provider:Ge(),status:Ge(),externalUsername:Ge().nullable(),connectedAt:Ge()}),Gte=gn({integrations:Ac(qte).optional()}),Kte=gn({authUrl:Ge().min(1).optional(),error:Ge().optional()}),Yte=gn({error:Ge().optional()}),j_=["integrations"],Xte="rivet:connect-result",Qte=t=>typeof t=="object"&&t!==null&&t.type===Xte,Jte=Zt(null),uA=async()=>{const t=await _t("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return Gte.parse(await t.json()).integrations??[]},ene=()=>{const t=XR(),[e,n]=gI(Jte),r=Ph({queryKey:j_,queryFn:uA,staleTime:1e4}),s=g.useCallback(async()=>(await t.invalidateQueries({queryKey:j_,refetchType:"none"}),t.fetchQuery({queryKey:j_,queryFn:uA})),[t]),i=g.useCallback(async l=>{const u=window.open("","_blank","width=560,height=720");if(!u)throw new Error("Popup blocked. Allow popups to connect.");n(l);try{const d=await _t(`/api/integrations/${l}/connect`,{method:"POST"}),f=Kte.safeParse(await d.json().catch(()=>({}))),h=f.success?f.data:{};if(!d.ok||!h.authUrl)throw u.close(),new Error(h.error||`Could not connect ${l}`);return u.location.href=h.authUrl,await new Promise(m=>{let v=!1,x=null;const _=async(b,k=!1)=>{if(!v){v=!0,window.removeEventListener("message",w),x&&clearInterval(x);try{const P=(await s()).some(T=>T.provider===l&&T.status==="connected");m(k&&P?"connected":b)}catch{m(b)}}},w=b=>{if(Qte(b.data)&&b.data.provider===l){if(b.data.status==="error"){Zte.warn(`Connect failed for ${l}:`,b.data.message),_("failed");return}_("connected")}};window.addEventListener("message",w),x=setInterval(()=>{u.closed&&_("closed",!0)},500)})}finally{n(null)}},[s,n]),o=g.useCallback(async l=>{n(l);try{const u=await _t(`/api/integrations/${l}`,{method:"DELETE"});if(!u.ok){const d=Yte.safeParse(await u.json().catch(()=>({}))),f=d.success?d.data:{};throw new Error(f.error||`Could not disconnect ${l}`)}await s()}finally{n(null)}},[s,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:o,refetch:s}},Hl=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),up=async(t,e="GET",n)=>{if(window.location.pathname.startsWith("/rivet/library"))return uz(t,{method:e,body:n});const r=await _t(t.replace(/^\/profile/,"/api/reference-profiles"),{method:e,headers:{"Content-Type":"application/json"},...n!==void 0?{body:JSON.stringify(n)}:{}}),s=await r.text();let i;try{i=JSON.parse(s)}catch{throw new Error(`Reference profile request failed (${r.status})`)}if(!r.ok)throw new Error(i.error??`Request failed (${r.status})`);return i},K9=()=>up("/profile"),tne=t=>Ph({queryKey:["cosmos-profile"],queryFn:K9,enabled:t}),nne=t=>up("/profile/discoveries","POST",{url:t}),rne=({discoveryId:t,collectionIds:e,runtime:n})=>up("/profile/import-plans","POST",{discoveryId:t,collectionIds:e,runtime:n}),sne=t=>up("/profile","PATCH",{isEnabled:!0,runtime:t}),ine=t=>up(`/profile/import-plans/${t.id}/imports`,"POST",{revision:t.revision,isApproved:!0}),ax=Ge().regex(/^[1-9]\d{0,15}$/).refine(t=>Number.isSafeInteger(Number(t))),one=Ge().min(1).max(4096),Y9=t=>{const e=()=>new Error("Use an HTTPS Cosmos profile URL such as https://www.cosmos.so/username");let n;try{n=new URL(t)}catch{throw e()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length!==1)throw e();let s;try{s=decodeURIComponent(r[0])}catch{throw e()}if(!/^[a-zA-Z0-9_.-]{1,100}$/.test(s)||["e","login","signup","explore","search","collections","settings","api","profile"].includes(s.toLowerCase()))throw e();return{username:s,url:`https://www.cosmos.so/${encodeURIComponent(s)}`}};Ge().max(2048).transform((t,e)=>{try{return Y9(t).url}catch(n){return e.addIssue({code:xe.custom,message:Or(n,"Invalid Cosmos profile URL")}),nz}});const ane=t=>{const e=()=>new Error("Use an HTTPS Cosmos collection URL such as https://www.cosmos.so/owner/collection");let n;try{n=new URL(t)}catch{throw e()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length<2||r.length>3||r[0]==="e")throw e();let s;try{s=r.map(i=>decodeURIComponent(i))}catch{throw e()}if(s.some(i=>!i.length||i.length>300||/[/\\\p{Cc}]/u.test(i)))throw e();return{ownerUsername:s[0],slug:s[1],subcollectionSlug:s[2],url:`https://www.cosmos.so/${s.map(encodeURIComponent).join("/")}`}},lne=Ge().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&e.hostname==="cdn.cosmos.so"&&!e.username&&!e.password&&!e.port}),cne=gn({id:ax,title:Ge().min(1).max(500),url:Ge().url().transform(t=>ane(t).url),children:Ac(ax)}),une=gn({id:ax,url:Ge().url(),title:Ge().max(1e3),text:Ge().max(1e5),author:Ge().nullable(),owner:Ge().nullable(),sourceUrl:Ge().url().nullable(),images:Ac(gn({url:lne,representation:lr(["image","video-cover"])})).max(100),unsupportedReason:Ge().optional()}),dne=gn({collection:cne,elements:Ac(une),total:lb().int().nonnegative(),nextCursor:one.nullable()});tz("status",[dne.extend({status:xE("ok")}),gn({status:xE("error"),message:Ge(),reason:lr(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:lb().nonnegative().optional()})]);const fne=({isOpen:t,onClose:e,onImported:n})=>{const[r,s]=g.useState(""),[i,o]=g.useState(null),[l,u]=g.useState([]),[d,f]=g.useState(""),[h,m]=g.useState(null),[v,x]=g.useState(null),[_,w]=g.useState(!1),b=g.useRef(0),k=ni(),C=()=>{b.current+=1,s(""),o(null),u([]),f(""),m(null),x(null),w(!1)},P=()=>{k==null||k.capture("visual_editor_cosmos_modal_closed"),C(),e()},T=async L=>{L.preventDefault(),x(null);let j;try{j=Y9(r.trim()).url}catch(D){x(Or(D,"Invalid Cosmos profile URL"));return}k==null||k.capture("visual_editor_cosmos_discovery_started");const F=++b.current;w(!0);try{const D=await nne(j);if(F!==b.current)return;o(D),u([]),k==null||k.capture("visual_editor_cosmos_discovery_completed",{collection_count:D.collections.length})}catch(D){if(F!==b.current)return;x(Or(D,"Could not find Cosmos profile")),k==null||k.capture("visual_editor_cosmos_discovery_failed")}finally{F===b.current&&w(!1)}},M=async()=>{if(!i||l.length===0||!d)return;x(null),k==null||k.capture("visual_editor_cosmos_plan_started",{collection_count:l.length,runtime:d});const L=++b.current;w(!0);try{const j=await rne({discoveryId:i.id,collectionIds:l,runtime:d});if(L!==b.current)return;m(j),k==null||k.capture("visual_editor_cosmos_plan_completed",{collection_count:j.collectionCount,reference_count:j.referenceCount})}catch(j){if(L!==b.current)return;x(Or(j,"Could not prepare import plan")),k==null||k.capture("visual_editor_cosmos_plan_failed")}finally{L===b.current&&w(!1)}},I=async()=>{if(!h||!d)return;x(null),k==null||k.capture("visual_editor_cosmos_import_started",{collection_count:h.collectionCount,reference_count:h.referenceCount});const L=++b.current;w(!0);try{if((await K9()).profile.isEnabled||await sne(d),await ine(h),k==null||k.capture("visual_editor_cosmos_import_completed",{reference_count:h.referenceCount}),n(),L!==b.current)return;C(),e()}catch(j){if(k==null||k.capture("visual_editor_cosmos_import_failed"),L!==b.current)return;x(Or(j,"Could not start Cosmos import"))}finally{L===b.current&&w(!1)}},R=L=>{u(j=>j.includes(L)?j.filter(F=>F!==L):[...j,L]),k==null||k.capture("visual_editor_cosmos_collection_toggled")};return S.jsx(cv,{open:t,onOpenChange:L=>!L&&P(),children:S.jsxs(uv,{children:[S.jsx(dv,{className:"z-max fixed inset-0 bg-black/60"}),S.jsxs(fv,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 max-h-[min(680px,calc(100vh-32px))] w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-lg border shadow-2xl outline-none",children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(hv,{className:"text-content text-base font-medium",children:"Connect Cosmos"}),S.jsx(to,{onClick:P,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(Zb,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"space-y-4 p-4",children:[S.jsx(pv,{className:"text-content-subtle text-sm",children:"Add public collections from a Cosmos profile to your design references."}),i?null:S.jsxs("form",{onSubmit:L=>void T(L),className:"space-y-4",children:[S.jsx("label",{className:"text-content block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),S.jsx("input",{id:"cosmos-profile-url",type:"url",required:!0,autoFocus:!0,value:r,onChange:L=>s(L.target.value),placeholder:"https://www.cosmos.so/username",className:"border-main-border bg-main-input text-content placeholder:text-content-muted focus:border-secondary w-full rounded-md border px-3 py-2 text-sm outline-none"}),S.jsx("button",{type:"submit",disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Finding collections…":"Continue"})]}),i&&!h?S.jsxs("div",{className:"space-y-4",children:[S.jsxs("p",{className:"text-content text-sm font-medium",children:["Choose collections from"," ",i.profile.title||i.profile.username]}),S.jsx("div",{className:"border-main-border max-h-60 divide-y overflow-y-auto rounded-md border",children:i.collections.map(L=>S.jsxs("label",{className:"text-content hover:bg-main-light flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[S.jsx("input",{type:"checkbox",checked:l.includes(L.id),disabled:_,onChange:()=>R(L.id)}),S.jsx("span",{className:"min-w-0 flex-1 truncate",children:L.title}),S.jsx("span",{className:"text-content-muted text-xs",children:L.total??"—"})]},L.id))}),i.collections.length===0?S.jsx("p",{className:"text-content-muted text-sm",children:"No public collections found for this profile."}):null,S.jsxs("label",{className:"text-content flex items-center justify-between gap-3 text-sm",children:["Analysis runtime",S.jsxs("select",{value:d,disabled:_,onChange:L=>{const j=L.target.value;f(j),k==null||k.capture("visual_editor_cosmos_runtime_selected",{runtime:j})},className:"border-main-border bg-main-input rounded-md border px-2 py-1.5",children:[S.jsx("option",{value:"",disabled:!0,children:"Select a runtime"}),S.jsx("option",{value:"codex",children:"Codex"}),S.jsx("option",{value:"claude",children:"Claude"}),S.jsx("option",{value:"cursor",children:"Cursor"})]})]}),S.jsx("button",{type:"button",onClick:()=>void M(),disabled:_||l.length===0||!d,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Preparing plan…":"Review import plan"}),S.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_profile_changed"),C()},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Use another profile"})]}):null,h?S.jsxs("div",{className:"space-y-4 text-sm",children:[S.jsxs("p",{className:"text-content",children:[h.collectionCount," ",h.collectionCount===1?"collection":"collections"," ·"," ",h.referenceCount," ",h.referenceCount===1?"reference":"references"," ·"," ",h.imageCount," ",h.imageCount===1?"image":"images"]}),S.jsx("p",{className:"text-content-subtle",children:h.scopeDisclosure}),S.jsx("p",{className:"text-content-subtle",children:h.usageDisclosure}),S.jsxs("p",{className:"text-content-muted text-xs",children:[h.reusableCount," reusable · ",h.unsupportedCount," ","unsupported · runtime: ",d]}),S.jsx("button",{type:"button",onClick:()=>void I(),disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Starting import…":"Approve and import"}),S.jsx("button",{type:"button",onClick:()=>{k==null||k.capture("visual_editor_cosmos_plan_revised"),m(null)},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Change selection"})]}):null,v?S.jsx("p",{role:"alert",className:"text-sm text-red-300",children:v}):null]})]})]})})},dA=Ls("ConnectorsModal"),hne=[{provider:"x",name:"X",iconClassName:"text-content",icon:S.jsx(ch,{provider:"x"})},{provider:"pinterest",name:"Pinterest",iconClassName:"text-[#e60023]",icon:S.jsx(ch,{provider:"pinterest"})},{provider:"arena",name:"Are.na",iconClassName:"text-content",icon:S.jsx(ch,{provider:"arena"})}],pne={name:"Cosmos",iconClassName:"text-content",icon:S.jsx(ch,{provider:"cosmos"})},fA=({meta:t,status:e,actionLabel:n,buttonLabel:r,isDisabled:s,isHighlighted:i,onAction:o})=>S.jsxs("li",{className:`flex min-h-[64px] items-center gap-3 py-3 ${i?"ring-secondary -mx-2 rounded-md px-2 ring-2":""}`,children:[S.jsx("span",{className:`grid h-7 w-7 flex-none place-items-center ${t.iconClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("span",{className:"text-content block text-sm font-medium",children:t.name}),S.jsx("span",{className:"text-content-muted block truncate text-xs",children:e})]}),S.jsx("button",{type:"button","aria-label":n,onClick:o,disabled:s,className:"active-push bg-main-input text-content hover:bg-main-input/80 inline-flex min-h-8 w-24 flex-none items-center justify-center rounded-md px-3 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:r})]}),lx=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{var M;const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:u,disconnect:d}=ene(),f=ni(),[h,m]=g.useState(null),[v,x]=g.useState(!1),_=tne(t),w=I=>s.find(R=>R.provider===I),b=g.useCallback(I=>{const R=Date.now(),L=Hl({action:"connect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(L.event,L.properties),u(I).then(j=>{const F=Date.now()-R;if(j==="connected"){const q=Hl({action:"connect",outcome:"completed",provider:I,entryPoint:n,durationMs:F});f==null||f.capture(q.event,q.properties);return}const D=Hl({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:F,failureReason:j==="closed"?"popup_closed":"provider_failed"});f==null||f.capture(D.event,D.properties)}).catch(j=>{const F=Or(j,"Could not connect."),D=Hl({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-R,failureReason:F.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture(D.event,D.properties),dA.warn(`Connect error for ${I}:`,F),Tt.error(F)})},[u,n,f]),k=g.useCallback(I=>{const R=Date.now(),L=Hl({action:"disconnect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(L.event,L.properties),d(I).then(()=>{const j=Hl({action:"disconnect",outcome:"completed",provider:I,entryPoint:n,durationMs:Date.now()-R});f==null||f.capture(j.event,j.properties)}).catch(j=>{const F=Or(j,"Could not disconnect."),D=Hl({action:"disconnect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-R,failureReason:"request_failed"});f==null||f.capture(D.event,D.properties),dA.warn(`Disconnect error for ${I}:`,F),Tt.error(F)})},[n,d,f]),C=n==="onboarding",P=(M=_.data)==null?void 0:M.sources.some(I=>I.provider==="cosmos");let T=P?"Connected":"Not connected";return _.isError&&(T="Status unavailable"),_.isPending&&(T="Checking status…"),S.jsxs(S.Fragment,{children:[S.jsx(cv,{open:t,onOpenChange:I=>!I&&e(),children:S.jsxs(uv,{children:[S.jsx(dv,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(fv,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(e9,{value:h,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(hv,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(to,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(Zb,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(pv,{className:"text-content-subtle text-sm",children:"Connect your references to add them to your Rivet library. Rivet can use them to inspire new design directions."}),o?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,S.jsxs("ul",{className:"divide-main-border divide-y","aria-label":"Design reference services",children:[hne.map(I=>{const R=w(I.provider),L=(R==null?void 0:R.status)==="connected",j=R==null?void 0:R.externalUsername;let F=L?`Connected${j?` as @${j}`:""}`:"Not connected";i&&(F="Checking status…");const D=l===I.provider,q=L?"Disconnect":"Connect";return S.jsx(fA,{meta:I,status:F,actionLabel:`${q} ${I.name}`,buttonLabel:D?`${q}ing…`:q,isDisabled:i||D,isHighlighted:r===I.provider,onAction:()=>L?k(I.provider):b(I.provider)},I.provider)}),S.jsx(fA,{meta:pne,status:T,actionLabel:P?"Add Cosmos profile":"Connect Cosmos",buttonLabel:P?"Add profile":"Connect",isDisabled:!1,isHighlighted:!1,onAction:()=>{f==null||f.capture("visual_editor_cosmos_modal_opened"),x(!0)}})]}),C?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})}),S.jsx(fne,{isOpen:v,onClose:()=>x(!1),onImported:()=>{_.refetch()}})]})},hA=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),mne=Ls("SupportTicketModal"),pA=5e3,$_="feedback",gne=gn({error:Ge().optional(),details:ez([Ge(),gn({formErrors:Ac(Ge()).optional(),fieldErrors:WR(Ge(),Ac(Ge()).optional()).optional()})]).optional()}),vne=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},yne=async t=>{let e;try{const n=gne.safeParse(await t.json());e=n.success?n.data:void 0}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=vne(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}`},_ne=({isOpen:t,onClose:e,contactEmail:n})=>{const r=ni(),[s,i]=g.useState(""),[o,l]=g.useState(!1),[u,d]=g.useState(null),f=g.useCallback(()=>{i("")},[]),h=g.useCallback(()=>{o||(f(),e())},[o,e,f]),m=g.useCallback(async()=>{const w=s.trim();if(!(!w||o)){l(!0);try{const b=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,k=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,C=n==null?void 0:n.trim(),P=await _t("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:$_,message:w,contactEmail:C||void 0,metadata:{posthogSessionId:b??void 0,posthogDistinctId:k??void 0,appVersion:"0.25.0",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!P.ok){const T=await yne(P);throw new Error(T)}r==null||r.capture("support_ticket_submitted",{ticket_type:$_,has_posthog_session_id:!!b}),Tt.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(b){const k=Or(b,"Failed to send message");r==null||r.capture("support_ticket_submit_failed",{ticket_type:$_,error:k}),mne.error("Failed to submit support ticket:",k),Tt.error("Could not send feedback",{description:k})}finally{l(!1)}}},[n,o,s,e,r,f]),v=g.useCallback(w=>{w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())},[m]),x=pA-s.length,_=o||s.trim().length===0;return S.jsx(cv,{open:t,onOpenChange:w=>!w&&h(),children:S.jsxs(uv,{children:[S.jsx(dv,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(fv,{ref:d,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(e9,{value:u,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(hv,{className:"text-content text-base font-medium",children:"Send feedback"}),S.jsx(to,{onClick:h,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(Zb,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(pv,{className:"text-content-subtle text-sm",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"bg-main-input rounded-lg outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:w=>i(w.target.value),onKeyDown:v,maxLength:pA,rows:6,disabled:o,placeholder:"What happened?",className:"text-content placeholder-content-subtle max-h-64 w-full resize-none overflow-y-auto bg-transparent pt-3 pr-3 pb-1 pl-3 text-sm focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[S.jsx("span",{className:"text-content-subtle text-xs",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[x<=500&&S.jsx("span",{className:"text-content-subtle text-xs",children:x}),S.jsx(to,{onClick:m,disabled:_,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",size:"icon-compact",children:o?S.jsx(Jg,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(nY,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},wne=Ls("ProfileAvatar"),X9=(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):""},xne=(t,e)=>X9(t,e).charAt(0).toUpperCase(),bne=({className:t="",side:e="bottom",align:n="end"})=>{var q,W,G;const r=Dte(),s=((q=r.data)==null?void 0:q.name)??null,i=((W=r.data)==null?void 0:W.email)??null,o=((G=r.data)==null?void 0:G.isAuthenticated)===!0,l=ni(),{startLogin:u,isStartingLogin:d,loginError:f}=G9("account_menu"),[h,m]=g.useState(!1),[v,x]=g.useState(!1),[_,w]=g.useState(!1),[b,k]=g.useState(!1),{containerRef:C,onKeyDown:P,onCloseAutoFocus:T}=w9({onDismiss:()=>D(!1)}),M=xne(s,i);if(r.isPending)return S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(hA,{className:"h-8 w-8 rounded-full"}),S.jsx(hA,{className:"h-3.5 w-16"})]});const I=X9(s,i),R=(s==null?void 0:s.trim())||null,L=(i==null?void 0:i.trim())||null,j=async()=>{k(!0);try{const H=await _t("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!H.ok)throw new Error(`Logout failed: ${H.status}`);window.location.pathname.startsWith("/rivet/library")&&qR()}catch(H){wne.warn("Logout request failed",H),Tt.error("Could not log out. Please try again."),k(!1);return}window.location.reload()};let F="Log in";o&&(F=I||"Account"),r.error&&!r.data&&(F="Account unavailable");const D=H=>{m(H),l==null||l.capture(`visual_editor_account_menu_${H?"opened":"closed"}`,{is_authenticated:o})};return S.jsxs(S.Fragment,{children:[S.jsxs(wS,{open:h,onOpenChange:D,children:[S.jsx(xS,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account","data-rivet-private":!0,className:`ph-no-capture text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[S.jsx("span",{className:"border-main-border bg-main-input flex h-8 w-8 items-center justify-center rounded-full border text-xs leading-none font-semibold",children:M||S.jsx(mY,{className:"h-4 w-4",weight:"bold"})}),S.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:F})]})}),S.jsx(bS,{children:S.jsxs(SS,{"data-rivet-private":!0,ref:C,onKeyDown:P,onCloseAutoFocus:T,role:"menu",className:"ph-no-capture bg-popover shadow-surface-4 z-[60] min-w-[180px] rounded-lg p-1",side:e,sideOffset:6,align:n,children:[R||L?S.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[R?S.jsx("div",{className:"text-content truncate text-sm font-medium",children:R}):null,L?S.jsx("div",{className:"text-content-muted truncate text-xs",children:L}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{D(!1),x(!0)},disabled:!o,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(x3,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{D(!1),w(!0)},className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none",children:[S.jsx(iY,{className:"h-4 w-4",weight:"bold"}),"Share feedback"]}),o?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:j,disabled:b,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(hY,{className:"h-4 w-4",weight:"bold"}),b?"Logging out…":"Log out"]}):null,!o&&!r.error?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u()},disabled:d,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm focus:outline-none disabled:opacity-50",children:[S.jsx(fY,{className:"h-4 w-4",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?S.jsx("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{r.refetch()},className:"text-content mt-1 px-3 py-1.5 text-sm",children:"Retry account"}):null,f?S.jsx("p",{role:"alert",className:"max-w-64 px-3 py-2 text-sm text-red-300",children:f}):null]})})]}),v?S.jsx(lx,{isOpen:!0,onClose:()=>x(!1)}):null,S.jsx(_ne,{isOpen:_,onClose:()=>w(!1),contactEmail:i??void 0})]})},Sne=({onClose:t,libraryOrigin:e})=>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(Lte,{onClose:t,libraryOrigin:e}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(vte,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:S.jsx(bne,{side:"top",align:"start"})})]});async function kne(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(o){const l=n[i-1];if(l===void 0||r&&!r(o))throw o;s==null||s(o,i,l),await new Promise(u=>setTimeout(u,l))}}const mA=Ls("useServerConfig"),Q9=[250,500,1e3,2e3,4e3],gA=Q9.length+1,Ene=async()=>{var n;const t=await _t("/api/health");if(!t.ok)throw new Error(`Failed to fetch config: ${t.status}`);const e=await t.json();if(!e.framework)throw new Error("Server did not return framework information");return{userPort:((n=e.ports)==null?void 0:n.userDevServer)||3e3,framework:e.framework}},Cne=()=>{const[t,e]=g.useState(null),[n,r]=g.useState(!0),[s,i]=g.useState(null),o=g.useCallback(async()=>{try{r(!0),i(null);const l=await kne(Ene,{delaysMs:Q9,onRetry:(u,d,f)=>{mA.warn(`Server config fetch failed (attempt ${d}); retrying in ${f}ms`,u)}});return e(l),l}catch(l){throw i(Or(l,"Failed to fetch server config")),mA.warn("Error fetching server config:",l),l}finally{r(!1)}},[]);return{config:t,fetchConfig:o,isLoading:n,error:s}},Pne="#1C1C20",Eo=[118,118,124],vA=.85,Ane=3,Tne=.15,Z0=36,Rne=4.4,Ine=.7,Mne=3.5,One=.8,yA=9,Lne=11,Nne=[1.35,1.12,.95,.85],Dne=[0,1.1,2.3,3.1],jne=[0,.35,.16,.13],$ne=[.9,.5,.4,.35],zl=3,F_=[[{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}]],q0=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},Sm=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Ul=(t,e)=>(Math.round(t/e-.5)+.5)*e,Fne=Math.sin(Math.PI/3),_A=(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*Fne;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()},Vne=(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)-yA}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)-yA}return Sm(.5-r/(2*Lne))},J9=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=wt(k9),r=g.useRef(null),s=g.useCallback(i=>{var j;if((j=r.current)==null||j.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n(F=>F+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,f=0,h=Z0,m=Z0,v=null,x=null,_=0,w=-1;const b=new Array(33),k=F=>{const D=Math.round(F*32);let q=b[D];if(!q){const W=D/32,G=Math.round(Eo[0]+(255-Eo[0])*W),H=Math.round(Eo[1]+(255-Eo[1])*W),J=Math.round(Eo[2]+(255-Eo[2])*W);q=`rgba(${G}, ${H}, ${J}, ${vA})`,b[D]=q}return q},C=F=>{const D=1-.35*F,q=Math.round(Eo[0]*D),W=Math.round(Eo[1]*D),G=Math.round(Eo[2]*D);return`rgba(${q}, ${W}, ${G}, ${vA})`},P=F=>{let D=Math.floor(Math.random()*F_.length);D===w&&(D=(D+1)%F_.length),w=D;const q=[0,0,0,0],W=F_[D].map((N,Y)=>{const oe=N.level,ne=q[oe]++,ie=Dne[oe]+ne*jne[oe],de=$ne[oe]+q0(D*131+Y*17+5)*.2;if(N.hline){const re=Ul((N.y??0)*f,m);return{hline:!0,x1:Ul(N.x1*d,h),x2:Ul(N.x2*d,h),y1:re,y2:re,level:oe,start:ie,dur:de}}const ge=Ul(N.x1*d,h),ce=Ul((N.y1??0)*f,m);return{hline:!1,x1:ge,y1:ce,x2:Math.max(Ul(N.x2*d,h),ge+h),y2:Math.max(Ul((N.y2??0)*f,m),ce+m),level:oe,start:ie,dur:de}}),G=W.reduce((N,Y)=>Math.max(N,Y.start+Y.dur),0),H=u.length,J=new Float32Array(H*zl),B=new Int16Array(H*zl).fill(-1),Q=new Uint8Array(H),z=W[0];for(let N=0;N<H;N++){const Y=u[N];Y.x>z.x1&&Y.x<z.x2&&Y.y>z.y1&&Y.y<z.y2&&(Q[N]=1);const oe=N*zl;for(let ne=0;ne<W.length;ne++){const ie=Vne(Y.x,Y.y,W[ne]);if(ie<=.02)continue;let de=oe;for(let ge=oe;ge<oe+zl;ge++){if(B[ge]===-1){de=ge;break}J[ge]<J[de]&&(de=ge)}(B[de]===-1||ie>J[de])&&(J[de]=ie,B[de]=ne)}}return{startT:F,buildEnd:G,els:W,frame:z,cellQ:J,cellEl:B,inFrame:Q}},T=()=>{const F=i.getBoundingClientRect();d=Math.max(1,F.width),f=Math.max(1,F.height);const D=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*D),i.height=Math.round(f*D),o.setTransform(D,0,0,D,0,0);const q=Math.max(8,Math.round(d/Z0)),W=Math.max(6,Math.round(f/Z0));h=d/q,m=f/W,u=[];for(let G=0;G<W;G++){const H=W>1?G/(W-1):.5,J=Rne*(1+Ine*.4*(H*2-1));for(let B=0;B<q;B++){const Q=G*8191+B*131+1,z={x:(B+.5)*h,y:(G+.5)*m,size:J,seed:Q,phase:q0(Q),kind:0};z.kind=Math.floor(q0(Q*97)*3),u.push(z)}}x=null,v=null},M=new Float32Array(32),I=F=>{o.fillStyle=Pne,o.fillRect(0,0,d,f),v||(v=P(F+.2)),F>=v.startT+v.buildEnd+Mne&&(x=v,_=F,v=P(F+.2));let D=0;x&&(D=1-Sm((F-_)/One),D<=0&&(x=null));const q=v;for(let z=0;z<q.els.length;z++){const N=q.els[z];M[z]=Sm(Math.min(1,Math.max(0,(F-q.startT-N.start)/N.dur)))}const W=M[0],G=C(0),H=C(W),J=D>0?C(D):G,B=D>0?C(Math.max(W,D)):H,Q=u.length;for(let z=0;z<Q;z++){const N=u[z];let Y=0,oe=0;const ne=z*zl;for(let Fe=ne;Fe<ne+zl;Fe++){const ke=q.cellEl[Fe];if(ke<0)break;const dt=q.cellQ[Fe]*M[ke];dt>Y&&(Y=dt,oe=q.els[ke].level)}if(x)for(let Fe=ne;Fe<ne+zl;Fe++){const ke=x.cellEl[Fe];if(ke<0)break;const dt=x.cellQ[Fe]*D;dt>Y&&(Y=dt,oe=x.els[ke].level)}const ie=F/Ane+N.phase,de=Math.floor(ie),ge=ie-de,ce=Sm(Math.min(ge,1-ge)/Tne),re=Math.floor(q0(N.seed*97+de*7919)*3);re!==N.kind&&Y<.02&&ce<.05&&(N.kind=re);const Ce=Math.max(ce*(1-Y),Y);if(!(Ce<.01))if(Y<.02){const Fe=q.inFrame[z]===1,ke=x?x.inFrame[z]===1:!1;Fe?o.fillStyle=ke?B:H:o.fillStyle=ke?J:G;const dt=Math.max(Fe?W:0,ke?D:0);_A(o,N.kind,N.x,N.y,N.size*Ce*(1-.2*dt))}else{o.fillStyle=k(Y);const Fe=1+(Nne[oe]-1)*Y;_A(o,N.kind,N.x,N.y,N.size*Ce*Fe)}}};T();let R=0;if(l)v=P(-100),I(0);else{const F=performance.now(),D=q=>{I((q-F)/1e3),R=requestAnimationFrame(D)};R=requestAnimationFrame(D)}const L=new ResizeObserver(()=>{T(),l&&(v=P(-100),I(0))});L.observe(i),r.current=()=>{cancelAnimationFrame(R),L.disconnect(),e&&n(F=>F-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},wA={kind:"base"};function xA(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}const Hne=async(t=null)=>{if(t)return zne(t);let e;try{e=await _t("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return G0();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return G0()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable",upstreamStatus:null}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable",upstreamStatus:null}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable",upstreamStatus:null}:G0()},eL=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},zne=t=>eL(t),G0=()=>eL("/"),V_=Ls("usePreviewUpstreamHealth"),Une=500,Bne=4e3,Wne=15e3,Zne=3,qne=(t,e={})=>{const n=g.useRef(null),r=g.useRef(null),s=e.probeMsWhileDown??Une,i=e.probeMsWhileUp??Bne,o=e.firstUnreachableCaptureAfterMs??Wne,l=e.rerunProbeImmediatelyOnVersion,u=e.probePath??null,d=e.skip??!1,f=g.useRef(e.onPersistentUpstreamServerErrors);f.current=e.onPersistentUpstreamServerErrors;const[h,m]=g.useState(t==="static"),[v,x]=g.useState(0),[_,w]=g.useState(null),[b,k]=g.useState(0),[C,P]=g.useState(!1),[T,M]=g.useState(!1),[I,R]=g.useState(t==="static"?null:"upstream_unreachable");return g.useEffect(()=>{if(t==="static"){m(!0),w(null),k(0),P(!1),M(!0),R(null);return}if(d){m(!1),w(null),k(0),P(!1),M(!0),R("upstream_unreachable"),n.current=null;return}let L=!0;const j=Date.now();w(j),k(0),P(!1),m(!1),M(!1),R("upstream_unreachable");const F={current:!1},D={current:!1},q={current:!1},W={current:null},G={current:!1},H={current:!1},J={current:0},B={current:!1},Q={current:null};let z=null;const N=()=>{q.current||(q.current=!0,L&&M(!0))},Y=()=>{z!==null&&(clearTimeout(z),z=null)},oe=(ie,de)=>{Y(),z=setTimeout(de,ie)},ne=async()=>{var dt;if(!L)return;k(Lt=>Lt+1);const{isOk:ie,unavailableReason:de,upstreamStatus:ge}=await Hne(u);if(!L)return;N(),Q.current=ge;const ce=ie&&ge!==null&&ge>=500;ce&&H.current?J.current+=1:ie&&!ce&&(J.current=0);const re=J.current>=Zne;if(re&&!B.current&&ge!==null&&(B.current=!0,Ie==null||Ie.capture("preview_upstream_error_responses",{framework:t,upstream_status:ge,consecutive_count:J.current}),V_.warn(`Preview upstream is listening but has served ${J.current} consecutive ${ge} responses`),(dt=f.current)==null||dt.call(f,{upstreamStatus:ge,consecutiveCount:J.current})),ie&&!re){ce||(H.current=!0,B.current=!1);const Lt=!G.current;G.current=!0,m(!0),R(null),W.current=null,D.current=!1,P(!1),F.current?Lt&&(Ie==null||Ie.capture("preview_upstream_restored",{framework:t})):(F.current=!0,Ie==null||Ie.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-j})),oe(i,ne);return}const Fe=G.current;G.current=!1,m(!1),R(de),W.current===null&&(W.current=Date.now(),D.current=!1,P(!1)),Fe&&(Ie==null||Ie.capture("preview_upstream_lost",{framework:t,upstream_status:ge}),x(Lt=>Lt+1),V_.warn("Preview upstream became unavailable after it was ready"));const ke=Date.now()-W.current;ke>=o&&!D.current&&(D.current=!0,P(!0),Ie==null||Ie.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:ke,upstream_status:Q.current}),V_.warn("Dev server did not become ready within timeout window")),oe(s,ne)};return n.current=()=>oe(0,ne),oe(0,ne),()=>{L=!1,n.current=null,Y()}},[t,s,i,o,u,d]),g.useEffect(()=>{var j;if(t==="static"||l===void 0)return;const L=r.current;r.current=l,L!==null&&L!==l&&((j=n.current)==null||j.call(n))},[t,l]),{isUpstreamReady:h,iframeRemountKey:v,probeStartedAt:_,probeAttemptCount:b,isFirstUnreachableWindowExceeded:C,initialProbeComplete:T,unavailableReason:I}};function Gne(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const tL=t=>{var r;if(typeof window>"u")return"";const e=(r=window.__RIVET_BOOTSTRAP__)==null?void 0:r.previewOrigin;if(e)return e;const n=new URL(window.location.origin);return n.hostname="localhost",n.origin},cx=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${tL()}${e}`:e,Kne="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",Yne=t=>Kne,Xne=Ls("PreviewSurface"),Lf=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",ux=({target:t,src:e,framework:n,remountKey:r,isActive:s=!0})=>{ut(yv);const i=ni(),o=g.useRef(!1),l=g.useRef(s),u=g.useCallback(f=>{t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Lf(e,t),framework:n,isReused:f}))},[n,i,e,t]),d=g.useCallback(f=>{f&&(s&&!l.current&&o.current&&u(!0),l.current=s)},[u,s]);return S.jsx("div",{ref:d,className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:s?"Project Preview":"Retained Project Preview",tabIndex:s?void 0:-1,sandbox:Yne(),onLoad:()=>{o.current=!0,i==null||i.capture("preview_iframe_loaded",{framework:n,src_kind:Lf(e,t)}),s&&u(!1)},onError:()=>{i==null||i.capture("preview_iframe_load_failed",{framework:n,src_kind:Lf(e,t)}),s&&t.kind==="variant"&&(i==null||i.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Lf(e,t),framework:n})),Xne.warn("Preview iframe failed to load",{framework:n,src_kind:Lf(e,t)})}},r)})},Qne=7,Jne=t=>{const e=xA(t.target),n=`${e}:${t.src}`,r=t.src==="about:blank",[s,i]=g.useState(()=>({selectedKey:n,remountKey:t.remountKey,selection:0,frames:r?[]:[{key:n,props:t,lastSelected:0}]}));if(s.selectedKey!==n||s.remountKey!==t.remountKey){const o=s.selection+1,l=s.remountKey!==t.remountKey;let u=s.frames.filter(d=>!l||xA(d.props.target)!==e);if(!r){const d=u.find(f=>f.key===n);if(d?u=u.map(f=>f===d?{...f,lastSelected:o}:f):u=[...u,{key:n,props:t,lastSelected:o}],u.length>Qne){const f=u.reduce((h,m)=>m.lastSelected<h.lastSelected?m:h);u=u.filter(h=>h!==f)}}i({selectedKey:n,remountKey:t.remountKey,selection:o,frames:u})}return S.jsxs("div",{className:"relative h-full w-full",children:[s.frames.map(o=>{const l=!r&&o.key===n;return S.jsx("div",{className:"absolute inset-0",style:{visibility:l?"visible":"hidden",pointerEvents:l?"auto":"none"},"aria-hidden":!l,children:S.jsx(ux,{...o.props,isActive:l})},`${o.key}:${o.props.remountKey??""}`)}),r?S.jsx(ux,{...t}):null]})},ere=g.lazy(()=>p5(()=>Promise.resolve().then(()=>Nse),void 0)),tre={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"},nre={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},rre={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"},yc=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:u,state:d,role:f="status",busy:h=!1,className:m=""})=>{const v=g.useCallback(_=>{_&&d&&(Ie==null||Ie.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),x=!!(e||n||r||u||s!=null&&s.length);return S.jsxs("div",{ref:v,className:`${tre[o]} ${m}`.trim(),role:f,"aria-live":"polite","aria-busy":h||void 0,"data-state":d,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,x?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:nre[l],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>S.jsx("button",{type:"button",onClick:_.onClick,className:rre[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},dx=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(yc,{...r,size:n,busy:!0,backdrop:S.jsx(J9,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(yc,{...r,size:n,busy:!0,backdrop:S.jsx(g.Suspense,{fallback:null,children:S.jsx(ere,{className:"absolute inset-0"})})}):S.jsx(yc,{...r,size:n,busy:!0,media:S.jsx(Jg,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),nL=({icon:t,...e})=>S.jsx(yc,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),AS=t=>S.jsx(yc,{...t,tone:"error",role:"alert"}),bA="/static/",sre=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(bA)}catch{return t.endsWith(bA)}},ire=t=>t==="spawn_error"?"The direction is saved, but its preview process didn’t start.":t==="exited"?"The direction is saved, but its preview stopped before it was ready.":t==="timeout"?"The direction is saved, but its preview took too long to become ready.":t==="dependency_install_failed"?"The direction is saved, but its dependencies couldn’t be prepared. Fix the installation error, then retry the preview.":t==="compile_error"?"The direction is saved, but its app couldn’t compile. Fix the app error, then retry the preview.":t==="missing_dev_script"?"The direction is saved, but Rivet couldn’t find a dev script to preview it.":t==="missing_static_entry"?"The direction is saved, but Rivet couldn’t find an HTML entry to preview it.":"The direction is saved, but Rivet couldn’t prepare its preview.",ore=t=>{if(t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE")return{state:"variant_verification_unavailable",title:"Rivet couldn’t verify this direction",description:"The worker completed, but Rivet couldn’t inspect its generated files.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED")return{state:"variant_output_integrity_failed",title:"This direction couldn’t be verified",description:"The worker completed, but Rivet found a structural problem in the generated files.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="failed")return{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:t.errorMessage??t.errorCode,isError:!0};if(t.status==="cancelled")return{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1};if(t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"){const e=t.previewUnavailable.portInUse?"The preview port was already in use.":void 0;return{state:"preview_unavailable",title:"Rivet couldn’t preview this direction",description:ire(t.previewUnavailable.reason),detail:t.previewUnavailable.detail??e,isError:!0}}return null},are=({issue:t,retryTarget:e})=>{const n=ni(),r=g.useRef(!1),[s,i]=g.useState(!1),[o,l]=g.useState(null),u=async()=>{if(!(!e||r.current)){r.current=!0,i(!0),l(null),n==null||n.capture("preview_retry_clicked",{session_id:e.sessionId,variant_id:e.variantId});try{const d=await _t(`/api/variants/${encodeURIComponent(e.sessionId)}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:e.variantId,retry:!0})});if(!d.ok){const f=gn({message:Ge().optional()}).safeParse(await d.json().catch(()=>({}))),h=f.success?f.data:{};throw new Error(h.message??"The preview could not restart. Try again.")}}catch(d){l(Or(d,"The preview could not restart. Try again."))}finally{r.current=!1,i(!1)}}};return S.jsxs(yc,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,busy:s,actions:e&&!s?[{label:"Retry preview",onClick:()=>void u()}]:void 0,children:[s?S.jsx("p",{className:"text-content-subtle text-xs",children:"Starting preview…"}):null,o?S.jsx("p",{className:"text-content-subtle text-xs",children:o}):null,t.detail?S.jsx("p",{"data-rivet-private":!0,className:"ph-no-capture text-content-subtle max-h-40 overflow-auto text-xs leading-relaxed break-words whitespace-pre-wrap",children:t.detail}):null]})},lre=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var vn;const r=ut(gv),s=ut(Qw),i=wt(Qw),o=ut(Pg),l=wt(Pg),u=ut(cp),d=ut(yv),f=ut(Jw),h=ut(ex),m=ut(E9),v=ut(C9),x=wt(ex),_=ut(el),w=ut(bm),b=wt(Jw),k=u.active&&u.projectContext.kind==="fresh",C=ut(tx),P=u.active?u.variants.find(Le=>Le.workItemId===C&&(Le.status==="pending"||Le.status==="running"||Le.status==="succeeded"&&!Le.preview&&typeof Le.port!="number"&&(!Le.previewUnavailable||Le.previewUnavailable.reason==="idle_timeout")))??null:null,T=u.active&&u.variants.some(Le=>Le.status==="pending"||Le.status==="running"),M=k||T,I=u.active?u.variants.find(Le=>Le.workItemId===C)??null:null,R=I?ore(I):null,L=e==="static"&&o!==null&&sre(o);g.useEffect(()=>{u.active||b(!1)},[u.active,b]);const j=g.useRef(!1);g.useEffect(()=>{const Le=!!(_!=null&&_.left||_!=null&&_.right),lt=Le&&!j.current;j.current=Le;const Te=u.active?u.sessionId:null;!Te||!Gne({enteringSplit:lt,isExistingSession:u.active&&u.projectContext.kind==="existing",hasActiveVariantProxy:f&&h!==null})||(b(!1),x(null),i(Je=>Je+1),_t(`/api/variants/${encodeURIComponent(Te)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[_,u,f,h,b,x,i]);const D=g.useMemo(()=>{var Ke;if(f||o&&!L||!u.active)return null;const{stage:Le,variants:lt}=u,Te=Le==="ready"||Le==="degraded",Je=lt.some(ft=>{var wr,Zn;return((wr=ft.refinement)==null?void 0:wr.status)==="pending"||((Zn=ft.refinement)==null?void 0:Zn.status)==="running"});if(!Te&&!Je)return null;const bt=lt.find(ft=>{var wr;return ft.status==="succeeded"&&((wr=ft.preview)==null?void 0:wr.kind)==="static_artifact"});return((Ke=bt==null?void 0:bt.preview)==null?void 0:Ke.kind)==="static_artifact"?vc({sessionId:u.sessionId,variant:bt,projectContext:u.projectContext}):null},[L,o,f,u])??o,q=g.useMemo(()=>!u.active||!D?null:u.variants.find(Le=>{var lt;return((lt=Le.preview)==null?void 0:lt.kind)==="static_artifact"&&D.startsWith(Le.preview.url)})??null,[D,u]),W=g.useMemo(()=>{if((w==null?void 0:w.previewKind)==="static"||(w==null?void 0:w.previewKind)==="dev_server"&&w.previewError||(w==null?void 0:w.previewKind)==="dev_server"&&D&&KP(D))return{kind:"variant",sessionId:w.sessionId,variantId:w.variantId};if(!u.active)return wA;if(q)return{kind:"variant",sessionId:u.sessionId,variantId:q.workItemId};if(D){const lt=D.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Te=lt!=null&&lt[1]?decodeURIComponent(lt[1]):null,Je=lt!=null&&lt[2]?decodeURIComponent(lt[2]):null;if(Te===u.sessionId&&Je&&u.variants.some(ft=>ft.workItemId===Je))return{kind:"variant",sessionId:u.sessionId,variantId:Je};const bt=D.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Ke=bt!=null&&bt[1]?decodeURIComponent(bt[1]):null;if(Ke&&u.variants.some(ft=>ft.workItemId===Ke))return{kind:"variant",sessionId:u.sessionId,variantId:Ke}}const Le=!!(_!=null&&_.left||_!=null&&_.right);return(!Le||k)&&!D&&f&&h&&u.variants.some(lt=>lt.workItemId===h)?{kind:"variant",sessionId:u.sessionId,variantId:h}:(!Le||k)&&!D&&C&&u.variants.some(lt=>lt.workItemId===C)?{kind:"variant",sessionId:u.sessionId,variantId:C}:wA},[w,q,u,f,h,D,_,k,C]),G=g.useRef(null);g.useEffect(()=>{var Je,bt,Ke;if(!q||((Je=q.preview)==null?void 0:Je.kind)!=="static_artifact"||((bt=q.refinement)==null?void 0:bt.status)!=="succeeded")return;const Le=`${q.workItemId}:${q.refinement.workItemId}`;if(G.current===Le)return;if(G.current=Le,(Ke=q.previewRoutes)!=null&&Ke.length){i(ft=>ft+1);return}const lt=q.preview.url.includes("?")?"&":"?",Te=`${q.preview.url}${lt}refinement=${encodeURIComponent(q.refinement.workItemId)}`;D!==Te&&(l(Te),i(ft=>ft+1))},[D,q,i,l,u]);const H=D!==null&&KP(D),J=D!==null&&!H||k&&!f&&!H,{isUpstreamReady:B,iframeRemountKey:Q,probeAttemptCount:z,initialProbeComplete:N}=qne(e,{rerunProbeImmediatelyOnVersion:s,probePath:H?D:null,skip:J}),[Y,oe]=g.useState(()=>m&&B?s:null),ne=g.useRef(null);g.useEffect(()=>{if(!m){ne.current=null,oe(null);return}if(Y===s){ne.current=null;return}const Le=ne.current;if(!Le||Le.remountKey!==s){ne.current={remountKey:s,probeAttemptCount:z};return}B&&z>Le.probeAttemptCount&&(ne.current=null,oe(s))},[Y,s,m,z,B]);const de=D!==null&&!H||B,ce=v||m&&!H&&Y!==s||m&&!de,re=`${Q}:${s}`,Ce=D9(window.location.pathname),Fe=e==="static"?`/static${Ce??"/"}`:Ce??"/",ke=tL();let dt=null;D&&(dt=cx({agentApplyMode:d,url:D}));const Lt=H&&!de?"about:blank":dt,sn=P||R||w!=null&&w.previewError||ce?"about:blank":Lt??(de?`${ke}${Fe}`:"about:blank"),jt=!!P||!!R||!de&&N;let pt=null;if(w!=null&&w.previewError)pt=S.jsx(yc,{fill:"overlay",size:"sm",state:"preview_replay_failed",role:"alert",tone:"error",title:"Rivet couldn’t preview this direction",description:"Select the direction again to retry.",children:S.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:w.previewError})});else if(ce)pt=S.jsx(dx,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(P)pt=S.jsx(dx,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(R){const Le=u.active&&I&&R.state==="preview_unavailable"&&((vn=I.previewUnavailable)==null?void 0:vn.reason)!=="missing_static_entry"?{sessionId:u.sessionId,variantId:I.workItemId}:void 0;pt=S.jsx(are,{issue:R,retryTarget:Le},I==null?void 0:I.workItemId)}else jt&&(pt=M?S.jsx(nL,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(AS,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}));return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:S.jsxs("div",{className:"relative min-h-0 flex-1",children:[pt,S.jsx(Jne,{target:W,src:sn,framework:e,remountKey:re},r)]})})};function SA({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const l=ut(el),u=wt(el),d=ni(),f=ut(cp),h=ut(yv),m=g.useRef(!1),v=g.useCallback(()=>{m.current||(m.current=!0,_d({source:i,sessionId:e,variantId:n}))},[i,e,n]),x=g.useCallback(()=>{if(o){u(null);const I=Ag("ended",l);d==null||d.capture(I.event,I.properties);return}v();const P={...l};delete P[t];const T=P.left||P.right?P:null;u(T);const M=Ag(T?"updated":"ended",T??l);d==null||d.capture(M.event,M.properties)},[o,d,u,t,l,v]),_=g.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),w=g.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(P=>P.workItemId===n)??null,[e,n,f]),b=g.useMemo(()=>{var T,M,I;let P=r;if(((T=w==null?void 0:w.preview)==null?void 0:T.kind)==="static_artifact"&&((M=w.refinement)==null?void 0:M.status)==="succeeded"){if((I=w.previewRoutes)!=null&&I.length)return cx({agentApplyMode:h,url:vc({sessionId:e,variant:w,projectContext:null})??r});const R=w.preview.url.includes("?")?"&":"?";P=`${w.preview.url}${R}refinement=${encodeURIComponent(w.refinement.workItemId)}`}return cx({agentApplyMode:h,url:P})},[h,w,e,r]),k=((C=w==null?void 0:w.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${w.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(Mc,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:x,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(ux,{target:_,src:b,framework:"static",remountKey:k})})]})}function cre(){const t=ut(yd),e=ut(ES);return!t||!e?null:ip.createPortal(S.jsx("div",{"aria-hidden":"true",className:"border-main-border bg-main pointer-events-none fixed top-0 left-0 z-[70] flex max-w-60 items-center gap-2 rounded-md border px-3 py-1.5 shadow-lg",style:{transform:`translate3d(${e.x+12}px, ${e.y+12}px, 0)`},children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:t.label})}),document.body)}function ure(){const t=ut(yd),e=ut(ES),n=ut(el),r=wt(yd),s=wt(el),i=ni(),o=g.useRef(null),[l,u]=g.useState(null),[d,f]=g.useState("hidden");g.useEffect(()=>{t||(f("hidden"),u(null))},[t]);const h=g.useCallback((v,x)=>{const _=o.current;if(!_)return null;const w=_.getBoundingClientRect();return v<w.left||v>w.right||x<w.top||x>w.bottom?null:v<(w.left+w.right)/2?"left":"right"},[]);if(g.useEffect(()=>{if(!t||!e)return;const v=h(e.x,e.y);u(x=>x===v?x:v),f(x=>{if(x==="exiting")return x;const _=v!==null?"visible":"hidden";return x===_?x:_})},[t,e,h]),g.useEffect(()=>{if(!t)return;const v=x=>{const _=h(x.clientX,x.clientY);if(_&&t.url){const w={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[_];b&&(b.sessionId!==w.sessionId||b.variantId!==w.variantId)&&_d(b);const k={...n??{},[_]:w};s(k);const C=Ag(n?"updated":"started",k);i==null||i.capture(C.event,C.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else _d(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,i,r,s,n]),!t)return null;const m=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:o,className:m,"aria-hidden":"true",children:[S.jsx(kA,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),S.jsx(kA,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function kA({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 rL=(t,e,n)=>{var i,o,l;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((o=r.previewRoutes)!=null&&o.length)return vc({sessionId:e,variant:r,projectContext:t.projectContext});if(((l=r.refinement)==null?void 0:l.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},EA=(t,e)=>{if(!t)return;const n=rL(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},dre=()=>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(J9,{trackGlobalLoaderCount:!1})})}),fre=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=Cne();return g.useEffect(()=>{r().catch(o=>{Ie==null||Ie.capture("preview_config_load_failed",{message:Or(o,"unknown_error"),attempts:gA})})},[r]),s?S.jsx(dre,{}):i||!n?S.jsx(AS,{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:()=>{Ie==null||Ie.capture("preview_config_retry_clicked"),r().catch(o=>{Ie==null||Ie.capture("preview_config_load_failed",{message:Or(o,"unknown_error"),attempts:gA})})}}]}):S.jsx(hre,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function hre(t){const e=ut(el),n=ut(yd),r=ut(cp),s=ut(Pg),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=g.useMemo(()=>{var T,M;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(T=i??o)==null?void 0:T.variantId,w=r.variants.filter(I=>{var R;return I.status==="succeeded"&&((R=I.preview)==null?void 0:R.kind)==="static_artifact"&&I.workItemId!==_}),b=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=w.find(I=>{var R;return((R=I.preview)==null?void 0:R.kind)==="static_artifact"&&(I.preview.url===b||vc({sessionId:r.sessionId,variant:I,projectContext:r.projectContext})===s)})??w[0];if(((M=C==null?void 0:C.preview)==null?void 0:M.kind)!=="static_artifact")return;const P=rL(r,r.sessionId,C.workItemId);if(P)return{sessionId:r.sessionId,variantId:C.workItemId,label:C.label,url:P,source:"live"}},[r,i,o,s]),u=EA(i,r)??(o?l:void 0),d=EA(o,r)??(i?l:void 0),f=!i&&!!u,h=!o&&!!d,m=!!(u||d),v=S.jsx(lre,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&S.jsx(SA,{side:"left",sessionId:u.sessionId,variantId:u.variantId,url:u.url,label:u.label,source:u.source,isFallback:f},`left-${u.sessionId}:${u.variantId}:${u.url}`),S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",style:{display:u&&d?"none":void 0},"aria-hidden":!!(u&&d),children:v}),d&&S.jsx(SA,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:h},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(ure,{}),S.jsx(cre,{})]})})}function Oo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sL(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
142
- * GSAP 3.15.0
143
- * https://gsap.com
144
- *
145
- * @license Copyright 2008-2026, GreenSock. All rights reserved.
146
- * Subject to the terms at https://gsap.com/standard-license
147
- * @author: Jack Doyle, jack@greensock.com
148
- */var Ts={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Vh={duration:.5,overwrite:!1,delay:0},TS,_r,mn,Xs=1e8,tn=1/Xs,fx=Math.PI*2,pre=fx/4,mre=0,iL=Math.sqrt,gre=Math.cos,vre=Math.sin,ur=function(e){return typeof e=="string"},In=function(e){return typeof e=="function"},Xo=function(e){return typeof e=="number"},RS=function(e){return typeof e>"u"},oo=function(e){return typeof e=="object"},os=function(e){return e!==!1},IS=function(){return typeof window<"u"},K0=function(e){return In(e)||ur(e)},oL=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Nr=Array.isArray,yre=/random\([^)]+\)/g,_re=/,\s*/g,CA=/(?:-?\.?\d|\.)+/gi,aL=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Lu=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,H_=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,lL=/[+-]=-?[.\d]+/,wre=/[^,'"\[\]\s]+/gi,xre=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,En,zi,hx,MS,Is={},Rg={},cL,uL=function(e){return(Rg=xd(e,Is))&&us},OS=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Hh=function(e,n){return!n&&console.warn(e)},dL=function(e,n){return e&&(Is[e]=n)&&Rg&&(Rg[e]=n)||Is},zh=function(){return 0},bre={suppressEvents:!0,isStart:!0,kill:!1},km={suppressEvents:!0,kill:!1},Sre={suppressEvents:!0},LS={},Wa=[],px={},fL,xs={},z_={},PA=30,Em=[],NS="",DS=function(e){var n=e[0],r,s;if(oo(n)||In(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Em.length;s--&&!Em[s].targetTest(n););r=Em[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new LL(e[s],r)))||e.splice(s,1);return e},_c=function(e){return e._gsap||DS(Qs(e))[0]._gsap},hL=function(e,n,r){return(r=e[n])&&In(r)?e[n]():RS(r)&&e.getAttribute&&e.getAttribute(n)||r},as=function(e,n){return(e=e.split(",")).forEach(n)||e},Nn=function(e){return Math.round(e*1e5)/1e5||0},Sn=function(e){return Math.round(e*1e7)/1e7||0},zu=function(e,n){var r=n.charAt(0),s=parseFloat(n.substr(2));return e=parseFloat(e),r==="+"?e+s:r==="-"?e-s:r==="*"?e*s:e/s},kre=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Ig=function(){var e=Wa.length,n=Wa.slice(0),r,s;for(px={},Wa.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},jS=function(e){return!!(e._initted||e._startAt||e.add)},pL=function(e,n,r,s){Wa.length&&!_r&&Ig(),e.render(n,r,!!(_r&&n<0&&jS(e))),Wa.length&&!_r&&Ig()},mL=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(wre).length<2?n:ur(e)?e.trim():e},gL=function(e){return e},Ms=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},Ere=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},xd=function(e,n){for(var r in n)e[r]=n[r];return e},AA=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=oo(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Mg=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},fh=function(e){var n=e.parent||En,r=e.keyframes?Ere(Nr(e.keyframes)):Ms;if(os(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},Cre=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},vL=function(e,n,r,s,i){var o=e[s],l;if(i)for(l=n[i];o&&o[i]>l;)o=o._prev;return o?(n._next=o._next,o._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=o,n.parent=n._dp=e,n},wv=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,o=n._next;i?i._next=o:e[r]===n&&(e[r]=o),o?o._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},tl=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},wc=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},Pre=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},mx=function(e,n,r,s){return e._startAt&&(_r?e._startAt.revert(km):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},Are=function t(e){return!e||e._ts&&t(e.parent)},TA=function(e){return e._repeat?bd(e._tTime,e=e.duration()+e._rDelay)*e:0},bd=function(e,n){var r=Math.floor(e=Sn(e/n));return e&&r===e?r-1:r},Og=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},xv=function(e){return e._end=Sn(e._start+(e._tDur/Math.abs(e._ts||e._rts||tn)||0))},bv=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Sn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),xv(e),r._dirty||wc(r,e)),e},yL=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Og(e.rawTime(),n),(!n._dur||dp(0,n.totalDuration(),r)-n._tTime>tn)&&n.render(r,!0)),wc(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=-tn}},Gi=function(e,n,r,s){return n.parent&&tl(n),n._start=Sn((Xo(r)?r:r||e!==En?qs(e,r,n):e._time)+n._delay),n._end=Sn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),vL(e,n,"_first","_last",e._sort?"_start":0),gx(n)||(e._recent=n),s||yL(e,n),e._ts<0&&bv(e,e._tTime),e},_L=function(e,n){return(Is.ScrollTrigger||OS("scrollTrigger",n))&&Is.ScrollTrigger.create(n,e)},wL=function(e,n,r,s,i){if(FS(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!_r&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&fL!==ks.frame)return Wa.push(e),e._lazy=[i,s],1},Tre=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},gx=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},Rre=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&Tre(e)&&!(!e._initted&&gx(e))||(e._ts<0||e._dp._ts<0)&&!gx(e))?0:1,l=e._rDelay,u=0,d,f,h;if(l&&e._repeat&&(u=dp(0,e._tDur,n),f=bd(u,l),e._yoyo&&f&1&&(o=1-o),f!==bd(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||_r||s||e._zTime===tn||!n&&e._zTime){if(!e._initted&&wL(e,n,s,r,u))return;for(h=e._zTime,e._zTime=n||(r?tn:0),r||(r=n&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=u,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&mx(e,n,r,!0),e._onUpdate&&!r&&Es(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&Es(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&tl(e,1),!r&&!_r&&(Es(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},Ire=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}},Sd=function(e,n,r,s){var i=e._repeat,o=Sn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:Sn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&bv(e,e._tTime=e._tDur*l),e.parent&&xv(e),r||wc(e.parent,e),e},RA=function(e){return e instanceof rs?wc(e):Sd(e,e._dur)},Mre={_start:0,endTime:zh,totalDuration:zh},qs=function t(e,n,r){var s=e.labels,i=e._recent||Mre,o=e.duration()>=Xs?i.endTime(!1):e._dur,l,u,d;return ur(n)&&(isNaN(n)||n in s)?(u=n.charAt(0),d=n.substr(-1)==="%",l=n.indexOf("="),u==="<"||u===">"?(l>=0&&(n=n.replace(/=/,"")),(u==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(l<0?i:r).totalDuration()/100:1)):l<0?(n in s||(s[n]=o),s[n]):(u=parseFloat(n.charAt(l-1)+n.substr(l+1)),d&&r&&(u=u/100*(Nr(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+u:o+u)):n==null?o:+n},hh=function(e,n,r){var s=Xo(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,u;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,u=r;u&&!("immediateRender"in l);)l=u.vars.defaults||{},u=os(u.vars.inherit)&&u.parent;o.immediateRender=os(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new Bn(n[0],o,n[i+1])},cl=function(e,n){return e||e===0?n(e):n},dp=function(e,n,r){return r<e?e:r>n?n:r},Ir=function(e,n){return!ur(e)||!(n=xre.exec(e))?"":n[1]},Ore=function(e,n,r){return cl(r,function(s){return dp(e,n,s)})},vx=[].slice,xL=function(e,n){return e&&oo(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&oo(e[0]))&&!e.nodeType&&e!==zi},Lre=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return ur(s)&&!n||xL(s,1)?(i=r).push.apply(i,Qs(s)):r.push(s)})||r},Qs=function(e,n,r){return mn&&!n&&mn.selector?mn.selector(e):ur(e)&&!r&&(hx||!kd())?vx.call((n||MS).querySelectorAll(e),0):Nr(e)?Lre(e,r):xL(e)?vx.call(e,0):e?[e]:[]},yx=function(e){return e=Qs(e)[0]||Hh("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Qs(n,r.querySelectorAll?r:r===e?Hh("Invalid scope")||MS.createElement("div"):e)}},bL=function(e){return e.sort(function(){return .5-Math.random()})},SL=function(e){if(In(e))return e;var n=oo(e)?e:{each:e},r=xc(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,u=isNaN(s)||l,d=n.axis,f=s,h=s;return ur(s)?f=h={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(f=s[0],h=s[1]),function(m,v,x){var _=(x||n).length,w=o[_],b,k,C,P,T,M,I,R,L;if(!w){if(L=n.grid==="auto"?0:(n.grid||[1,Xs])[1],!L){for(I=-Xs;I<(I=x[L++].getBoundingClientRect().left)&&L<_;);L<_&&L--}for(w=o[_]=[],b=u?Math.min(L,_)*f-.5:s%L,k=L===Xs?0:u?_*h/L-.5:s/L|0,I=0,R=Xs,M=0;M<_;M++)C=M%L-b,P=k-(M/L|0),w[M]=T=d?Math.abs(d==="y"?P:C):iL(C*C+P*P),T>I&&(I=T),T<R&&(R=T);s==="random"&&bL(w),w.max=I-R,w.min=R,w.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(L>_?_-1:d?d==="y"?_/L:L:Math.max(L,_/L))||0)*(s==="edges"?-1:1),w.b=_<0?i-_:i,w.u=Ir(n.amount||n.each)||0,r=r&&_<0?qre(r):r}return _=(w[m]-w.min)/w.max||0,Sn(w.b+(r?r(_):_)*w.v)+w.u}},_x=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Sn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(Xo(r)?0:Ir(r))}},kL=function(e,n){var r=Nr(e),s,i;return!r&&oo(e)&&(s=r=e.radius||Xs,e.values?(e=Qs(e.values),(i=!Xo(e[0]))&&(s*=s)):e=_x(e.increment)),cl(n,r?In(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),u=parseFloat(i?o.y:0),d=Xs,f=0,h=e.length,m,v;h--;)i?(m=e[h].x-l,v=e[h].y-u,m=m*m+v*v):m=Math.abs(e[h]-l),m<d&&(d=m,f=h);return f=!s||d<=s?e[f]:o,i||f===o||Xo(o)?f:f+Ir(o)}:_x(e))},EL=function(e,n,r,s){return cl(Nr(e)?!n:r===!0?!!(r=0):!s,function(){return Nr(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})},Nre=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,o){return o(i)},s)}},Dre=function(e,n){return function(r){return e(parseFloat(r))+(n||Ir(r))}},jre=function(e,n,r){return PL(e,n,0,1,r)},CL=function(e,n,r){return cl(r,function(s){return e[~~n(s)]})},$re=function t(e,n,r){var s=n-e;return Nr(e)?CL(e,t(0,e.length),n):cl(r,function(i){return(s+(i-e)%s)%s+e})},Fre=function t(e,n,r){var s=n-e,i=s*2;return Nr(e)?CL(e,t(0,e.length-1),n):cl(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},Uh=function(e){return e.replace(yre,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(_re);return EL(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},PL=function(e,n,r,s,i){var o=n-e,l=s-r;return cl(i,function(u){return r+((u-e)/o*l||0)})},Vre=function t(e,n,r,s){var i=isNaN(e+n)?0:function(v){return(1-v)*e+v*n};if(!i){var o=ur(e),l={},u,d,f,h,m;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(Nr(e)&&!Nr(n)){for(f=[],h=e.length,m=h-2,d=1;d<h;d++)f.push(t(e[d-1],e[d]));h--,i=function(x){x*=h;var _=Math.min(m,~~x);return f[_](x-_)},r=n}else s||(e=xd(Nr(e)?[]:{},e));if(!f){for(u in n)$S.call(l,e,u,"get",n[u]);i=function(x){return zS(x,l)||(o?e.p:e)}}}return cl(r,i)},IA=function(e,n,r){var s=e.labels,i=Xs,o,l,u;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(u=o,i=l);return u},Es=function(e,n,r){var s=e.vars,i=s[n],o=mn,l=e._ctx,u,d,f;if(i)return u=s[n+"Params"],d=s.callbackScope||e,r&&Wa.length&&Ig(),l&&(mn=l),f=u?i.apply(d,u):i.call(d),mn=o,f},Wf=function(e){return tl(e),e.scrollTrigger&&e.scrollTrigger.kill(!!_r),e.progress()<1&&Es(e,"onInterrupt"),e},Nu,AL=[],TL=function(e){if(e)if(e=!e.name&&e.default||e,IS()||e.headless){var n=e.name,r=In(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:zh,render:zS,add:$S,kill:rse,modifier:nse,rawVars:0},o={targetTest:0,get:0,getSetter:HS,aliases:{},register:0};if(kd(),e!==s){if(xs[n])return;Ms(s,Ms(Mg(e,i),o)),xd(s.prototype,xd(i,Mg(e,o))),xs[s.prop=n]=s,e.targetTest&&(Em.push(s),LS[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}dL(n,s),e.register&&e.register(us,s,ls)}else AL.push(e)},Jt=255,Zf={aqua:[0,Jt,Jt],lime:[0,Jt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Jt],navy:[0,0,128],white:[Jt,Jt,Jt],olive:[128,128,0],yellow:[Jt,Jt,0],orange:[Jt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Jt,0,0],pink:[Jt,192,203],cyan:[0,Jt,Jt],transparent:[Jt,Jt,Jt,0]},U_=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)*Jt+.5|0},RL=function(e,n,r){var s=e?Xo(e)?[e>>16,e>>8&Jt,e&Jt]:0:Zf.black,i,o,l,u,d,f,h,m,v,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Zf[e])s=Zf[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),l=e.charAt(3),e="#"+i+i+o+o+l+l+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&Jt,s&Jt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Jt,e&Jt]}else if(e.substr(0,3)==="hsl"){if(s=x=e.match(CA),!n)u=+s[0]%360/360,d=+s[1]/100,f=+s[2]/100,o=f<=.5?f*(d+1):f+d-f*d,i=f*2-o,s.length>3&&(s[3]*=1),s[0]=U_(u+1/3,i,o),s[1]=U_(u,i,o),s[2]=U_(u-1/3,i,o);else if(~e.indexOf("="))return s=e.match(aL),r&&s.length<4&&(s[3]=1),s}else s=e.match(CA)||Zf.transparent;s=s.map(Number)}return n&&!x&&(i=s[0]/Jt,o=s[1]/Jt,l=s[2]/Jt,h=Math.max(i,o,l),m=Math.min(i,o,l),f=(h+m)/2,h===m?u=d=0:(v=h-m,d=f>.5?v/(2-h-m):v/(h+m),u=h===i?(o-l)/v+(o<l?6:0):h===o?(l-i)/v+2:(i-o)/v+4,u*=60),s[0]=~~(u+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},IL=function(e){var n=[],r=[],s=-1;return e.split(Za).forEach(function(i){var o=i.match(Lu)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},MA=function(e,n,r){var s="",i=(e+s).match(Za),o=n?"hsla(":"rgba(",l=0,u,d,f,h;if(!i)return e;if(i=i.map(function(m){return(m=RL(m,n,1))&&o+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(f=IL(e),u=r.c,u.join(s)!==f.c.join(s)))for(d=e.replace(Za,"1").split(Lu),h=d.length-1;l<h;l++)s+=d[l]+(~u.indexOf(l)?i.shift()||o+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split(Za),h=d.length-1;l<h;l++)s+=d[l]+i[l];return s+d[h]},Za=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Zf)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),Hre=/hsl[a]?\(/,ML=function(e){var n=e.join(" "),r;if(Za.lastIndex=0,Za.test(n))return r=Hre.test(n),e[1]=MA(e[1],r),e[0]=MA(e[0],r,IL(e[1])),!0},Bh,ks=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],u,d,f,h,m,v,x=function _(w){var b=t()-s,k=w===!0,C,P,T,M;if((b>e||b<0)&&(r+=b-n),s+=b,T=s-r,C=T-o,(C>0||k)&&(M=++h.frame,m=T-h.time*1e3,h.time=T=T/1e3,o+=C+(C>=i?4:i-C),P=1),k||(u=d(_)),P)for(v=0;v<l.length;v++)l[v](T,m,M,w)};return h={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(w){return m/(1e3/(w||60))},wake:function(){cL&&(!hx&&IS()&&(zi=hx=window,MS=zi.document||{},Is.gsap=us,(zi.gsapVersions||(zi.gsapVersions=[])).push(us.version),uL(Rg||zi.GreenSockGlobals||!zi.gsap&&zi||{}),AL.forEach(TL)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&h.sleep(),d=f||function(w){return setTimeout(w,o-h.time*1e3+1|0)},Bh=1,x(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(u),Bh=0,d=zh},lagSmoothing:function(w,b){e=w||1/0,n=Math.min(b||33,e)},fps:function(w){i=1e3/(w||240),o=h.time*1e3+i},add:function(w,b,k){var C=b?function(P,T,M,I){w(P,T,M,I),h.remove(C)}:w;return h.remove(w),l[k?"unshift":"push"](C),kd(),C},remove:function(w,b){~(b=l.indexOf(w))&&l.splice(b,1)&&v>=b&&v--},_listeners:l},h})(),kd=function(){return!Bh&&ks.wake()},Pt={},zre=/^[\d.\-M][\d.\-,\s]/,Ure=/["']/g,Bre=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,o=r.length,l,u,d;i<o;i++)u=r[i],l=i!==o-1?u.lastIndexOf(","):u.length,d=u.substr(0,l),n[s]=isNaN(d)?d.replace(Ure,"").trim():+d,s=u.substr(l+1).trim();return n},Wre=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)},Zre=function(e){var n=(e+"").split("("),r=Pt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[Bre(n[1])]:Wre(e).split(",").map(mL)):Pt._CE&&zre.test(e)?Pt._CE("",e):r},qre=function(e){return function(n){return 1-e(1-n)}},xc=function(e,n){return e&&(In(e)?e:Pt[e]||Zre(e))||n},Lc=function(e,n,r,s){r===void 0&&(r=function(u){return 1-n(1-u)}),s===void 0&&(s=function(u){return u<.5?n(u*2)/2:1-n((1-u)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},o;return as(e,function(l){Pt[l]=Is[l]=i,Pt[o=l.toLowerCase()]=r;for(var u in i)Pt[o+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=Pt[l+"."+u]=i[u]}),i},OL=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},B_=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/fx*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*vre((f-o)*i)+1},u=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:OL(l);return i=fx/i,u.config=function(d,f){return t(e,d,f)},u},W_=function t(e,n){n===void 0&&(n=1.70158);var r=function(o){return o?--o*o*((n+1)*o+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:OL(r);return s.config=function(i){return t(e,i)},s};as("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Lc(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})});Pt.Linear.easeNone=Pt.none=Pt.Linear.easeIn;Lc("Elastic",B_("in"),B_("out"),B_());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(l){return l<n?t*l*l:l<r?t*Math.pow(l-1.5/e,2)+.75:l<s?t*(l-=2.25/e)*l+.9375:t*Math.pow(l-2.625/e,2)+.984375};Lc("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);Lc("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Lc("Circ",function(t){return-(iL(1-t*t)-1)});Lc("Sine",function(t){return t===1?1:-gre(t*pre)+1});Lc("Back",W_("in"),W_("out"),W_());Pt.SteppedEase=Pt.steps=Is.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-tn;return function(l){return((s*dp(0,o,l)|0)+i)*r}}};Vh.ease=Pt["quad.out"];as("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return NS+=t+","+t+"Params,"});var LL=function(e,n){this.id=mre++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:hL,this.set=n?n.getSetter:HS},Wh=(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,Sd(this,+n.duration,1,1),this.data=n.data,mn&&(this._ctx=mn,mn.data.push(this)),Bh||ks.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,Sd(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(kd(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(bv(this,r),!i._dp||i.parent||yL(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)&&Gi(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===tn||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),pL(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+TA(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)+TA(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?bd(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-tn?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Og(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-tn?0:this._rts,this.totalTime(dp(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),xv(this),Pre(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):(kd(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==tn&&(this._tTime-=tn)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=Sn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Gi(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(os(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?Og(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=Sre);var s=_r;return _r=r,jS(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),_r=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,RA(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,RA(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(qs(this,r),os(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,os(s)),this._dur||(this._zTime=-tn),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?-tn:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-tn,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)-tn)},e.eventCallback=function(r,s,i){var o=this.vars;return arguments.length>1?(s?(o[r]=s,i&&(o[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete o[r],this):o[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(o){var l=In(r)?r:gL,u=function(){var f=s.then;s.then=null,i&&i(),In(l)&&(l=l(s))&&(l.then||l===s)&&(s.then=f),o(l),s.then=f};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?u():s._prom=u})},e.kill=function(){Wf(this)},t})();Ms(Wh.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:-tn,_prom:0,_ps:!1,_rts:1});var rs=(function(t){sL(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=os(r.sortChildren),En&&Gi(r.parent||En,Oo(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&_L(Oo(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return hh(0,arguments,this),this},n.from=function(s,i,o){return hh(1,arguments,this),this},n.fromTo=function(s,i,o,l){return hh(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,fh(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Bn(s,i,qs(this,o),1),this},n.call=function(s,i,o){return Gi(this,Bn.delayedCall(0,s,i),o)},n.staggerTo=function(s,i,o,l,u,d,f){return o.duration=i,o.stagger=o.stagger||l,o.onComplete=d,o.onCompleteParams=f,o.parent=this,new Bn(s,o,qs(this,u)),this},n.staggerFrom=function(s,i,o,l,u,d,f){return o.runBackwards=1,fh(o).immediateRender=os(o.immediateRender),this.staggerTo(s,i,o,l,u,d,f)},n.staggerFromTo=function(s,i,o,l,u,d,f,h){return l.startAt=o,fh(l).immediateRender=os(l.immediateRender),this.staggerTo(s,i,l,u,d,f,h)},n.render=function(s,i,o){var l=this._time,u=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:Sn(s),h=this._zTime<0!=s<0&&(this._initted||!d),m,v,x,_,w,b,k,C,P,T,M,I;if(this!==En&&f>u&&s>=0&&(f=u),f!==this._tTime||o||h){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),m=f,P=this._start,C=this._ts,b=!C,h&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(M=this._yoyo,w=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(w*100+s,i,o);if(m=Sn(f%w),f===u?(_=this._repeat,m=d):(T=Sn(f/w),_=~~T,_&&_===T&&(m=d,_--),m>d&&(m=d)),T=bd(this._tTime,w),!l&&this._tTime&&T!==_&&this._tTime-T*w-this._dur<=0&&(T=_),M&&_&1&&(m=d-m,I=1),_!==T&&!this._lock){var R=M&&T&1,L=R===(M&&_&1);if(_<T&&(R=!R),l=R?0:f%d?d:f,this._lock=1,this.render(l||(I?0:Sn(_*w)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&Es(this,"onRepeat"),this.vars.repeatRefresh&&!I&&(this.invalidate()._lock=1,T=_),l&&l!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,u=this._tDur,L&&(this._lock=2,l=R?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!I&&this.invalidate()),this._lock=0,!this._ts&&!b)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=Ire(this,Sn(l),Sn(m)),k&&(f-=m-(m=k._start))),this._tTime=f,this._time=m,this._act=!!C,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&f&&d&&!i&&!T&&(Es(this,"onStart"),this._tTime!==f))return this;if(m>=l&&s>=0)for(v=this._first;v;){if(x=v._next,(v._act||m>=v._start)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(m-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(m-v._start)*v._ts,i,o),m!==this._time||!this._ts&&!b){k=0,x&&(f+=this._zTime=-tn);break}}v=x}else{v=this._last;for(var j=s<0?s:m;v;){if(x=v._prev,(v._act||j<=v._end)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(j-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(j-v._start)*v._ts,i,o||_r&&jS(v)),m!==this._time||!this._ts&&!b){k=0,x&&(f+=this._zTime=j?-tn:tn);break}}v=x}}if(k&&!i&&(this.pause(),k.render(m>=l?0:-tn)._zTime=m>=l?1:-1,this._ts))return this._start=P,xv(this),this.render(s,i,o);this._onUpdate&&!i&&Es(this,"onUpdate",!0),(f===u&&this._tTime>=this.totalDuration()||!f&&l)&&(P===this._start||Math.abs(C)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===u&&this._ts>0||!f&&this._ts<0)&&tl(this,1),!i&&!(s<0&&!l)&&(f||l||!u)&&(Es(this,f===u&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<u&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(Xo(i)||(i=qs(this,i,s)),!(s instanceof Wh)){if(Nr(s))return s.forEach(function(l){return o.add(l,i)}),this;if(ur(s))return this.addLabel(s,i);if(In(s))s=Bn.delayedCall(0,s);else return this}return this!==s?Gi(this,s,i):this},n.getChildren=function(s,i,o,l){s===void 0&&(s=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),l===void 0&&(l=-Xs);for(var u=[],d=this._first;d;)d._start>=l&&(d instanceof Bn?i&&u.push(d):(o&&u.push(d),s&&u.push.apply(u,d.getChildren(!0,i,o)))),d=d._next;return u},n.getById=function(s){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===s)return i[o]},n.remove=function(s){return ur(s)?this.removeLabel(s):In(s)?this.killTweensOf(s):(s.parent===this&&wv(this,s),s===this._recent&&(this._recent=this._last),wc(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Sn(ks.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]=qs(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=Bn.delayedCall(0,i||zh,o);return l.data="isPause",this._hasPause=1,Gi(this,l,qs(this,s))},n.removePause=function(s){var i=this._first;for(s=qs(this,s);i;)i._start===s&&i.data==="isPause"&&tl(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),u=l.length;u--;)Fa!==l[u]&&l[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Qs(s),u=this._first,d=Xo(i),f;u;)u instanceof Bn?kre(u._targets,l)&&(d?(!Fa||u._initted&&u._ts)&&u.globalTime(0)<=i&&u.globalTime(u.totalDuration())>i:!i||u.isActive())&&o.push(u):(f=u.getTweensOf(l,i)).length&&o.push.apply(o,f),u=u._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=qs(o,s),u=i,d=u.startAt,f=u.onStart,h=u.onStartParams,m=u.immediateRender,v,x=Bn.to(o,Ms({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:l,overwrite:"auto",duration:i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale())||tn,onStart:function(){if(o.pause(),!v){var w=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());x._dur!==w&&Sd(x,w,0,1).render(x._time,!0,!0),v=1}f&&f.apply(x,h||[])}},i));return m?x.render(0):x},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Ms({startAt:{time:qs(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),IA(this,qs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),IA(this,qs(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+tn)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,u=this.labels,d;for(s=Sn(s);l;)l._start>=o&&(l._start+=s,l._end+=s),l=l._next;if(i)for(d in u)u[d]>=o&&(u[d]+=s);return wc(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),wc(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,u=Xs,d,f,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(h=o.parent;l;)d=l._prev,l._dirty&&l.totalDuration(),f=l._start,f>u&&o._sort&&l._ts&&!o._lock?(o._lock=1,Gi(o,l,f-l._delay,1)._lock=0):u=f,f<0&&l._ts&&(i-=f,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=Sn(f/o._ts),o._time-=f,o._tTime-=f),o.shiftChildren(-f,!1,-1/0),u=0),l._end>i&&l._ts&&(i=l._end),l=d;Sd(o,o===En&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(En._ts&&(pL(En,Og(s,En)),fL=ks.frame),ks.frame>=PA){PA+=Ts.autoSleep||120;var i=En._first;if((!i||!i._ts)&&Ts.autoSleep&&ks._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||ks.sleep()}}},e})(Wh);Ms(rs.prototype,{_lock:0,_hasPause:0,_forcing:0});var Gre=function(e,n,r,s,i,o,l){var u=new ls(this._pt,e,n,0,1,VL,null,i),d=0,f=0,h,m,v,x,_,w,b,k;for(u.b=r,u.e=s,r+="",s+="",(b=~s.indexOf("random("))&&(s=Uh(s)),o&&(k=[r,s],o(k,e,n),r=k[0],s=k[1]),m=r.match(H_)||[];h=H_.exec(s);)x=h[0],_=s.substring(d,h.index),v?v=(v+1)%5:_.substr(-5)==="rgba("&&(v=1),x!==m[f++]&&(w=parseFloat(m[f-1])||0,u._pt={_next:u._pt,p:_||f===1?_:",",s:w,c:x.charAt(1)==="="?zu(w,x)-w:parseFloat(x)-w,m:v&&v<4?Math.round:0},d=H_.lastIndex);return u.c=d<s.length?s.substring(d,s.length):"",u.fp=l,(lL.test(s)||b)&&(u.e=0),this._pt=u,u},$S=function(e,n,r,s,i,o,l,u,d,f){In(s)&&(s=s(i||0,e,o));var h=e[n],m=r!=="get"?r:In(h)?d?e[n.indexOf("set")||!In(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():h,v=In(h)?d?Jre:$L:VS,x;if(ur(s)&&(~s.indexOf("random(")&&(s=Uh(s)),s.charAt(1)==="="&&(x=zu(m,s)+(Ir(m)||0),(x||x===0)&&(s=x))),!f||m!==s||wx)return!isNaN(m*s)&&s!==""?(x=new ls(this._pt,e,n,+m||0,s-(m||0),typeof h=="boolean"?tse:FL,0,v),d&&(x.fp=d),l&&x.modifier(l,this,e),this._pt=x):(!h&&!(n in e)&&OS(n,s),Gre.call(this,e,n,m,s,v,u||Ts.stringFilter,d))},Kre=function(e,n,r,s,i){if(In(e)&&(e=ph(e,i,n,r,s)),!oo(e)||e.style&&e.nodeType||Nr(e)||oL(e))return ur(e)?ph(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=ph(e[l],i,n,r,s);return o},NL=function(e,n,r,s,i,o){var l,u,d,f;if(xs[e]&&(l=new xs[e]).init(i,l.rawVars?n[e]:Kre(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=u=new ls(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Nu))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=u;return l},Fa,wx,FS=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,u=s.lazy,d=s.onUpdate,f=s.runBackwards,h=s.yoyoEase,m=s.keyframes,v=s.autoRevert,x=e._dur,_=e._startAt,w=e._targets,b=e.parent,k=b&&b.data==="nested"?b.vars.targets:w,C=e._overwrite==="auto"&&!TS,P=e.timeline,T=s.easeReverse||h,M,I,R,L,j,F,D,q,W,G,H,J,B;if(P&&(!m||!i)&&(i="none"),e._ease=xc(i,Vh.ease),e._rEase=T&&(xc(T)||e._ease),e._from=!P&&!!s.runBackwards,e._from&&(e.ratio=1),!P||m&&!s.stagger){if(q=w[0]?_c(w[0]).harness:0,J=q&&s[q.prop],M=Mg(s,LS),_&&(_._zTime<0&&_.progress(1),n<0&&f&&l&&!v?_.render(-1,!0):_.revert(f&&x?km:bre),_._lazy=0),o){if(tl(e._startAt=Bn.set(w,Ms({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!_&&os(u),startAt:null,delay:0,onUpdate:d&&function(){return Es(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(_r||!l&&!v)&&e._startAt.revert(km),l&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&x&&!_){if(n&&(l=!1),R=Ms({overwrite:!1,data:"isFromStart",lazy:l&&!_&&os(u),immediateRender:l,stagger:0,parent:b},M),J&&(R[q.prop]=J),tl(e._startAt=Bn.set(w,R)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(_r?e._startAt.revert(km):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,tn,tn);else if(!n)return}for(e._pt=e._ptCache=0,u=x&&os(u)||u&&!x,I=0;I<w.length;I++){if(j=w[I],D=j._gsap||DS(w)[I]._gsap,e._ptLookup[I]=G={},px[D.id]&&Wa.length&&Ig(),H=k===w?I:k.indexOf(j),q&&(W=new q).init(j,J||M,e,H,k)!==!1&&(e._pt=L=new ls(e._pt,j,W.name,0,1,W.render,W,0,W.priority),W._props.forEach(function(Q){G[Q]=L}),W.priority&&(F=1)),!q||J)for(R in M)xs[R]&&(W=NL(R,M,e,H,j,k))?W.priority&&(F=1):G[R]=L=$S.call(e,j,R,"get",M[R],H,k,0,s.stringFilter);e._op&&e._op[I]&&e.kill(j,e._op[I]),C&&e._pt&&(Fa=e,En.killTweensOf(j,G,e.globalTime(n)),B=!e.parent,Fa=0),e._pt&&u&&(px[D.id]=1)}F&&HL(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!B,m&&n<=0&&P.render(Xs,!0,!0)},Yre=function(e,n,r,s,i,o,l,u){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,h,m,v;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,v=e._targets.length;v--;){if(f=m[v][n],f&&f.d&&f.d._pt)for(f=f.d._pt;f&&f.p!==n&&f.fp!==n;)f=f._next;if(!f)return wx=1,e.vars[n]="+=0",FS(e,l),wx=0,u?Hh(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(v=d.length;v--;)h=d[v],f=h._pt||h,f.s=(s||s===0)&&!i?s:f.s+(s||0)+o*f.c,f.c=r-f.s,h.e&&(h.e=Nn(r)+Ir(h.e)),h.b&&(h.b=f.s+Ir(h.b))},Xre=function(e,n){var r=e[0]?_c(e[0]).harness:0,s=r&&r.aliases,i,o,l,u;if(!s)return n;i=xd({},n);for(o in s)if(o in i)for(u=s[o].split(","),l=u.length;l--;)i[u[l]]=i[o];return i},Qre=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(Nr(n))l=r[e]||(r[e]=[]),n.forEach(function(u,d){return l.push({t:d/(n.length-1)*100,v:u,e:i})});else for(o in n)l=r[o]||(r[o]=[]),o==="ease"||l.push({t:parseFloat(e),v:n[o],e:i})},ph=function(e,n,r,s,i){return In(e)?e.call(n,r,s,i):ur(e)&&~e.indexOf("random(")?Uh(e):e},DL=NS+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",jL={};as(DL+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return jL[t]=1});var Bn=(function(t){sL(e,t);function e(r,s,i,o){var l;typeof s=="number"&&(i.duration=s,s=i,i=null),l=t.call(this,o?s:fh(s))||this;var u=l.vars,d=u.duration,f=u.delay,h=u.immediateRender,m=u.stagger,v=u.overwrite,x=u.keyframes,_=u.defaults,w=u.scrollTrigger,b=s.parent||En,k=(Nr(r)||oL(r)?Xo(r[0]):"length"in s)?[r]:Qs(r),C,P,T,M,I,R,L,j;if(l._targets=k.length?DS(k):Hh("GSAP target "+r+" not found. https://gsap.com",!Ts.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,x||m||K0(d)||K0(f)){s=l.vars;var F=s.easeReverse||s.yoyoEase;if(C=l.timeline=new rs({data:"nested",defaults:_||{},targets:b&&b.data==="nested"?b.vars.targets:k}),C.kill(),C.parent=C._dp=Oo(l),C._start=0,m||K0(d)||K0(f)){if(M=k.length,L=m&&SL(m),oo(m))for(I in m)~DL.indexOf(I)&&(j||(j={}),j[I]=m[I]);for(P=0;P<M;P++)T=Mg(s,jL),T.stagger=0,F&&(T.easeReverse=F),j&&xd(T,j),R=k[P],T.duration=+ph(d,Oo(l),P,R,k),T.delay=(+ph(f,Oo(l),P,R,k)||0)-l._delay,!m&&M===1&&T.delay&&(l._delay=f=T.delay,l._start+=f,T.delay=0),C.to(R,T,L?L(P,R,k):0),C._ease=Pt.none;C.duration()?d=f=0:l.timeline=0}else if(x){fh(Ms(C.vars.defaults,{ease:"none"})),C._ease=xc(x.ease||s.ease||"none");var D=0,q,W,G;if(Nr(x))x.forEach(function(H){return C.to(k,H,">")}),C.duration();else{T={};for(I in x)I==="ease"||I==="easeEach"||Qre(I,x[I],T,x.easeEach);for(I in T)for(q=T[I].sort(function(H,J){return H.t-J.t}),D=0,P=0;P<q.length;P++)W=q[P],G={ease:W.e,duration:(W.t-(P?q[P-1].t:0))/100*d},G[I]=W.v,C.to(k,G,D),D+=G.duration;C.duration()<d&&C.to({},{duration:d-C.duration()})}}d||l.duration(d=C.duration())}else l.timeline=0;return v===!0&&!TS&&(Fa=Oo(l),En.killTweensOf(k),Fa=0),Gi(b,Oo(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(h||!d&&!x&&l._start===Sn(b._time)&&os(h)&&Are(Oo(l))&&b.data!=="nested")&&(l._tTime=-tn,l.render(Math.max(0,-f)||0)),w&&_L(Oo(l),w),l}var n=e.prototype;return n.render=function(s,i,o){var l=this._time,u=this._tDur,d=this._dur,f=s<0,h=s>u-tn&&!f?u:s<tn?0:s,m,v,x,_,w,b,k,C;if(!d)Rre(this,s,i,o);else if(h!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(m=h,C=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(_*100+s,i,o);if(m=Sn(h%_),h===u?(x=this._repeat,m=d):(w=Sn(h/_),x=~~w,x&&x===w?(m=d,x--):m>d&&(m=d)),b=this._yoyo&&x&1,b&&(m=d-m),w=bd(this._tTime,_),m===l&&!o&&this._initted&&x===w)return this._tTime=h,this;x!==w&&this.vars.repeatRefresh&&!b&&!this._lock&&m!==_&&this._initted&&(this._lock=o=1,this.render(Sn(_*x),!0).invalidate()._lock=0)}if(!this._initted){if(wL(this,f?s:m,o,i,h))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&x!==w))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var P=m<l;if(P!==this._inv){var T=P?l:d-l;this._inv=P,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=T?(P?-1:1)/T:0,this._invScale=P?-this.ratio:1-this.ratio,this._invEase=P?this._rEase:this._ease}this.ratio=k=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=k=this._ease(m/d);if(this._from&&(this.ratio=k=1-k),this._tTime=h,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&h&&!i&&!w&&(Es(this,"onStart"),this._tTime!==h))return this;for(v=this._pt;v;)v.r(k,v.d),v=v._next;C&&C.render(s<0?s:C._dur*C._ease(m/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&mx(this,s,i,o),Es(this,"onUpdate")),this._repeat&&x!==w&&this.vars.onRepeat&&!i&&this.parent&&Es(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(f&&!this._onUpdate&&mx(this,s,!0,!0),(s||!d)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&tl(this,1),!i&&!(f&&!l)&&(h||l||b)&&(Es(this,h===u?"onComplete":"onReverseComplete",!0),this._prom&&!(h<u&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,o,l,u){Bh||ks.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||FS(this,d),f=this._ease(d/this._dur),Yre(this,s,i,o,l,f,d,u)?this.resetTo(s,i,o,l,1):(bv(this,0),this.parent||vL(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?Wf(this):this.scrollTrigger&&this.scrollTrigger.kill(!!_r),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Fa&&Fa.vars.overwrite!==!0)._first||Wf(this),this.parent&&o!==this.timeline.totalDuration()&&Sd(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,u=s?Qs(s):l,d=this._ptLookup,f=this._pt,h,m,v,x,_,w,b;if((!i||i==="all")&&Cre(l,u))return i==="all"&&(this._pt=0),Wf(this);for(h=this._op=this._op||[],i!=="all"&&(ur(i)&&(_={},as(i,function(k){return _[k]=1}),i=_),i=Xre(l,i)),b=l.length;b--;)if(~u.indexOf(l[b])){m=d[b],i==="all"?(h[b]=i,x=m,v={}):(v=h[b]=h[b]||{},x=i);for(_ in x)w=m&&m[_],w&&((!("kill"in w.d)||w.d.kill(_)===!0)&&wv(this,w,"_pt"),delete m[_]),v!=="all"&&(v[_]=1)}return this._initted&&!this._pt&&f&&Wf(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return hh(1,arguments)},e.delayedCall=function(s,i,o,l){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:l})},e.fromTo=function(s,i,o){return hh(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,o){return En.killTweensOf(s,i,o)},e})(Wh);Ms(Bn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});as("staggerTo,staggerFrom,staggerFromTo",function(t){Bn[t]=function(){var e=new rs,n=vx.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var VS=function(e,n,r){return e[n]=r},$L=function(e,n,r){return e[n](r)},Jre=function(e,n,r,s){return e[n](s.fp,r)},ese=function(e,n,r){return e.setAttribute(n,r)},HS=function(e,n){return In(e[n])?$L:RS(e[n])&&e.setAttribute?ese:VS},FL=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},tse=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},VL=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)},zS=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},nse=function(e,n,r,s){for(var i=this._pt,o;i;)o=i._next,i.p===s&&i.modifier(e,n,r),i=o},rse=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?wv(this,n,"_pt"):n.dep||(r=1),n=s;return!r},sse=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},HL=function(e){for(var n=e._pt,r,s,i,o;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:o)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:o=n,n=r}e._pt=i},ls=(function(){function t(n,r,s,i,o,l,u,d,f){this.t=r,this.s=i,this.c=o,this.p=s,this.r=l||FL,this.d=u||this,this.set=d||VS,this.pr=f||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=sse,this.m=r,this.mt=i,this.tween=s},t})();as(NS+"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 LS[t]=1});Is.TweenMax=Is.TweenLite=Bn;Is.TimelineLite=Is.TimelineMax=rs;En=new rs({sortChildren:!1,defaults:Vh,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ts.stringFilter=ML;var bc=[],Cm={},ise=[],OA=0,ose=0,Z_=function(e){return(Cm[e]||ise).map(function(n){return n()})},xx=function(){var e=Date.now(),n=[];e-OA>2&&(Z_("matchMediaInit"),bc.forEach(function(r){var s=r.queries,i=r.conditions,o,l,u,d;for(l in s)o=zi.matchMedia(s[l]).matches,o&&(u=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),u&&n.push(r))}),Z_("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),OA=e,Z_("matchMedia"))},zL=(function(){function t(n,r){this.selector=r&&yx(r),this.data=[],this._r=[],this.isReverted=!1,this.id=ose++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){In(r)&&(i=s,s=r,r=In);var o=this,l=function(){var d=mn,f=o.selector,h;return d&&d!==o&&d.data.push(o),i&&(o.selector=yx(i)),mn=o,h=s.apply(o,arguments),In(h)&&o._r.push(h),mn=d,o.selector=f,o.isReverted=!1,h};return o.last=l,r===In?l(o,function(u){return o.add(null,u)}):r?o[r]=l:l},e.ignore=function(r){var s=mn;mn=null,r(this),mn=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof Bn&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var l=i.getTweens(),u=i.data.length,d;u--;)d=i.data[u],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(f){return l.splice(l.indexOf(f),1)}));for(l.map(function(f){return{g:f._dur||f._delay||f._sat&&!f._sat.vars.immediateRender?f.globalTime(0):-1/0,t:f}}).sort(function(f,h){return h.g-f.g||-1/0}).forEach(function(f){return f.t.revert(r)}),u=i.data.length;u--;)d=i.data[u],d instanceof rs?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof Bn)&&d.revert&&d.revert(r);i._r.forEach(function(f){return f(r,i)}),i.isReverted=!0})():this.data.forEach(function(l){return l.kill&&l.kill()}),this.clear(),s)for(var o=bc.length;o--;)bc[o].id===this.id&&bc.splice(o,1)},e.revert=function(r){this.kill(r||{})},t})(),ase=(function(){function t(n){this.contexts=[],this.scope=n,mn&&mn.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){oo(r)||(r={matches:r});var o=new zL(0,i||this.scope),l=o.conditions={},u,d,f;mn&&!o.selector&&(o.selector=mn.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?f=1:(u=zi.matchMedia(r[d]),u&&(bc.indexOf(o)<0&&bc.push(o),(l[d]=u.matches)&&(f=1),u.addListener?u.addListener(xx):u.addEventListener("change",xx)));return f&&s(o,function(h){return o.add(null,h)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),Lg={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 TL(s)})},timeline:function(e){return new rs(e)},getTweensOf:function(e,n){return En.getTweensOf(e,n)},getProperty:function(e,n,r,s){ur(e)&&(e=Qs(e)[0]);var i=_c(e||{}).get,o=r?gL:mL;return r==="native"&&(r=""),e&&(n?o((xs[n]&&xs[n].get||i)(e,n,r,s)):function(l,u,d){return o((xs[l]&&xs[l].get||i)(e,l,u,d))})},quickSetter:function(e,n,r){if(e=Qs(e),e.length>1){var s=e.map(function(f){return us.quickSetter(f,n,r)}),i=s.length;return function(f){for(var h=i;h--;)s[h](f)}}e=e[0]||{};var o=xs[n],l=_c(e),u=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var h=new o;Nu._pt=0,h.init(e,r?f+r:f,Nu,0,[e]),h.render(1,h),Nu._pt&&zS(1,Nu)}:l.set(e,u);return o?d:function(f){return d(e,u,r?f+r:f,l,1)}},quickTo:function(e,n,r){var s,i=us.to(e,Ms((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(u,d,f){return i.resetTo(n,u,d,f)};return o.tween=i,o},isTweening:function(e){return En.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=xc(e.ease,Vh.ease)),AA(Vh,e||{})},config:function(e){return AA(Ts,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,o=e.extendTimeline;(s||"").split(",").forEach(function(l){return l&&!xs[l]&&!Is[l]&&Hh(n+" effect requires "+l+" plugin.")}),z_[n]=function(l,u,d){return r(Qs(l),Ms(u||{},i),d)},o&&(rs.prototype[n]=function(l,u,d){return this.add(z_[n](l,oo(u)?u:(d=u)&&{},this),d)})},registerEase:function(e,n){Pt[e]=xc(n)},parseEase:function(e,n){return arguments.length?xc(e,n):Pt},getById:function(e){return En.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new rs(e),s,i;for(r.smoothChildTiming=os(e.smoothChildTiming),En.remove(r),r._dp=0,r._time=r._tTime=En._time,s=En._first;s;)i=s._next,(n||!(!s._dur&&s instanceof Bn&&s.vars.onComplete===s._targets[0]))&&Gi(r,s,s._start-s._delay),s=i;return Gi(En,r,0),r},context:function(e,n){return e?new zL(e,n):mn},matchMedia:function(e){return new ase(e)},matchMediaRefresh:function(){return bc.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||xx()},addEventListener:function(e,n){var r=Cm[e]||(Cm[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Cm[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:$re,wrapYoyo:Fre,distribute:SL,random:EL,snap:kL,normalize:jre,getUnit:Ir,clamp:Ore,splitColor:RL,toArray:Qs,selector:yx,mapRange:PL,pipe:Nre,unitize:Dre,interpolate:Vre,shuffle:bL},install:uL,effects:z_,ticker:ks,updateRoot:rs.updateRoot,plugins:xs,globalTimeline:En,core:{PropTween:ls,globals:dL,Tween:Bn,Timeline:rs,Animation:Wh,getCache:_c,_removeLinkedListItem:wv,reverting:function(){return _r},context:function(e){return e&&mn&&(mn.data.push(e),e._ctx=mn),mn},suppressOverwrites:function(e){return TS=e}}};as("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Lg[t]=Bn[t]});ks.add(rs.updateRoot);Nu=Lg.to({},{duration:0});var lse=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},cse=function(e,n){var r=e._targets,s,i,o;for(s in n)for(i=r.length;i--;)o=e._ptLookup[i][s],o&&(o=o.d)&&(o._pt&&(o=lse(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},q_=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var u,d;if(ur(i)&&(u={},as(i,function(f){return u[f]=1}),i=u),n){u={};for(d in i)u[d]=n(i[d]);i=u}cse(l,i)}}}},us=Lg.registerPlugin({name:"attr",init:function(e,n,r,s,i){var o,l,u;this.tween=r;for(o in n)u=e.getAttribute(o)||"",l=this.add(e,"setAttribute",(u||0)+"",n[o],s,i,0,0,o),l.op=o,l.b=u,this._props.push(o)},render:function(e,n){for(var r=n._pt;r;)_r?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)}},q_("roundProps",_x),q_("modifiers"),q_("snap",kL))||Lg;Bn.version=rs.version=us.version="3.15.0";cL=1;IS()&&kd();Pt.Power0;Pt.Power1;Pt.Power2;Pt.Power3;Pt.Power4;Pt.Linear;Pt.Quad;Pt.Cubic;Pt.Quart;Pt.Quint;Pt.Strong;Pt.Elastic;Pt.Back;Pt.SteppedEase;Pt.Bounce;Pt.Sine;Pt.Expo;Pt.Circ;/*!
149
- * CSSPlugin 3.15.0
150
- * https://gsap.com
151
- *
152
- * Copyright 2008-2026, GreenSock. All rights reserved.
153
- * Subject to the terms at https://gsap.com/standard-license
154
- * @author: Jack Doyle, jack@greensock.com
155
- */var LA,Va,Uu,US,tc,NA,BS,use=function(){return typeof window<"u"},Qo={},Xl=180/Math.PI,Bu=Math.PI/180,bu=Math.atan2,DA=1e8,WS=/([A-Z])/g,dse=/(left|right|width|margin|padding|x)/i,fse=/[\s,\(]\S/,Xi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},bx=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},hse=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)},pse=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)},mse=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)},gse=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},UL=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},BL=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},vse=function(e,n,r){return e.style[n]=r},yse=function(e,n,r){return e.style.setProperty(n,r)},_se=function(e,n,r){return e._gsap[n]=r},wse=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},xse=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},bse=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},Cn="transform",cs=Cn+"Origin",Sse=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in Qo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Xi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=Lo(s,l)}):this.tfm[e]=o.x?o[e]:Lo(s,e),e===cs&&(this.tfm.zOrigin=o.zOrigin);else return Xi.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(Cn)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(cs,n,"")),e=Cn}(i||n)&&this.props.push(e,n,i[e])},WL=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},kse=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(WS,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=BS(),(!i||!i.isStart)&&!r[Cn]&&(WL(r),s.zOrigin&&r[cs]&&(r[cs]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},ZL=function(e,n){var r={target:e,props:[],revert:kse,save:Sse};return e._gsap||us.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},qL,Sx=function(e,n){var r=Va.createElementNS?Va.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Va.createElement(e);return r&&r.style?r:Va.createElement(e)},Cs=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(WS,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Ed(n)||n,1)||""},jA="O,Moz,ms,Ms,Webkit".split(","),Ed=function(e,n,r){var s=n||tc,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(jA[o]+e in i););return o<0?null:(o===3?"ms":o>=0?jA[o]:"")+e},kx=function(){use()&&window.document&&(LA=window,Va=LA.document,Uu=Va.documentElement,tc=Sx("div")||{style:{}},Sx("div"),Cn=Ed(Cn),cs=Cn+"Origin",tc.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",qL=!!Ed("perspective"),BS=us.core.reverting,US=1)},$A=function(e){var n=e.ownerSVGElement,r=Sx("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Uu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Uu.removeChild(r),i},FA=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},GL=function(e){var n,r;try{n=e.getBBox()}catch{n=$A(e),r=1}return n&&(n.width||n.height)||r||(n=$A(e)),n&&!n.width&&!n.x&&!n.y?{x:+FA(e,["x","cx","x1"])||0,y:+FA(e,["y","cy","y1"])||0,width:0,height:0}:n},KL=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&GL(e))},nl=function(e,n){if(n){var r=e.style,s;n in Qo&&n!==cs&&(n=Cn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(WS,"-$1").toLowerCase())):r.removeAttribute(n)}},Ha=function(e,n,r,s,i,o){var l=new ls(e._pt,n,r,0,1,o?BL:UL);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},VA={deg:1,rad:1,turn:1},Ese={grid:1,flex:1},rl=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=tc.style,u=dse.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(u?"Width":"Height"),h=100,m=s==="px",v=s==="%",x,_,w,b;if(s===o||!i||VA[s]||VA[o])return i;if(o!=="px"&&!m&&(i=t(e,n,r,"px")),b=e.getCTM&&KL(e),(v||o==="%")&&(Qo[n]||~n.indexOf("adius")))return x=b?e.getBBox()[u?"width":"height"]:e[f],Nn(v?i/x*h:i/100*x);if(l[u?"width":"height"]=h+(m?o:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,b&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Va||!_.appendChild)&&(_=Va.body),w=_._gsap,w&&v&&w.width&&u&&w.time===ks.time&&!w.uncache)return Nn(i/w.width*h);if(v&&(n==="height"||n==="width")){var k=e.style[n];e.style[n]=h+s,x=e[f],k?e.style[n]=k:nl(e,n)}else(v||o==="%")&&!Ese[Cs(_,"display")]&&(l.position=Cs(e,"position")),_===e&&(l.position="static"),_.appendChild(tc),x=tc[f],_.removeChild(tc),l.position="absolute";return u&&v&&(w=_c(_),w.time=ks.time,w.width=_[f]),Nn(m?x*i/h:x&&i?h/x*i:0)},Lo=function(e,n,r,s){var i;return US||kx(),n in Xi&&n!=="transform"&&(n=Xi[n],~n.indexOf(",")&&(n=n.split(",")[0])),Qo[n]&&n!=="transform"?(i=qh(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Dg(Cs(e,cs))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Ng[n]&&Ng[n](e,n,r)||Cs(e,n)||hL(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?rl(e,n,i,r)+r:i},Cse=function(e,n,r,s){if(!r||r==="none"){var i=Ed(n,e,1),o=i&&Cs(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=Cs(e,"borderTopColor"))}var l=new ls(this._pt,e.style,n,0,1,VL),u=0,d=0,f,h,m,v,x,_,w,b,k,C,P,T;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=Cs(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=Cs(e,n)||s,_?e.style[n]=_:nl(e,n)),f=[r,s],ML(f),r=f[0],s=f[1],m=r.match(Lu)||[],T=s.match(Lu)||[],T.length){for(;h=Lu.exec(s);)w=h[0],k=s.substring(u,h.index),x?x=(x+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(x=1),w!==(_=m[d++]||"")&&(v=parseFloat(_)||0,P=_.substr((v+"").length),w.charAt(1)==="="&&(w=zu(v,w)+P),b=parseFloat(w),C=w.substr((b+"").length),u=Lu.lastIndex-C.length,C||(C=C||Ts.units[n]||P,u===s.length&&(s+=C,l.e+=C)),P!==C&&(v=rl(e,n,_,C)||0),l._pt={_next:l._pt,p:k||d===1?k:",",s:v,c:b-v,m:x&&x<4||n==="zIndex"?Math.round:0});l.c=u<s.length?s.substring(u,s.length):""}else l.r=n==="display"&&s==="none"?BL:UL;return lL.test(s)&&(l.e=0),this._pt=l,l},HA={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Pse=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]=HA[r]||r,n[1]=HA[s]||s,n.join(" ")},Ase=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,o=r._gsap,l,u,d;if(i==="all"||i===!0)s.cssText="",u=1;else for(i=i.split(","),d=i.length;--d>-1;)l=i[d],Qo[l]&&(u=1,l=l==="transformOrigin"?cs:Cn),nl(r,l);u&&(nl(r,Cn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",qh(r,1),o.uncache=1,WL(s)))}},Ng={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new ls(e._pt,n,r,0,0,Ase);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},Zh=[1,0,0,1,0,0],YL={},XL=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},zA=function(e){var n=Cs(e,Cn);return XL(n)?Zh:n.substr(7).match(aL).map(Nn)},ZS=function(e,n){var r=e._gsap||_c(e),s=e.style,i=zA(e),o,l,u,d;return r.svg&&e.getAttribute("transform")?(u=e.transform.baseVal.consolidate().matrix,i=[u.a,u.b,u.c,u.d,u.e,u.f],i.join(",")==="1,0,0,1,0,0"?Zh:i):(i===Zh&&!e.offsetParent&&e!==Uu&&!r.svg&&(u=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,Uu.appendChild(e)),i=zA(e),u?s.display=u:nl(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):Uu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Ex=function(e,n,r,s,i,o){var l=e._gsap,u=i||ZS(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,h=l.xOffset||0,m=l.yOffset||0,v=u[0],x=u[1],_=u[2],w=u[3],b=u[4],k=u[5],C=n.split(" "),P=parseFloat(C[0])||0,T=parseFloat(C[1])||0,M,I,R,L;r?u!==Zh&&(I=v*w-x*_)&&(R=P*(w/I)+T*(-_/I)+(_*k-w*b)/I,L=P*(-x/I)+T*(v/I)-(v*k-x*b)/I,P=R,T=L):(M=GL(e),P=M.x+(~C[0].indexOf("%")?P/100*M.width:P),T=M.y+(~(C[1]||C[0]).indexOf("%")?T/100*M.height:T)),s||s!==!1&&l.smooth?(b=P-d,k=T-f,l.xOffset=h+(b*v+k*_)-b,l.yOffset=m+(b*x+k*w)-k):l.xOffset=l.yOffset=0,l.xOrigin=P,l.yOrigin=T,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[cs]="0px 0px",o&&(Ha(o,l,"xOrigin",d,P),Ha(o,l,"yOrigin",f,T),Ha(o,l,"xOffset",h,l.xOffset),Ha(o,l,"yOffset",m,l.yOffset)),e.setAttribute("data-svg-origin",P+" "+T)},qh=function(e,n){var r=e._gsap||new LL(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",u=getComputedStyle(e),d=Cs(e,cs)||"0",f,h,m,v,x,_,w,b,k,C,P,T,M,I,R,L,j,F,D,q,W,G,H,J,B,Q,z,N,Y,oe,ne,ie;return f=h=m=_=w=b=k=C=P=0,v=x=1,r.svg=!!(e.getCTM&&KL(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(s[Cn]=(u.translate!=="none"?"translate3d("+(u.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(u.rotate!=="none"?"rotate("+u.rotate+") ":"")+(u.scale!=="none"?"scale("+u.scale.split(" ").join(",")+") ":"")+(u[Cn]!=="none"?u[Cn]:"")),s.scale=s.rotate=s.translate="none"),I=ZS(e,r.svg),r.svg&&(r.uncache?(B=e.getBBox(),d=r.xOrigin-B.x+"px "+(r.yOrigin-B.y)+"px",J=""):J=!n&&e.getAttribute("data-svg-origin"),Ex(e,J||d,!!J||r.originIsAbsolute,r.smooth!==!1,I)),T=r.xOrigin||0,M=r.yOrigin||0,I!==Zh&&(F=I[0],D=I[1],q=I[2],W=I[3],f=G=I[4],h=H=I[5],I.length===6?(v=Math.sqrt(F*F+D*D),x=Math.sqrt(W*W+q*q),_=F||D?bu(D,F)*Xl:0,k=q||W?bu(q,W)*Xl+_:0,k&&(x*=Math.abs(Math.cos(k*Bu))),r.svg&&(f-=T-(T*F+M*q),h-=M-(T*D+M*W))):(ie=I[6],oe=I[7],z=I[8],N=I[9],Y=I[10],ne=I[11],f=I[12],h=I[13],m=I[14],R=bu(ie,Y),w=R*Xl,R&&(L=Math.cos(-R),j=Math.sin(-R),J=G*L+z*j,B=H*L+N*j,Q=ie*L+Y*j,z=G*-j+z*L,N=H*-j+N*L,Y=ie*-j+Y*L,ne=oe*-j+ne*L,G=J,H=B,ie=Q),R=bu(-q,Y),b=R*Xl,R&&(L=Math.cos(-R),j=Math.sin(-R),J=F*L-z*j,B=D*L-N*j,Q=q*L-Y*j,ne=W*j+ne*L,F=J,D=B,q=Q),R=bu(D,F),_=R*Xl,R&&(L=Math.cos(R),j=Math.sin(R),J=F*L+D*j,B=G*L+H*j,D=D*L-F*j,H=H*L-G*j,F=J,G=B),w&&Math.abs(w)+Math.abs(_)>359.9&&(w=_=0,b=180-b),v=Nn(Math.sqrt(F*F+D*D+q*q)),x=Nn(Math.sqrt(H*H+ie*ie)),R=bu(G,H),k=Math.abs(R)>2e-4?R*Xl:0,P=ne?1/(ne<0?-ne:ne):0),r.svg&&(J=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!XL(Cs(e,Cn)),J&&e.setAttribute("transform",J))),Math.abs(k)>90&&Math.abs(k)<270&&(i?(v*=-1,k+=_<=0?180:-180,_+=_<=0?180:-180):(x*=-1,k+=k<=0?180:-180)),n=n||r.uncache,r.x=f-((r.xPercent=f&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-f)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+o,r.y=h-((r.yPercent=h&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=m+o,r.scaleX=Nn(v),r.scaleY=Nn(x),r.rotation=Nn(_)+l,r.rotationX=Nn(w)+l,r.rotationY=Nn(b)+l,r.skewX=k+l,r.skewY=C+l,r.transformPerspective=P+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[cs]=Dg(d)),r.xOffset=r.yOffset=0,r.force3D=Ts.force3D,r.renderTransform=r.svg?Rse:qL?QL:Tse,r.uncache=0,r},Dg=function(e){return(e=e.split(" "))[0]+" "+e[1]},G_=function(e,n,r){var s=Ir(n);return Nn(parseFloat(n)+parseFloat(rl(e,"x",r+"px",s)))+s},Tse=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,QL(e,n)},Bl="0deg",Nf="0px",Wl=") ",QL=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.z,d=r.rotation,f=r.rotationY,h=r.rotationX,m=r.skewX,v=r.skewY,x=r.scaleX,_=r.scaleY,w=r.transformPerspective,b=r.force3D,k=r.target,C=r.zOrigin,P="",T=b==="auto"&&e&&e!==1||b===!0;if(C&&(h!==Bl||f!==Bl)){var M=parseFloat(f)*Bu,I=Math.sin(M),R=Math.cos(M),L;M=parseFloat(h)*Bu,L=Math.cos(M),o=G_(k,o,I*L*-C),l=G_(k,l,-Math.sin(M)*-C),u=G_(k,u,R*L*-C+C)}w!==Nf&&(P+="perspective("+w+Wl),(s||i)&&(P+="translate("+s+"%, "+i+"%) "),(T||o!==Nf||l!==Nf||u!==Nf)&&(P+=u!==Nf||T?"translate3d("+o+", "+l+", "+u+") ":"translate("+o+", "+l+Wl),d!==Bl&&(P+="rotate("+d+Wl),f!==Bl&&(P+="rotateY("+f+Wl),h!==Bl&&(P+="rotateX("+h+Wl),(m!==Bl||v!==Bl)&&(P+="skew("+m+", "+v+Wl),(x!==1||_!==1)&&(P+="scale("+x+", "+_+Wl),k.style[Cn]=P||"translate(0, 0)"},Rse=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.rotation,d=r.skewX,f=r.skewY,h=r.scaleX,m=r.scaleY,v=r.target,x=r.xOrigin,_=r.yOrigin,w=r.xOffset,b=r.yOffset,k=r.forceCSS,C=parseFloat(o),P=parseFloat(l),T,M,I,R,L;u=parseFloat(u),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,u+=f),u||d?(u*=Bu,d*=Bu,T=Math.cos(u)*h,M=Math.sin(u)*h,I=Math.sin(u-d)*-m,R=Math.cos(u-d)*m,d&&(f*=Bu,L=Math.tan(d-f),L=Math.sqrt(1+L*L),I*=L,R*=L,f&&(L=Math.tan(f),L=Math.sqrt(1+L*L),T*=L,M*=L)),T=Nn(T),M=Nn(M),I=Nn(I),R=Nn(R)):(T=h,R=m,M=I=0),(C&&!~(o+"").indexOf("px")||P&&!~(l+"").indexOf("px"))&&(C=rl(v,"x",o,"px"),P=rl(v,"y",l,"px")),(x||_||w||b)&&(C=Nn(C+x-(x*T+_*I)+w),P=Nn(P+_-(x*M+_*R)+b)),(s||i)&&(L=v.getBBox(),C=Nn(C+s/100*L.width),P=Nn(P+i/100*L.height)),L="matrix("+T+","+M+","+I+","+R+","+C+","+P+")",v.setAttribute("transform",L),k&&(v.style[Cn]=L)},Ise=function(e,n,r,s,i){var o=360,l=ur(i),u=parseFloat(i)*(l&&~i.indexOf("rad")?Xl:1),d=u-s,f=s+d+"deg",h,m;return l&&(h=i.split("_")[1],h==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),h==="cw"&&d<0?d=(d+o*DA)%o-~~(d/o)*o:h==="ccw"&&d>0&&(d=(d-o*DA)%o-~~(d/o)*o)),e._pt=m=new ls(e._pt,n,r,s,d,hse),m.e=f,m.u="deg",e._props.push(r),m},UA=function(e,n){for(var r in n)e[r]=n[r];return e},Mse=function(e,n,r){var s=UA({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,u,d,f,h,m,v,x;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[Cn]=n,l=qh(r,1),nl(r,Cn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Cn],o[Cn]=n,l=qh(r,1),o[Cn]=d);for(u in Qo)d=s[u],f=l[u],d!==f&&i.indexOf(u)<0&&(v=Ir(d),x=Ir(f),h=v!==x?rl(r,u,d,x):parseFloat(d),m=parseFloat(f),e._pt=new ls(e._pt,l,u,h,m-h,bx),e._pt.u=x||0,e._props.push(u));UA(l,s)};as("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",o=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(l){return e<2?t+l:"border"+l+t});Ng[e>1?"border"+t:t]=function(l,u,d,f,h){var m,v;if(arguments.length<4)return m=o.map(function(x){return Lo(l,x,d)}),v=m.join(" "),v.split(m[0]).length===5?m[0]:v;m=(f+"").split(" "),v={},o.forEach(function(x,_){return v[x]=m[_]=m[_]||m[(_-1)/2|0]}),l.init(u,v,h)}});var JL={name:"css",register:kx,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,u=r.vars.startAt,d,f,h,m,v,x,_,w,b,k,C,P,T,M,I,R,L;US||kx(),this.styles=this.styles||ZL(e),R=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(f=n[_],!(xs[_]&&NL(_,n,r,s,e,i)))){if(v=typeof f,x=Ng[_],v==="function"&&(f=f.call(r,s,e,i),v=typeof f),v==="string"&&~f.indexOf("random(")&&(f=Uh(f)),x)x(this,e,_,f,r)&&(I=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),f+="",Za.lastIndex=0,Za.test(d)||(w=Ir(d),b=Ir(f),b?w!==b&&(d=rl(e,_,d,b)+b):w&&(f+=w)),this.add(l,"setProperty",d,f,s,i,0,0,_),o.push(_),R.push(_,0,l[_]);else if(v!=="undefined"){if(u&&_ in u?(d=typeof u[_]=="function"?u[_].call(r,s,e,i):u[_],ur(d)&&~d.indexOf("random(")&&(d=Uh(d)),Ir(d+"")||d==="auto"||(d+=Ts.units[_]||Ir(Lo(e,_))||""),(d+"").charAt(1)==="="&&(d=Lo(e,_))):d=Lo(e,_),m=parseFloat(d),k=v==="string"&&f.charAt(1)==="="&&f.substr(0,2),k&&(f=f.substr(2)),h=parseFloat(f),_ in Xi&&(_==="autoAlpha"&&(m===1&&Lo(e,"visibility")==="hidden"&&h&&(m=0),R.push("visibility",0,l.visibility),Ha(this,l,"visibility",m?"inherit":"hidden",h?"inherit":"hidden",!h)),_!=="scale"&&_!=="transform"&&(_=Xi[_],~_.indexOf(",")&&(_=_.split(",")[0]))),C=_ in Qo,C){if(this.styles.save(_),L=f,v==="string"&&f.substring(0,6)==="var(--"){if(f=Cs(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var j=e.style.perspective;e.style.perspective=f,f=Cs(e,"perspective"),j?e.style.perspective=j:nl(e,"perspective")}h=parseFloat(f)}if(P||(T=e._gsap,T.renderTransform&&!n.parseTransform||qh(e,n.parseTransform),M=n.smoothOrigin!==!1&&T.smooth,P=this._pt=new ls(this._pt,l,Cn,0,1,T.renderTransform,T,0,-1),P.dep=1),_==="scale")this._pt=new ls(this._pt,T,"scaleY",T.scaleY,(k?zu(T.scaleY,k+h):h)-T.scaleY||0,bx),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){R.push(cs,0,l[cs]),f=Pse(f),T.svg?Ex(e,f,0,M,0,this):(b=parseFloat(f.split(" ")[2])||0,b!==T.zOrigin&&Ha(this,T,"zOrigin",T.zOrigin,b),Ha(this,l,_,Dg(d),Dg(f)));continue}else if(_==="svgOrigin"){Ex(e,f,1,M,0,this);continue}else if(_ in YL){Ise(this,T,_,m,k?zu(m,k+f):f);continue}else if(_==="smoothOrigin"){Ha(this,T,"smooth",T.smooth,f);continue}else if(_==="force3D"){T[_]=f;continue}else if(_==="transform"){Mse(this,f,e);continue}}else _ in l||(_=Ed(_)||_);if(C||(h||h===0)&&(m||m===0)&&!fse.test(f)&&_ in l)w=(d+"").substr((m+"").length),h||(h=0),b=Ir(f)||(_ in Ts.units?Ts.units[_]:w),w!==b&&(m=rl(e,_,d,b)),this._pt=new ls(this._pt,C?T:l,_,m,(k?zu(m,k+h):h)-m,!C&&(b==="px"||_==="zIndex")&&n.autoRound!==!1?gse:bx),this._pt.u=b||0,C&&L!==f?(this._pt.b=d,this._pt.e=L,this._pt.r=mse):w!==b&&b!=="%"&&(this._pt.b=d,this._pt.r=pse);else if(_ in l)Cse.call(this,e,_,d,k?k+f:f);else if(_ in e)this.add(e,_,d||e[_],k?k+f:f,s,i);else if(_!=="parseTransform"){OS(_,f);continue}C||(_ in l?R.push(_,0,l[_]):typeof e[_]=="function"?R.push(_,2,e[_]()):R.push(_,1,d||e[_])),o.push(_)}}I&&HL(this)},render:function(e,n){if(n.tween._time||!BS())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Lo,aliases:Xi,getSetter:function(e,n,r){var s=Xi[n];return s&&s.indexOf(",")<0&&(n=s),n in Qo&&n!==cs&&(e._gsap.x||Lo(e,"x"))?r&&NA===r?n==="scale"?wse:_se:(NA=r||{})&&(n==="scale"?xse:bse):e.style&&!RS(e.style[n])?vse:~n.indexOf("-")?yse:HS(e,n)},core:{_removeProperty:nl,_getMatrix:ZS}};us.utils.checkPrefix=Ed;us.core.getStyleSaver=ZL;(function(t,e,n,r){var s=as(t+","+e+","+n,function(i){Qo[i]=1});as(e,function(i){Ts.units[i]="deg",YL[i]=1}),Xi[s[13]]=t+","+e,as(r,function(i){var o=i.split(":");Xi[o[1]]=s[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");as("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Ts.units[t]="px"});us.registerPlugin(JL);var vi=us.registerPlugin(JL)||us;vi.core.Tween;const Pm="/assets/logo-animation",K_=1280,Ose=[{id:"eraser",src:`${Pm}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${Pm}/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:`${Pm}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],Lse=[{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}],Cx=({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,o=r.current;if(!s||!i||!o)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,u=(b,k)=>b+Math.random()*(k-b);let d=null,f,h=1;const m=Ose.map(b=>({...b})),v=()=>{s.querySelectorAll(".la-obj").forEach(R=>R.remove());const b=s.getBoundingClientRect(),k=b.width||K_,C=b.height||K_*.64;h=k/K_,i.style.width=`${242*h}px`,i.style.height=`${250*h}px`;const T=250*h/337,M=[],I=(R,L,j)=>{const F=document.createElement("div");return F.className="la-obj",F.style.width=`${L}px`,F.innerHTML=`<img src="${R}" alt="" style="${j?"transform:scaleX(-1)":""}">`,s.appendChild(F),F};return Lse.forEach((R,L)=>{const j=R.w*h,F=I(`${Pm}/sea/${R.k}.png`,j,L%2===0);vi.set(F,{x:R.x*k-j/2,y:R.y*C-j/2,rotation:R.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),M.push({el:F,hero:!1,rest:1})}),m.forEach(R=>{const L=R.cssW*h;R.el=I(R.src,L,!!R.flip),R.finalScale=R.fit*T/(R.cssW*h),vi.set(R.el,{x:R.seaX*k-L/2,y:R.seaY*C-R.cssH*h/2,rotation:R.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),M.push({el:R.el,hero:!0,rest:150/R.cssW})}),M},x=(b,k)=>{const C=s.getBoundingClientRect(),P=o.getBoundingClientRect();return{x:P.left-C.left+b/326*P.width,y:P.top-C.top+k/337*P.height}},_=()=>{d&&d.revert();const b=v();if(l){d=vi.context(()=>{b.filter(P=>!P.hero).forEach(P=>vi.set(P.el,{scale:0})),m.forEach(P=>{if(!P.el)return;const T=x(P.localX,P.localY);vi.set(P.el,{x:T.x-P.cssW*h/2,y:T.y-P.cssH*h/2,rotation:P.rot,scale:P.finalScale})})},s);return}const k=[],C=[];d=vi.context(()=>{const P=vi.timeline();P.to(b.map(T=>T.el),{scale:T=>b[T].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),P.add(()=>{b.forEach(({el:T,hero:M},I)=>{const R=M?k:C,L=I%2?1:-1;R.push(vi.to(T,{rotation:"+="+u(2.5,6)*L,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),vi.to(T,{y:"+="+u(5,11)*L,x:"+="+u(4,9)*-L,duration:u(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:u(0,.4)}))})},"<0.1"),P.to({},{duration:1.1}),P.add("pick"),m.forEach((T,M)=>{T.el&&P.to(T.el,{scale:150/T.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+M*.08)}),P.add("clear","pick+=0.7"),P.add(()=>C.forEach(T=>T.kill()),"clear"),P.to(b.filter(T=>!T.hero).map(T=>T.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),P.add("assemble","clear+=0.25"),P.add(()=>k.forEach(T=>T.kill()),"assemble"),m.forEach((T,M)=>{if(!T.el||T.finalScale===void 0)return;const I=x(T.localX,T.localY);P.to(T.el,{x:I.x-T.cssW*h/2,y:I.y-T.cssH*h/2,rotation:T.rot,scale:T.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+M*.12)}),m.forEach(T=>{!T.el||T.finalScale===void 0||P.to(T.el,{scale:T.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};vi.ticker.fps(12),_();const w=()=>{clearTimeout(f),f=setTimeout(_,250)};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(b=>b.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},Nse=Object.freeze(Object.defineProperty({__proto__:null,default:Cx},Symbol.toStringTag,{value:"Module"})),BA=({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"})]}),Dse=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,displayMode:r="full"})=>r==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(Cx,{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(BA,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[S.jsx(Cx,{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(BA,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),jse="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",$se=({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:jse,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(Jg,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),Fse="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M70.5245%206.60961C66.8741%202.95923%2060.9556%202.95922%2057.3053%206.60961L8.61753%2055.2973C4.96715%2058.9477%204.96714%2064.8662%208.61752%2068.5166L26.3518%2086.2508C30.0022%2089.9012%2035.9206%2089.9012%2039.571%2086.2508L92.033%2033.7889C93.5989%2032.2229%2093.5989%2029.684%2092.033%2028.1181L70.5245%206.60961Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M119.208%2068.5159C122.858%2064.8655%20122.858%2058.947%20119.208%2055.2966L70.5199%206.60891C66.8695%202.95853%2060.951%202.95851%2057.3007%206.6089L32.8391%2031.0705L88.1364%2086.3678C91.7868%2090.0182%2097.7053%2090.0182%20101.356%2086.3678L119.208%2068.5159Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M64.0164%2077.3398L44.0436%2097.3127C41.1057%20100.251%2041.1057%20105.014%2044.0436%20107.952L58.5067%20122.415C61.4446%20125.353%2066.2079%20125.353%2069.1458%20122.415L83.7991%20107.762C86.737%20104.824%2086.737%20100.06%2083.7991%2097.1225L64.0164%2077.3398Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3c/svg%3e",jg=44,Df=8,Y0=16,Vse=4,WA=-18,Hse=.18,zse=[.22,1,.36,1],ZA=.92,Use=1,Bse=.95,Wse=.4,Zse=[.19,1,.22,1],Y_=0,qse=1,Gse=0,Kse=0,Yse=0,eN=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Df,s=Math.max(r,e.width-jg-Df),i=Math.max(Df,e.height-jg-Df);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Df,t.y))}},qS=()=>({width:window.innerWidth,height:window.innerHeight}),Xse=({position:t,boundsLeftPx:e=0})=>eN({position:t,viewport:qS(),boundsLeft:e}),Qse=()=>{if(typeof window>"u")return{x:Y0,y:Y0};const t=qS();return{x:t.width-jg-Y0,y:t.height-jg-Y0}},Jse=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=Vse,eie=t=>t.button===void 0||t.button<=Yse,qA=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},tie=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=g.useRef(null),u=g.useRef(!1),[d,f]=g.useState(!1),[h,m]=g.useState(!1),v=n?!1:{opacity:Y_,scale:ZA,x:WA},x=n?{opacity:Y_}:{opacity:Y_,scale:ZA,x:WA},_=n?{duration:Kse}:{duration:Hse,ease:zse,scale:{duration:Wse,ease:Zse}},w=g.useCallback(()=>{const T=l.current;T&&(u.current=T.hasMoved),l.current=null,f(!1)},[]),b=g.useCallback(T=>{const M=l.current;if(!M)return;const I=qA(T),R=I.x-M.startPointer.x,L=I.y-M.startPointer.y,j=M.hasMoved||Jse({deltaX:R,deltaY:L});l.current={...M,hasMoved:j},j&&o(eN({position:{x:M.startPosition.x+R,y:M.startPosition.y+L},viewport:qS(),boundsLeft:s}))},[o,s]),k=g.useCallback(T=>{if(l.current||!eie(T))return;const M=qA(T);l.current={startPointer:M,startPosition:r,hasMoved:!1},f(!0)},[r]),C=g.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),P=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[d?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:b,onPointerUp:w,onPointerCancel:w,onMouseMove:b,onMouseUp:w}):null,S.jsx(As,{children:t?S.jsx(Mc,{label:P,side:"top",forceOpen:h&&!d?void 0:!1,children:S.jsx(Ci.button,{type:"button","aria-label":P,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:v,animate:{opacity:qse,scale:Use,x:Gse},whileTap:{scale:Bse},exit:x,transition:_,onPointerDown:k,onMouseDown:k,onPointerMove:b,onPointerUp:w,onPointerCancel:w,onMouseMove:b,onMouseUp:w,onClick:C,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:S.jsx("img",{src:Fse,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},X_=Ls("useConfig"),nie=300*1e3,rie=1800*1e3,sie=60*1e3,iie=300*1e3,oie=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},aie=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},lie=gn({agentModeAvailable:Ua(),email:Ge().optional(),userId:Ge().optional(),name:Ge().optional(),isMCPSession:Ua(),mcpEditor:Ge().nullable(),agentApplyMode:lr(["embedded","external"]).nullable().optional(),queueAccessToken:Ge().nullable().optional(),projectPath:Ge(),projectId:Ge().uuid().nullable().optional(),libraryOrigin:Ge().url().nullable()}),cie=gn({featureFlags:WR(Ge(),gn({isEnabled:Ua()})).optional()}),uie=t=>({...x9,...t??{}}),die=()=>{const t=ut(nx),e=wt(nx),n=wt(R9),r=wt(I9),s=wt(yv),i=wt(nte),o=wt(ete),l=wt(Jee),u=wt(vv),d=wt(Qee),f=wt(T9),h=g.useCallback(k=>{o(k.agentModeAvailable),f(k.projectId??null),d({name:k.name??null,email:k.email??null}),k.isMCPSession&&n(!0),k.mcpEditor&&r(k.mcpEditor),s(k.agentApplyMode??aie()??null),i(k.queueAccessToken??oie())},[s,o,n,r,i,f,d]),m=Ph({queryKey:["rivet-config"],queryFn:async()=>{const k=await _t("/api/config");if(!k.ok)throw new Error(`Failed to fetch config: ${k.statusText}`);return lie.parse(await k.json())},staleTime:nie,gcTime:rie}),v=Ph({queryKey:["rivet-feature-flags"],queryFn:async()=>{const k=await _t("/api/feature-flags");if(!k.ok)throw new Error(`Failed to fetch feature flags: ${k.statusText}`);return cie.parse(await k.json())},staleTime:sie,gcTime:iie}),{refetch:x}=m,{refetch:_}=v;g.useLayoutEffect(()=>{m.data&&(h(m.data),u(!1),X_.info("Config loaded:",m.data)),v.data&&(e(uie(v.data.featureFlags)),l(!0))},[m.data,v.data,h,u,e,l]),g.useLayoutEffect(()=>{m.error&&(l(!0),u(!1),X_.warn("Failed to load config:",m.error instanceof Error?m.error.message:"Failed to load config")),v.error&&(l(!0),X_.warn("Failed to load feature flags:",v.error instanceof Error?v.error.message:"Failed to load feature flags"))},[m.error,v.error,u,l]);const w=g.useCallback(async()=>{const[k]=await Promise.all([x(),_()]);return k.data?k.data:null},[x,_]);let b=null;return m.error instanceof Error?b=m.error.message:m.error&&(b="Failed to load config"),{config:m.data??null,featureFlags:t,loading:m.isPending||!m.error&&v.isPending,error:b,refetchConfig:w}},Su=Ls("useOAuthCallback"),fie=()=>{const[t,e]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var l,u,d;const i=window.location.hash,o=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{Su.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),h=f.get("access_token"),m=f.get("refresh_token"),x=new URLSearchParams(o).get("session");if(!h)throw new Error("No access token found in URL");if(!x)throw new Error("No session ID found in URL");Su.info(`Completing OAuth with session: ${x}`);const _=await fetch(`${ox}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:h,refreshToken:m}),signal:n.signal}),w=await _.json();if(!_.ok||!w.success)throw new Error(w.error||w.message||"Failed to complete authentication");if(Su.info("OAuth authentication completed successfully"),r)return;if(q2()&&((l=w.user)!=null&&l.id)?(Ie.identify(w.user.id,{...w.user.email?{email:w.user.email}:{}}),w.user.email&&Ie.alias(w.user.email,w.user.id)):q2()&&((u=w.user)!=null&&u.email)&&Ie.identify(w.user.email,{email:w.user.email}),(d=w.user)!=null&&d.email&&h)try{const k=await _t("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w.user.email,token:h,refreshToken:m,userId:w.user.id}),signal:n.signal});k.ok||Su.warn(`Local auth store returned ${k.status}`)}catch(k){if(r)return;Su.warn("Failed to store auth locally:",k)}if(r)return;window.sessionStorage.setItem(Tg,"1");const b=window.location.pathname;window.history.replaceState({},document.title,b),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;Su.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:Or(f,"Unknown error occurred")})}}})(),()=>{r=!0,n.abort()}},[]),t},hie=3e3,pie=(t,e=_t)=>{const n=new AbortController;let r;const s={onmessage:null,onerror:null,close:()=>{n.abort(),clearTimeout(r)}},i=async()=>{var l,u,d;let o=!1;try{const f=await e(t,{signal:n.signal,headers:{Accept:"text/event-stream"}});if(o=f.status===401||f.status===403,!f.ok||!f.body)throw await((l=f.body)==null?void 0:l.cancel()),new Error(`Event stream request failed (${f.status}).`);const h=f.body.getReader(),m=new TextDecoder;let v="",x=[];try{for(;!n.signal.aborted;){const _=await h.read();if(_.done)break;v+=m.decode(_.value,{stream:!0});let w=v.indexOf(`
156
- `);for(;w!==-1;){const b=v.slice(0,w).replace(/\r$/,"");v=v.slice(w+1),b===""?(x.length>0&&!n.signal.aborted&&((u=s.onmessage)==null||u.call(s,{data:x.join(`
157
- `)})),x=[]):b.startsWith("data:")&&x.push(b.slice(5).replace(/^ /,"")),w=v.indexOf(`
158
- `)}}}finally{await h.cancel().catch(()=>{}),h.releaseLock()}}catch(f){n.signal.aborted||(d=s.onerror)==null||d.call(s,f)}!n.signal.aborted&&!o&&(r=setTimeout(()=>void i(),hie))};return i(),s},Q_=Ls("useAgentVariantsSession"),mie=({enabled:t=!0}={})=>{const e=wt(cp),n=wt(P9),r=wt(b9),s=wt(A9),i=g.useRef(null);g.useEffect(()=>{if(n(!1),!t)return;const o=pie("/api/variants/events");return o.onmessage=l=>{try{const u=JSON.parse(l.data),d=i.current;if(u.active){const h=new Set(u.variants.map(m=>m.requestId).filter(m=>!!m));s(m=>m.filter(x=>!h.has(x.requestId))),u.sessionId!==i.current&&(i.current=u.sessionId,r(!0))}else i.current=null;e(u),n(!0),u.active&&u.sessionId!==d&&_t(`/api/variants/${u.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(h=>Q_.warn("failed to reset preview-port on session switch",h))}catch(u){Q_.warn("failed to parse SSE event payload",u)}},o.onerror=l=>{Q_.warn("SSE error (auto-reconnects)",l)},()=>{o.close()}},[t,e,n,r,s])};var gie=Object.defineProperty,er=(t,e)=>gie(t,"name",{value:e,configurable:!0});function tN(t){const e=t+"CollectionProvider",[n,r]=ao(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=er(_=>{const{scope:w,children:b}=_,k=g.useRef(null),C=g.useRef(new Map).current;return S.jsx(s,{scope:w,itemMap:C,collectionRef:k,children:b})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",u=Xa(l),d=g.forwardRef((_,w)=>{const{scope:b,children:k}=_,C=i(l,b),P=Kt(w,C.collectionRef);return S.jsx(u,{ref:P,children:k})});d.displayName=l;const f=t+"CollectionItemSlot",h="data-radix-collection-item",m=Xa(f),v=g.forwardRef((_,w)=>{const{scope:b,children:k,...C}=_,P=g.useRef(null),T=Kt(w,P),M=i(f,b);return g.useEffect(()=>(M.itemMap.set(P,{ref:P,...C}),()=>void M.itemMap.delete(P))),S.jsx(m,{[h]:"",ref:T,children:k})});v.displayName=f;function x(_){const w=i(t+"CollectionConsumer",_);return g.useCallback(()=>{const k=w.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(w.itemMap.values()).sort((M,I)=>C.indexOf(M.ref.current)-C.indexOf(I.ref.current))},[w.collectionRef,w.itemMap])}return er(x,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},x,r]}er(tN,"createCollection");var GA=new WeakMap,Ln,ws,X0=(ws=class extends Map{constructor(n){super(n);nt(this,Ln);Ae(this,Ln,[...super.keys()]),GA.set(this,!0)}set(n,r){return GA.get(this)&&!this.has(n)&&Z(this,Ln).push(n),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=i?this.size:this.size+1,l=GS(n),u=l>=0?Math.min(l,o-1):Math.max(o+l,0);if(i?Z(this,Ln).indexOf(r)===u:u===this.size)return this.set(r,s),this;const d=Z(this,Ln).filter(h=>h!==r);d.splice(u,0,r);const f=d.map(h=>[h,h===r?s:this.get(h)]);this.clear();for(const[h,m]of f)this.set(h,m);return this}with(n,r,s){const i=new ws(this);return i.insert(n,r,s),i}before(n){const r=Z(this,Ln).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=Z(this,Ln).indexOf(n);if(i===-1)return this;const o=Z(this,Ln).indexOf(r),l=o!==-1&&o<i?i-1:i;return this.insert(l,r,s)}after(n){let r=Z(this,Ln).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=Z(this,Ln).indexOf(n);if(i===-1)return this;const o=Z(this,Ln).indexOf(r),l=o!==-1&&o<=i?i:i+1;return this.insert(l,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Ae(this,Ln,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Z(this,Ln).splice(Z(this,Ln).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Am(Z(this,Ln),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Am(Z(this,Ln),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Z(this,Ln).indexOf(n)}keyAt(n){return Am(Z(this,Ln),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const o of this)Reflect.apply(n,r,[o,i,this])&&s.push(o),i++;return new ws(s)}map(n,r){const s=[];let i=0;for(const o of this)s.push([o[0],Reflect.apply(n,r,[o,i,this])]),i++;return new ws(s)}reduce(...n){const[r,s]=n,i=n.length>1;if(!i&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let o=0,l=s;for(const u of this)o===0&&!i?l=u:l=Reflect.apply(r,this,[l,u,o,this]),o++;return l}reduceRight(...n){const[r,s]=n,i=n.length>1;if(!i&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let o=s;for(let l=this.size-1;l>=0;l--){const u=this.entryAt(l);l===this.size-1&&!i?o=u:o=Reflect.apply(r,this,[o,u,l,this])}return o}sort(n){if(typeof n!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(n);this.clear();for(const[s,i]of r)this.set(s,i);return this}toSorted(n){if(typeof n!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(n);return new ws(r)}toReversed(){const n=new ws;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new ws(r)}slice(n,r){const s=new ws;for(const i of Z(this,Ln).slice(n,r))s.set(i,this.get(i));return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},Ln=new WeakMap,er(ws,"OrderedDict"),ws);function Am(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=nN(t,e);return n===-1?void 0:t[n]}er(Am,"at");function nN(t,e){const n=t.length,r=GS(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}er(nN,"toSafeIndex");function GS(t){return t!==t||t===0?0:Math.trunc(t)}er(GS,"toSafeInteger");function rN(t){const e=t+"CollectionProvider",[n,r]=ao(e),[s,i]=n(e);s.displayName=t+"CollectionStableContextProvider";const[o,l]=n(e);o.displayName=t+"CollectionStatefulContextProvider";const u=er(({state:M,...I})=>M?S.jsx(f,{...I,state:M}):S.jsx(d,{...I}),"CollectionProvider");u.displayName=e;const d=er(M=>{const I=k();return S.jsx(f,{...M,state:I})},"CollectionInit");d.displayName=t+"CollectionInit";const f=er(M=>{const{scope:I,children:R,state:L}=M,j=g.useRef(null),[F,D]=g.useState(null),q=Kt(j,D),[W,G]=L,H=g.useRef(new X0),J=g.useCallback(()=>{const B=H.current;return oN(B)||B.sort(Tm),B},[]);return g.useEffect(()=>{if(!F)return;const B=aN(()=>{G(Q=>{const z=Q.toSorted(Tm);return z.some(([Y],oe)=>Q.keyAt(oe)!==Y)?z:Q})});return B.observe(F,{childList:!0,subtree:!0}),()=>{B.disconnect()}},[F,G]),S.jsx(s,{scope:I,collectionElementRef:q,collectionElementRefObject:j,getCollection:J,setCollection:G,registryRef:H,children:S.jsx(o,{scope:I,collectionElement:F,collection:W,children:R})})},"CollectionProviderImpl");f.displayName=t+"CollectionProviderImpl";const h=t+"CollectionSlot",m=Xa(h),v=g.forwardRef((M,I)=>{const{scope:R,children:L}=M,j=i(h,R),F=Kt(I,j.collectionElementRef);return S.jsx(m,{ref:F,children:L})});v.displayName=h;const x=t+"CollectionItemSlot",_="data-radix-collection-item",w=Xa(x),b=g.forwardRef((M,I)=>{const{scope:R,children:L,...j}=M,F=g.useRef(null),D=i(x,R),{setCollection:q,registryRef:W}=D,G=g.useRef(j);sN(G.current,j)||(G.current=j);const H=G.current,J=g.useCallback(z=>{const N=W.current;z?N.set(z,{...G.current,element:z}):F.current&&N.delete(F.current)},[W]),B=Kt(I,J,F);Lr(()=>{const z=F.current,N=W.current;z&&N.has(z)&&N.set(z,{...H,element:z})},[H,W]);const Q=g.useRef(null);return g.useEffect(()=>{const z=F.current,N=Q.current;((N==null?void 0:N.element)??null)===z&&(!z||(N==null?void 0:N.itemData)===H)||(Q.current=z?{element:z,itemData:H}:null,q(Y=>{const oe=new X0(Y);return N&&N.element!==z&&oe.delete(N.element),z&&oe.set(z,{...H,element:z}),oe.sort(Tm)}))}),g.useEffect(()=>()=>{const z=Q.current;Q.current=null,z&&q(N=>{if(!N.has(z.element))return N;const Y=new X0(N);return Y.delete(z.element),Y})},[q]),S.jsx(w,{[_]:"",ref:B,children:L})});b.displayName=x;function k(){return g.useState(new X0)}er(k,"useInitCollection");function C(M){const{collection:I}=l(t+"CollectionConsumer",M);return I}er(C,"useCollection");function P(M){const{getCollection:I}=i(t+"CollectionConsumer",M);return I}return er(P,"useGetCollection"),[{Provider:u,Slot:v,ItemSlot:b},{createCollectionScope:r,useCollection:C,useGetCollection:P,useInitCollection:k}]}er(rN,"createCollection");function sN(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||t[s]!==e[s])return!1;return!0}er(sN,"shallowEqual");function iN(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}er(iN,"isElementPreceding");function oN(t){let e;for(const n of t.keys()){if(e){const r=e.compareDocumentPosition(n);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}e=n}return!0}er(oN,"isInDocumentOrder");function Tm(t,e){return!t[1].element||!e[1].element?0:iN(t[1].element,e[1].element)?-1:1}er(Tm,"sortByDocumentPosition");function aN(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}er(aN,"getChildListObserver");var vie=Object.defineProperty,fp=(t,e)=>vie(t,"name",{value:e,configurable:!0}),KS="Collapsible",[yie,lN]=ao(KS),[_ie,YS]=yie(KS),wie=g.forwardRef(fp(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,f]=ll({prop:s,defaultProp:i??!1,onChange:l,caller:KS});return S.jsx(_ie,{scope:r,disabled:o,contentId:eo(),open:d,onOpenToggle:g.useCallback(()=>f(h=>!h),[f]),children:S.jsx(An.div,{"data-state":Sv(d),"data-disabled":o?"":void 0,...u,ref:n})})},"Collapsible")),xie="CollapsibleTrigger",bie=g.forwardRef(fp(function(e,n){const{__scopeCollapsible:r,...s}=e,i=YS(xie,r);return S.jsx(An.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Sv(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Gt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),cN="CollapsibleContent",Sie=g.forwardRef(fp(function(e,n){const{forceMount:r,...s}=e,i=YS(cN,e.__scopeCollapsible);return S.jsx(al,{present:r||i.open,children:({present:o})=>S.jsx(kie,{...s,ref:n,present:o})})},"CollapsibleContent")),kie=g.forwardRef(fp(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=YS(cN,r),[u,d]=g.useState(s),f=g.useRef(null),h=Kt(n,f),m=g.useRef(0),v=m.current,x=g.useRef(0),_=x.current,w=l.open||u,b=g.useRef(w),k=g.useRef(void 0);return g.useEffect(()=>{const C=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(C)},[]),Lr(()=>{const C=f.current;if(C){k.current=k.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const P=C.getBoundingClientRect();m.current=P.height,x.current=P.width,b.current||(C.style.transitionDuration=k.current.transitionDuration,C.style.animationName=k.current.animationName),d(s)}},[l.open,s]),S.jsx(An.div,{"data-state":Sv(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!w,...o,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:w&&i})},"CollapsibleContentImpl"));function Sv(t){return t?"open":"closed"}fp(Sv,"getState");var Eie=Object.defineProperty,Cie=(t,e)=>Eie(t,"name",{value:e,configurable:!0}),Pie={LTR:"ltr"},Aie=g.createContext(void 0);function XS(t){const e=g.useContext(Aie);return t||e||Pie.LTR}Cie(XS,"useDirection");var Tie=Object.defineProperty,Rs=(t,e)=>Tie(t,"name",{value:e,configurable:!0}),Rie={Multiple:"multiple"},jf={Vertical:"vertical",Horizontal:"horizontal"},Iie={LTR:"ltr"},lo="Accordion",Mie=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[QS,{useGetCollection:Oie,createCollectionScope:Lie}]=rN(lo),[kv,sle]=ao(lo,[Lie,lN]),JS=lN(),uN=g.forwardRef(Rs(function(e,n){const{type:r,...s}=e,i=s,o=s;return S.jsx(QS.Provider,{scope:e.__scopeAccordion,children:r===Rie.Multiple?S.jsx($ie,{...o,ref:n}):S.jsx(jie,{...i,ref:n})})},"Accordion")),[dN,Nie]=kv(lo),[fN,Die]=kv(lo,{collapsible:!1}),jie=g.forwardRef(Rs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Rs(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[u,d]=ll({prop:r,defaultProp:s??"",onChange:i,caller:lo});return S.jsx(dN,{scope:e.__scopeAccordion,value:g.useMemo(()=>u?[u]:[],[u]),onItemOpen:d,onItemClose:g.useCallback(()=>o&&d(""),[o,d]),children:S.jsx(fN,{scope:e.__scopeAccordion,collapsible:o,children:S.jsx(hN,{...l,ref:n})})})},"AccordionImplSingle")),$ie=g.forwardRef(Rs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Rs(()=>{},"onValueChange"),...o}=e,[l,u]=ll({prop:r,defaultProp:s??[],onChange:i,caller:lo}),d=g.useCallback(h=>u((m=[])=>[...m,h]),[u]),f=g.useCallback(h=>u((m=[])=>m.filter(v=>v!==h)),[u]);return S.jsx(dN,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:S.jsx(fN,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(hN,{...o,ref:n})})})},"AccordionImplMultiple")),[Fie,Ev]=kv(lo),hN=g.forwardRef(Rs(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o=jf.Vertical,...l}=e,u=g.useRef(null),d=Kt(u,n),f=Oie(r),m=XS(i)===Iie.LTR,v=Gt(e.onKeyDown,x=>{var j;if(!Mie.includes(x.key))return;const _=f(),w=x.target,b=_.filter(([,F])=>!F.element.disabled),k=b.findIndex(([,F])=>F.element===w),C=b.size;if(k===-1)return;x.preventDefault();let P=k;const T=0,M=C-1,I=Rs(()=>{P=k+1,P>M&&(P=T)},"moveNext"),R=Rs(()=>{P=k-1,P<T&&(P=M)},"movePrev");switch(x.key){case"Home":P=T;break;case"End":P=M;break;case"ArrowRight":o===jf.Horizontal&&(m?I():R());break;case"ArrowDown":o===jf.Vertical&&I();break;case"ArrowLeft":o===jf.Horizontal&&(m?R():I());break;case"ArrowUp":o===jf.Vertical&&R();break}const L=P%C;(j=b.at(L))==null||j.element.focus()});return S.jsx(Fie,{scope:r,disabled:s,direction:i,orientation:o,children:S.jsx(QS.Slot,{scope:r,children:S.jsx(An.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),Px="AccordionItem",[Vie,e6]=kv(Px),Hie=g.forwardRef(Rs(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=Ev(Px,r),l=Nie(Px,r),u=JS(r),d=eo(),f=s&&l.value.includes(s)||!1,h=o.disabled||e.disabled;return S.jsx(Vie,{scope:r,open:f,disabled:h,triggerId:d,children:S.jsx(wie,{"data-orientation":o.orientation,"data-state":t6(f),...u,...i,ref:n,disabled:h,open:f,onOpenChange:m=>{m?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),zie="AccordionHeader",Uie=g.forwardRef(Rs(function(e,n){const{__scopeAccordion:r,...s}=e,i=Ev(lo,r),o=e6(zie,r);return S.jsx(An.h3,{"data-orientation":i.orientation,"data-state":t6(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),KA="AccordionTrigger",Bie=g.forwardRef(Rs(function(e,n){const{__scopeAccordion:r,...s}=e,i=Ev(lo,r),o=e6(KA,r),l=Die(KA,r),u=JS(r);return S.jsx(QS.ItemSlot,{scope:r,children:S.jsx(bie,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),Wie="AccordionContent",Zie=g.forwardRef(Rs(function(e,n){const{__scopeAccordion:r,...s}=e,i=Ev(lo,r),o=e6(Wie,r),l=JS(r);return S.jsx(Sie,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function t6(t){return t?"open":"closed"}Rs(t6,"getState");/**
159
- * @license lucide-react v1.62.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 qie=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
164
- * @license lucide-react v1.62.0 - ISC
165
- *
166
- * This source code is licensed under the ISC license.
167
- * See the LICENSE file in the root directory of this source tree.
168
- */function Gie(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:qie(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}/**
169
- * @license lucide-react v1.62.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 Kie=t=>{let e="",n=!1;for(const r of t){if(r==="-"||r==="_"||r<=" "){n=e.length>0;continue}e.length===0?e+=r.toLowerCase():e+=n?r.toUpperCase():r,n=!1}return e};/**
174
- * @license lucide-react v1.62.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 Yie=t=>{const e=Kie(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
179
- * @license lucide-react v1.62.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 Ax=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
184
- * @license lucide-react v1.62.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 Zl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
189
- * @license lucide-react v1.62.0 - ISC
190
- *
191
- * This source code is licensed under the ISC license.
192
- * See the LICENSE file in the root directory of this source tree.
193
- */function J_(t){return t!=null}function Xie(t,e={}){var m,v;const n=e.attributeNames??{},r=x=>n[x]??x,s=t.size??t.width??Zl.width,i=t.size??t.height??Zl.height,o=((m=t.aliases)==null?void 0:m.filter(x=>typeof x=="string"&&x.trim()!=="").map(x=>`lucide-${x}`))??[],l=[...t.name?[`lucide-${t.name}`]:[],...o],u=((v=e.className)==null?void 0:v.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?Ax(...u):Ax("lucide",...l,...u),f=e.absoluteStrokeWidth?Number(e.strokeWidth??Zl["stroke-width"])*Number(t.size??t.width??Zl.width)/Number(e.size??e.width??Zl.width):e.strokeWidth??Zl["stroke-width"];return["svg",{...Object.entries(Zl).reduce((x,[_,w])=>(x[r(_)]=w,x),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&J_(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&J_(e.width)&&{[r("width")]:e.width},..."height"in e&&J_(e.height)&&{[r("height")]:e.height},[r("stroke-width")]:f,...d&&{[r("class")]:d},[r("viewBox")]:`0 0 ${s} ${i}`,...e.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(x=>{const[_,w,b]=x,k=e.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...w}:w;return b?[_,k,b]:[_,k]})]}/**
194
- * @license lucide-react v1.62.0 - ISC
195
- *
196
- * This source code is licensed under the ISC license.
197
- * See the LICENSE file in the root directory of this source tree.
198
- */function Qie(t,e={}){return Xie(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
199
- * @license lucide-react v1.62.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 Jie=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},eoe=g.createContext({}),toe=()=>g.useContext(eoe),noe=g.forwardRef(({color:t,size:e,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:u,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...h},m)=>{const{size:v=24,strokeWidth:x=2,absoluteStrokeWidth:_=!1,nonScalingStroke:w=!1,color:b="currentColor",className:k=""}=toe()??{},C=!!u||Jie(h),[P,T,M=[]]=Qie(f,{color:t??b,width:n??e??v,height:r??e??v,strokeWidth:s??x,absoluteStrokeWidth:i??_,nonScalingStroke:o??w,className:Ax(k,l),hasA11yProp:C,attributes:h});return g.createElement(P,{ref:m,...T},[...M.map(([I,R])=>g.createElement(I,R)),...Array.isArray(u)?u:[u]])});/**
204
- * @license lucide-react v1.62.0 - ISC
205
- *
206
- * This source code is licensed under the ISC license.
207
- * See the LICENSE file in the root directory of this source tree.
208
- */function ct(t,e=[],n=[]){const r=typeof t=="string"?Gie(t,e,n):t,s=g.forwardRef(({className:i,...o},l)=>g.createElement(noe,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=Yie(r.name)),s}/**
209
- * @license lucide-react v1.62.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 pN={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};pN.node;const roe=ct(pN);/**
214
- * @license lucide-react v1.62.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 mN={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};mN.node;const soe=ct(mN);/**
219
- * @license lucide-react v1.62.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 gN={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};gN.node;const ioe=ct(gN);/**
224
- * @license lucide-react v1.62.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 vN={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};vN.node;const ooe=ct(vN);/**
229
- * @license lucide-react v1.62.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 yN={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4",key:"5nuw1p"}],["path",{d:"M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294",key:"18ldcf"}],["path",{d:"M17.996 5.125a4 4 0 012.526 5.77",key:"1sdu8q"}],["path",{d:"M18 18a4 4 0 002-7.465",key:"7xqqvr"}],["path",{d:"M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517",key:"t46ysz"}],["path",{d:"M6 18a4 4 0 01-2-7.465",key:"1y2m15"}],["path",{d:"M6.004 5.125a4 4 0 00-2.526 5.77",key:"3cw1ss"}]]};yN.node;const aoe=ct(yN);/**
234
- * @license lucide-react v1.62.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 _N={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};_N.node;const loe=ct(_N);/**
239
- * @license lucide-react v1.62.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 wN={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};wN.node;const coe=ct(wN);/**
244
- * @license lucide-react v1.62.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 xN={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};xN.node;const uoe=ct(xN);/**
249
- * @license lucide-react v1.62.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 bN={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};bN.node;const doe=ct(bN);/**
254
- * @license lucide-react v1.62.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 SN={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};SN.node;const foe=ct(SN);/**
259
- * @license lucide-react v1.62.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 kN={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};kN.node;const hoe=ct(kN);/**
264
- * @license lucide-react v1.62.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 EN={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};EN.node;const poe=ct(EN);/**
269
- * @license lucide-react v1.62.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 CN={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};CN.node;const moe=ct(CN);/**
274
- * @license lucide-react v1.62.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 PN={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};PN.node;const goe=ct(PN);/**
279
- * @license lucide-react v1.62.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 AN={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};AN.node;const voe=ct(AN);/**
284
- * @license lucide-react v1.62.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 TN={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};TN.node;const yoe=ct(TN);/**
289
- * @license lucide-react v1.62.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 RN={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};RN.node;const _oe=ct(RN);/**
294
- * @license lucide-react v1.62.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 IN={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};IN.node;const woe=ct(IN);/**
299
- * @license lucide-react v1.62.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 MN={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};MN.node;const xoe=ct(MN);/**
304
- * @license lucide-react v1.62.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 ON={name:"loader",size:24,node:[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]};ON.node;const boe=ct(ON);/**
309
- * @license lucide-react v1.62.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 LN={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};LN.node;const Soe=ct(LN);/**
314
- * @license lucide-react v1.62.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 NN={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};NN.node;const koe=ct(NN);/**
319
- * @license lucide-react v1.62.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 DN={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};DN.node;const Eoe=ct(DN);/**
324
- * @license lucide-react v1.62.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 jN={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};jN.node;const Coe=ct(jN);/**
329
- * @license lucide-react v1.62.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 $N={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};$N.node;const Poe=ct($N);/**
334
- * @license lucide-react v1.62.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 FN={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};FN.node;const Aoe=ct(FN);/**
339
- * @license lucide-react v1.62.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 VN={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};VN.node;const Toe=ct(VN);/**
344
- * @license lucide-react v1.62.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 HN={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]};HN.node;const Roe=ct(HN);/**
349
- * @license lucide-react v1.62.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 zN={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};zN.node;const Ioe=ct(zN);/**
354
- * @license lucide-react v1.62.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 UN={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};UN.node;const Moe=ct(UN);/**
359
- * @license lucide-react v1.62.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 BN={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]};BN.node;const Ooe=ct(BN);/**
364
- * @license lucide-react v1.62.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 WN={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};WN.node;const Loe=ct(WN);/**
369
- * @license lucide-react v1.62.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 ZN={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};ZN.node;const Noe=ct(ZN);/**
374
- * @license lucide-react v1.62.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 qN={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};qN.node;const Doe=ct(qN);/**
379
- * @license lucide-react v1.62.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 GN={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};GN.node;const joe=ct(GN);/**
384
- * @license lucide-react v1.62.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 KN={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};KN.node;const $oe=ct(KN);/**
389
- * @license lucide-react v1.62.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 YN={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};YN.node;const Foe=ct(YN);/**
394
- * @license lucide-react v1.62.0 - ISC
395
- *
396
- * This source code is licensed under the ISC license.
397
- * See the LICENSE file in the root directory of this source tree.
398
- */const XN={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};XN.node;const Voe=ct(XN);/**
399
- * @license lucide-react v1.62.0 - ISC
400
- *
401
- * This source code is licensed under the ISC license.
402
- * See the LICENSE file in the root directory of this source tree.
403
- */const QN={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};QN.node;const Hoe=ct(QN);/**
404
- * @license lucide-react v1.62.0 - ISC
405
- *
406
- * This source code is licensed under the ISC license.
407
- * See the LICENSE file in the root directory of this source tree.
408
- */const JN={name:"skip-forward",size:24,node:[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]};JN.node;const zoe=ct(JN);/**
409
- * @license lucide-react v1.62.0 - ISC
410
- *
411
- * This source code is licensed under the ISC license.
412
- * See the LICENSE file in the root directory of this source tree.
413
- */const eD={name:"square-library",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],aliases:["library-square"]};eD.node;const Uoe=ct(eD);/**
414
- * @license lucide-react v1.62.0 - ISC
415
- *
416
- * This source code is licensed under the ISC license.
417
- * See the LICENSE file in the root directory of this source tree.
418
- */const tD={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};tD.node;const Boe=ct(tD);/**
419
- * @license lucide-react v1.62.0 - ISC
420
- *
421
- * This source code is licensed under the ISC license.
422
- * See the LICENSE file in the root directory of this source tree.
423
- */const nD={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};nD.node;const Woe=ct(nD);/**
424
- * @license lucide-react v1.62.0 - ISC
425
- *
426
- * This source code is licensed under the ISC license.
427
- * See the LICENSE file in the root directory of this source tree.
428
- */const rD={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};rD.node;const Zoe=ct(rD);/**
429
- * @license lucide-react v1.62.0 - ISC
430
- *
431
- * This source code is licensed under the ISC license.
432
- * See the LICENSE file in the root directory of this source tree.
433
- */const sD={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};sD.node;const qoe=ct(sD);/**
434
- * @license lucide-react v1.62.0 - ISC
435
- *
436
- * This source code is licensed under the ISC license.
437
- * See the LICENSE file in the root directory of this source tree.
438
- */const iD={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};iD.node;const Goe=ct(iD),Koe={"chevron-right":uoe,"chevron-down":coe,pipette:Ooe,x:Goe,copy:hoe,menu:Eoe,dot:poe,monitor:Poe,sun:Woe,moon:Aoe,"rectangle-horizontal":Doe,circle:doe,"square-library":Uoe,clock:foe,star:Boe,settings:Voe,plus:Noe,"arrow-left":roe,"arrow-right":soe,"arrow-up":ioe,search:Foe,loader:boe,users:qoe,lock:Soe,mail:koe,bell:ooe,shield:Hoe,palette:Toe,lightbulb:woe,rocket:joe,heart:goe,paintbrush:Roe,brain:aoe,globe:moe,user:Zoe,image:yoe,link:xoe,check:loe,"rotate-ccw":$oe,play:Loe,pause:Ioe,home:voe,"message-circle":Coe,inbox:_oe,pencil:Moe,"skip-forward":zoe},YA={lucide:Koe},oD=g.createContext(null);function Yoe(t){const e=g.useContext(oD);return e?YA[e.iconLibrary][t]:YA.lucide[t]}function Xoe({children:t,defaultLibrary:e="lucide"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{r(i)},[]);return S.jsx(oD.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const aD=g.createContext(null);function n6(){return g.useContext(aD)}const lD=g.createContext(null);function cD(){const t=g.useContext(lD);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const Qoe=g.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=g.useRef(null),l=g.useRef(new Map),[u,d]=g.useState(new Map),{activeIndex:f,setActiveIndex:h,itemRects:m,sessionRef:v,handlers:x,registerItem:_,measureItems:w}=_9(o),b=g.useCallback((ce,re)=>{re?l.current.set(ce,re):l.current.delete(ce)},[]),k=g.useCallback(()=>{if(!o.current)return;const ce=new Map;l.current.forEach((re,Ce)=>{ce.set(Ce,{top:re.offsetTop,left:re.offsetLeft,width:re.offsetWidth,height:re.offsetHeight})}),d(ce)},[]),[C,P]=g.useState(()=>r==="single"?t.defaultValue??"":""),[T,M]=g.useState(()=>r==="multiple"?t.defaultValue??[]:[]),I=t.onValueChange,R=t.onValueChange,L=t.value,j=new Set(r==="multiple"?t.value??T:(()=>{const ce=t.value??C;return ce?[ce]:[]})()),F=g.useCallback(ce=>{const re=t;re.onValueChange?re.onValueChange(ce):P(ce)},[I]),D=g.useCallback(ce=>{const re=t;re.onValueChange?re.onValueChange(ce):M(ce)},[R]),q=g.useCallback(ce=>{if(r==="multiple"){const re=t.value??T;D(re.filter(Ce=>Ce!==ce))}else F("")},[r,F,D,T,L]);g.useEffect(()=>{w(),k()},[w,k,n]);const W=[...j].join(",");g.useEffect(()=>{w(),k()},[w,k,W]);const[G,H]=g.useState(null),J=f!==null?m[f]:null,B=G!==null?m[G]:null,Q=f!==null&&!u.has(f),z=op(),{value:N,defaultValue:Y,onValueChange:oe,collapsible:ne,type:ie,...de}=i,ge=r==="multiple"?{type:"multiple",value:t.value??T,onValueChange:D}:{type:"single",collapsible:t.collapsible??!0,value:t.value??C,onValueChange:F};return S.jsx(aD.Provider,{value:{registerItem:_,registerFullItem:b,activeIndex:f,grouped:!0,remeasure:()=>{w(),k()},openValues:j,openItemRects:u,toggleValue:q},children:S.jsx(uN,{...ge,asChild:!0,children:S.jsxs("div",{ref:ce=>{o.current=ce,typeof e=="function"?e(ce):e&&(e.current=ce)},onMouseEnter:x.onMouseEnter,onMouseMove:ce=>{const re=o.current;if(re){const Ce=re.getBoundingClientRect(),Fe=re.offsetHeight,ke=Ce.height,dt=Fe>0?ke/Fe:1,Lt=(ce.clientY-Ce.top)/dt+re.scrollTop;for(const[sn,jt]of u){const pt=m[sn];if(!pt)continue;const vn=pt.top+pt.height,Le=jt.top+jt.height;if(Lt>=vn&&Lt<=Le){h(null);return}}}x.onMouseMove(ce)},onMouseLeave:x.onMouseLeave,onFocus:ce=>{var Ce;const re=(Ce=ce.target.closest("[data-proximity-index]"))==null?void 0:Ce.getAttribute("data-proximity-index");if(re!=null){const Fe=Number(re);h(Fe),H(ce.target.matches(":focus-visible")?Fe:null)}},onBlur:ce=>{var re;(re=o.current)!=null&&re.contains(ce.relatedTarget)||(H(null),h(null))},className:Wt("relative flex flex-col gap-0.5 w-72 max-w-full",s),...de,children:[S.jsx(As,{children:[...u.entries()].map(([ce,re])=>S.jsx(Uo.div,{className:`absolute ${z.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:re.top,left:re.left,width:re.width,height:re.height,opacity:Q?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${ce}`))}),S.jsx(As,{children:J&&S.jsx(Uo.div,{className:`absolute ${z.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:J.top,left:J.left,width:J.width,height:J.height},animate:{opacity:1,top:J.top,left:J.left,width:J.width,height:J.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Fh.fast,opacity:{duration:.08}}},v.current)}),S.jsx(As,{children:B&&S.jsx(Uo.div,{className:`absolute ${z.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:B.left-2,top:B.top-2,width:B.width+4,height:B.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...Fh.fast,opacity:{duration:.08}}})}),n]})})})});Qoe.displayName="AccordionGroup";const uD=g.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},u)=>{const[d,f]=g.useState(()=>e==="single"?r??"":""),[h,m]=g.useState(()=>e==="multiple"?r??[]:[]),v=new Set(e==="multiple"?s??h:(()=>{const k=s??d;return k?[k]:[]})()),x=g.useCallback(k=>{i?i(k):f(k)},[i]),_=g.useCallback(k=>{i?i(k):m(k)},[i]),w=g.useCallback(k=>{e==="multiple"?_((s??h).filter(P=>P!==k)):x("")},[e,s,h,x,_]),b=e==="multiple"?{type:"multiple",value:s??h,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:x};return S.jsx(uN,{...b,asChild:!0,children:S.jsx("div",{ref:u,className:Wt("w-72 max-w-full flex flex-col gap-0.5",o),...l,children:S.jsx(dD.Provider,{value:v,children:S.jsx(fD.Provider,{value:w,children:t})})})})});uD.displayName="Accordion";const dD=g.createContext(new Set),fD=g.createContext(()=>{}),hD=g.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=g.useRef(null),u=n6(),d=g.useContext(dD),f=g.useContext(fD),h=op(),m=u!=null&&u.grouped?u.openValues.has(t):d.has(t),v=g.useRef(null),x=g.useCallback(()=>{u!=null&&u.grouped?u.toggleValue(t):f(t)},[u,f,t]);return g.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return u.registerItem(e,v.current),()=>u.registerItem(e,null)},[e,u]),g.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return m?u.registerFullItem(e,l.current):u.registerFullItem(e,null),()=>u.registerFullItem(e,null)},[e,u,m]),S.jsx(lD.Provider,{value:{index:e,value:t,isOpen:m,onToggle:x,triggerRef:v},children:S.jsxs(Hie,{ref:_=>{l.current=_,typeof o=="function"?o(_):o&&(o.current=_)},value:t,disabled:n,"data-proximity-index":e,className:Wt(!(u!=null&&u.grouped)&&"relative",s),...i,children:[!(u!=null&&u.grouped)&&S.jsx(As,{children:m&&S.jsx(Uo.div,{className:`absolute inset-0 ${h.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]})})});hD.displayName="AccordionItem";const pD=g.forwardRef(({children:t,className:e,...n},r)=>{const s=Yoe("chevron-right"),i=n6(),{index:o,isOpen:l,triggerRef:u}=cD(),d=op(),[f,h]=g.useState(!1),m=i!=null&&i.grouped?i.activeIndex===o:f,v=S.jsx(Uie,{asChild:!0,children:S.jsx("div",{children:S.jsxs(Bie,{ref:r,className:Wt(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:uh.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:Wt("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",l||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:l?uh.semibold:uh.normal},children:t})]}),S.jsx(Uo.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:Fh.fast,children:S.jsx(s,{size:16,strokeWidth:l||m?2:1.5,className:Wt("transition-[color,stroke-width] duration-80",l||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:u,children:v}):S.jsxs("div",{className:"relative",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[S.jsx(As,{children:f&&S.jsx(Uo.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),v]})});pD.displayName="AccordionTrigger";const mD=g.forwardRef(({children:t,className:e,...n},r)=>{const s=n6(),{isOpen:i}=cD();return S.jsx(As,{initial:!1,children:i&&S.jsx(Zie,{forceMount:!0,asChild:!0,...n,children:S.jsx(Uo.div,{ref:r,className:Wt("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Fh.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})})})})});mD.displayName="AccordionContent";const Rm=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(uD,{type:"multiple",defaultValue:e,className:Wt("w-full",n),children:t}),Joe=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return S.jsxs(hD,{value:t,className:Wt("w-full",!l&&"border-t border-main-border"),children:[S.jsxs(pD,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(mD,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};Rm.Item=Joe;const eae=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(Jg,{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})]}),tae=()=>{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},nae=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},XA="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",QA="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",rae="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",Im=["Applying","Thinking","Planning","Crafting"],sae=Im.reduce((t,e)=>t.length>=e.length?t:e),iae=20,oae="Still working — runs can take a few minutes.",aae=({hint:t,showElapsed:e=!0})=>{const[n,r]=g.useState(0),s=tae();g.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%Im.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=iae?oae:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(Ci.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(Ci.path,{animate:{d:[XA,QA,rae,QA,XA]},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:uh.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:sae}),S.jsx(As,{mode:"popLayout",initial:!1,children:S.jsx(Ci.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:Im[n]},Im[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:nae(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var lae=Object.defineProperty,cae=(t,e)=>lae(t,"name",{value:e,configurable:!0});function $g(t,[e,n]){return Math.min(n,Math.max(e,t))}cae($g,"clamp");var uae=Object.defineProperty,Mt=(t,e)=>uae(t,"name",{value:e,configurable:!0}),JA={Horizontal:"horizontal"},dae={LTR:"ltr"},gD=["PageUp","PageDown"],vD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],yD={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},hp="Slider",[Tx,fae,hae]=tN(hp),[r6,ile]=ao(hp,[hae]),[pae,Nd]=r6(hp),mae=g.forwardRef(Mt(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l=JA.Horizontal,disabled:u=!1,minStepsBetweenThumbs:d=0,preserveThumbOrder:f=!1,defaultValue:h=[s],value:m,onValueChange:v=Mt(()=>{},"onValueChange"),onValueCommit:x=Mt(()=>{},"onValueCommit"),inverted:_=!1,form:w,...b}=e,k=g.useRef(new Set),C=g.useRef(0),P=g.useRef(!1),[T,M]=g.useState(null),R=l===JA.Horizontal?gae:vae,[L,j]=g.useState(null),F=Kt(n,j),[D=[],q]=ll({prop:m,defaultProp:h,onChange:Mt(z=>{var Y;(Y=[...k.current][C.current])==null||Y.focus({preventScroll:!0,focusVisible:P.current}),P.current=!1,v(z)},"onChange")}),W=g.useRef(D),G=g.useRef(D);g.useEffect(()=>{const z=w?L==null?void 0:L.ownerDocument.getElementById(w):L==null?void 0:L.closest("form");if(z instanceof HTMLFormElement){const N=Mt(()=>q(G.current),"reset");return z.addEventListener("reset",N),()=>z.removeEventListener("reset",N)}},[L,w,q]);function H(z){const N=CD(D,z);Q(z,N)}Mt(H,"handleSlideStart");function J(z){Q(z,C.current)}Mt(J,"handleSlideMove");function B(){String(D)!==String(W.current)&&x(D)}Mt(B,"handleSlideEnd");function Q(z,N,{commit:Y}={commit:!1}){const oe=i6(o),ne=mh(Math.round((z-s)/o)*o+s,oe),ie=$g(ne,[s,i]),de=d*o;function ge(re){const Ce=f?$g(ie,[re[N-1]===void 0?s:re[N-1]+de,re[N+1]===void 0?i:re[N+1]-de]):ie,Fe=kD(re,Ce,N);return TD(Fe,de)?{nextValues:Fe,changedIndex:f?N:Fe.indexOf(Ce),hasChanged:String(Fe)!==String(re)}:null}Mt(ge,"getNextValues");const ce=ge(D);ce!=null&&ce.hasChanged&&M(ce.nextValues),q((re=[])=>{const Ce=ge(re);return Ce?(C.current=Ce.changedIndex,Ce.hasChanged&&Y&&x(Ce.nextValues),Ce.hasChanged?Ce.nextValues:re):re})}return Mt(Q,"updateValues"),S.jsx(pae,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:C,thumbs:k.current,values:D,orientation:l,form:w,userRequestedValues:T,children:S.jsx(Tx.Provider,{scope:e.__scopeSlider,children:S.jsx(Tx.Slot,{scope:e.__scopeSlider,children:S.jsx(R,{"aria-disabled":u,"data-disabled":u?"":void 0,...b,ref:F,onPointerDown:Gt(b.onPointerDown,()=>{u||(W.current=D,P.current=!1)}),min:s,max:i,inverted:_,onSlideStart:u?void 0:H,onSlideMove:u?void 0:J,onSlideEnd:u?void 0:B,onHomeKeyDown:()=>{u||(P.current=!0,Q(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(P.current=!0,Q(i,D.length-1,{commit:!0}))},onStepKeyDown:({event:z,direction:N})=>{if(!u){P.current=!0;const ne=gD.includes(z.key)||z.shiftKey&&vD.includes(z.key)?10:1,ie=C.current,de=D[ie],ge=RD(de,{min:s,step:o,direction:N,multiplier:ne});Q(ge,ie,{commit:!0})}}})})})})},"Slider")),[_D,wD]=r6(hp,{startEdge:"left",endEdge:"right",size:"width",direction:1}),gae=g.forwardRef(Mt(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...h}=e,[m,v]=g.useState(null),x=Kt(n,v),_=g.useRef(void 0),w=XS(i),b=w===dae.LTR,k=b&&!o||!b&&o;function C(P){const T=_.current||m.getBoundingClientRect(),M=[0,T.width],R=Cv(M,k?[r,s]:[s,r]);return _.current=T,R(P-T.left)}return Mt(C,"getValueFromPointer"),S.jsx(_D,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:S.jsx(xD,{dir:w,"data-orientation":"horizontal",...h,ref:x,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:P=>{const T=C(P.clientX);l==null||l(T)},onSlideMove:P=>{const T=C(P.clientX);u==null||u(T)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:P=>{const M=yD[k?"from-left":"from-right"].includes(P.key);f==null||f({event:P,direction:M?-1:1})}})})},"SliderHorizontal")),vae=g.forwardRef(Mt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,h=g.useRef(null),m=Kt(n,h),v=g.useRef(void 0),x=!i;function _(w){const b=v.current||h.current.getBoundingClientRect(),k=[0,b.height],P=Cv(k,x?[s,r]:[r,s]);return v.current=b,P(w-b.top)}return Mt(_,"getValueFromPointer"),S.jsx(_D,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:S.jsx(xD,{"data-orientation":"vertical",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const b=_(w.clientY);o==null||o(b)},onSlideMove:w=>{const b=_(w.clientY);l==null||l(b)},onSlideEnd:()=>{v.current=void 0,u==null||u()},onStepKeyDown:w=>{const k=yD[x?"from-bottom":"from-top"].includes(w.key);d==null||d({event:w,direction:k?-1:1})}})})},"SliderVertical")),xD=g.forwardRef(Mt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,h=Nd(hp,r);return S.jsx(An.span,{...f,ref:n,onKeyDown:Gt(e.onKeyDown,m=>{m.key==="Home"?(l(m),m.preventDefault()):m.key==="End"?(u(m),m.preventDefault()):gD.concat(vD).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:Gt(e.onPointerDown,m=>{const v=m.target;v.setPointerCapture(m.pointerId),m.preventDefault(),h.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:Gt(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:Gt(e.onPointerUp,m=>{const v=m.target;v.hasPointerCapture(m.pointerId)&&(v.releasePointerCapture(m.pointerId),o(m))})})},"SliderImpl")),yae="SliderTrack",_ae=g.forwardRef(Mt(function(e,n){const{__scopeSlider:r,...s}=e,i=Nd(yae,r);return S.jsx(An.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),e5="SliderRange",wae=g.forwardRef(Mt(function(e,n){const{__scopeSlider:r,...s}=e,i=Nd(e5,r),o=wD(e5,r),l=g.useRef(null),u=Kt(n,l),d=i.values.length,f=i.values.map(v=>s6(v,i.min,i.max)),h=d>1?Math.min(...f):0,m=100-Math.max(...f);return S.jsx(An.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:u,style:{...e.style,[o.startEdge]:h+"%",[o.endEdge]:m+"%"}})},"SliderRange")),xae="SliderThumb",[bae,bD]=r6(xae),Sae="SliderThumbProvider";function SD(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=Nd(Sae,e),o=fae(e),[l,u]=g.useState(null),d=g.useMemo(()=>l?o().findIndex(w=>w.ref.current===l):-1,[o,l]),f=cS(l),h=l?!!i.form||!!l.closest("form"):!0,m=i.values[d],v=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),x=m===void 0?0:s6(m,i.min,i.max);g.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const _={value:m,name:v,form:i.form,isFormControl:h,index:d,thumb:l,onThumbChange:u,percent:x,size:f};return S.jsx(bae,{scope:e,..._,children:ID(s)?s(_):r})}Mt(SD,"SliderThumbProvider");var e2="SliderThumbTrigger",kae=g.forwardRef(Mt(function(e,n){const{__scopeSlider:r,...s}=e,i=Nd(e2,r),o=wD(e2,r),{index:l,value:u,percent:d,size:f,onThumbChange:h}=bD(e2,r),m=Kt(n,h),v=ED(l,i.values.length),x=f==null?void 0:f[o.size],_=x?PD(x,d,o.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${d}% + ${_}px)`},children:S.jsx(Tx.ItemSlot,{scope:r,children:S.jsx(An.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":u,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:u===void 0?{display:"none"}:e.style,onFocus:Gt(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),Eae=g.forwardRef(Mt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(SD,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>S.jsxs(S.Fragment,{children:[S.jsx(kae,{...i,ref:n,__scopeSlider:r}),l?S.jsx(Cae,{__scopeSlider:r},o):null]})})},"SliderThumb")),t5="SliderBubbleInput",Cae=g.forwardRef(Mt(function({__scopeSlider:e,onInput:n,...r},s){const{index:i,value:o,name:l,form:u}=bD(t5,e),{userRequestedValues:d}=Nd(t5,e),f=g.useRef(null),h=Kt(f,s),m=g.useRef(!1),v=g.useRef(o),x=g.useRef(d),_=g.useRef(d);return g.useEffect(()=>{const w=f.current;if(!w)return;const b=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(b,"value").set,P=v.current,T=P!==o;v.current=o;const M=d!==_.current;if(_.current=d,T&&C){const I=d!==x.current;x.current=d;const R=d==null?void 0:d[i],L=I&&(M&&R!==P||R===o);m.current=!L;const j=new Event("input",{bubbles:!0});C.call(w,o),w.dispatchEvent(j),m.current=!1}},[i,o,d]),S.jsx(An.input,{style:{display:"none"},name:l,form:u,...r,ref:h,defaultValue:o,onInput:Gt(n,w=>{m.current&&w.stopPropagation()})})},"SliderBubbleInput"));function kD(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}Mt(kD,"getNextSortedValues");function s6(t,e,n){const i=100/(n-e)*(t-e);return $g(i,[0,100])}Mt(s6,"convertValueToPercentage");function ED(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}Mt(ED,"getLabel");function CD(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)}Mt(CD,"getClosestValueIndex");function PD(t,e,n){const r=t/2,i=Cv([0,50],[0,r]);return(r-i(e)*n)*n}Mt(PD,"getThumbInBoundsOffset");function AD(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}Mt(AD,"getStepsBetweenValues");function TD(t,e){if(e>0){const n=AD(t);return Math.min(...n)>=e}return!0}Mt(TD,"hasMinStepsBetweenValues");function Cv(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])}}Mt(Cv,"linearScale");function i6(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",o=Number(s);return Math.max(0,i.length-o)}const n=e.split(".")[1];return n?n.length:0}Mt(i6,"getDecimalCount");function mh(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}Mt(mh,"roundValue");function RD(t,{min:e,step:n,direction:r,multiplier:s}){const i=i6(n),o=(t-e)/n,l=Math.round(o),u=mh(l*n+e,i)===mh(t,i);let d;return u?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),mh(d*n+e,i)}Mt(RD,"getNextStepValue");function ID(t){return typeof t=="function"}Mt(ID,"isFunction");const Rx=g.forwardRef(({className:t,...e},n)=>S.jsxs(mae,{ref:n,className:Wt("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(_ae,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(wae,{className:"absolute h-full bg-primary"})}),S.jsx(Eae,{className:Wt("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")})]}));Rx.displayName="Slider";const Pae=[{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"}],Aae=[{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"}],Tae=[{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"}],Q0=[{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:"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."}],Rae=()=>{window.location.hash=""},Co=({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]}),n5=({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))}),Iae=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",Mae=()=>{const t=Q0.filter(n=>n.status==="showcased").length,e=Q0.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:Rae,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(tY,{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(x3,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Co,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"Rivet's shared Button exposes variants and sizes backed by Fluid Functionalism, alongside the split button and tooltip controls.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(to,{title:"Primary action",shortcut:"D",variant:"primary",children:"Design action"}),S.jsx(to,{title:"Secondary action",variant:"secondary",children:"Secondary"}),S.jsx(to,{title:"Disabled action",disabled:!0,variant:"tertiary",children:"Disabled"}),S.jsx(M9,{primaryLabel:"Ship",primaryIcon:__,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(Mc,{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(pS,{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(Co,{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(n5,{swatches:Pae})}),S.jsx(Co,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(n5,{swatches:Aae})}),S.jsx(Co,{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(Co,{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:Tae.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(Co,{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(Rm,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(Rm.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(__,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(Rm.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(Rx,{defaultValue:[64],max:100,step:1}),S.jsx(Rx,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Co,{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(eae,{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(CS,{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(aae,{hint:"Reading selected elements"})})]})}),S.jsx(Co,{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(dx,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(nL,{icon:S.jsx(__,{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(AS,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Co,{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:Q0.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:Q0.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 ${Iae(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},Oae=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",Ix=274,Fg=395,t2=Math.min(Fg,Math.round((Ix+Fg)/2*1.1)),r5="rivet:panelWidth:v2",Lae=({projectPath:t,libraryOrigin:e})=>{const n=ut(k9)>0,[r,s]=gI(b9),i=JG(),[o,l]=g.useState(()=>{if(typeof window>"u")return t2;const T=Number(window.localStorage.getItem(r5));return Number.isFinite(T)&&T>=Ix&&T<=Fg?T:t2}),[u,d]=g.useState(!1),[f,h]=g.useState(Qse),m=r?o:0,[v,x]=g.useState(r);g.useEffect(()=>{if(!r){x(!1);return}h(T=>Xse({position:T,boundsLeftPx:o}))},[r,o]),g.useEffect(()=>{window.localStorage.setItem(r5,String(o))},[o]),g.useEffect(()=>{if(!r)return;const T=M=>{M.key==="Escape"&&(cI(M.target)||(M.preventDefault(),s(!1)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[r,s]);const _=g.useCallback(T=>{T.preventDefault(),T.stopPropagation();const M=T.clientX,I=o;d(!0);const R=j=>{const F=Math.min(Fg,Math.max(Ix,I+(j.clientX-M)));l(F)},L=()=>{window.removeEventListener("pointermove",R),window.removeEventListener("pointerup",L),window.removeEventListener("pointercancel",L),d(!1)};window.addEventListener("pointermove",R),window.addEventListener("pointerup",L),window.addEventListener("pointercancel",L)},[o]),w=g.useCallback(()=>l(t2),[]),b=fie(),k=ut(vv);mie({enabled:!k});const C=b.isProcessing?"Completing authentication...":null,P=wt(gv);return g.useEffect(()=>{P(t??null)},[t,P]),S.jsxs(Ci.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[C!==null?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx($se,{message:C})}):null,S.jsx(fre,{}),S.jsx(S.Fragment,{children:n?null:S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:v?o:0},children:S.jsxs(Ci.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:r?0:-o},transition:i?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{r&&x(!0)},style:{width:o,willChange:"transform"},children:[S.jsx(Sne,{onClose:()=>s(!1),libraryOrigin:e}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:_,onDoubleClick:w,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 ${u?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),u&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(tie,{isVisible:!0,isPanelOpen:r,isReducedMotion:!!i,position:f,dragBoundsLeftPx:m,onPositionChange:h,onToggle:()=>s(T=>!T)})]})}),S.jsx(TK,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},Mx="rivet_connect_deep_link",Nae=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(Mx);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(Mx,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},Dae=Nae(),jae=()=>{const[t,e]=g.useState(window.location.hash),[n]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Tg)==="1"),[r,s]=g.useState(!1),[i,o]=g.useState(Dae);g.useEffect(()=>{n&&window.sessionStorage.removeItem(Tg)},[n]);const{config:l,refetchConfig:u,loading:d,error:f}=die(),h=wt(vv),{startLogin:m,isStartingLogin:v,loginError:x}=G9(),[_,w]=g.useState(!1);g.useEffect(()=>{q2()&&(l!=null&&l.userId?(Ie.identify(l.userId,{...l.email?{email:l.email}:{}}),l.email&&Ie.alias(l.email,l.userId)):l!=null&&l.email&&Ie.identify(l.email,{email:l.email}))},[l==null?void 0:l.userId,l==null?void 0:l.email]),g.useEffect(()=>{l&&Ie.register({source:"visual_editor",surface:"visual_editor"})},[l]);const b=l!=null&&l.agentModeAvailable!==!0,k=Oae(t),C=g.useCallback(async()=>{w(!0),h(!0);try{await u()}finally{h(!1),w(!1)}},[u,h]);if(g.useEffect(()=>{const I=()=>{const R=window.location.hash;e(R)};return window.addEventListener("hashchange",I),()=>window.removeEventListener("hashchange",I)},[]),k==="design-system")return S.jsx(Mae,{});if(!d&&l===null&&!_){const I=f||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-muted mt-2 text-xs",children:I}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{C()},children:"Retry"})]})})}if(b)return S.jsx(Dse,{isSigningIn:v,onStartSignIn:()=>{m()},errorMessage:x,displayMode:"full"});const T=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,M=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!T;return S.jsxs(S.Fragment,{children:[S.jsx(Lae,{projectPath:l==null?void 0:l.projectPath,libraryOrigin:(l==null?void 0:l.libraryOrigin)??null}),S.jsx(lx,{context:"onboarding",isOpen:M,onClose:()=>s(!0)}),S.jsx(lx,{context:"menu",isOpen:T,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(Mx),o(null)}})]})};g7();const $ae=g.lazy(()=>p5(()=>import("./LibraryEntry-BJl_pPMq.js"),[])),o6=window.location.pathname.startsWith("/rivet/library");o6||yU();const Fae=new Uz,Vae=()=>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."})}),MD=document.getElementById("root");if(!MD)throw new Error("Rivet root element is missing");const Hae=()=>kU.createRoot(MD).render(S.jsx(we.StrictMode,{children:S.jsx(sU,{client:Ie,children:S.jsx(uU,{fallback:S.jsx(Vae,{}),children:S.jsx(vz,{client:Fae,children:S.jsx(_X,{defaultShape:"rounded",children:S.jsx(Xoe,{defaultLibrary:"lucide",children:o6?S.jsx(g.Suspense,{fallback:S.jsx("div",{className:"bg-background h-screen"}),children:S.jsx($ae,{})}):S.jsx(jae,{})})})})})})})),zae=async()=>{o6&&await cz(),await gz(),Hae()};zae();export{ez as $,uv as A,to as B,dv as C,cv as D,fv as E,hv as F,pv as G,Tt as H,Or as I,Fse as J,ip as K,Foe as L,GR as M,Ph as N,A3 as O,wS as P,jz as Q,ch as R,ep as S,loe as T,lr as U,gn as V,Ge as W,Goe as X,lb as Y,Ac as Z,xE as _,Bz as a,Bae as a0,dX as a1,xe as a2,nz as a3,Ua as a4,tle as a5,nle as a6,uz as a7,Dte as a8,Wt as a9,Yae as aa,Xae as ab,roe as ac,bne as ad,TK as ae,Ite as af,Gae as ag,qae as ah,Wae as ai,G9 as aj,_t as ak,lz as al,az as am,Zae as an,qz as b,g as c,Gz as d,Xz as e,Kz as f,Vz as g,Ch as h,ts as i,Qz as j,Jz as k,Yz as l,nI as m,vr as n,ct as o,ni as p,w9 as q,eI as r,Xy as s,S as t,XR as u,Dw as v,xS as w,bS as x,SS as y,Moe as z};
439
- //# sourceMappingURL=main-D1832qVC.js.map