rivet-design 0.28.1 → 0.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/open.js +4 -2
- package/dist/cli/commands/serve.js +1 -0
- package/dist/jest.globalSetup.d.ts +3 -0
- package/dist/jest.globalSetup.js +19 -0
- package/dist/proxy-middleware/proxy-config.d.ts +0 -1
- package/dist/proxy-middleware/proxy-config.js +6 -34
- package/dist/routes/agentVariants.js +20 -173
- package/dist/routes/static.js +8 -2
- package/dist/server.d.ts +1 -1
- package/dist/server.js +13 -25
- package/dist/services/AuthService.js +7 -61
- package/dist/services/templates/viteReactTs.js +1 -1
- package/dist/types/rivet-page-types.d.ts +48 -0
- package/dist/types/rivet-page-types.js +6 -0
- package/dist/utils/rivetPage.d.ts +8 -0
- package/dist/utils/rivetPage.js +24 -0
- package/dist/utils/rivetPage.testHelpers.d.ts +6 -0
- package/dist/utils/rivetPage.testHelpers.js +18 -0
- package/dist/utils/rivetPageDocument.d.ts +7 -0
- package/dist/utils/rivetPageDocument.js +41 -0
- package/dist/utils/scriptJson.d.ts +2 -0
- package/dist/utils/scriptJson.js +9 -0
- package/dist/utils/uiDistPath.d.ts +2 -0
- package/dist/utils/uiDistPath.js +22 -0
- package/package.json +8 -5
- package/src/ui/dist/assets/LibraryEntry-B8-RtQpK.js +2 -0
- package/src/ui/dist/assets/google-g-CpxN0HWb.png +0 -0
- package/src/ui/dist/assets/main-11-ME6E3.css +1 -0
- package/src/ui/dist/assets/main-BGCGsyhl.js +204 -0
- package/src/ui/dist/index.html +3 -3
- package/src/ui/dist/pages/empty-project.html +53 -0
- package/src/ui/dist/pages/rivet-page.html +53 -0
- package/dist/routes/emptyStatePage.d.ts +0 -2
- package/dist/routes/emptyStatePage.js +0 -589
- package/src/ui/dist/assets/LibraryEntry-DS6Ce0sW.js +0 -112
- package/src/ui/dist/assets/logo-animation/clasp.png +0 -0
- package/src/ui/dist/assets/logo-animation/eraser.png +0 -0
- package/src/ui/dist/assets/logo-animation/playdough.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/bubblephone.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/cart.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/chair.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/desk.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/mug.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/pitcher.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/pot.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/startac.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/terracotta-1.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/terracotta-2.png +0 -0
- package/src/ui/dist/assets/logo-animation/sea/vhsplant.png +0 -0
- package/src/ui/dist/assets/main-CQSk-6km.css +0 -1
- package/src/ui/dist/assets/main-DkKRuatC.js +0 -218
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
var mk=e=>{throw TypeError(e)};var Ty=(e,t,n)=>t.has(e)||mk("Cannot "+n);var Z=(e,t,n)=>(Ty(e,t,"read from private field"),n?n.call(e):t.get(e)),rt=(e,t,n)=>t.has(e)?mk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),$e=(e,t,n,r)=>(Ty(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),bt=(e,t,n)=>(Ty(e,t,"access private method"),n);var Yp=(e,t,n,r)=>({set _(s){$e(e,t,s,n)},get _(){return Z(e,t,r)}});function HD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.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 UD="modulepreload",ZD=function(e){return"/"+e},gk={},BD=function(t,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(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=o(n.map(d=>{if(d=ZD(d),d in gk)return;gk[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":UD,f||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((v,_)=>{m.addEventListener("load",v),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return s.then(o=>{for(const c of o||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})};function vg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ay={exports:{}},of={},Iy={exports:{}},Ot={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var vk;function WD(){if(vk)return Ot;vk=1;var e=Symbol.for("react.element"),t=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"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;function m(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function b(D,q,fe){this.props=D,this.context=q,this.refs=w,this.updater=fe||v}b.prototype.isReactComponent={},b.prototype.setState=function(D,q){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,q,"setState")},b.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=b.prototype;function E(D,q,fe){this.props=D,this.context=q,this.refs=w,this.updater=fe||v}var C=E.prototype=new S;C.constructor=E,_(C,b.prototype),C.isPureReactComponent=!0;var R=Array.isArray,T=Object.prototype.hasOwnProperty,O={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function A(D,q,fe){var ae,ce={},he=null,ke=null;if(q!=null)for(ae in q.ref!==void 0&&(ke=q.ref),q.key!==void 0&&(he=""+q.key),q)T.call(q,ae)&&!M.hasOwnProperty(ae)&&(ce[ae]=q[ae]);var ge=arguments.length-2;if(ge===1)ce.children=fe;else if(1<ge){for(var pe=Array(ge),Le=0;Le<ge;Le++)pe[Le]=arguments[Le+2];ce.children=pe}if(D&&D.defaultProps)for(ae in ge=D.defaultProps,ge)ce[ae]===void 0&&(ce[ae]=ge[ae]);return{$$typeof:e,type:D,key:he,ref:ke,props:ce,_owner:O.current}}function L(D,q){return{$$typeof:e,type:D.type,key:q,ref:D.ref,props:D.props,_owner:D._owner}}function V(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function W(D){var q={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(fe){return q[fe]})}var z=/\/+/g;function X(D,q){return typeof D=="object"&&D!==null&&D.key!=null?W(""+D.key):q.toString(36)}function Q(D,q,fe,ae,ce){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var ke=!1;if(D===null)ke=!0;else switch(he){case"string":case"number":ke=!0;break;case"object":switch(D.$$typeof){case e:case t:ke=!0}}if(ke)return ke=D,ce=ce(ke),D=ae===""?"."+X(ke,0):ae,R(ce)?(fe="",D!=null&&(fe=D.replace(z,"$&/")+"/"),Q(ce,q,fe,"",function(Le){return Le})):ce!=null&&(V(ce)&&(ce=L(ce,fe+(!ce.key||ke&&ke.key===ce.key?"":(""+ce.key).replace(z,"$&/")+"/")+D)),q.push(ce)),1;if(ke=0,ae=ae===""?".":ae+":",R(D))for(var ge=0;ge<D.length;ge++){he=D[ge];var pe=ae+X(he,ge);ke+=Q(he,q,fe,pe,ce)}else if(pe=m(D),typeof pe=="function")for(D=pe.call(D),ge=0;!(he=D.next()).done;)he=he.value,pe=ae+X(he,ge++),ke+=Q(he,q,fe,pe,ce);else if(he==="object")throw q=String(D),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return ke}function H(D,q,fe){if(D==null)return D;var ae=[],ce=0;return Q(D,ae,"","",function(he){return q.call(fe,he,ce++)}),ae}function Y(D){if(D._status===-1){var q=D._result;q=q(),q.then(function(fe){(D._status===0||D._status===-1)&&(D._status=1,D._result=fe)},function(fe){(D._status===0||D._status===-1)&&(D._status=2,D._result=fe)}),D._status===-1&&(D._status=0,D._result=q)}if(D._status===1)return D._result.default;throw D._result}var oe={current:null},U={transition:null},J={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:U,ReactCurrentOwner:O};function K(){throw Error("act(...) is not supported in production builds of React.")}return Ot.Children={map:H,forEach:function(D,q,fe){H(D,function(){q.apply(this,arguments)},fe)},count:function(D){var q=0;return H(D,function(){q++}),q},toArray:function(D){return H(D,function(q){return q})||[]},only:function(D){if(!V(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Ot.Component=b,Ot.Fragment=n,Ot.Profiler=s,Ot.PureComponent=E,Ot.StrictMode=r,Ot.Suspense=u,Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,Ot.act=K,Ot.cloneElement=function(D,q,fe){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var ae=_({},D.props),ce=D.key,he=D.ref,ke=D._owner;if(q!=null){if(q.ref!==void 0&&(he=q.ref,ke=O.current),q.key!==void 0&&(ce=""+q.key),D.type&&D.type.defaultProps)var ge=D.type.defaultProps;for(pe in q)T.call(q,pe)&&!M.hasOwnProperty(pe)&&(ae[pe]=q[pe]===void 0&&ge!==void 0?ge[pe]:q[pe])}var pe=arguments.length-2;if(pe===1)ae.children=fe;else if(1<pe){ge=Array(pe);for(var Le=0;Le<pe;Le++)ge[Le]=arguments[Le+2];ae.children=ge}return{$$typeof:e,type:D.type,key:ce,ref:he,props:ae,_owner:ke}},Ot.createContext=function(D){return D={$$typeof:o,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:i,_context:D},D.Consumer=D},Ot.createElement=A,Ot.createFactory=function(D){var q=A.bind(null,D);return q.type=D,q},Ot.createRef=function(){return{current:null}},Ot.forwardRef=function(D){return{$$typeof:c,render:D}},Ot.isValidElement=V,Ot.lazy=function(D){return{$$typeof:f,_payload:{_status:-1,_result:D},_init:Y}},Ot.memo=function(D,q){return{$$typeof:d,type:D,compare:q===void 0?null:q}},Ot.startTransition=function(D){var q=U.transition;U.transition={};try{D()}finally{U.transition=q}},Ot.unstable_act=K,Ot.useCallback=function(D,q){return oe.current.useCallback(D,q)},Ot.useContext=function(D){return oe.current.useContext(D)},Ot.useDebugValue=function(){},Ot.useDeferredValue=function(D){return oe.current.useDeferredValue(D)},Ot.useEffect=function(D,q){return oe.current.useEffect(D,q)},Ot.useId=function(){return oe.current.useId()},Ot.useImperativeHandle=function(D,q,fe){return oe.current.useImperativeHandle(D,q,fe)},Ot.useInsertionEffect=function(D,q){return oe.current.useInsertionEffect(D,q)},Ot.useLayoutEffect=function(D,q){return oe.current.useLayoutEffect(D,q)},Ot.useMemo=function(D,q){return oe.current.useMemo(D,q)},Ot.useReducer=function(D,q,fe){return oe.current.useReducer(D,q,fe)},Ot.useRef=function(D){return oe.current.useRef(D)},Ot.useState=function(D){return oe.current.useState(D)},Ot.useSyncExternalStore=function(D,q,fe){return oe.current.useSyncExternalStore(D,q,fe)},Ot.useTransition=function(){return oe.current.useTransition()},Ot.version="18.3.1",Ot}var yk;function B2(){return yk||(yk=1,Iy.exports=WD()),Iy.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 _k;function KD(){if(_k)return of;_k=1;var e=B2(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,u,d){var f,p={},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)&&(p[f]=u[f]);if(c&&c.defaultProps)for(f in u=c.defaultProps,u)p[f]===void 0&&(p[f]=u[f]);return{$$typeof:t,type:c,key:m,ref:v,props:p,_owner:s.current}}return of.Fragment=n,of.jsx=o,of.jsxs=o,of}var wk;function GD(){return wk||(wk=1,Ay.exports=KD()),Ay.exports}var P=GD();const qD="x-rivet-editor-token",bk="editorToken",YD=["/api/account","/api/config","/api/auth/store","/api/auth/logout","/api/library/browser-launches","/api/integrations","/api/reference-profiles"],XD=/^\/api\/variants\/(?:[^/]+\/static\/|history\/[^/]+\/[^/]+\/(?:preview(?:\/|$)|site\/)|[^/]+\/[^/]+\/references\/[^/]+\/image\/?$)/,QD=(e,t="GET")=>{const n=e.split(/[?#]/)[0].toLowerCase();return/^\/api\/variants(?:\/|$)/.test(n)?!["GET","HEAD"].includes(t.toUpperCase())||!XD.test(n):YD.some(r=>n===r||n.startsWith(`${r}/`))},S_="rivet_editor_token";let E_;const JD=()=>{if(window.location.pathname.startsWith("/rivet/library"))return;const e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(bk);if(t===null)return;E_=t||null,e.delete(bk);const n=e.toString();window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${n?`#${n}`:""}`);try{t?window.sessionStorage.setItem(S_,t):window.sessionStorage.removeItem(S_)}catch{}},eF=()=>{if(E_!==void 0)return E_;try{return window.sessionStorage.getItem(S_)}catch{return null}};var g=B2();const Ee=vg(g),_d=HD({__proto__:null,default:Ee},[g]);var tF={};const ie="u">typeof window?window:void 0,es="u">typeof globalThis?globalThis:ie,Dr=es==null?void 0:es.navigator,Ie=es==null?void 0:es.document,an=es==null?void 0:es.location,nh=es==null?void 0:es.fetch,W2=es!=null&&es.XMLHttpRequest&&"withCredentials"in new es.XMLHttpRequest?es.XMLHttpRequest:void 0,xk=es==null?void 0:es.AbortController,nF=es==null?void 0:es.CompressionStream,cs=Dr==null?void 0:Dr.userAgent,af=typeof globalThis<"u"?globalThis:ie;af&&typeof self>"u"&&(af.self=af),af&&typeof File>"u"&&(af.File=function(){});const et=ie??{},rF="0.10.7",Yo={DEBUG:!1,LIB_VERSION:rF,LIB_NAME:"browser-common"};var ro=(function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e})({}),k_=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({});const sF=["$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"],iF=["token"];function We(e,t){return e.indexOf(t)!==-1}const qu=function(e){return e.trim()},C_=function(e){return e.replace(/^\$/,"")};function e3(e){var t;const n=[];return(t=JSON.stringify(e,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&&t!==void 0?t:"null"}const t3=Object.prototype,K2=t3.hasOwnProperty,yg=t3.toString,He=Array.isArray||function(e){return yg.call(e)==="[object Array]"},On=e=>typeof e=="function",ut=e=>e===Object(e)&&!He(e),ks=e=>{if(ut(e)){for(const t in e)if(K2.call(e,t))return!1;return!0}return!1},le=e=>e===void 0,ft=e=>yg.call(e)=="[object String]",Df=e=>ft(e)&&e.trim().length===0,kn=e=>e===null,ot=e=>le(e)||kn(e),Fn=e=>yg.call(e)=="[object Number]"&&e==e,jo=e=>Fn(e)&&e>0,ds=e=>yg.call(e)==="[object Boolean]",oF=e=>We(sF,e),aF=e=>We(iF,e);function n3(e){return e===null||typeof e!="object"}function h0(e,t){return{}.toString.call(e)===`[object ${t}]`}function wd(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return r3(e,Error)}}function G2(e){return"u">typeof Event&&r3(e,Event)}function r3(e,t){try{return e instanceof t}catch{return!1}}const lF=[!0,"true",1,"1","yes"],Oy=e=>We(lF,e),cF=[!1,"false",0,"0","no"];function Sk(e,t,n,r,s,i,o){try{var c=e[i](o),u=c.value}catch(d){return void n(d)}c.done?t(u):Promise.resolve(u).then(r,s)}function cn(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var i=e.apply(t,n);function o(u){Sk(i,r,s,o,c,"next",u)}function c(u){Sk(i,r,s,o,c,"throw",u)}o(void 0)})}}const uF=["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","lightpanda","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"],Xp=new Map,Ek=function(e,t=[]){if(!e)return!1;const n=(function(o,c){let u="";for(let d=0;c.length>d;d++){const f=c[d];u+=f.length+":"+f}return o.length+":"+o+"|"+c.length+":"+u})(e,t),r=Xp.get(n);if(r!==void 0)return r;const s=e.toLowerCase(),i=uF.concat(t).some(o=>s.indexOf(o.toLowerCase())!==-1);return 256>Xp.size||Xp.clear(),Xp.set(n,i),i};function fo(e,t,n,r,s){return t>n&&(r.warn("min cannot be greater than max."),t=n),Fn(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),fo(s??n,t,n,r))}var dF=class{constructor(e){this.C={},this.I=e.I,this.A=fo(e.bucketSize,0,100,e.R),this.O=fo(e.refillRate,0,this.A,e.R),this.$=fo(e.refillInterval,0,864e5,e.R)}F(e,t){const n=Math.floor((t-e.lastAccess)/this.$);n>0&&(e.tokens=Math.min(e.tokens+n*this.O,this.A),e.lastAccess=e.lastAccess+n*this.$)}consumeRateLimit(e){var t;const n=Date.now(),r=String(e);let s=this.C[r];return s?this.F(s,n):(s={tokens:this.A,lastAccess:n},this.C[r]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((t=this.I)===null||t===void 0||t.call(this,e)),s.tokens===0)}stop(){this.C={}}};const rh="Mobile",sh="Android",P_="Tablet",s3="Android Tablet",i3="iPad",o3="Apple Watch",Fm="Safari",_g="BlackBerry",a3="Samsung Internet",jm="Chrome",l3="Chrome iOS",c3="Internet Explorer",u3="Internet Explorer Mobile",d3="Opera",f3="Microsoft Edge",Vm="Firefox",h3="Firefox iOS",p0="Nintendo",m0="PlayStation",wg="Xbox",p3="Android Mobile",m3="Mobile Safari",My="Windows",g3="Windows Phone",kk="Nokia",R_="Ouya",v3="Generic tablet",T_="Konqueror",y3="Oculus Browser",_3="Vivaldi",w3="Yandex",b3="Whale",x3="DuckDuckGo",S3="Pale Moon",E3="Waterfox",A_="Brave",k3="Claude",C3="Codex",P3="ChatGPT",R3="Google Search App",Ly=new RegExp("Version/(\\d+(\\.\\d+)?)"),$y=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),fF=new RegExp(wg,"i"),hF=new RegExp("PlayStation \\w+","i"),pF=new RegExp("Nintendo \\w+","i"),q2=new RegExp("BlackBerry|PlayBook|BB10","i"),mF={"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"},T3=function(e,t,n,r){return t=t||"",(function(i){return i!=null&&i.brave?A_:null})(n)||(r!=null&&r.detectGoogleSearchApp&&We(e,"GSA/")?R3:We(e," OPR/")&&We(e,"Mini")?"Opera Mini":We(e," OPR/")?d3:q2.test(e)?_g:We(e,"IEMobile")||We(e,"WPDesktop")?u3:We(e,"OculusBrowser")?y3:We(e,"SamsungBrowser")?a3:We(e,"Edge")||We(e,"Edg/")?f3:We(e,"Vivaldi/")?_3:We(e,"YaBrowser/")?w3:We(e,"Whale/")?b3:We(e,"DuckDuckGo/")||We(e,"Ddg/")?x3:We(e,"Claude/")?k3:We(e,"Codex/")?C3:We(e,"ChatGPT/")?P3:We(e,"FBIOS")?"Facebook Mobile":We(e,"UCWEB")||We(e,"UCBrowser")?"UC Browser":We(e,"CriOS")?l3:We(e,"CrMo")||We(e,jm)?jm:We(e,sh)&&We(e,Fm)?p3:We(e,"FxiOS")?h3:We(e.toLowerCase(),T_.toLowerCase())?T_:We(e,"Brave/")?A_:((i,o)=>o&&We(o,"Apple")||(function(c){return We(c,Fm)&&!We(c,jm)&&!We(c,sh)})(i))(e,t)?We(e,rh)?m3:Fm:We(e,"PaleMoon/")?S3:We(e,"Waterfox/")?E3:We(e,Vm)?Vm:We(e,"MSIE")||We(e,"Trident/")?c3:We(e,"Gecko")?Vm:"")},gF={[u3]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[f3]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[jm]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[l3]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[Fm]:[Ly],[m3]:[Ly],[d3]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[Vm]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[h3]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[T_]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[_g]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Ly],[p3]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[a3]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[y3]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[_3]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[w3]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[b3]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[A_]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[k3]:[$y],[C3]:[$y],[P3]:[$y],[x3]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[S3]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[E3]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[R3]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[c3]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},vF=function(e,t,n,r){const s=T3(e,t,n,r),i=gF[s];if(le(i))return null;for(let o=0;i.length>o;o++){const c=e.match(i[o]);if(c)return parseFloat(c[c.length-2])}return null},Ck=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[wg,e&&e[1]||""]],[new RegExp(p0,"i"),[p0,""]],[new RegExp(m0,"i"),[m0,""]],[q2,[_g,""]],[new RegExp(My,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[g3,""];if(new RegExp(rh).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){let r=mF[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[My,r]}return[My,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=le(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[sh,[e[2],e[3],e[4]||"0"].join(".")]:[sh,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{const t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],A3=function(e){for(let t=0;Ck.length>t;t++){const[n,r]=Ck[t],s=n.exec(e),i=s&&(On(r)?r(s,e):r);if(i)return i}return["",""]},I3=function(e){return pF.test(e)?p0:hF.test(e)?m0:fF.test(e)?wg:new RegExp(R_,"i").test(e)?R_:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?g3:/iPad/.test(e)?i3:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?o3:q2.test(e)?_g:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(kk,"i").test(e)?kk:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(rh).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?sh:s3:new RegExp("(pda|Mobile)","i").test(e)?"Generic mobile":new RegExp(P_,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?v3:""},yF=function(e,t){var n;const r=I3(e);return r===i3||r===s3||r==="Kobo"||r==="Kindle Fire"||r===v3?P_:r===p0||r===wg||r===m0||r===R_?"Console":r===o3?"Wearable":r?rh:(t==null?void 0:t.userAgentDataPlatform)==="Android"&&((n=t==null?void 0:t.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((s=t==null?void 0:t.screenWidth)!==null&&s!==void 0?s:0,(i=t==null?void 0:t.screenHeight)!==null&&i!==void 0?i:0)/((o=t==null?void 0:t.devicePixelRatio)!==null&&o!==void 0?o:1)?rh:P_:"Desktop";var s,i,o},Ny=/\bFBAV\/(\d+(?:\.\d+)*)/i,Pk=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Ny],[/\bFBAN\/EMA\b/i,"Facebook Lite",Ny],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Ny],[/\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"]],I_="[Truncated]",Vh="[Unserializable]";function Pu(e){let t="";for(let n=0;e.length>n;n++){const r=e.charCodeAt(n);if(55296>r||r>56319)t+=56320>r||r>57343?e[n]:"�";else{const s=e.charCodeAt(n+1);56320>s||s>57343?t+="�":(t+=e[n]+e[n+1],n++)}}return t}function O3(e,t){if(!t)return e;let n=[];try{n=Object.keys(t)}catch{n=[]}for(const r of n){let s;try{s=t[r]}catch{s=Vh}Object.defineProperty(e,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return e}const Dy=3e5;var M3=class{record(e){if(e.kind==="too-large")return;if(e.kind!=="retry-later")return void this.reset();if(!e.retryAfterMs)return;const t=this.isOpen(),n=Date.now(),r=Math.min(e.retryAfterMs,Dy);if(!t)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+Dy))}remainingMs(){const e=Date.now();if(this.ts-5e3>e)return this.reset(),0;const t=Math.min(Dy,Math.max(0,this.es-e));return t===0&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const _F=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Rk(e,t){return typeof(n=e)=="string"&&_F.test(n)?e:t();var n}function L3(e,t){const n=new Error(t);try{Object.defineProperty(n,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function el(e){return e&&e.split("#")[0]}function Tk(e){try{return e()}catch{return}}function $3(e,t){const n=setTimeout(e,t);return n!=null&&n.unref&&(n==null||n.unref()),n}function Ak(e,t,n){return N3.apply(this,arguments)}function N3(){return(N3=cn(function*(e,t,n){let r;try{return yield Promise.race([e,new Promise((s,i)=>{r=$3(()=>{try{n==null||n(),s()}catch(o){i(o)}},t)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function Ff(e){return Ff=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ff(e)}function wF(e,t,n){return(t=(function(r){var s=(function(i){if(Ff(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var c=o.call(i,"string");if(Ff(c)!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return Ff(s)=="symbol"?s:s+""})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ik(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function N(e){for(var t=1;arguments.length>t;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ik(Object(n),!0).forEach(function(r){wF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ik(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}let lf,Ok,Mk,Qc;function bF(e){var t;const n=globalThis._posthogChunkIds,r=globalThis._debugIds;if(!n&&!r)return;const s=n?Object.keys(n):[],i=r?Object.keys(r):[];if(Qc&&Lk(n,s,Ok)&&Lk(r,i,Mk))return Qc;Ok=n?N({},n):void 0,Mk=r?N({},r):void 0,Qc={},(t=lf)!==null&&t!==void 0||(lf={});const o=(c,u)=>{for(const f of c){const p=u[f];if(!p)continue;const m=lf==null?void 0:lf[f];if(m){Qc[m]=p;continue}const v=e(f);for(let _=v.length-1;_>=0;_--){var d;const w=(d=v[_])===null||d===void 0?void 0:d.filename;if(w){Qc[w]=p,lf[f]=w;break}}}};return r&&o(i,r),n&&o(s,n),Qc}function Lk(e,t,n){return e&&n?t.length===Object.keys(n).length&&t.every(r=>e[r]===n[r]):e===n}var xF=class{constructor(e,t,n=[]){this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t={}){const n=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,t,0).apply(e),s=this.buildParsingContext(t),i=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(e){var t=this;return cn(function*(){for(const n of e)n.stacktrace&&n.stacktrace.frames&&He(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)===null||t===void 0?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var n;let r,s;if(e.cause!=null&&(r=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null)try{s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch{}return N(N({},e),{},{cause:r,stack:s,errors:(n=e.errors)===null||n===void 0?void 0:n.map(i=>this.parseStacktrace(i,t))})}applyChunkIds(e,t){return e.map(n=>(n.filename&&t&&(n.chunk_id=t[n.filename]),n))}applyCoercers(e,t){for(const n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return cn(function*(){let n=e;for(const r of t.modifiers)n=yield r(n);return n})()}convertToExceptionList(e,t){const n=[],r=(s,i,o)=>{var c;const u=n.length,d=i===void 0?N(N({type:typeof t.type=="string"&&t.type.length>0?t.type:"generic"},typeof t.handled=="boolean"?{handled:t.handled}:t.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof t.synthetic=="boolean"?t.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 p of(c=s.errors)!==null&&c!==void 0?c:[])r(p,u,"member")};return r(e),n}buildParsingContext(e){var t;return{chunkIdMap:bF(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}getAggregateErrors(e){try{if(wd(e)){let n=Object.getPrototypeOf(e);for(let r=0;n&&100>r;r++){var t;const s=(t=Object.getOwnPropertyDescriptor(n,"constructor"))===null||t===void 0?void 0:t.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=e.errors;return He(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(e,t,n=0){let r=0,s=0,i=!1;const o=new Set,c=[],u={},d=(m,v,_=0)=>{const w=f(v,_),b=w.apply;if(w.apply=O=>{c.push(m);try{return b(O)}finally{c.pop()}},_>4||_>0&&c.indexOf(m)!==-1)return this.coerceFallback(w);const S=typeof m=="object"&&m!==null||typeof m=="function";if(_===0&&r>=50||S&&o.has(m))return;S&&o.add(m),_===0&&r++;const E=this.getAggregateErrors(m);let C,R;i||(i=!!E);try{if(C=this.applyCoercers(m,w),!C)throw u}catch(O){if(O===u)return void(_===0&&r--);if(!i)throw O;C=this.coerceFallback(w)}if(!E||r>=50)return C;try{R=E.length}catch{return C}if(!Number.isInteger(R)||0>R||R>4294967295)return C;const T=[];for(let O=0;50>r&&1e3>s&&R>O;O++){let M;s++;try{M=w.next(E[O])}catch{r++,M=this.coerceFallback(f(v+1))}M&&T.push(M)}return N(N({},C),{},{errors:T})},f=(m,v=0)=>N(N({},t),{},{syntheticException:m==0?t.syntheticException:void 0,mechanism:m==0?e:{},apply(_){const w=d(_,m,v+1);if(!w)throw u;return w},next:_=>d(_,m+1)}),p=f(n);return N(N({},p),{},{apply:m=>{var v;return(v=d(m,n))!==null&&v!==void 0?v:this.coerceFallback(p)}})}};const SF=/^([a-z][a-z0-9.+-]+):/i,EF=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function kF(e){if(!e||e==="<anonymous>")return!1;const t=SF.exec(e);return!t||EF.includes(t[1].toLowerCase())}function O_(e,t,n,r,s){const i={platform:e,filename:t,function:n==="<anonymous>"?"?":n,in_app:kF(t)};return le(r)||(i.lineno=r),le(s)||(i.colno=s),i}const D3=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},CF=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,PF=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,RF=/\((\S*)(?::(\d+))(?::(\d+))\)/,TF=(e,t)=>{const n=CF.exec(e);if(n){const[,s,i,o]=n;return O_(t,s,"?",+i,+o)}const r=PF.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=RF.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=D3(r[1]||"?",r[2]);return O_(t,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},AF=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,IF=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,OF=(e,t)=>{const n=AF.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=IF.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]=D3(s,r),O_(t,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},$k=/\(error: (.*)\)/;function Y2(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function MF(e){for(let t=1;10>=t;t++){const n=e.length-2*t;if(0>n)break;let r=!0;for(let s=0;t>s;s++)if(!Y2(e[n+s],e[n+t+s])){r=!1;break}if(r){for(let s=0;t>s;s++)e[n+s]=e[n+t+s];return e.length=n+t,{start:n,length:t}}}}function LF(e,t){const n=t.start+t.length,r=j3(e,t);r&&e.splice(n+r===e.length?n:t.start,r)}function F3(e,t){let n=t.start;for(;n>0&&Y2(e[n-1],e[n-1+t.length]);)n--;return t.start-n}function j3(e,t){const n=t.start+t.length;let r=n;for(;e.length>r&&Y2(e[r],e[r-t.length]);)r++;return r-n}function $F(e,t){const n=t[0];let r=e.length-(n?F3(e,n):0);for(const s of t)r-=j3(e,s);return r}function NF(e,t,n){for(let r=0;e.length>r;r++){const s=e[(t+r)%e.length],i=e[(n+r)%e.length];if(s!==i)return i>s}return!1}var DF=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){const n=ft(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){const t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return h0(e,"DOMException")}isDOMError(e){return h0(e,"DOMError")}},FF=class{match(e){return wd(e)}coerce(e,t){var n;const r=this.getStack(e),s=r===void 0?(n=t.syntheticException)===null||n===void 0?void 0:n.stack:void 0,i=!!s;return{type:this.getType(e),value:this.getMessage(e,t),stack:r??s,cause:e.cause?t.next(e.cause):void 0,synthetic:i}}getType(e){return e.name||e.constructor.name}getMessage(e,t){const n=e.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(e){try{const t=e.stacktrace;if(typeof t=="string"&&t.length>0)return t;const n=e.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}},jF=class{match(e){return!!h0(e,"ErrorEvent")&&(e.error!=null||this.yr(e))}coerce(e,t){var n;if(e.error!=null)return t.apply(e.error);const r=t.apply(e.message);return N(N({},r),{},{stack:(n=this.br(e))!==null&&n!==void 0?n:r.stack,synthetic:!0})}yr(e){return ft(e.message)&&e.message.length>0}br(e){var t,n;const r=e,s=(t=r.lineno)!==null&&t!==void 0?t:0,i=(n=r.colno)!==null&&n!==void 0?n:0;if(ft(r.filename)&&r.filename.length!==0&&s!==0)return`Error
|
|
18
|
+
at ${r.filename}:${s}:${i}`}};const VF=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var zF=class{match(e){return typeof e=="string"}coerce(e,t){var n;const[r,s]=this.getInfos(e);return{type:r??"Error",value:s??e,stack:(n=t.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}getInfos(e){let t="Error",n=e;const r=e.match(VF);return r&&(t=r[1],n=r[2]),[t,n]}};const HF=["fatal","error","warning","log","info","debug"];function V3(e,t=40){const n=Object.keys(e);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(t>=s.length)return r===n.length?s:s.length>t?`${s.slice(0,t)}...`:s}return""}var UF=class{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var n,r;const s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(n=this.getStack(e))!==null&&n!==void 0?n:(r=t.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(G2(e))return e.constructor.name;const t="name"in e?e.name:void 0;return ft(t)&&!Df(t)?t:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){let n=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(n+=` with message: '${e.message}'`),n}if("message"in e&&typeof e.message=="string")return e.message;const t=this.getObjectClassName(e);return`${t&&t!=="Object"?`'${t}'`:"Object"} captured as exception with keys: ${V3(e)}`}isSeverityLevel(e){return ft(e)&&!Df(e)&&HF.indexOf(e)>=0}getStack(e){try{return ft(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:ft(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(const t in e)if({}.hasOwnProperty.call(e,t)){const n=e[t];if(wd(n))return n}}getObjectClassName(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},ZF=class{match(e){return G2(e)}coerce(e,t){var n;const r=e.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${V3(e)}`,stack:(n=t.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},BF=class{match(e){return n3(e)}coerce(e,t){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:(n=t.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},WF=class{match(e){return h0(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!G2(e))return!1;try{const t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var n;const r=this.getUnhandledRejectionReason(e);return n3(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(n=t.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}};const g0="$message",v0="$timestamp",KF=new Set([g0,v0]),Fy={enabled:!0,max_bytes:32768};function y0(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:Fy.enabled,max_bytes:qF(e.max_bytes,Fy.max_bytes)}:N({},Fy)}var GF=class{constructor(e){this.ns=[],this.ss=0,this.Fr=y0(e)}setConfig(e){this.Fr=y0(e),this.rs()}add(e){const t=(function(r){let s;try{s=e3(r)}catch{return}try{const i=JSON.parse(s);if(!ut(i))return;const o=i,c=o[g0],u=o[v0];return!ft(c)||c.trim().length===0||!ft(u)&&!Fn(u)?void 0:{step:o,json:s}}catch{return}})(e);if(!t)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})(t.json);n>this.Fr.max_bytes||(this.ns.push({step:t.step,bytes:n}),this.ss+=n,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Fr.max_bytes&&this.ns.length>0;){const e=this.ns.shift();e&&(this.ss-=e.bytes)}}};function qF(e,t){if(!Fn(e)||e===1/0||e===-1/0)return t;const n=Math.floor(e);return 0>n?t:n}const Nk=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};function Dk(e){return typeof e=="string"||e}function Fk(e){return typeof e=="string"?e:void 0}const YF=["$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"],z3="NativeGzipValidationError",M_=e=>e.length>=2&&e[0]===31&&e[1]===139,jk=(e,t)=>e===k_.GZipJS||t===k_.GZipJS||t==="gzip",Vk=e=>!(!e||typeof e!="object")&&("name"in e?String(e.name):"")==="NotReadableError";let cf;const Qp=e=>{throw L3(z3,`Native gzip produced invalid output: ${e}`)},XF=(function(){var e=cn(function*(t,n){18>t.size&&Qp("too-short");const r=new Uint8Array(yield t.slice(0,10).arrayBuffer());M_(r)&&r[2]===8||Qp("invalid-header");const s=new DataView(yield t.slice(t.size-8).arrayBuffer());s.getUint32(0,!0)!==(o=>{const c=(()=>{if(cf)return cf;cf=[];for(let d=0;256>d;d++){let f=d;for(let p=0;8>p;p++)f=1&f?3988292384^f>>>1:f>>>1;cf[d]=f>>>0}return cf})();let u=4294967295;for(let d=0;o.length>d;d++)u=c[255&(u^o[d])]^u>>>8;return(4294967295^u)>>>0})(n)&&Qp("invalid-crc");const i=n.length>>>0;s.getUint32(4,!0)!==i&&Qp("invalid-size")});return function(t,n){return e.apply(this,arguments)}})();function L_(){return L_=cn(function*(e,t=!0,n){try{const s=new TextEncoder().encode(e),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),c=o.write(s).then(()=>o.close()).catch((r=cn(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,c]);return yield XF(d,s),d}catch(s){if(n!=null&&n.rethrow)throw s;return t&&console.error("Failed to gzip compress data",s),null}var r}),L_.apply(this,arguments)}function H3(e,t){if(e==null)return{};var n,r,s=(function(o,c){if(o==null)return{};var u={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(c.includes(d))continue;u[d]=o[d]}return u})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;i.length>r;r++)t.includes(n=i[r])||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}const Jr="[redacted]",QF=/^[A-Za-z0-9+/\n\r]+=*$/,JF=/^[A-Za-z0-9_-]+={0,2}$/,e9=/[-_]/,t9=/^data:[^,\s]*;base64,/i,n9=/^[A-Za-z0-9+/_-]+={0,2}$/,r9=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,s9=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,U3=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,i9=/[\s<>"]/,Z3=new RegExp(U3.source,"i"),B3=/[a-z][a-z0-9+.-]{0,63}:\/\//i,o9=new RegExp(`^${B3.source}`,"i"),a9=new RegExp(B3.source,"gi"),l9=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,c9=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,u9=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,d9=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,f9=/\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,h9=/(^|[^\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,p9=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,m9=/\b\d(?:[ ./-]?\d){12,}\b/g,zk=/\d+/g,g9=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,v9=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function $_(e){return(function(t){return s9.test(t)})(e)||l9.test(e)||c9.test(e)}function jy(e){return e.split("&",129).length>128}function y9(e,t,n){return $_(e)||t.includes(";")&&(function(r){return r.split(";").some(s=>$_(s.split("=",1)[0]))})(t)?Jr:Z3.test(t)?n?X2(t,{allowNestedUrls:!1,stripPunctuation:!0}):Jr:t}function W3(e,t){const n=new URLSearchParams;let r=!1,s=!1;for(const[i,o]of new URLSearchParams(e)){const c=_0(i),u=_0(o);r||(r=c!==i||u!==o);const d=y9(c,u,t);r||(r=d!==u),s=$_(c)||d!==u,n.append(c,d)}return{changed:r,lastFieldSensitive:s,serialized:n.toString()}}function Hk(e,t){if(!e.includes("="))return{value:_9(e,t),lastFieldSensitive:!1};const n=W3(e,t);return{value:n.changed?n.serialized:e,lastFieldSensitive:n.lastFieldSensitive}}function _9(e,t){return t?X2(e,{allowNestedUrls:!1,stripPunctuation:!0}):Z3.test(e)?Jr:e}function w9(e,t,n){return e==="#"?!t.fragment&&(t.fragment=!0):e==="?"&&(t.fragment?n!=="="&&!t.fragmentQuery&&(t.fragmentQuery=!0):!t.query&&(t.query=!0))}function Vy(e,t){var n;if(e.length>8192&&o9.test(e))return Jr;const{address:r,suffix:s}=t.stripPunctuation?(function(b){let S=b.length;for(;S>0&&".,;:!?)]}'".includes(b[S-1]);)S--;return{address:b.slice(0,S),suffix:b.slice(S)}})(e):{address:e,suffix:""};let i;try{i=new URL(r)}catch{return Jr+s}const o=i.search.slice(1),c=i.hash!=="",u=(function(b){const S=b.slice(1),E=S.indexOf("?");return 0>E?{head:S,tail:null}:{head:S.slice(0,E),tail:S.slice(E+1)}})(i.hash);if(jy(o)||jy(u.head)||jy((n=u.tail)!==null&&n!==void 0?n:""))return Jr+s;let d=!1;(i.username||i.password)&&(i.username=Jr,i.password="",d=!0);const f=W3(o,t.allowNestedUrls);f.changed&&(i.search=f.serialized,d=!0);const p=Hk(u.head,t.allowNestedUrls),m=u.tail===null?null:(v=u.tail,p.lastFieldSensitive?{value:v===""?"":Jr,lastFieldSensitive:!0}:Hk(v,t.allowNestedUrls));var v;const _=m===null?p.value:`${p.value}?${m.value}`;_!==i.hash.slice(1)&&(i.hash=_,d=!0);const w=c?m??p:f;return(d?_0(i.toString()):r)+(w.lastFieldSensitive?"":s)}function X2(e,t){return e.replace(U3,n=>(function(r,s){const i=(function(u){if(!u.includes("://"))return[];const d=[...u.matchAll(a9)].map(w=>w.index),f=[],p={query:!1,fragment:!1,fragmentQuery:!1};let m=0,v=!1,_="";for(let w=0;u.length>w&&d.length>m;w++){d[m]===w&&(w>0&&_!=="="&&f.push(w),m++);const b=u[w];w9(b,p,_)?(_=b,v=!0):v&&"=&".includes(b)&&(_=b)}return f})(r);if(i.length===0)return Vy(r,s);let o="",c=0;for(const u of i)o+=Vy(r.slice(c,u),N(N({},s),{},{stripPunctuation:!1})),c=u;return o+Vy(r.slice(c),s)})(n,N(N({},t),{},{stripPunctuation:t.stripPunctuation&&n.length!==e.length})))}function _0(e){return e.replace(r9,Jr)}function K3(e,t){return(function(n){return n.length>=10240&&(QF.test(n)||(function(r){const s=t9.exec(r);if(!s)return!1;let i;try{i=decodeURIComponent(r.slice(s[0].length))}catch{return!1}return n9.test(i.replace(/[\r\n]/g,""))})(n)||e9.test(n)&&JF.test(n))})(e)?"[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(c,u){let d=u;for(;d>0&&!i9.test(c[d-1]);)d--;return d})(n,i)));if(o.length>=2*s.maxStringLength)return o+s.truncationSuffix}return r(n)})(e,n=>(function(r){return X2(r,{allowNestedUrls:!0,stripPunctuation:!0})})((function(r){let s=r.replace(u9," ");return s=s.replace(d9,Jr),s=s.replace(f9,Jr),s=s.replace(h9,`$1${Jr}`),s=s.replace(m9,x9),s=s.replace(p9,Jr),s=s.replace(g9,`$1${Jr}`),s=s.replace(v9,`$1${Jr}`),s})(_0(n))),t)}function b9(e){let t=0,n=!1;for(let r=e.length-1;r>=0;r--){let s=e.charCodeAt(r)-48;if(0>s||s>9)return!1;n&&(s*=2,s>9&&(s-=9)),t+=s,n=!n}return t%10==0}function x9(e){const t=[];for(let i=zk.exec(e);i!==null;i=zk.exec(e))t.push({digits:i[0],start:i.index,end:i.index+i[0].length});let n="",r=0,s=0;for(;t.length>s;){let i="",o=-1;for(let c=s;t.length>c&&(i+=t[c].digits,19>=i.length);c++)i.length>=13&&b9(i)&&(o=c);0>o?s++:(n+=e.slice(r,t[s].start)+Jr,r=t[o].end,s=o+1)}return n+e.slice(r)}const S9={}.propertyIsEnumerable;function w0(e,t){try{return G3(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function Q2(e,t,n,r){if(0>=n.remainingNodes)return{stringValue:I_};if(n.remainingNodes--,ds(e))return{boolValue:e};if(typeof e=="bigint")return(function(s,i){const o=s.toString(),c=BigInt("9223372036854775808");return s>=c||-c>s?(i==null||i.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(e,t);if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};const s=BigInt(e).toString();return e>=9223372036854776e3||-9223372036854776e3>e?(t==null||t.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:Pu(e)};if(typeof e=="function")return{stringValue:"[Function]"};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(n.ancestors.has(e))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:I_};if(e instanceof Date){const s=e.getTime(),i=Number.isFinite(s)?e.toISOString():String(e);return{stringValue:typeof i=="string"?Pu(i):String(i)}}n.ancestors.add(e);try{try{const s=e.toJSON;if(typeof s=="function")return Q2(s.call(e),t,n,r+1)}catch{}return He(e)?{arrayValue:{values:E9(e,t,n,r+1)}}:{kvlistValue:{values:G3(e,t,n,r+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:Pu(String(e))}}function E9(e,t,n,r){const s=[],i=Math.min(e.length,1e3);let o=0;for(;i>o&&n.remainingNodes>0;o++)try{const c=o in e?e[o]:void 0;if(ot(c))continue;s.push(Q2(c,t,n,r))}catch{s.push({stringValue:Vh})}return e.length>o&&s.push({stringValue:I_}),s}function G3(e,t,n,r){const s=[];for(const i in e)if(S9.call(e,i)){if(!i){t==null||t.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=n.remainingNodes){t==null||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=e[i];if(kn(o)||le(o))continue;s.push({key:Pu(i),value:Q2(o,t,n,r)})}catch{s.push({key:Pu(i),value:{stringValue:Vh}})}}return s}function q3(e,t,n){return N(N(N(N({},O3({},e.resourceAttributes)),{},{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment}),e.serviceVersion&&{"service.version":e.serviceVersion}),{},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}const k9=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Y3(e,t){const n=O3({},e),r={};for(const s of k9)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...w0(n,t),...w0(r,t)]}const Uk={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"},X3={text:"INFO",number:9},C9={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:X3,warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}};function P9(e){try{return Pu(String(e))}catch{return Vh}}function R9(e,t,n,r){const s=e.level||"info",{text:i,number:o}=C9[s]||X3,c=(function(m=Date.now()){return String(m)+"000000"})(Fn(r)?r:void 0),u={};t.distinctId&&(u.posthogDistinctId=t.distinctId),t.sessionId&&(u.sessionId=t.sessionId),t.windowId&&(u["window.id"]=t.windowId),ot(t.sessionStartTimestamp)||(u.sessionStartTimestamp=String(t.sessionStartTimestamp)),ot(t.lastActivityTimestamp)||(u.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(u["url.full"]=t.currentUrl),t.screenName&&(u["screen.name"]=t.screenName),t.appState&&(u["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(u.feature_flags=t.activeFeatureFlags);const d=N({},u),f=e.attributes;if(f){let m=[];try{m=Object.keys(f)}catch{m=[]}for(const v of m){let _;try{_=f[v]}catch{_=Vh}Object.defineProperty(d,v,{value:_,enumerable:!0,writable:!0,configurable:!0})}}const p={timeUnixNano:c,observedTimeUnixNano:c,severityNumber:o,severityText:i,body:{stringValue:P9(e.body)},attributes:w0(d,n)};return e.trace_id&&(p.traceId=e.trace_id),e.span_id&&(p.spanId=e.span_id),le(e.trace_flags)||(p.flags=e.trace_flags),p}function Q3(e,t,n){return q3(e,t,n)}function J3(e,t,n,r){return{resourceLogs:[{resource:{attributes:Y3(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var eA=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.cs}arm(e){this.clear(),this.us=Date.now()+e,this.cs=$3(()=>{this.cs=void 0,this.ls()},e)}armNoEarlierThan(e){this.cs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function tA(){return .75+.5*Math.random()}function nA(e,t,n,r){const s=Math.min(Math.max(0,t-1),6),i=e*Math.pow(2,s);return Math.round(Math.min(i,Math.max(r,e))*n)}var T9=class{constructor(e,t,n,r,s,i=()=>Promise.resolve(),o){var c;this._instance=e,this.Fr=t,this.R=n,this.hs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new eA(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new M3,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=t.maxBufferSize,this.Is=Math.max((c=t.maxQueueSize)!==null&&c!==void 0?c:t.maxBufferSize,t.maxBufferSize),this.Ms=t.flushIntervalMs,this.Es=t.maxBatchRecordsPerPost,this.As=t.rateCapWindowMs,this.Rs=t.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(ro.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.Fr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.Ps()&&this.Os():this.gs()}captureLog(e,t){var n;if(this._instance.isDisabled||this._instance.optedOut||!(e!=null&&e.body))return;const r=this.Fs(e);if(r===null)return;if(!r.body)return void this.R.info("Log was rejected in beforeSend function");if(!this.Ds())return;const s={record:R9(r,(n=t==null?void 0:t.context)!==null&&n!==void 0?n:this.hs(),this.R,t==null?void 0:t.occurredAtMs)};this.ds(()=>this.Ls(s))}Fs(e){const t=this.Fr.beforeSend;if(!t)return e;const n=He(t)?t:[t];let r=e;for(const s of n)try{const i=s(r);if(!i)return this.R.info("Log was rejected in beforeSend function"),null;r=i}catch(i){return this.R.error("Error in beforeSend function for log:",i),null}return r}Ds(){if(this.Rs===void 0)return!0;const e=Date.now(),t=e-this.xs;return this.As>t&&t>=0||(this.xs=e,this.$s=0,this.Cs=!1),this.Rs>this.$s?(this.$s++,!0):(this.Cs||(this.R.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.As}ms`),this.Cs=!0),!1)}flush(){var e=this;return cn(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return cn(function*(){var t;e.ps.clear();let n=(t=e._instance.getPersistedProperty(ro.LogsQueue))!==null&&t!==void 0?t:[];if(n.length===0)return;const r=n.length;let s=0;for(;n.length>0&&r>s;){var i,o;const c=e._s;e.bs=0;const u=Math.min(n.length,e.Es),d=n.slice(0,u),f=J3(d.map(m=>m.record),e.js(),(i=e.fs)!==null&&i!==void 0?i:e._instance.getLibraryId(),e._instance.getLibraryVersion()),p=yield e._instance.qs(f);if(e._s!==c)return;if(p.kind==="too-large"&&d.length>1)e.Es=Math.max(1,Math.floor(d.length/2)),e.R.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(p),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),p.kind==="retry-later"||(p.kind==="too-large"?e.R.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):p.kind==="ok"&&e.Fr.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Fr.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(d.length),n=(o=e._instance.getPersistedProperty(ro.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,p.kind==="fatal"))throw p.error}})()}Bs(e){var t=this;return cn(function*(){var n;const r=Math.max(0,e-t.bs),s=(n=t._instance.getPersistedProperty(ro.LogsQueue))!==null&&n!==void 0?n:[];t._instance.setPersistedProperty(ro.LogsQueue,s.slice(r)),yield t.vs()})()}js(){return Q3(this.Fr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var t;if(this._instance.optedOut)return;const n=(t=this._instance.getPersistedProperty(ro.LogsQueue))!==null&&t!==void 0?t:[];this.Is>n.length||(n.shift(),this.bs++,this.R.info("Logs queue is full, dropping oldest record.")),n.push(e),this._instance.setPersistedProperty(ro.LogsQueue,n),this.Ts>n.length||this.ws.isOpen()?this.Os():this.gs()}Os(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(nA(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}Ps(){const e=this._instance.getPersistedProperty(ro.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return cn(function*(){t.ps.clear();const n=t.flush().catch(()=>{});e!==void 0?yield Ak(n,e):yield n})()}flushWithTimeout(e){var t=this;return cn(function*(){const n=t.flush();yield Ak(n,e,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=tA(),this.R.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.Ps()&&this.ps.armNoEarlierThan(this.zs())})}};const A9=/^[0-9a-f]+$/;function Zk(e,t,n){return typeof e=="string"&&e.length===t&&e!==n&&A9.test(e)}const I9=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/,O9="00",Jp=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function N_(e){return String(e)+"000000"}function zy(e,t,n,r){let s="";return r&&(s=Object.keys(r).sort().map(i=>`${JSON.stringify(i)}:${JSON.stringify(r[i])}`).join(",")),`${e}\0${t}\0${n??""}\0${s}`}var M9=class{constructor(e,t,n){this._instance=e,this.Fr=t,this.R=n,this.Hs=new Map,this.ps=new eA(()=>this.flush().catch(r=>{this.R.error("Metrics flush failed:",r)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Gs=new Map,this.Qs=new Set,this.Js=!1,this.ws=new M3,this.ks=0,this.Ss=1,this.Zs=0}count(e,t=1,n){this.Ks({name:e,type:"count",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(e,t,n){this.Ks({name:e,type:"gauge",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(e,t,n){this.Ks({name:e,type:"histogram",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes,bounds:He(n==null?void 0:n.bounds)?n.bounds.slice():n==null?void 0:n.bounds})}flush(){var e=this;const t=this.ys,n=(function(){var r=cn(function*(){t&&(yield t.catch(()=>{})),yield e.Ys()});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 e=this.Hs;return this.Xs(),this._o(e)}reset(){this.Zs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.ys=null,this.Xs(),this.Gs=new Map,this.Js=!1}Xs(){this.Hs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Qs=new Set}Ks(e){if(this._instance.isDisabled||this._instance.optedOut)return;const t=this.Fs(e);if(t===null)return;if(!t.name||typeof t.name!="string")return void this.R.warn("Dropping metric with empty name");if(typeof t.value!="number"||!Number.isFinite(t.value))return void this.R.warn(`Dropping metric '${t.name}': value must be a finite number`);if(t.type!=="count"&&t.type!=="gauge"&&t.type!=="histogram")return void this.R.warn(`Dropping metric '${t.name}': unknown type '${String(t.type)}'`);if(t.type==="count"&&0>t.value)return void this.R.warn(`Dropping count '${t.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=t.attributes?N({},t.attributes):void 0,r=zy(t.type,t.name,t.unit,n)}catch(u){return void this.R.warn(`Dropping metric '${t.name}': attributes could not be serialized`,u)}let s,i=this.Hs.get(r);if(!i&&!this.ko()||t.type==="histogram"&&(s=this.So(t.name,t.unit,t.bounds),!s))return;i||(i={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now(),hist:s&&L9(s)},this.Hs.set(r,i));const o=this.Ws.get(t.name);o===void 0?this.Ws.set(t.name,t.type):o===t.type||this.Vs.has(t.name)||(this.Vs.add(t.name),this.R.warn(`Metric name '${t.name}' is already used as a ${o}; recording it as a ${t.type} too will blend both series in charts. Use a distinct name.`)),this.xo(i,t.value);const c=this.$o();c&&(i.exemplar=N(N({},c),{},{value:t.value,timeMs:Date.now()})),this.Os()}$o(){try{var e,t;const n=(function(r){const s=(function(o){if(typeof o!="string")return;const c=I9.exec(o.trim());if(!c)return;const[,u,d,f,p,m]=c;return u==="ff"||u==="00"&&m||!(function(v){return Zk(v,32,"00000000000000000000000000000000")})(d)||!(function(v){return Zk(v,16,"0000000000000000")})(f)?void 0:{version:u,traceId:d,spanId:f,flags:p}})(r);return s&&{traceId:s.traceId,spanId:s.spanId,flags:(i=s.flags,1&parseInt(i,16)?"01":O9)};var i})((e=(t=this._instance).getActiveSpan)===null||e===void 0||(e=e.call(t))===null||e===void 0?void 0:e.traceparent());if(n&&n.flags==="01")return{traceId:n.traceId,spanId:n.spanId}}catch{}}ko(){return this.Fr.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.R.warn(`Metric series cap reached (${this.Fr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}So(e,t,n){if(n!==void 0&&!(function(o){if(!He(o)||o.length===0)return!1;for(let c=0;o.length>c;c++)if(!Number.isFinite(o[c])||c>0&&o[c-1]>=o[c])return!1;return!0})(n))return void this.R.warn(`Dropping histogram '${e}': bounds must be a non-empty array of finite, strictly increasing numbers`);const r=zy("histogram",e,t,void 0),s=this.Gs.get(r);if(s)return this.Co(e,r,s,n),s;if(this.Gs.size>=this.Fr.maxSeriesPerFlush)return this.Js||(this.Js=!0,this.R.warn(`Histogram bounds limit reached (${this.Fr.maxSeriesPerFlush} distinct histograms); new histograms that pass custom bounds are dropped. Reduce histogram name cardinality.`)),n&&!Bk(n,Jp)?void 0:Jp;const i=n?n.slice():Jp;return this.Gs.set(r,i),i}Co(e,t,n,r){Bk(n,r??Jp)||this.Qs.has(t)||(this.Qs.add(t),this.R.warn(`Histogram '${e}' already uses the bounds [${n.join(", ")}]; samples that pass different bounds are recorded in those buckets.`))}xo(e,t){switch(e.type){case"count":var n;e.total=((n=e.total)!==null&&n!==void 0?n:0)+t;break;case"gauge":e.last=t;break;case"histogram":{const r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[(function(s,i){for(let o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(t,r.bounds)]+=1;break}}}Fs(e){const t=this.Fr.beforeSend;if(!t)return e;const n=He(t)?t:[t];let r=e;for(const s of n)try{const i=s(r);if(!i)return this.R.info("Metric was rejected in beforeSend function"),null;r=i}catch(i){return this.R.error("Error in beforeSend function for metric:",i),null}return r}Os(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(nA(this.Fr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Ys(){var e=this;return cn(function*(){if(e.ps.clear(),e.Hs.size===0)return;const t=e.Hs;e.Xs();const n=e.Zs,r=yield e._instance.To(e._o(t));if(n===e.Zs)switch(e.ws.record(r),r.kind==="retry-later"?(e.ks++,e.Ss=tA()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.zs()),r.kind){case"ok":return;case"retry-later":return e.Io(t),void e.ps.armNoEarlierThan(e.zs());case"too-large":return void e.R.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.R.error("Failed to send metrics batch:",r.error)}})()}_o(e){return t=this.Mo(e),n=(function(i,o,c){return q3(i,o,c)})(this.Fr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Y3(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:t}]}]};var t,n,r,s}Mo(e){const t=N_(Date.now()),n=new Map;for(const o of e.values()){var r;const c=zy(o.type,o.name,o.unit,void 0);let u=n.get(c);u||(u=N({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(c,u));const d=w0((r=o.attributes)!==null&&r!==void 0?r:{},this.R),f=N_(o.windowStartMs),p=$9(o.exemplar);if(o.type==="count"){var s;const m=N({attributes:d,startTimeUnixNano:f,timeUnixNano:t,asDouble:(s=o.total)!==null&&s!==void 0?s:0},p);u.sum.dataPoints.push(m)}else if(o.type==="gauge"){var i;const m=N({attributes:d,timeUnixNano:t,asDouble:(i=o.last)!==null&&i!==void 0?i:0},p);u.gauge.dataPoints.push(m)}else{const m=o.hist,v=N({attributes:d,startTimeUnixNano:f,timeUnixNano:t,count:m.count,sum:m.sum,min:m.min,max:m.max,bucketCounts:m.bucketCounts,explicitBounds:m.bounds},p);u.histogram.dataPoints.push(v)}}return Array.from(n.values())}Io(e){for(const[s,i]of e){var t;const o=this.Hs.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,i.windowStartMs),o.exemplar=(t=o.exemplar)!==null&&t!==void 0?t: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":{const c=o.hist,u=i.hist;c.count+=u.count,c.sum+=u.sum,c.min=Math.min(c.min,u.min),c.max=Math.max(c.max,u.max);for(let d=0;c.bucketCounts.length>d;d++)c.bucketCounts[d]+=u.bucketCounts[d];break}}else this.ko()&&this.Hs.set(s,i)}}};function Bk(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function L9(e){return{bounds:e,count:0,sum:0,min:1/0,max:-1/0,bucketCounts:new Array(e.length+1).fill(0)}}function $9(e){return e?{exemplars:[{filteredAttributes:[],timeUnixNano:N_(e.timeMs),asDouble:e.value,traceId:e.traceId,spanId:e.spanId}]}:{}}const rA=(e,{debugEnabled:t}={})=>{const n={N(r,...s){let i;try{i=typeof window>"u"?void 0:window}catch{return}i&&(Yo.DEBUG||i.POSTHOG_DEBUG||t)&&!le(i.console)&&i.console&&("__rrweb_original__"in i.console[r]?i.console[r].__rrweb_original__:i.console[r])(e,...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(e,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>rA(`${e} ${r}`,s)};return n},me=rA("[PostHog.js]"),xn=(e,t)=>me.createLogger(e,t),N9=xn("[ExternalScriptsLoader]"),b0=e=>{const t=Ie==null?void 0:Ie.querySelectorAll("script");if(t){for(let n=0;t.length>n;n++)if(t[n].src===e||t[n].getAttribute("src")===e)return t[n]}},Jc=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return N9.warn(`${t} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=()=>{if(Ie==null||Ie.removeEventListener("DOMContentLoaded",r),e.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");if(!Ie)return n("document not found");let i=Ie.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=u=>{i.__posthog_loading_callback_fired=!0,n(void 0,u)},i.onerror=u=>{i.__posthog_loading_error=u,n(u)},e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(e.config.disable_external_dependency_loading)return n("Loading of external scripts is disabled");const o=b0(i.src);if(o){if(o.integrity!==i.integrity||o.crossOrigin!==i.crossOrigin||o.nonce!==i.nonce)return n("Existing script conflicts with prepared script policy");if(o.__posthog_loading_callback_fired)return n();const u=o.__posthog_loading_error;return u?n(u):(o.addEventListener("load",d=>{o.__posthog_loading_callback_fired=!0,n(void 0,d)}),void o.addEventListener("error",d=>{o.__posthog_loading_error=d,n(d)}))}if(!Ie.body)return s();if(e.config.external_scripts_inject_target==="head")Ie.head.appendChild(i);else{const u=Ie.querySelectorAll("body > script");var c;u.length>0?(c=u[0].parentNode)===null||c===void 0||c.insertBefore(i,u[0]):Ie.body.appendChild(i)}},s=()=>{Ie==null||Ie.addEventListener("DOMContentLoaded",r)};Ie!=null&&Ie.body||b0(t)?r():s()},Hy={},Wk=(e,t)=>{let n=`/static/${t}.js?v=${e.version}`;return t==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),e.requestRouter.endpointFor("assets",n)};et.__PosthogExtensions__=et.__PosthogExtensions__||{},et.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t==="remote-config"){const s=e.requestRouter.endpointFor("assets",`/array/${e.config.token}/config.js`);return void Jc(e,s,n)}const r=e.config.strict_script_versioning;if(r){const s=e.requestRouter.endpointFor("assets",`/static/${e.version}/${t}.js`),i=Hy[s];if(r==="fallback"&&i){if(b0(i))return void Jc(e,i,n);delete Hy[s]}return void Jc(e,s,r==="fallback"?(o,c)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=Wk(e,t);Hy[s]=d;const f=b0(s);f==null||(u=f.parentNode)===null||u===void 0||u.removeChild(f),Jc(e,d,n)}else n(void 0,c)}:n)}Jc(e,Wk(e,t),n)},et.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{const r=e.requestRouter.endpointFor("api",t);Jc(e,r,n)},Yo.DEBUG=!1,Yo.LIB_VERSION="1.447.3",Yo.LIB_NAME="web";var Es=Yo;const D_="$early_access_features",Ko="$active_feature_flags",uc="$feature_flag_details",ih="$feature_flag_errors",tl="$feature_flag_evaluated_at",dc="$feature_flag_request_id",jf="$minimal_flag_called_events",Ni="$enabled_feature_flags",qa="$stored_group_properties",Ya="$stored_person_properties",lo="$flag_call_reported",kf="$flag_call_reported_session_id",Xa="$feature_flag_payloads",no="$override_feature_flags",ql="$override_feature_flag_payloads",Ru="visibilitychange",sA="$autocapture_disabled_server_side",Cf="$surveys",x0="$surveys_loaded_at",F_="PostHog loadExternalDependency extension not found.",j_="$surveys_activated",zm="$surveys_activated_session",Hm="$surveys_activated_timestamps",D9="$people_distinct_id",ui="distinct_id",J2="$device_id",Uy="$device_model",S0="__alias",F9="__cmpns",Kk="$fbc",Tu="$fbc_persistence",Gk="$fbp",Vf="$fbp_persistence",V_="__timers",z_="$heatmaps_enabled_server_side",H_="$exception_capture_enabled_server_side",iA="$error_tracking_suppression_rules",U_="$error_tracking_capture_extension_exceptions",Z_="$web_vitals_enabled_server_side",eb="$dead_clicks_enabled_server_side",tb="$product_tours_enabled_server_side",oA="$logs_capture_enabled_server_side",aA="$web_vitals_allowed_metrics",zf="$session_recording_remote_config",j9="$session_recording_enabled_server_side",V9="$replay_sample_rate",z9="$replay_override_sampling",H9="$replay_override_linked_flag",U9="$replay_override_url_trigger",Z9="$replay_override_event_trigger",yu="$sesid",lA="$session_is_sampled",B9="$session_past_minimum_duration",W9="$session_recording_url_trigger_activated_session",K9="$session_recording_event_trigger_activated_session",G9="$debug_first_full_snapshot_timestamp",q9="$sess_rec_flush_size",cA="$groups",B_="ph_product_tours",Y9="$product_tours_activated",X9="$product_tours_activated_session",Q9="$conversations_widget_session_id",J9="$conversations_ticket_id",ej="$conversations_widget_state",tj="$conversations_user_traits",Qr="$user_state",W_="$client_session_props",uA="$capture_rate_limit",dA="$initial_campaign_params",fA="$initial_referrer_info",_u="$initial_person_info",nb="$epp",Zy="$posthog_cookieless",hA="$cookieless_mode",pA="$sdk_debug_extensions_init_method",mA="$sdk_debug_extensions_init_time_ms",rb="$sdk_debug_recording_script_not_loaded",sb="$sdk_debug_replay_stale_config",gA="$sdk_debug_replay_event_trigger_status",vA="$sdk_debug_replay_linked_flag_trigger_status",yA="$sdk_debug_replay_matched_recording_trigger_groups",_A="$sdk_debug_replay_pending_trigger_conditions",wA="$sdk_debug_replay_remote_trigger_matching_config",bA="$sdk_debug_replay_trigger_groups_count",xA="$sdk_debug_replay_url_trigger_status",nj="$session_recording_start_reason",Go="anonymous",Um="identified",SA="identified_only",E0="beforeunload",ib="$pageview",qk="$pageleave",EA="$identify",Yk="$groupidentify";function wu(e,t){He(e)&&e.forEach(t)}function Zt(e,t){if(!ot(e))if(He(e))e.forEach(t);else if((n=>n instanceof FormData)(e))e.forEach((n,r)=>t(n,r));else for(const n in e)K2.call(e,n)&&t(e[n],n)}const pn=function(e,...t){for(const n of t)for(const r in n)n[r]!==void 0&&(e[r]=n[r]);return e};function Zm(e){const t=Object.keys(e);let n=t.length;const r=new Array(n);for(;n--;)r[n]=[t[n],e[t[n]]];return r}const rj=function(e){return function(...t){try{return e.apply(this,t)}catch(n){me.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),me.critical(n)}}},ob=function(e){const t={};return Zt(e,function(n,r){(ft(n)&&n.length>0||Fn(n))&&(t[r]=n)}),t};function kA(e){const t=N({},e);for(const n of["name","message","stack","cause","errors"])try{n in e&&(t[n]=e[n])}catch{}return t}const sj=["herokuapp.com","vercel.app","netlify.app"];function ij(e){const t=e==null?void 0:e.hostname;if(!ft(t))return!1;const n=t.split(".").slice(-2).join(".");for(const r of sj)if(n===r)return!1;return!0}function $t(e,t,n,r){const{capture:s=!1,passive:i=!0}=r??{};e==null||e.addEventListener(t,n,{capture:s,passive:i})}function By(e){return e.name==="ph_toolbar_internal"}const Hf=e=>{if(Ie){try{const t=e+"=",n=Ie.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(t)===0)return decodeURIComponent(s.substring(t.length,s.length))}}catch{}return null}};var oj=class K_{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,s){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>t||0>n||0>r||0>s||t>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");const i=new Uint8Array(16);return i[0]=t/Math.pow(2,40),i[1]=t/Math.pow(2,32),i[2]=t/Math.pow(2,24),i[3]=t/Math.pow(2,16),i[4]=t/256,i[5]=t,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 K_(i)}toString(){let t="";for(let n=0;this.bytes.length>n;n++)t=t+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new K_(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let n=0;16>n;n++){const r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}},aj=class{generate(){const e=this.generateOrAbort();if(!le(e))return e;{this.Tt=0;const t=this.generateOrAbort();if(le(t))throw new Error("Could not generate UUID after timestamp reset");return t}}generateOrAbort(){const e=(()=>{const t=Date.now();return Fn(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(e>this.Tt)this.Tt=e,this.It();else{if(this.Tt>=e+1e4)return;this.Mt++,this.Mt>4398046511103&&(this.Tt++,this.It())}return oj.fromFieldsV7(this.Tt,Math.trunc(this.Mt/Math.pow(2,30)),this.Mt&Math.pow(2,30)-1,this.At.nextUint32())}It(){this.Mt=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Tt=0,this.Mt=0,this.At=new lj}};const Xk=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};let Qk;var lj=class{nextUint32(){var e;return this.Rt.length>this.Et||(((e=Qk)!==null&&e!==void 0?e:Qk="u">typeof window&&!le(window.crypto)&&crypto.getRandomValues?t=>{try{return crypto.getRandomValues(t)}catch{return Xk(t)}}:Xk)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let Jk;const Di=()=>cj().toString(),cj=()=>(Jk||(Jk=new aj)).generate();let uf="";const uj=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let eu=null;const gn={Ot(){if(!kn(eu))return eu;if(eu=!1,Ie)try{const e=`__ph_cookie_support_${Di()}`;gn.$t(e,"xyz"),eu=Hf(e)==='"xyz"',gn.Dt(e)}catch{eu=!1}return eu},Pt(e){me.error("cookieStore error: "+e)},Lt:Hf,Ft(e){let t;try{t=JSON.parse(gn.Lt(e))||{}}catch{}return t},$t(e,t,n,r,s){if(!Ie)return!1;try{let i="",o="";const c=(function(d,f){if(f){let p=(function(m,v=Ie){if(uf)return uf;if(!v||["localhost","127.0.0.1"].includes(m))return"";const _=m.split(".");let w=Math.min(_.length,8);const b="dmn_chk_"+Di();for(;!uf&&w--;){const S=_.slice(w).join("."),E=b+"=1;domain=."+S+";path=/";v.cookie=E+";max-age=3",v.cookie.includes(b)&&(v.cookie=E+";max-age=0",uf=S)}return uf})(d);if(!p){const m=(v=>{const _=v.match(uj);return _?_[0]:""})(d);m!==p&&me.info("Warning: cookie subdomain discovery mismatch",m,p),p=m}return p?"; domain=."+p:""}return""})(Ie.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const u=e+"="+encodeURIComponent(JSON.stringify(t))+i+"; SameSite=Lax; path=/"+c+o;return u.length>3686.4&&me.warn("cookieStore warning: large cookie, len="+u.length),Ie.cookie=u,!0}catch{return!1}},Dt(e,t){if(Ie!=null&&Ie.cookie&&(!t||!kn(Hf(e))))try{gn.$t(e,"",-1,t)}catch{return}}};let Wy=null;const It={Ot(){if(!kn(Wy))return Wy;let e=!0;if(le(ie))e=!1;else try{const t="__mplssupport__";It.$t(t,"xyz"),It.Lt(t)!=='"xyz"'&&(e=!1),It.Dt(t)}catch{e=!1}return e||me.error("localStorage unsupported; falling back to cookie store"),Wy=e,e},Pt(e){me.error("localStorage error: "+e)},Lt(e){try{return ie==null?void 0:ie.localStorage.getItem(e)}catch(t){It.Pt(t)}return null},Ft(e){try{return JSON.parse(It.Lt(e))||{}}catch{}return null},$t(e,t){try{return ie==null||ie.localStorage.setItem(e,JSON.stringify(t)),!0}catch(n){It.Pt(n)}return!1},Dt(e){try{ie==null||ie.localStorage.removeItem(e)}catch(t){It.Pt(t)}}},Ky=[Ya,Ko,Ni,uc,Xa,dc,tl,ih,lo],Yl=[J2,ui,yu,lA,nb,_u,Tu,Qr],Uf=e=>e+"_cpm",dj=["__proto__","constructor","prototype"],Gy=e=>{if(!ut(e))return{};const t={};return Object.keys(e).forEach(n=>{dj.indexOf(n)===-1&&(t[n]=e[n])}),t},qy=(e,t=[])=>{const n={};return[...Yl,...t].forEach(r=>{const s=e[r];le(s)||kn(s)||s===""||(n[r]=s)}),n},CA=e=>{let t=5381,n=2166136261;for(let r=0;e.length>r;r++){const s=e.charCodeAt(r);t=33*t^s,n=Math.imul(n^s,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(n>>>0).toString(36)},e6=(e,t)=>({p:t,f:CA(JSON.stringify(e))}),t6=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{const n=gn.Ft(Uf(e)),r=(n==null?void 0:n.f)===CA(t)&&He(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},Yy=(e,t)=>t+"|"+(gn.Lt(Uf(e))||""),tu={},G_={Ot:()=>!0,Pt(e){me.error("memoryStorage error: "+e)},Lt:e=>e in tu?tu[e]:null,Ft:e=>e in tu?tu[e]:null,$t:(e,t)=>(tu[e]=t,!0),Dt(e){delete tu[e]}};let Fl=null;const ln={Ot(){if(!kn(Fl))return Fl;if(Fl=!0,le(ie))Fl=!1;else try{const e="__support__";ln.$t(e,"xyz"),ln.Lt(e)!=='"xyz"'&&(Fl=!1),ln.Dt(e)}catch{Fl=!1}return Fl},Pt(e){me.error("sessionStorage error: ",e)},Lt(e){try{return ie==null?void 0:ie.sessionStorage.getItem(e)}catch(t){ln.Pt(t)}return null},Ft(e){try{return JSON.parse(ln.Lt(e))||null}catch{}return null},$t(e,t){try{return ie==null||ie.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(n){ln.Pt(n)}return!1},Dt(e){try{ie==null||ie.sessionStorage.removeItem(e)}catch(t){ln.Pt(t)}}};var fj=class{constructor(e){this._instance=e}get Fr(){return this._instance.config}get consent(){return this.Fl()?0:this.Dl}isOptedOut(){return this.Fr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Fr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Fr.opt_out_capturing_by_default}optInOut(e){this.Ll.$t(this.Nl,e?1:0,this.Fr.cookie_expiration,this.Fr.cross_subdomain_cookie,this.Fr.secure_cookie)}reset(){this.Ll.Dt(this.Nl,this.Fr.cross_subdomain_cookie)}get Nl(){const{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:"__ph_opt_in_out_"+e)}get Dl(){const e=this.Ll.Lt(this.Nl);return Oy(e)?1:We(cF,e)?0:-1}get Ll(){const e=this.Fr.opt_out_capturing_persistence_type,t=e==="localStorage"?It:gn,n=t.Ot()?t:G_;if(!this.jl||this.jl!==n){this.jl=n;const r=e==="localStorage"?gn:It;r.Lt(this.Nl)&&(this.jl.Lt(this.Nl)||this.optInOut(Oy(r.Lt(this.Nl))),r.Dt(this.Nl,this.Fr.cross_subdomain_cookie))}return this.jl}Fl(){return!!this.Fr.respect_dnt&&[Dr==null?void 0:Dr.doNotTrack,Dr==null?void 0:Dr.msDoNotTrack,et.doNotTrack,Dr==null?void 0:Dr.globalPrivacyControl].some(e=>Oy(e))}};function PA(e,t){var n;const r=e==null||(n=e.config)===null||n===void 0?void 0:n.get_current_url;if(!On(r))return t;try{const s=r(t);return ft(s)&&s?s:t}catch(s){return me.error("Error in get_current_url, falling back to window.location.href",s),t}}function n6(e){var t;return e instanceof Element&&(e.id==="__POSTHOG_TOOLBAR__"||!!(!((t=e.closest)===null||t===void 0)&&t.call(e,".toolbar-global-fade-container")))}function pi(e){return!!e&&e.nodeType===1}function Xn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function RA(e){return!!e&&e.nodeType===3}function k0(e){return!!e&&e.nodeType===11&&pi(e.host)}function ab(e){return e?qu(e).split(/\s+/):[]}function r6(e,t){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:PA(r,o)})(t);return!!(n&&e&&e.some(r=>n.match(r)))}function fc(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return ab(t)}function TA(e){return ot(e)?null:qu(e).split(/(\s+)/).filter(t=>Au(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function oh(e){let t="";return nl(e)&&!Yu(e)&&e.childNodes&&e.childNodes.length&&Zt(e.childNodes,function(n){var r;RA(n)&&n.textContent&&(t+=(r=TA(n.textContent))!==null&&r!==void 0?r:"")}),qu(t)}function Zf(e){var t;return le(e.target)?e.srcElement||null:!((t=e.target)===null||t===void 0)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}const lb=["a","button","form","input","select","textarea","label"];function Pf(e,t){const n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch{return!1}}function q_(e,t){if(le(t))return!0;for(const n of e)if(t.some(r=>Pf(n,r)))return!0;return!1}function AA(e){const t=e.parentNode;return!(!t||!pi(t))&&t}const em=[".ph-no-autocapture","[data-ph-no-autocapture]"],IA=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],cb=[...IA,"+","-","−","–"],s6=cb.length+10,hj=["button","a","input","select","textarea","label"],pj=["button","link","tab","menuitem","option"],i6=(e,t)=>/[a-z0-9]/i.test(t)?We(cb,t)?new RegExp(`\\b${t}\\b`).test(e):e.includes(t):e===t,mj=e=>We(hj,e.tagName.toLowerCase())||We(pj,(e.getAttribute("role")||"").toLowerCase());function Xy(e){let t="",n="";const r=o=>{pi(o)&&nl(o)&&!Yu(o)&&(t+=` ${oh(o)}`,n=n||o.getAttribute("aria-label")||"",Zt(o.childNodes,r))};r(e),t=qu(t.replace(/\s+/g," "));const s=(Au(t)?t:"").toLowerCase(),i=e.getAttribute("aria-label")||(s?"":n);return{safeText:s,ariaLabel:qu(i).toLowerCase()}}const o6=[".ph-no-rageclick",".ph-no-capture"],gj=["","text","search","email","password","url","tel","number"];function OA(e,t){if(!(!(typeof window>"u")&&window)||ub(e))return!1;let n,r,s;var i,o;if(ds(t)?(n=!!t&&o6,r=void 0,s=!1):(n=(i=t==null?void 0:t.css_selector_ignorelist)!==null&&i!==void 0?i:o6,r=t==null?void 0:t.content_ignorelist,s=(o=t==null?void 0:t.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&(function(u){return!(!u||!pi(u))&&(!!Xn(u,"textarea")||(Xn(u,"input")?We(gj,(u.getAttribute("type")||"").toLowerCase()):(function(d){var f;if(d.isContentEditable)return!0;const p=(f=d.getAttribute)===null||f===void 0?void 0:f.call(d,"contenteditable");return p==="true"||p===""})(u)))})(e))return!1;const{targetElementList:c}=MA(e,!1);return!(r&&(function(u,{safeText:d,ariaLabel:f}){let p;if(u===!0)p=IA;else{if(!He(u))return!1;if(u.length>s6)return me.error(`[PostHog] content_ignorelist array cannot exceed ${s6} items. Use css_selector_ignorelist for more complex matching.`),!1;p=u.map(m=>m.toLowerCase())}return p.some(m=>i6(d,m)||i6(f,m))})(r,(function(u,d){for(const p of d)if(mj(p))return Xy(p);for(const p of d){try{var f;if(((f=window)===null||f===void 0?void 0:f.getComputedStyle(p).getPropertyValue("cursor"))!=="pointer")break}catch{break}const m=Xy(p);if(m.safeText||m.ariaLabel)return m}return Xy(u)})(e,c))||q_(c,n))}const ub=e=>!e||Xn(e,"html")||!pi(e),MA=(e,t)=>{const n=typeof window>"u"?void 0:window;if(!n||ub(e))return{parentIsUsefulElement:!1,targetElementList:[]};let r=!1;const s=[e];let i=e;for(;i.parentNode&&!Xn(i,"body");){if(k0(i.parentNode)){s.push(i.parentNode.host),i=i.parentNode.host;continue}const o=AA(i);if(!o)break;if(t||lb.indexOf(o.tagName.toLowerCase())>-1)r=!0;else try{const c=n.getComputedStyle(o);c&&c.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}s.push(o),i=o}return{parentIsUsefulElement:r,targetElementList:s}};function nl(e){const t=new Set;let n=0;for(let i=e;i.parentNode&&!Xn(i,"body");i=i.parentNode){if(n++>=1e3||t.has(i))return!1;t.add(i);const o=fc(i);if(We(o,"ph-sensitive")||We(o,"ph-no-capture"))return!1}if(We(fc(e),"ph-include"))return!0;const r=e.type||"";if(ft(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=e.name||e.id||"";return!ft(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 Yu(e){return!!(Xn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Xn(e,"select")||Xn(e,"textarea")||e.getAttribute("contenteditable")==="true")}const a6=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}))$"),l6=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,vj=[16,15,14,13],yj=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),c6=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),u6=/[0-9A-Za-z_]/;function _j(e){let t=0,n=!1;for(let r=e.length-1;r>=0;r--){let s=e.charCodeAt(r)-48;n&&(s*=2,s>9&&(s-=9)),t+=s,n=!n}return t%10==0}function Au(e,t=!0){return!(ot(e)||ft(e)&&(e=qu(e),(t?a6.test((e||"").replace(/[- ]/g,"")):(function(n){let r;for(l6.lastIndex=0;r=l6.exec(n);){const s=r[2];if(!s)continue;const i=s.replace(/[- ]/g,"");for(let o=0;i.length>o;o++)for(const c of vj){const u=o+c;if(i.length>=u){const d=i.slice(o,u);if(a6.test(d)&&_j(d))return!0}}}return!1})(e))||(t?yj.test(e):(function(n){let r;for(c6.lastIndex=0;r=c6.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&u6.test(s)&&u6.test(i)))return!0}return!1})(e))))}function d6(e){let t=oh(e);return t=`${t} ${LA(e)}`.trim(),Au(t)?t:""}function LA(e){let t="";return e&&e.childNodes&&e.childNodes.length&&Zt(e.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=oh(n);t=`${t} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(t=`${t} ${LA(n)}`.trim())}catch(s){me.error("[AutoCapture]",s)}}),t}function f6(e){return e.replace(/"|\\"/g,'\\"')}function wj(e){const t=e.attr__class;if(t)return He(t)?t:ab(t)}const tm=xn("[Dead Clicks]"),bj=()=>!0,xj=e=>{var t;const n=!!(!((t=e.instance.persistence)===null||t===void 0)&&t.get_property(eb)),r=e.instance.config.capture_dead_clicks;return ds(r)?r:!!ut(r)||n};var h6=class{get lazyLoadedDeadClicksAutocapture(){return this.ql}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;const t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[eb]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bl(()=>{this.zl()}):this.stop()}Bl(e){var t,n,r;!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture?e():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?tm.error("failed to load script",s):e()})}zl(){var e;if(Ie){if(!this.ql&&(!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture)){const t=ut(this.instance.config.capture_dead_clicks)?N({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.ql=et.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.ql.start(Ie),tm.info("starting...")}}else tm.error("`document` not found. Cannot start.")}stop(){this.ql&&(this.ql.stop(),this.ql=void 0,tm.info("stopping..."))}};const df=xn("[SegmentIntegration]");function p6(e,t,n=!0){const r=e.config.segment;if(!r)return t();const{analytics:s,filterProperties:i}=(c=>On(c.register))(o=r)?{analytics:o}:o;var o;(function(c,u,d,f){const p=v=>{const _=()=>v.anonymousId()||Di();c.config.get_device_id=_,f&&v.id()&&(c.register({distinct_id:v.id(),$device_id:_()}),c.persistence.set_property(Qr,Um)),d(f?void 0:v.anonymousId()||void 0)},m=u.user();"then"in m&&On(m.then)?m.then(p):p(m)})(e,s,c=>{s.register(((u,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||df.warn("This browser does not have Promise support, and can not use the segment integration");const p=(m,v)=>{if(!v)return m;const _=!!d&&m.event.anonymousId===d&&!m.event.userId;_||m.event.userId||m.event.anonymousId===u.get_distinct_id()||(df.info("No userId set, resetting PostHog"),u.reset()),_||(d=void 0),m.event.userId&&m.event.userId!==u.get_distinct_id()&&(df.info("UserId set, identifying with PostHog"),u.identify(m.event.userId));let w=u.calculateEventProperties(v,m.event.properties);if(!ot(f)){const b=m.event.properties||{},S={};for(const C of Object.keys(w))K2.call(b,C)||(S[C]=w[C]);const E=((C,R)=>{const T=He(C)?C:[C];let O=N({},R);for(const M of T)try{if(O=M(O),ot(O))return null}catch(A){return df.error("Error in Segment filterProperties:",A),null}return O})(f,S);if(ot(E))return m;w=E}return m.event.properties=Object.assign({},w,m.event.properties),m};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(m){return p(m,m.event.event)},page(m){return p(m,ib)},identify(m){return p(m,EA)},screen(m){return p(m,"$screen")}}})(e,c,{filterProperties:i})).then(()=>{t()},u=>{df.error("Failed to register the Segment integration",u),t()})},n)}const $A="posthog-js";function NA(e,{organization:t,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var c,u,d,f,p;if(s!=="*"&&!s.includes(o.level)||!e.__loaded)return o;o.tags||(o.tags={});const m=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);o.tags["PostHog Person URL"]=m,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));const v=((c=o.exception)===null||c===void 0?void 0:c.values)||[],_=v.map(S=>N(N({},S),{},{stacktrace:S.stacktrace?N(N({},S.stacktrace),{},{type:"raw",frames:(S.stacktrace.frames||[]).map(E=>N(N({},E),{},{platform:"web:javascript"}))}):void 0})),w={$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:_,$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:(p=v[0])===null||p===void 0?void 0:p.type,$sentry_tags:o.tags};var b;return t&&n&&(w.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+o.event_id),i&&((b=e.exceptions)===null||b===void 0||b.sendExceptionEvent(w)),o}}var Sj=class{constructor(e,t,n,r,s,i){this.name=$A,this.setupOnce=function(o){o(NA(e,{organization:t,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},m6=class{constructor(e){this.Hl=(t,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(me.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.Ul=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Wl()}Wl(){var e;this.Vl=(e=this._instance.sessionManager)===null||e===void 0?void 0:e.onSessionId(this.Hl)}destroy(){var e;(e=this.Vl)===null||e===void 0||e.call(this),this.Vl=void 0}doPageView(e,t){var n;const r=this.Gl(e,t);return this.Ul={pathname:(n=ie==null?void 0:ie.location.pathname)!==null&&n!==void 0?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.Gl(e,(t=this.Ul)===null||t===void 0?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Ul)===null||e===void 0?void 0:e.pageViewId}}Gl(e,t){const n=this.Ul;if(!n)return{$pageview_id:t};let r={$pageview_id:t,$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:c,maxContentHeight:u,lastContentY:d,maxContentY:f}=s;if(!(le(i)||le(o)||le(c)||le(u)||le(d)||le(f))){i=Math.ceil(i),o=Math.ceil(o),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);const p=i>1?fo(o/i,0,1,me):1,m=i>1?fo(c/i,0,1,me):1,v=u>1?fo(d/u,0,1,me):1,_=u>1?fo(f/u,0,1,me):1;r=pn(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:c,$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:_})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}};const ff=["flags","surveys"],Ej={[D9]:{exposure:"hidden"},[S0]:{exposure:"hidden"},[F9]:{exposure:"hidden"},[V_]:{exposure:"hidden"},[Tu]:{exposure:"hidden"},[Vf]:{exposure:"hidden"},[sA]:{exposure:"event"},[z_]:{exposure:"hidden"},[oA]:{exposure:"hidden"},[H_]:{exposure:"event"},[iA]:{exposure:"hidden"},[U_]:{exposure:"event"},[Z_]:{exposure:"event"},[eb]:{exposure:"event"},[tb]:{exposure:"hidden"},[aA]:{exposure:"event"},[zf]:{exposure:"hidden"},[j9]:{exposure:"hidden"},[yu]:{exposure:"hidden"},[lA]:{exposure:"event"},[V9]:{exposure:"event",shouldSkipFromEventProperties:e=>kn(e)},[B9]:{exposure:"event"},[W9]:{exposure:"event"},[K9]:{exposure:"event"},[G9]:{exposure:"event"},[q9]:{exposure:"hidden"},[Ni]:{exposure:"hidden",storageGroup:"flags"},[Ko]:{exposure:"hidden",storageGroup:"flags"},[D_]:{exposure:"hidden"},[uc]:{exposure:"hidden",storageGroup:"flags"},[Xa]:{exposure:"hidden",storageGroup:"flags"},[dc]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[jf]:{exposure:"hidden",storageGroup:"flags"},[no]:{exposure:"hidden"},[ql]:{exposure:"hidden"},[Ya]:{exposure:"hidden"},[qa]:{exposure:"hidden"},[Cf]:{exposure:"hidden",storageGroup:"surveys"},[x0]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[j_]:{exposure:"event"},[zm]:{exposure:"hidden"},[Hm]:{exposure:"hidden"},[B_]:{exposure:"hidden"},[Y9]:{exposure:"hidden"},[X9]:{exposure:"hidden"},[Q9]:{exposure:"event"},[J9]:{exposure:"event"},[ej]:{exposure:"event"},[tj]:{exposure:"event"},[lo]:{exposure:"hidden"},[kf]:{exposure:"hidden"},[cA]:{exposure:"event"},[ih]:{exposure:"hidden"},[tl]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Qr]:{exposure:"hidden"},[W_]:{exposure:"hidden"},[uA]:{exposure:"hidden"},[dA]:{exposure:"hidden"},[fA]:{exposure:"hidden"},[_u]:{exposure:"hidden"},[nb]:{exposure:"hidden"},[z9]:{exposure:"event"},[H9]:{exposure:"event"},[U9]:{exposure:"event"},[Z9]:{exposure:"event"},[pA]:{exposure:"event"},[mA]:{exposure:"event"},[rb]:{exposure:"hidden"},[sb]:{exposure:"hidden"},[gA]:{exposure:"hidden"},[vA]:{exposure:"hidden"},[yA]:{exposure:"hidden"},[_A]:{exposure:"hidden"},[wA]:{exposure:"hidden"},[bA]:{exposure:"hidden"},[xA]:{exposure:"hidden"},[nj]:{exposure:"event"}},kj=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Er=e=>{const t=Ej[e];if(t)return t;for(const[n,r]of kj)if(e.indexOf(n)===0)return r};function db(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const vo=e=>{const t=typeof document>"u"?void 0:document,n=t==null?void 0:t.createElement("a");return le(n)?null:(n.href=e,n)},DA=()=>{try{return"u">typeof window&&window.navigator.onLine!==!1}catch{return!1}},FA=(e,t)=>e>=t&&DA(),jA=(e,t,n,r)=>{if(e===0){if(DA()){const s=t+1;return s===n&&r(),s}return t}return 0},bu=(e,t)=>{try{let n;return JSON.stringify(e,(r,s)=>{var i;return wd(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,kA(s)),n.get(s)):typeof s=="bigint"?s.toString():s},t)}catch{return e3(e)}},Xu=function(e,t){const n=((e.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]===t){r=i;break}}if(!He(r)||2>r.length)return"";{let s=r[1].replace(/\+/g," ");try{s=decodeURIComponent(s)}catch{me.error("Skipping decoding for malformed query param: "+s)}return s}},ah=function(e,t,n){if(!e||!t||!t.length)return e;const r=e.split(/#(.*)/),s=r[1],i=(r[0]||"").split(/\?(.*)/),o=i[1],c=i[0],u=(o||"").split("&"),d=[];for(let p=0;u.length>p;p++){const m=u[p].split("?");let v=0;for(;m.length>v&&!t.includes(m[v].split("=")[0]);)v++;d.push(m.length>v?m.slice(0,v).concat(m[v].split("=")[0]+"="+n).join("?"):u[p])}let f=c;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},C0=function(e,t){const n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Qu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],Cj=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Qu],lh="<masked>",Pj=["li_fat_id"];function VA(e,t,n){if(!Ie)return{};const r=t?[...Qu,...n||[]]:[],s=zA(ah(Ie.URL,r,lh),e),i=(function(){const o={};return Zt(Pj,function(c){const u=Hf(c);o[c]=u||null}),o})();return pn(i,s)}function zA(e,t){const n=Cj.concat(t||[]),r={};return Zt(n,function(s){const i=Xu(e,s);r[s]=i||null}),r}function HA(e){const t=(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})(e),n=t!="yahoo"?"q":"p",r={};if(!kn(t)){r.$search_engine=t;const s=Ie?Xu(Ie.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function UA(){return navigator.language||navigator.userLanguage}function Rj(){const e=UA();return typeof e=="string"?e.split("-")[0]:void 0}const P0="$direct";function ZA(){return(Ie==null?void 0:Ie.referrer)||P0}function BA(e,t,n=!1){const r=e?[...Qu,...t||[]]:[],s=n?el(an==null?void 0:an.href):an==null?void 0:an.href,i=s==null?void 0:s.substring(0,1e3);return{r:ZA().substring(0,1e3),u:i?ah(i,r,lh):void 0}}function WA(e,t=!1){var n;const{r,u:s}=e,i=t?el(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==P0?P0:(n=vo(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const c=vo(i);o.$host=c==null?void 0:c.host,o.$pathname=c==null?void 0:c.pathname;const u=zA(i);pn(o,u)}if(r){const c=HA(r);pn(o,c)}return o}function Tj(){try{return new Date().getTimezoneOffset()}catch{return}}const Aj={flags:tl,surveys:x0},Ij=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],nm=e=>`${e}_cookie_identity_change_pending`,rm=e=>{let t="",n=0;for(const r of e){const s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;t+=r,n+=s}return t},tr="main",Vo=[Ni,Ko,uc,Xa,dc,tl,jf,Ya],Qy=e=>Vo.indexOf(e)!==-1,KA=[Tu,Vf],g6=e=>KA.indexOf(e)!==-1,Ta=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}},nu=e=>{if(!e)return{};const t=JSON.parse(e);return ut(t)?t:{}},v6=(e,t)=>{Zt(e,(n,r)=>{const s=Er(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(t,r)||delete e[r]})};var Jy=class{constructor(e,t,n=!0,r=!e.cookieless_mode){if(this.Ql={},this.Jl=!1,this.Zl=!1,this.Kl=!1,this.Yl=!1,this.Xl=!1,this.tu=new Map,this.eu=!1,this.iu=!1,this.nu=!1,this.su=new Set,this.ru=new Set,this.Fr=e,this.ou=n,this.props={},this.au=void 0,this.lu=(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"})(e),this.fi=e.disable_persistence||!!t,this.Ll=this.uu(e),this.Kl=this.cu(e),this.load(r),this.hu(),e.debug&&me.info("Persistence loaded",e.persistence,N({},this.props)),this.update_config(e,e,t),this.save(),ie){const s=()=>this.flush();$t(ie,"beforeunload",s,{capture:!1}),$t(ie,"pagehide",s,{capture:!1}),this.du=i=>{if(this.Jl&&(!i.storageArea||i.storageArea===(ie==null?void 0:ie.localStorage))&&i.key)if(i.key!==this.lu){if(this.Kl){const o=ff.find(c=>i.key===this.vu(c));o&&this.fu(i.key,o)}}else this.fu(i.key,tr)},$t(ie,"storage",this.du)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([t,n])=>{const r=this.tu.get(t);if(!Qy(t)||r===!0)return;if(n===!0)return void this.pu(t,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.pu(t,s)})}onCrossTabFeatureFlagChange(e){return this.ru.add(e),()=>this.ru.delete(e)}destroy(){this.du&&ie&&(ie.removeEventListener("storage",this.du),this.du=void 0),this.ru.clear()}fu(e,t,n=!0){if(this.fi)return!1;let r,s;try{if(s=It.Lt(e),kn(s)){const c=this.gu(t);return c.storageValue=null,t!==tr&&(c.persisted=!1),!1}r=nu(s)}catch{return!1}const i=t===tr?r:It.Ft(this.lu);if(i&&this.mu(i))return!1;const o=this.yu(r,t,n);return t===tr&&this.Kl&&!Ta(this.bu().main,r)||this._u(r,t,!0,s),o}mu(e){const t=this.props[ui],n=e[ui];return!le(t)&&!le(n)&&t!==n}_u(e,t,n,r){const s=this.gu(t);s.storageValue=r,t!==tr&&(s.persisted=n);try{s.fingerprint=this.wu(e,t)}catch{s.fingerprint=void 0}}yu(e,t,n){let r=!1;return Vo.forEach(s=>{var i;const o=(i=Er(s))===null||i===void 0?void 0:i.storageGroup;if(t===tr&&this.Kl&&o||t!==tr&&o!==t)return;const c=s in e,u=this.ku(s,c?e[s]:void 0),d=this.tu.has(s)?s in this.props:c;d===s in this.props&&Ta(u,this.props[s])||(d?this.Su(s,u,!1):this.xu(s,!1),r=!0)}),r&&n&&this.ru.forEach(s=>s()),r}$u(){if(!this.Jl)return!1;try{this.nu=!1;const e=It.Lt(this.lu),t=this.gu(tr);let n,r=!1,s=!1;if(e!==t.storageValue)if(kn(e))t.storageValue=null;else{if(n=nu(e),this.nu=!this.iu&&this.mu(n),this.nu)return!1;s=this.yu(n,tr,!1),!this.Kl||Ta(this.bu().main,n)?this._u(n,tr,!0,e):t.storageValue=e,r=!0}return this.Kl&&ff.forEach(i=>{const o=It.Lt(this.vu(i)),c=this.gu(i),u=n||{},d=r&&Vo.some(p=>{var m;return((m=Er(p))===null||m===void 0?void 0:m.storageGroup)===i&&p in u});if(o===c.storageValue&&!d)return;if(kn(o))return c.storageValue=null,c.persisted=!1,void(d&&(s=this.yu(u,i,!1)||s));const f=nu(o);s=this.yu(f,i,!1)||s,this._u(f,i,!0,o)}),s}catch{return!1}}pu(e,t){this.tu.set(e,t);const n=Er(e);n!=null&&n.volatile||(this.gu((this.Kl?n==null?void 0:n.storageGroup:void 0)||tr).fingerprint=void 0,this.Cu(e))}Tu(){Vo.forEach(e=>this.tu.set(e,!0))}hu(){if(this.Jl)try{const e=It.Lt(this.lu),t=nu(e);this.gu(tr).storageValue=e,Vo.forEach(n=>{var r;const s=this.Kl?(r=Er(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?It.Lt(this.vu(s)):null;if(s){const c=this.gu(s);c.storageValue=i,c.persisted=!kn(i)}const o=s&&!kn(i)?nu(i):t;n in this.props?this.Iu(n,o[n],this.props[n]):n in o&&this.pu(n,!0)})}catch{}}ku(e,t){const n=this.tu.get(e);if(!n)return t;if(n===!0)return this.props[e];if(e==="$active_feature_flags"){const i=new Set(He(t)?t:[]),o=new Set(He(this.props[e])?this.props[e]:[]);return n.forEach(c=>o.has(c)?i.add(c):i.delete(c)),Array.from(i)}const r=ut(t)?N({},t):{},s=ut(this.props[e])?this.props[e]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}Iu(e,t,n){if(!Qy(e))return;const r=this.tu.get(e);if(r===!0)return;let s=t;if(this.Jl)try{var i;const c=this.Kl?(i=Er(e))===null||i===void 0?void 0:i.storageGroup:void 0,u=c?this.vu(c):this.lu;s=nu(It.Lt(u))[e]}catch{}const o=new Set(r||[]);if(e==="$active_feature_flags"){if(!le(t)&&!He(t)||!le(s)&&!He(s)||!He(n))return void this.pu(e,!0);const c=new Set(t||[]),u=new Set(s||[]),d=new Set(n);new Set([...c,...d]).forEach(f=>{c.has(f)!==d.has(f)&&o.add(f)}),o.forEach(f=>{u.has(f)===d.has(f)&&o.delete(f)})}else{if(!ut(n))return void(Ta(s,n)?this.tu.delete(e):this.pu(e,!0));{if(!le(t)&&!ut(t)||le(t)&&ks(n)&&le(s))return void this.pu(e,!0);const c=ut(t)?t:{},u=ut(s)?s:{};new Set([...Object.keys(c),...Object.keys(n)]).forEach(d=>{d in c==d in n&&Ta(c[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&Ta(u[d],n[d])&&o.delete(d)})}}o.size?this.pu(e,o):this.tu.delete(e)}Mu(){var e;const t=(e=this.Fr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return Fn(t)&&t>0?t:0}Eu(e){if(this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie")if(e)try{const t=qy(e,this.Fr.cookie_persisted_properties||[]),n=e6(t,this.Fr.cookie_persisted_properties||[]),r=JSON.stringify(t)+"|"+JSON.stringify(n),s=gn.Lt(this.lu)||void 0;s&&Yy(this.lu,s)===r&&(this.Au=r,this.Ru=s)}catch{}else try{const t=gn.Lt(this.lu)||void 0;this.Au=t?Yy(this.lu,t):void 0,this.Ru=t}catch{}}syncCookieProperties(){return this.Pu(this.Fr)}Pu(e,t=!1){if(this.fi&&!t||this.Xl||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=gn.Lt(this.lu)||void 0}catch{}if(!n||n===this.Ru)return!1;const r=Yy(this.lu,n);let s;try{s=Gy(JSON.parse(n))}catch{return!1}if((gn.Lt(this.lu)||void 0)!==n)return!1;this.Au=r,this.Ru=n;const i=t6(this.lu,n),o=[...Yl,...i.properties],c={};if(Object.keys(s).forEach(w=>{const b=s[w];(le(b)||kn(b)||b===""||w==="$user_state"&&b!=="anonymous"&&b!=="identified")&&(c[w]=!0,delete s[w])}),ks(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[ui],p=d[Qr],m=pn({},d);[...Yl,...e.cookie_persisted_properties||[]].forEach(w=>{if(o.indexOf(w)!==-1&&!(w in s)&&!c[w]&&(u||w!=="distinct_id"&&w!=="$user_state")){const b=m[w];(i.isValid||Yl.indexOf(w)===-1||b!==!1&&b!==0)&&delete m[w]}}),this.props=pn(m,s),Vo.forEach(w=>{const b=w in this.props;w in d===b&&Ta(d[w],this.props[w])||(b?this.Iu(w,d[w],this.props[w]):this.pu(w,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.Su(Qr,Go);const v=this.props[ui],_=this.props[Qr];return!u||v===f&&_===p||(this.iu=!0,this.Yl=!0,ln.$t(nm(this.lu),!0),this.xu(Ya),this.xu(Ko),this.xu(Ni),this.xu(uc),this.xu(Xa),this.xu(dc),this.xu(tl),this.xu(ih),this.xu(lo),_!=="anonymous"||p!=="identified"&&s.$user_state!=="anonymous"&&(le(f)||v===f)||(v6(this.props,s),this.xu(qa)),_==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.xu(S0)),!0}consumeCookieIdentityChange(){const e=nm(this.lu),t=this.Yl||!!ln.Lt(e);return this.Yl=!1,t&&ln.Dt(e),t}Ou(e=!1){return!(this.Xl||this.fi&&!e||!this.Fr.cookieWinsOnConflict||this.Fr.persistence.toLowerCase()!=="localstorage+cookie"||(this.Xl=!0,0))}Fu(){this.Xl&&(le(this.Du)||(clearTimeout(this.Du),this.Du=void 0),delete this.Ql[tr],this.Lu(!0))}Nu(e=!0){if(this.Xl)try{e?this.Fu():le(this.Du)||(clearTimeout(this.Du),this.Du=void 0)}finally{this.Xl=!1}}isDisabled(){return!!this.fi}uu(e){Ij.indexOf(e.persistence.toLowerCase())===-1&&(me.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");const t=((o=[],c=!1,u=()=>!1)=>{const d=[...Yl,...o];return N(N({},It),{},{ju(f){return[gn.Lt(f),gn.Lt(Uf(f)),It.Lt(f)].join("\0")},Ft(f){try{let m,v={};try{m=gn.Lt(f)||void 0,v=m?Gy(JSON.parse(m)):{}}catch{}const _=JSON.parse(It.Lt(f)||"{}");let w;if(c){const b=t6(f,m),S=[...Yl,...b.properties],E={};Object.keys(v).forEach(R=>{const T=v[R];kn(T)||T===""||R==="$user_state"&&T!=="anonymous"&&T!=="identified"||(E[R]=T)});const C="distinct_id"in E||E.$user_state==="anonymous"||E.$user_state==="identified";if(Object.keys(E).length>0){var p;const R=_[ui],T=(p=_.$user_state)!==null&&p!==void 0?p:Go;d.forEach(O=>{if(S.indexOf(O)!==-1&&!(O in v)&&(C||O!=="distinct_id"&&O!=="$user_state")){const M=_[O];(b.isValid||Yl.indexOf(O)===-1||M!==!1&&M!==0)&&delete _[O]}}),!C||"$user_state"in v||"$user_state"in _||(_[Qr]=Go),!C||("distinct_id"in E?E[ui]:_[ui])===R&&("$user_state"in E?E[Qr]:_[Qr])===T||(Ky.forEach(O=>delete _[O]),E.$user_state==="identified"&&"distinct_id"in E?_.$user_id=E[ui]:delete _.$user_id,E.$user_state!=="identified"&&(delete _[cA],delete _[qa]),delete _.__alias)}w=pn(_,E)}else w=pn(v,_);return u()||It.$t(f,w),w}catch{}return null},$t(f,p,m,v,_,w){const b=It.$t(f,p,void 0,void 0,w);try{const S=qy(p,o);if(Object.keys(S).length){if(c){const E=Uf(f),C=e6(S,o);if(gn.$t(E,C,m,v,_,w),gn.Lt(E)!==JSON.stringify(C)){gn.Dt(E,v);const R=qy(p);return gn.$t(f,R,m,v,_,w),b}}gn.$t(f,S,m,v,_,w)}}catch(S){It.Pt(S)}return b},Dt(f,p){try{ie==null||ie.localStorage.removeItem(f),gn.Dt(f,p),gn.Dt(Uf(f),p)}catch(m){It.Pt(m)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict,()=>!!this.fi);let n,r=!1,s=!1;const i=e.persistence.toLowerCase();return i==="localstorage"&&It.Ot()?(n=It,s=!0):i==="localstorage+cookie"&&t.Ot()?(n=t,s=!0,r=!0):i==="sessionstorage"&&ln.Ot()?n=ln:i==="memory"?n=G_:i==="cookie"&&gn.Ot()?(n=gn,r=!0):t.Ot()?(n=t,s=!0,r=!0):gn.Ot()?(n=gn,r=!0):n=G_,this.Jl=s,this.Zl=r,n}vu(e){return`${this.lu}__${e}`}cu(e){return this.Jl&&!!e.split_storage}properties(){const e={};return Zt(this.props,(t,n)=>{const r=Er(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,t))return;e[n]=t}}),e}load(e=!1){if(this.fi&&!e)return;const t=this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie",n=t?It.Ft(this.lu):null;let r={};if(t)try{r=Gy(gn.Ft(this.lu)),Zt(r,(c,u)=>{(le(c)||kn(c)||c==="")&&delete r[u]})}catch{}const s=this.Ll.Ft(this.lu);if(s&&(this.props=pn({},s)),this.Kl&&this.qu(),t&&s){var i,o;const c=n==null?void 0:n[ui],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Go,d=s[ui],f=(o=s.$user_state)!==null&&o!==void 0?o:Go;if(d!==c||f!==u){this.Yl=!0,this.fi||ln.$t(nm(this.lu),!0);const p=pn({},this.props);Ky.forEach(v=>delete p[v]),f!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(le(c)||d===c)||(v6(p,r),delete p[qa]),this.props=p;const m=new Set;Ky.forEach(v=>{var _;const w=(_=Er(v))===null||_===void 0?void 0:_.storageGroup;w&&m.add(w)}),m.forEach(v=>{if(this.fi)return;const _={};Zt(this.props,(w,b)=>{var S;((S=Er(b))===null||S===void 0?void 0:S.storageGroup)===v&&(_[b]=w)}),ks(_)?(It.Dt(this.vu(v)),this.Ql[v]={}):It.$t(this.vu(v),_)&&(this.Ql[v]={persisted:!0,fingerprint:this.wu(_,v)})})}}ln.Lt(nm(this.lu))&&(this.Yl=!0)}qu(){for(const e of ff){const t=It.Ft(this.vu(e));if(t&&!ks(t)){const n=this.gu(e);n.persisted=!0,this.Bu(e)||(n.fingerprint=this.wu(t,e)),this.zu(e,t)||pn(this.props,t)}}}Bu(e){return Object.keys(this.props).some(t=>{var n;return((n=Er(t))===null||n===void 0?void 0:n.storageGroup)===e})}zu(e,t){const n=Aj[e];if(!n)return!1;const r=t[n],s=this.props[n];return Fn(r)&&Fn(s)&&s>r}refreshKey(e){this.Hu([e])}Hu(e){if(this.fi)return;let t,n=!1;const r=()=>(n||(t=this.Ll.Ft(this.lu),n=!0),t);e.forEach(s=>{var i;if(this.su.has(s))return;const o=this.Kl?(i=Er(s))===null||i===void 0?void 0:i.storageGroup:void 0,c=o?It.Ft(this.vu(o)):r();if(c&&s in c)this.Su(s,c[s],!1);else{if(o){const u=r();if(u&&s in u)return void this.Su(s,u[s],!1)}this.xu(s,!1)}})}refreshMetaIdentifiers(){if(this.fi)return;const e=this.Uu();(le(e)||e!==this.Wu)&&(this.Hu(KA),this.Vu(e))}Vu(e=this.Uu()){this.Wu=this.su.size===0?e:void 0}Uu(){const e=this.Ll.ju?this.Ll.ju(this.lu):this.Ll.Lt(this.lu);return ft(e)?e:void 0}save(){if(this.fi)return;const e=this.Mu();e>0?le(this.Du)&&(this.Du=setTimeout(()=>{this.Du=void 0,this.Lu()},e)):this.Lu()}flush(){le(this.Du)||(clearTimeout(this.Du),this.Du=void 0,this.Lu())}Lu(e=!1){if(this.fi||this.Xl&&!e)return;e||(this.syncCookieProperties(),this.Fr.cookieWinsOnConflict&&this.Fr.persistence.toLowerCase()==="localstorage+cookie"||this.refreshMetaIdentifiers());const t=!e&&!this.eu;t||(this.nu=!1);const n=!!t&&this.$u();if(this.nu)return void(this.Fr.debug&&me.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Kl)return this.Gu(),void(n&&this.ru.forEach(s=>s()));const r=this.Qu(this.Ll,this.lu,this.props,tr);r==="written"&&this.Eu(this.props),r!=="failed"&&(this.tu.clear(),this.iu=!1,this.su.clear()),r==="written"&&this.Vu(),n&&this.ru.forEach(s=>s())}Gu(){const{main:e,groups:t}=this.bu(),n=this.Qu(this.Ll,this.lu,e,tr);n==="written"&&this.Eu(e),n!=="failed"&&(this.iu=!1,this.su.clear(),Vo.forEach(s=>{var i;!((i=Er(s))===null||i===void 0)&&i.storageGroup||this.tu.delete(s)})),n==="written"&&this.Vu();for(const s of ff){var r;const i=t[s];if(ks(i)&&!(!((r=this.Ql[s])===null||r===void 0)&&r.persisted)){Vo.forEach(c=>{var u;((u=Er(c))===null||u===void 0?void 0:u.storageGroup)===s&&this.tu.delete(c)});continue}const o=this.Qu(It,this.vu(s),i,s);o!=="failed"&&Vo.forEach(c=>{const u=Er(c);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.tu.delete(c)})}}bu(){const e={},t={flags:{},surveys:{}};return Zt(this.props,(n,r)=>{var s;const i=(s=Er(r))===null||s===void 0?void 0:s.storageGroup;i?t[i][r]=n:e[r]=n}),{main:e,groups:t}}wu(e,t){if(t===tr)return JSON.stringify(e)+"|"+this.Ju+"|"+this.Zu+"|"+this.Ku;const n={};return Zt(e,(r,s)=>{var i;n[s]=!((i=Er(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Qu(e,t,n,r){const s=this.gu(r);if(r!==tr&&!s.dirty&&!le(s.fingerprint))return"skipped";let i;try{if(i=this.wu(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return e.$t(t,n,this.Ju,this.Zu,this.Ku,this.Fr.debug)?(s.dirty=!1,r!==tr&&(s.persisted=!0),le(i)||(s.fingerprint=i),this.Jl&&(s.storageValue=It.Lt(t)),"written"):(this.Fr.debug&&me.warn(`failed to persist storage entry "${t}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Tu(),le(this.Du)||(clearTimeout(this.Du),this.Du=void 0),this.Ll.Dt(this.lu,!1),this.Ll.Dt(this.lu,!0),!e&&this.ou)for(const t of ff)It.Dt(this.vu(t));e?delete this.Ql[tr]:this.Ql={},this.Au=void 0,this.Ru=void 0}clear(){this.remove(),this.props={}}register_once(e,t,n){if(ut(e)){this.syncCookieProperties(),le(t)&&(t="None"),this.Ju=le(n)?this.Yu:n;let r=!1;if(Zt(e,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Su(i,s),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(ut(e)){this.syncCookieProperties(),this.Ju=le(t)?this.Yu:t;let n=!1;if(Zt(e,(r,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==r||ut(r)||He(r))&&(this.Su(s,r),n=!0)}),n)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();const t=typeof e=="string"?[e]:e;let n=!1;for(const r of t)r in this.props&&(this.xu(r),n=!0);n&&this.save()}update_campaign_params(){const e=Ie==null?void 0:Ie.URL;if(e===this.au)return;const t=VA(this.Fr.custom_campaign_params,this.Fr.mask_personal_data_properties,this.Fr.custom_personal_data_properties),n=!ks(ob(t));return n&&this.register(t),this.au=e,n?t:void 0}update_search_keyword(){this.register((function(){const e=Ie==null?void 0:Ie.referrer;return e?HA(e):{}})())}update_referrer_info(){var e;this.register_once({$referrer:ZA(),$referring_domain:(Ie==null?void 0:Ie.referrer)&&((e=vo(Ie.referrer))===null||e===void 0?void 0:e.host)||P0},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const e=BA(this.Fr.mask_personal_data_properties,this.Fr.custom_personal_data_properties,this.Fr.disable_capture_url_hashes);this.register_once({[_u]:this.Zl?{r:rm(e.r),u:e.u?rm(e.u):void 0}:e},void 0)}get_initial_props(){const e={};Zt([fA,dA],n=>{const r=this.props[n];r&&Zt(r,function(s,i){e["$initial_"+C_(i)]=s})});const t=this.props[_u];if(t){const n=(function(r,s=!1){const i=WA(r,s),o={};return Zt(i,function(c,u){o[`$initial_${C_(u)}`]=c}),o})(t,this.Fr.disable_capture_url_hashes);pn(e,n)}return e}safe_merge(e){return Zt(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t,n){const r=e.persistence!==t.persistence,s=!((v,_)=>{if(v.length!==_.length)return!1;const w=[...v].sort(),b=[..._].sort();return w.every((S,E)=>S===b[E])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),i=r||s,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,c=e.disable_persistence||!!n,u=!!this.fi&&!c;c||this.Pu(t,u),this.Fr=e,!c&&(r||s||o)&&(this.Au=void 0,this.Ru=void 0,this.Pu(N(N({},e),{},{cookie_persisted_properties:t.cookie_persisted_properties}),u));const d=i||o?this.uu(e):this.Ll;this.Xu();const f=this.cu(e),p=i||f!==this.Kl,m=!c&&(p||e.cross_subdomain_cookie!==this.Zu||e.secure_cookie!==this.Ku)&&this.Ou(u);this.eu=p;try{if(this.Yu=this.Ju=e.cookie_expiration,this.set_disabled(c),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),p){const v=this.props;this.clear(),this.Ll=d,this.Kl=f,this.props=v,this.save()}else o&&(this.Ll=d,c||(delete this.Ql[tr],this.Lu()))}finally{this.eu=!1,m&&this.Nu()}}Xu(){const e=this.props[_u];if(!this.Zl||!ut(e)||typeof e.r!="string")return;const t=rm(e.r),n=typeof e.u=="string"?rm(e.u):e.u;t===e.r&&n===e.u||this.Su(_u,N(N({},e),{},{r:t,u:n}))}set_disabled(e){this.fi=e,this.fi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Zu&&(this.Zu=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ku&&(this.Ku=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){const n=this.props.__timers||{};n[e]=t,this.Su(V_,n),this.save()}remove_event_timer(e){const t=this.props.__timers||{},n=t[e];return le(n)||(delete t[e],this.Su(V_,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Su(e,t),this.save()}Su(e,t,n=!0){var r;const s=this.props[e];this.props[e]=t,n&&(e!=="distinct_id"&&e!=="$user_state"||s===t||(this.iu=!0),g6(e)&&!Ta(s,t)&&this.su.add(e),this.Iu(e,s,t),!((r=Er(e))===null||r===void 0)&&r.volatile||this.Cu(e))}xu(e,t=!0){delete this.props[e],t&&(Qy(e)&&this.pu(e,!0),g6(e)&&this.su.add(e),this.Cu(e))}Cu(e){var t;const n=(t=Er(e))===null||t===void 0?void 0:t.storageGroup;n&&(this.gu(n).dirty=!0)}gu(e){return this.Ql[e]||(this.Ql[e]={})}};const Ws={GZipJS:"gzip-js",Base64:"base64"},hf={Activation:"events",Cancellation:"cancelEvents"},e1={Popover:"popover",API:"api",Widget:"widget"},Bs={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},t1={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Y_={Popover:"popover",Inline:"inline"};function sm(e){let t=!0;return{dispose(){if(t){t=!1;const n=e();n&&On(n.then)&&n.then(void 0,()=>{})}}}}const Oj={SHOWN:"product tour shown"},y6={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},_6=xn("[RateLimiter]");var Mj=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{const n=t.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(r=>{_6.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void _6.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}get isClientRateLimited(){return 1>this.tc().tokens}clientRateLimitContext(e=!1){var t;const n=this.tc(),r=1>n.tokens;if(r||e||(n.tokens=Math.max(0,n.tokens-1)),r&&!e){const s=(Fn(n.dropped)?n.dropped:0)+1;n.dropped=s,!this.lastEventRateLimited&&this.ec(s)&&(n.dropped=0)}return this.lastEventRateLimited=r,(t=this.instance.persistence)===null||t===void 0||t.set_property("$capture_rate_limit",n),{isRateLimited:r,remainingTokens:n.tokens}}tc(){var e;const{captureEventsBurstLimit:t,captureEventsPerSecond:n}=this,r=new Date().getTime(),s=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_property(uA),i=s?N({},s):{tokens:t,last:r};return i.tokens+=Math.max(0,r-i.last)/1e3*n,i.last=Math.max(i.last,r),i.tokens>t&&(i.tokens=t),i}nc(e){const t=this.instance.config.property_denylist;return!He(t)||!t.includes(e)}sc(){var e;if(this.nc("$current_url")&&this.nc("$pathname")&&(an!=null&&an.pathname))return`${(e=an.origin)!==null&&e!==void 0?e:""}${an.pathname}`}ec(e){var t,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.sc(),o=this.nc("$session_id")?(t=(n=this.instance).get_session_id)===null||t===void 0?void 0:t.call(n):void 0,c=[`${e} 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: ${c}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){const t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}};const Aa=xn("[RemoteConfig]");var GA=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=et._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.config}rc(e){var t,n,r;!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.loadExternalDependency?(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}oc(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return Aa.info("Using preloaded remote config",this.remoteConfig),void this.ac(this.remoteConfig);if(this._instance.lc())return void Aa.warn("Remote config is disabled. Falling back to local config.");this.rc(e=>{if(!e)return Aa.info("No config found after loading remote JS config. Falling back to JSON."),void this.oc(t=>{this.ac(t.json,t)});this.ac(e)})}catch(e){Aa.error("Error loading remote config",e),this.ac()}}ac(e,t){!e&&t&&(t.statusCode===0?t.error||Aa.warn("Failed to fetch remote config from PostHog."):Aa.error("Failed to fetch remote config from PostHog."));try{this._instance.ac(e?{ok:!0,config:e}:{ok:!1})}catch(r){Aa.error("Error applying remote config",r)}if((e==null?void 0:e.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){Aa.error("Error loading feature flags",r)}}},mi=Uint8Array,Cs=Uint16Array,Ju=Uint32Array,fb=new mi([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]),hb=new mi([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]),w6=new mi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qA=function(e,t){for(var n=new Cs(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var s=new Ju(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]},YA=qA(fb,2),X_=YA[1];YA[0][28]=258,X_[258]=28;for(var b6=qA(hb,0)[1],XA=new Cs(32768),Cn=0;32768>Cn;++Cn){var ru=(43690&Cn)>>>1|(21845&Cn)<<1;XA[Cn]=((65280&(ru=(61680&(ru=(52428&ru)>>>2|(13107&ru)<<2))>>>4|(3855&ru)<<4))>>>8|(255&ru)<<8)>>>1}var Bf=function(e,t,n){for(var r=e.length,s=0,i=new Cs(t);r>s;++s)++i[e[s]-1];var o,c=new Cs(t);for(s=0;t>s;++s)c[s]=c[s-1]+i[s-1]<<1;for(o=new Cs(r),s=0;r>s;++s)o[s]=XA[c[e[s]-1]++]>>>15-e[s];return o},_c=new mi(288);for(Cn=0;144>Cn;++Cn)_c[Cn]=8;for(Cn=144;256>Cn;++Cn)_c[Cn]=9;for(Cn=256;280>Cn;++Cn)_c[Cn]=7;for(Cn=280;288>Cn;++Cn)_c[Cn]=8;var R0=new mi(32);for(Cn=0;32>Cn;++Cn)R0[Cn]=5;var Lj=Bf(_c,9),$j=Bf(R0,5),QA=function(e){return(e/8|0)+(7&e&&1)},JA=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Cs?Cs:e instanceof Ju?Ju:mi)(n-t);return r.set(e.subarray(t,n)),r},Lo=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},pf=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},n1=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var s=n.length,i=n.slice();if(!s)return[new mi(0),0];if(s==1){var o=new mi(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(T,O){return T.f-O.f}),n.push({s:-1,f:25001});var c=n[0],u=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:c.f+u.f,l:c,r:u};f!=s-1;)c=n[n[p].f>n[d].f?d++:p++],u=n[d!=f&&n[p].f>n[d].f?d++:p++],n[f++]={s:-1,f:c.f+u.f,l:c,r:u};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var v=new Cs(m+1),_=Q_(n[f-1],v,0);if(_>t){r=0;var w=0,b=_-t,S=1<<b;for(i.sort(function(T,O){return v[O.s]-v[T.s]||T.f-O.f});s>r;++r){var E=i[r].s;if(t>=v[E])break;w+=S-(1<<_-v[E]),v[E]=t}for(w>>>=b;w>0;){var C=i[r].s;t>v[C]?w-=1<<t-v[C]++-1:++r}for(;r>=0&&w;--r){var R=i[r].s;v[R]==t&&(--v[R],++w)}_=t}return[new mi(v),_]},Q_=function(e,t,n){return e.s==-1?Math.max(Q_(e.l,t,n+1),Q_(e.r,t,n+1)):t[e.s]=n},x6=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Cs(++t),r=0,s=e[0],i=1,o=function(u){n[r++]=u},c=1;t>=c;++c)if(e[c]==s&&c!=t)++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=e[c]}return[n.subarray(0,r),t]},mf=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},J_=function(e,t,n){var r=n.length,s=QA(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var i=0;r>i;++i)e[s+i+4]=n[i];return 8*(s+4+r)},S6=function(e,t,n,r,s,i,o,c,u,d,f){Lo(t,f++,n),++s[256];for(var p=n1(s,15),m=p[0],v=p[1],_=n1(i,15),w=_[0],b=_[1],S=x6(m),E=S[0],C=S[1],R=x6(w),T=R[0],O=R[1],M=new Cs(19),A=0;E.length>A;++A)M[31&E[A]]++;for(A=0;T.length>A;++A)M[31&T[A]]++;for(var L=n1(M,7),V=L[0],W=L[1],z=19;z>4&&!V[w6[z-1]];--z);var X,Q,H,Y,oe=d+5<<3,U=mf(s,_c)+mf(i,R0)+o,J=mf(s,m)+mf(i,w)+o+14+3*z+mf(M,V)+(2*M[16]+3*M[17]+7*M[18]);if(U>=oe&&J>=oe)return J_(t,f,e.subarray(u,u+d));if(Lo(t,f,1+(U>J)),f+=2,U>J){X=Bf(m,v),Q=m,H=Bf(w,b),Y=w;var K=Bf(V,W);for(Lo(t,f,C-257),Lo(t,f+5,O-1),Lo(t,f+10,z-4),f+=14,A=0;z>A;++A)Lo(t,f+3*A,V[w6[A]]);f+=3*z;for(var D=[E,T],q=0;2>q;++q){var fe=D[q];for(A=0;fe.length>A;++A)Lo(t,f,K[ae=31&fe[A]]),f+=V[ae],ae>15&&(Lo(t,f,fe[A]>>>5&127),f+=fe[A]>>>12)}}else X=Lj,Q=_c,H=$j,Y=R0;for(A=0;c>A;++A)if(r[A]>255){var ae;pf(t,f,X[257+(ae=r[A]>>>18&31)]),f+=Q[ae+257],ae>7&&(Lo(t,f,r[A]>>>23&31),f+=fb[ae]);var ce=31&r[A];pf(t,f,H[ce]),f+=Y[ce],ce>3&&(pf(t,f,r[A]>>>5&8191),f+=hb[ce])}else pf(t,f,X[r[A]]),f+=Q[r[A]];return pf(t,f,X[256]),f+Q[256]},Nj=new Ju([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Dj=(function(){for(var e=new Ju(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),r1=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Fj(e,t){t===void 0&&(t={});var n=(function(){var p=4294967295;return{p(m){for(var v=p,_=0;m.length>_;++_)v=Dj[255&v^m[_]]^v>>>8;p=v},d(){return 4294967295^p}}})(),r=e.length;n.p(e);var s,i,o,c,u,d=(c=10+((s=t).filename&&s.filename.length+1||0),u=8,(function(p,m,v,_,w,b){var S=p.length,E=new mi(_+S+5*(1+Math.floor(S/7e3))+w),C=E.subarray(_,E.length-w),R=0;if(!m||8>S)for(var T=0;S>=T;T+=65535){var O=T+65535;S>O?R=J_(C,R,p.subarray(T,O)):(C[T]=b,R=J_(C,R,p.subarray(T,S)))}else{for(var M=Nj[m-1],A=M>>>13,L=8191&M,V=(1<<v)-1,W=new Cs(32768),z=new Cs(V+1),X=Math.ceil(v/3),Q=2*X,H=function(xt){return(p[xt]^p[xt+1]<<X^p[xt+2]<<Q)&V},Y=new Ju(25e3),oe=new Cs(288),U=new Cs(32),J=0,K=0,D=(T=0,0),q=0,fe=0;S>T;++T){var ae=H(T),ce=32767&T,he=z[ae];if(W[ce]=he,z[ae]=ce,T>=q){var ke=S-T;if((J>7e3||D>24576)&&ke>423){R=S6(p,C,0,Y,oe,U,K,D,fe,T-fe,R),D=J=K=0,fe=T;for(var ge=0;286>ge;++ge)oe[ge]=0;for(ge=0;30>ge;++ge)U[ge]=0}var pe=2,Le=0,Ae=L,Ne=ce-he&32767;if(ke>2&&ae==H(T-Ne))for(var Et=Math.min(A,ke)-1,dn=Math.min(32767,T),sn=Math.min(258,ke);dn>=Ne&&--Ae&&ce!=he;){if(p[T+pe]==p[T+pe-Ne]){for(var kt=0;sn>kt&&p[T+kt]==p[T+kt-Ne];++kt);if(kt>pe){if(pe=kt,Le=Ne,kt>Et)break;var Gt=Math.min(Ne,kt-2),mn=0;for(ge=0;Gt>ge;++ge){var Xt=T-Ne+ge+32768&32767,Me=Xt-W[Xt]+32768&32767;Me>mn&&(mn=Me,he=Xt)}}}Ne+=(ce=he)-(he=W[ce])+32768&32767}if(Le){Y[D++]=268435456|X_[pe]<<18|b6[Le];var Qe=31&X_[pe],Te=31&b6[Le];K+=fb[Qe]+hb[Te],++oe[257+Qe],++U[Te],q=T+pe,++J}else Y[D++]=p[T],++oe[p[T]]}}R=S6(p,C,b,Y,oe,U,K,D,fe,T-fe,R)}return JA(E,0,_+QA(R)+w)})(i=e,(o=t).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,c,u,!0)),f=d.length;return(function(p,m){var v=m.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>m.level?4:m.level==9?2:0,p[9]=3,m.mtime!=0&&r1(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),v){p[3]=8;for(var _=0;v.length>=_;++_)p[_+10]=v.charCodeAt(_)}})(d,t),r1(d,f-8,n.d()),r1(d,f-4,r),d}const jj=!!W2||!!nh,eI=new WeakMap,tI="text/plain";let s1=0,Bm=!1;const nI=(e,t)=>{const[n,r]=e.split("#"),[s,i]=n.split("?");if(!i)return e;const o=i.split("&").filter(c=>c.split("=")[0]!==t).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},bg=(e,t,n=!0)=>{var r;const[s,i]=e.split("?"),o=N({},t),c=(r=i==null?void 0:i.split("&").map(d=>{var f;const[p,m]=d.split("="),v=n&&(f=o[p])!==null&&f!==void 0?f:m;return delete o[p],`${p}=${v}`}))!==null&&r!==void 0?r:[],u=(function(d,f="&"){let p,m;const v=[];return Zt(d,function(_,w){le(_)||le(w)||w==="undefined"||(p=encodeURIComponent((b=>b instanceof File)(_)?_.name:_.toString()),m=encodeURIComponent(w),v[v.length]=m+"="+p)}),v.join(f)})(o);return u&&c.push(u),c.length>0?`${s}?${c.join("&")}`:s},i1=e=>{if(e.cr)return e.cr;const{data:t,compression:n}=e;if(!t)return;if(n===Ws.GZipJS){const s=Fj((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var c=new mi(i.length+(i.length>>>1)),u=0,d=function(v){c[u++]=v},f=0;o>f;++f){if(u+5>c.length){var p=new mi(u+8+(o-f<<1));p.set(c),c=p}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 JA(c,0,u)})(bu(t)),{mtime:0});return{contentType:tI,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===Ws.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(c,u)=>String.fromCharCode(parseInt(u,16))))})(bu(t)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:bu(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=bu(t);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},rI=e=>{const t=()=>e.transport==="sendBeacon"?{url:bg(e.url,{compression:Ws.Base64}),encodedBody:i1(N(N({},e),{},{compression:Ws.Base64,cr:void 0}))}:{url:nI(e.url,"compression"),encodedBody:i1(N(N({},e),{},{compression:void 0,cr:void 0}))};let n;try{n=i1(e)}catch(s){if(jk(e.compression,Xu(e.url,"compression")))return me.error("Failed to gzip request body, sending uncompressed payload",s),t();throw s}return n&&jk(e.compression,Xu(e.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?M_(new Uint8Array(r)):ArrayBuffer.isView(r)&&M_(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(Bm=!0,t()):{url:e.url,encodedBody:n};var r},sI=e=>{try{return rI(e)}catch(n){var t;return me.error(n),void((t=e.callback)===null||t===void 0||t.call(e,{statusCode:0,error:n}))}},Vj=(function(){var e=cn(function*(t){const n=yield(function(s){return L_.apply(this,arguments)})(bu(t.data),Es.DEBUG,{rethrow:!0});if(!n)return t;const r=yield n.arrayBuffer();return N(N({},t),{},{cr:{contentType:tI,body:r,estimatedSize:r.byteLength}})});return function(t){return e.apply(this,arguments)}})(),iI=e=>L3("AbortError","PostHog request timed out"+(e?` after ${e}ms`:"")),zj=/Failed to fetch|NetworkError|Load failed/i,oI=e=>(e==null?void 0:e.name)==="TypeError"&&zj.test((e==null?void 0:e.message)||""),aI=e=>{try{const t=(function(n,r=Date.now(),s=3e5){if(typeof n!="string"||!n)return;const i=n.trim(),o=/^\d+\s*,/.test(i)?i.slice(0,i.indexOf(",")).trim():i;if(/^\d+$/.test(o)){const d=1e3*Math.min(Number(o),s/1e3);return d>0?d:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(o))return;const c=/^\w{3} \w{3} /.test(o)?o+" GMT":o,u=Date.parse(c)-r;return Number.isFinite(u)&&u>0?Math.min(u,s):void 0})(e());return le(t)?void 0:Math.min(t,3e4)}catch{return}},lI=e=>{const t=sI(e);if(!t)return;const n=new W2;eI.set(n,!0);const{url:r,encodedBody:s}=t;n.open(e.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Zt(e.headers,function(u,d){n.setRequestHeader(d,u)}),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout);let c=!1;n.ontimeout=()=>{c=!0},n.onloadend=()=>{var u;if(c){var d;const p=iI(e.timeout);return me.warn(p),void((d=e.callback)===null||d===void 0||d.call(e,{statusCode:0,error:p}))}const f={statusCode:n.status,text:n.responseText};if(n.status===200)try{f.json=JSON.parse(n.responseText)}catch{}(u=e.callback)===null||u===void 0||u.call(e,f,aI(()=>n.getResponseHeader("Retry-After")))},n.send(o)},cI=e=>{const t=sI(e);if(!t)return;const{url:n,encodedBody:r}=t,{contentType:s,body:i,estimatedSize:o}=r??{},c=new Headers;Zt(e.headers,function(_,w){c.append(w,_)}),s&&c.append("Content-Type",s);let u=null,d=!1;if(xk){const _=new xk;u={signal:_.signal,timeout:setTimeout(()=>{d=!0;try{_.abort(iI(e.timeout))}catch(w){p(w)}},e.timeout)}}let f=!1;const p=_=>{var w;f||(f=!0,d&&(_==null?void 0:_.name)==="AbortError"||oI(_)?me.warn(_):me.error(_),(w=e.callback)===null||w===void 0||w.call(e,{statusCode:0,error:_}))};let m=0;const v=()=>{s1-=m,m=0,u&&clearTimeout(u.timeout)};try{const _=N({method:(e==null?void 0:e.method)||"GET",headers:c,referrerPolicy:"strict-origin",body:i,signal:u==null?void 0:u.signal},e.fetchOptions),w=o??(le(i)?0:void 0);_.keepalive=_.method==="POST"&&!e.Ol&&_.keepalive!==!1&&_.body===i&&!le(w)&&w>=0&&52428.8>s1+w,_.keepalive&&(m=w,s1+=m),nh(n,_).then(b=>b.text().then(S=>{var E;if(f)return;const C={statusCode:b.status,text:S};if(b.status===200)try{C.json=JSON.parse(S)}catch(R){me.error(R)}f=!0,v(),(E=e.callback)===null||E===void 0||E.call(e,C,aI(()=>b.headers.get("Retry-After")))})).catch(b=>{v(),p(b)}).finally(v)}catch(_){v(),p(_)}},ew=e=>{try{var t;const{url:n,encodedBody:r}=rI(e),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const c=i instanceof Blob?i:new Blob([i],{type:s});if(Dr.sendBeacon(n,c))return;const u=He(e.data)?e.data:(t=e.data)===null||t===void 0?void 0:t.batch;if(He(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),f=p=>He(e.data)?p:N(N({},e.data),{},{batch:p});return ew(N(N({},e),{},{data:f(u.slice(0,d))})),void ew(N(N({},e),{},{data:f(u.slice(d))}))}me.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${nh?"fetch":"XHR"}`),nh?cI(N(N({},e),{},{Ol:!0})):lI(e)}catch(n){me.warn("Beacon send failed",n)}},E6=(e,t,n,r)=>{const s=r==="query"?t==="POST"?"sent_at":"_":void 0;return bg(n===Ws.GZipJS?nI(e,"compression"):e,N(N({},s?{[s]:Date.now().toString()}:{}),n===Ws.GZipJS?{}:{compression:n}))},Hj=(()=>{const e=[];return nh&&e.push({transport:"fetch",method:cI}),W2&&e.push({transport:"XHR",method:lI}),Dr!=null&&Dr.sendBeacon&&e.push({transport:"sendBeacon",method:ew}),e})();let uI=!jj&&(cs==null?void 0:cs.indexOf("MSIE"))===-1&&(cs==null?void 0:cs.indexOf("Mozilla"))===-1;function dI(e,t,n){var r,s,i,o;n&&(t=N(N({},t),{},{callback:c=>n(c)})),e.__loaded?uI?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&((i=t.callback)===null||i===void 0||i.call(t,{statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=N(N({},e.config.request_headers),t.headers),t.compression=t.compression==="best-available"?(r=e.compression)!==null&&r!==void 0?r:t.compressionFallback:t.compression,(le(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,(s=t.onDispatch)===null||s===void 0||s.call(t),((c,u)=>{var d,f,p;const m=N(N({},c),{},{callback:u??(S=>{var E;return(E=c.callback)===null||E===void 0?void 0:E.call(c,S)})});m.timeout=m.timeout||6e4;const v=(d=m.transport)!==null&&d!==void 0?d:"fetch";v==="sendBeacon"&&le(m.compression)&&m.data&&(m.compression=Ws.Base64),m.method==="POST"&&m.data&&(m.timestampMode==="capture-body"?m.data=(S=>{var E,C;const R=(He(S)?S:[S]).map(O=>N(N({},O),O.timestamp instanceof Date&&!isNaN(O.timestamp.getTime())?{timestamp:O.timestamp.toISOString()}:{})),T=R[0];return{api_key:(E=T==null||(C=T.properties)===null||C===void 0?void 0:C.token)!==null&&E!==void 0?E:T==null?void 0:T.token,batch:R,sent_at:new Date().toISOString()}})(m.data):m.timestampMode==="body"&&(m.data=((S,E=new Date().toISOString())=>He(S)?S.map(C=>N(N({},C),{},{sent_at:E})):N(N({},S),{},{sent_at:E}))(m.data))),m.url=E6(m.url,m.method,m.compression,m.timestampMode);const _=Hj.filter(S=>!m.disableTransport||!S.transport||!m.disableTransport.includes(S.transport)),w=(f=(p=(function(S,E){for(let C=0;S.length>C;C++)if(E(S[C]))return S[C]})(_,S=>S.transport===v))===null||p===void 0?void 0:p.method)!==null&&f!==void 0?f:_[0].method;if(!w)throw new Error("No available transport method");const b=S=>{try{w(S)}catch(C){var E;oI(C)?me.warn(C):me.error(C),(E=m.callback)===null||E===void 0||E.call(m,{statusCode:0,error:C})}};v!=="sendBeacon"&&!m.preferSyncCompression&&m.data&&m.compression===Ws.GZipJS&&nF&&typeof Promise<"u"&&!Bm?Vj(m).then(S=>{b(S)}).catch(S=>{if(Vk(S))return Bm=!0,void b(N(N({},m),{},{compression:void 0,url:E6(c.url,c.method,void 0,c.timestampMode)}));(E=>{if(!E||typeof E!="object")return!1;const C="name"in E?String(E.name):"";return Vk(E)||C===z3})(S)&&(Bm=!0),b(m)}):b(m)})(t,(c,u)=>{var d,f,p;e.rateLimiter.checkForLimiting(c),400>c.statusCode||(d=(f=e.config).on_request_error)===null||d===void 0||d.call(f,c),n?n(c,u):(p=t.callback)===null||p===void 0||p.call(t,c)})):t.fireCallbackOnDrop&&((o=t.callback)===null||o===void 0||o.call(t,{statusCode:0}))}var Uj=class{constructor(e,t){this.uc=!0,this.cc=[],this.hc=fo((t==null?void 0:t.flush_interval_ms)||3e3,250,5e3,me.createLogger("flush interval"),3e3),this.dc=e}enqueue(e){this.cc.push(e),this.vc||this.fc()}unload(){this.gc();const e=this.cc.length>0?this.mc():{},t=Object.values(e);[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.yc(N(N({},n),{},{callback:void 0}),"sendBeacon")})}enable(){this.uc=!1,this.fc()}fc(){this.uc||(this.vc=setTimeout(()=>{this.gc(),this.bc()},this.hc))}bc(){if(this.cc.length>0){const e=this.mc();for(const t in e)this.yc(e[t])}}yc(e,t){try{this.dc(e,t)}catch(n){me.error(n)}}gc(){clearTimeout(this.vc),this.vc=void 0}mc(){const e={},t={};Zt(this.cc,n=>{var r;const s=n,i=((s?s.batchKey:null)||s.url)+(s.batchGroup?`:${s.batchGroup}`:"");le(e[i])&&(e[i]=N(N({},s),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),t[i]=[]),(r=e[i].data)===null||r===void 0||r.push(s.data),s.callback&&t[i].push(s.callback)});for(const n in t){const r=t[n];r.length&&(e[n].callback=s=>{for(const i of r)i(s)})}return this.cc=[],e}};const Zj=["retriesPerformedSoFar"];var Bj=class{constructor(e){this._instance=e,this._c=!1,this.wc=3e3,this.cc=[],this.cc=[],this.kc=!0,this.resume()}resume(){if(!le(ie)&&"onLine"in ie.navigator){if(this.kc=ie.navigator.onLine,this.Sc)return;this.Sc=()=>{this.kc=!0,this.bc()},this.xc=()=>{this.kc=!1},$t(ie,"online",this.Sc),$t(ie,"offline",this.xc)}}get length(){return this.cc.length}retriableRequest(e,t){let{retriesPerformedSoFar:n}=e,r=H3(e,Zj);jo(n)&&(r.url=bg(r.url,{retry_count:n})),dI(this._instance,t?N(N({},r),{},{transport:t}):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(N({retriesPerformedSoFar:n},r),i);s.statusCode===0&&me.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(e,t){const n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const c=3e3*Math.pow(2,o),u=c/2,d=Math.min(18e5,c),f=(Math.random()-.5)*(d-u);return Math.ceil(d+f)})(n),t??0),s=Date.now()+r;this.cc.push({retryAt:s,requestOptions:e});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),me.warn(i),this._c||(this._c=!0,this.$c())}$c(){if(this.Cc&&clearTimeout(this.Cc),this.cc.length===0)return this._c=!1,void(this.Cc=void 0);this.Cc=setTimeout(()=>{this.kc&&this.cc.length>0&&this.bc(),this.$c()},this.wc)}bc(){const e=Date.now(),t=[],n=this.cc.filter(r=>e>r.retryAt||(t.push(r),!1));if(this.cc=t,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.Cc&&(clearTimeout(this.Cc),this.Cc=void 0),this._c=!1,le(ie)||(this.Sc&&(ie.removeEventListener("online",this.Sc),this.Sc=void 0),this.xc&&(ie.removeEventListener("offline",this.xc),this.xc=void 0));for(const{requestOptions:e}of this.cc)try{this._instance._send_request(N(N({},e),{},{callback:He(e.data)?void 0:e.callback,transport:"sendBeacon"}))}catch(t){me.error(t)}this.cc=[]}},Wj=class{constructor(e){this._instance=e,this.Tc=()=>{var t,n,r,s;this.Ic||(this.Ic={});const i=this.scrollElement(),o=this.scrollY(),c=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.Ic.lastScrollY=Math.ceil(o),this.Ic.maxScrollY=Math.max(o,(t=this.Ic.maxScrollY)!==null&&t!==void 0?t:0),this.Ic.maxScrollHeight=Math.max(c,(n=this.Ic.maxScrollHeight)!==null&&n!==void 0?n:0),this.Ic.lastContentY=u,this.Ic.maxContentY=Math.max(u,(r=this.Ic.maxContentY)!==null&&r!==void 0?r:0),this.Ic.maxContentHeight=Math.max(d,(s=this.Ic.maxContentHeight)!==null&&s!==void 0?s:0)}}get Mc(){return this._instance.config.scroll_root_selector}getContext(){return this.Ic}resetContext(){const e=this.Ic;return this.Ic=void 0,setTimeout(this.Tc,0),e}startMeasuringScrollPosition(){$t(ie,"scroll",this.Tc,{capture:!0}),$t(ie,"scrollend",this.Tc,{capture:!0}),$t(ie,"resize",this.Tc)}scrollElement(){if(this.Mc){const n=He(this.Mc)?this.Mc:[this.Mc];for(const r of n){var e;const s=ie==null||(e=ie.document)===null||e===void 0?void 0:e.querySelector(r);if(s)return s}return}var t;return ie==null||(t=ie.document)===null||t===void 0?void 0:t.documentElement}Ec(e){var t,n;const r=e==="y"?"scrollTop":"scrollLeft";if(this.Mc){const s=this.scrollElement();return s&&s[r]||0}return ie?e==="y"?ie.scrollY||ie.pageYOffset||((t=ie.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.scrollTop)||0:ie.scrollX||ie.pageXOffset||((n=ie.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollLeft)||0:0}scrollY(){return this.Ec("y")}scrollX(){return this.Ec("x")}};const Kj=e=>BA(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties,e==null?void 0:e.config.disable_capture_url_hashes);var k6=class{constructor(e,t,n,r){this.je=s=>{const i=this.Ac();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.Rc(this._instance)};this.Pc.register({[W_]:o})},this._instance=e,this.Oc=t,this.Pc=n,this.Rc=r||Kj,this.Oc.onSessionId(this.je)}Ac(){return this.Pc.props[W_]}getSetOnceProps(){var e;const t=(e=this.Ac())===null||e===void 0?void 0:e.props;return t?"r"in t?WA(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){const e={};return Zt(ob(this.getSetOnceProps()),(t,n)=>{n==="$current_url"&&(n="url"),e[`$session_entry_${C_(n)}`]=t}),e}},T0=class{on(e,t){return this.Eo[e]||(this.Eo[e]=[]),this.Eo[e].push(t),()=>{this.Eo[e]=this.Eo[e].filter(n=>n!==t)}}emit(e,t){for(const n of this.Eo[e]||[])n(t);for(const n of this.Eo["*"]||[])n(e,t)}constructor(){this.Eo={}}};const su=xn("[SessionId]"),C6=864e5;var P6=class{on(e,t){return this.Fc.on(e,t)}constructor(e,t,n){var r;if(this.Dc=null,this.Lc=null,this.Nc=[],this.jc=void 0,this.qc=!1,this.Fc=new T0,this.Bc=(i,o)=>!(!jo(i)||!jo(o))&&Math.abs(i-o)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Fr=e.config,this.Pc=e.persistence,this.Be=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.zc=void 0,this._sessionActivityTimestamp=null,this.Hc=t||Di,this.Uc=n||Di;const s=this.Fr.persistence_name||this.Fr.token;if(this._sessionTimeoutMs=1e3*fo(this.Fr.session_idle_timeout_seconds||1800,60,36e3,su.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Wc(),this.Vc="ph_"+s+"_window_id",this.Gc="ph_"+s+"_primary_window_exists",this.Qc()){const i=ln.Ft(this.Vc),o=ln.Ft(this.Gc);i&&!o?this.Be=i:ln.Dt(this.Vc),ln.$t(this.Gc,!0)}!((r=this.Fr.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Fr.bootstrap.sessionID),this.Jc()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return le(this.Nc)&&(this.Nc=[]),this.Nc.push(e),this.Xt&&e(this.Xt,this.Be),()=>{this.Nc=this.Nc.filter(t=>t!==e)}}Qc(){return this.Fr.persistence!=="memory"&&!this.Pc.fi&&ln.Ot()}Zc(e){e!==this.Be&&(this.Be=e,this.Qc()&&ln.$t(this.Vc,e))}Kc(){return this.Be?this.Be:this.Qc()?ln.Ft(this.Vc):null}Yc(e){const t=this.Dc;return!kn(t)&&!kn(e)&&5e3>Math.abs(e-t)}Xc(e,t,n){const r=t!==this._sessionActivityTimestamp,s=!(e!==this.Xt||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Xt=e,s&&!r||s&&this.Yc(t)||(this.Dc=t,this.Pc.register({[yu]:[t,e,n]}))}eh(){var e;const t=(e=this.Fr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return jo(t)&&t>0}ih(){this.eh()?this.Pc.refreshKey(yu):(this.Pc.flush(),this.Pc.load())}nh(){var e;if(kn(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Dc)return;this.ih();const[,t,n]=this.sh();t===this.Xt&&n===this._sessionStartTimestamp&&(this.Dc=this._sessionActivityTimestamp,this.Pc.register({[yu]:[this._sessionActivityTimestamp,(e=this.Xt)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Pc.flush())}rh(){const[e]=this.sh(),t=jo(e)?e:0,n=jo(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)}oh(e){return this.ih(),this.Bc(e,this.rh())}sh(){const e=this.Pc.props[yu];return He(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Dc=null,this.zc=void 0,clearTimeout(this.ah),this.ah=void 0,this.Xc(null,null,null)}setBootstrapSessionId(e,t=!1){const n=((r,s=new Date().getTime())=>{try{const i=(o=>{const c=o.replace(/-/g,"");if(c.length!==32)throw new Error("Not a valid UUID");if(c[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(c.substring(0,12),16)})(r);return i>s+6e4?void su.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void su.error("Invalid sessionID in bootstrap",i)}})(e);return!le(n)&&(t?this.zc={sessionId:e,sessionStartTimestamp:n}:this.Xc(e,new Date().getTime(),n),!0)}destroy(){this.qc=!0,this.nh(),clearTimeout(this.ah),this.ah=void 0,this.jc&&ie&&(ie.removeEventListener(E0,this.jc,{capture:!1}),this.jc=void 0),this.Nc=[]}Jc(){this.jc=()=>{this.nh(),this.Qc()&&ln.Dt(this.Gc)},$t(ie,E0,this.jc,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,t=null,n=!1){if(this.Fr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=t||new Date().getTime(),s=this.Xt;if(n)this.Lc=r;else if(kn(this.Lc)||this.Lc>r||r-this.Lc>=1e3){var i,o;(i=(o=this.Pc).syncCookieProperties)===null||i===void 0||i.call(o),this.Lc=r}let[,c,u]=this.sh();const d=!le(s)&&c!==s,f=this.rh();let p=this.Kc();const m=this.zc,v=!!m&&(m.sessionStartTimestamp>r+6e4||r-m.sessionStartTimestamp>C6),_=m?v:jo(u)&&Math.abs(r-u)>C6;let w=!1,b=d,S=!c||!!m;const E=c;let C=!S&&!e&&this.Bc(r,f);if(C&&(C=this.oh(r),C||su.info("cross-tab refresh kept the session alive",{sessionId:c}),[,c,u]=this.sh(),C||(S=!c||!!m)),S||C||_){b=!1;const M=m&&!v;c=M?m.sessionId:this.Hc(),p=this.Uc(),su.info("new session ID assigned",{sessionId:c,windowId:p,bootstrapped:!!M,changeReason:{noSessionId:S,activityTimeout:C,sessionPastMaximumLength:_}}),u=M?m.sessionStartTimestamp:r,this.zc=void 0,w=!0}else p||(p=this.Uc(),w=!0),b=b||c!==E,b&&(su.info("adopted cross-tab session id",{sessionId:c,windowId:p}),w=!0);const R=jo(f)&&e&&!_?f:r,T=jo(u)?u:new Date().getTime();this.Zc(p),this.Xc(c,R,T),e||this.Wc();const O={noSessionId:S,activityTimeout:C,sessionPastMaximumLength:_,crossTabAdoption:b};return w&&this.Nc.forEach(M=>M(c,p,O)),{sessionId:c,windowId:p,sessionStartTimestamp:T,changeReason:w?O:void 0,lastActivityTimestamp:f}}Wc(){this.qc||(clearTimeout(this.ah),this.ah=setTimeout(()=>{if(!this.qc)if(this.oh(new Date().getTime())){const e=this.Xt;this.resetSessionId(),this.Fc.emit("forcedIdleReset",{idleSessionId:e})}else this.Wc()},1.1*this.sessionTimeoutMs))}};const R6=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]),fI=function(e,t){if(!e)return!1;const n=e.userAgent;if(n&&Ek(n,t))return!0;try{const r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>Ek(s==null?void 0:s.brand,t)))return!0}catch{}return!!e.webdriver};function hI(){return(hI=cn(function*(){const e=Dr==null?void 0:Dr.userAgentData;if(e!=null&&e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["model"]),n=t==null?void 0:t.model;return ft(n)&&n.length>0?n:void 0}catch(t){return void me.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})).apply(this,arguments)}function Gj(e,t){let n=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(n=`$survey_${t}/${e.id}/${e.current_iteration}`),n}function pI(e){var t;return!!(!((t=e.conditions)===null||t===void 0||(t=t.events)===null||t===void 0||(t=t.values)===null||t===void 0)&&t.length)}const A0=(e,t)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}},im=e=>e.toLowerCase(),mI={exact:(e,t)=>t.some(n=>e.some(r=>n===r)),is_not:(e,t)=>t.every(n=>e.every(r=>n!==r)),regex:(e,t)=>t.some(n=>e.some(r=>A0(n,r))),not_regex:(e,t)=>t.every(n=>e.every(r=>!A0(n,r))),icontains:(e,t)=>t.map(im).some(n=>e.map(im).some(r=>n.includes(r))),not_icontains:(e,t)=>t.map(im).every(n=>e.map(im).every(r=>!n.includes(r))),gt:(e,t)=>t.some(n=>{const r=parseFloat(n);return!isNaN(r)&&e.some(s=>r>parseFloat(s))}),lt:(e,t)=>t.some(n=>{const r=parseFloat(n);return!isNaN(r)&&e.some(s=>r<parseFloat(s))})};function gI(e,t){return!e||Object.entries(e).every(([n,r])=>{const s=t==null?void 0:t[n];if(s==null)return!1;const i=mI[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function o1(e,t,n){return bu({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}const tw="custom",T6="i.posthog.com",qj=/^\/static\//,Yj=["/s/","/e/","/i/"];var Xj=class{constructor(e){this.uh={},this.instance=e}get apiHost(){const e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){const e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${T6}`,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.uh[this.apiHost]||(this.uh[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":tw),this.uh[this.apiHost]}hh(e){if(!qj.test(e))return;const t=this.instance.config.asset_host;return typeof t=="string"&&t.trim().replace(/\/$/,"")||void 0}dh(e){const t=vo(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}fh(e,t,n){if(e==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=vo(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&e==="api"&&Yj.some(o=>t.indexOf(o)===0)){const o=this.dh(r);if(o){const c=this.apiHost;let u=this.ph;(u==null?void 0:u.apiHost)===c&&u.rewriteRequestPath===s||(u={apiHost:c,rewriteRequestPath:s,urls:new Set},this.ph=u),u.urls.add(o)}}return r}isIngestionEndpoint(e){const t=this.ph,n=this.dh(e);return(t==null?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&t.urls.has(n)}endpointFor(e,t=""){if(t&&(t=t[0]==="/"?t:`/${t}`),e==="ui")return this.fh(e,t,this.uiHost+t);if(e==="flags")return this.fh(e,t,this.flagsApiHost+t);if(e==="assets"){const r=this.hh(t);if(r)return this.fh(e,t,`${r}${t}`)}if(this.region===tw)return this.fh(e,t,this.apiHost+t);const n=T6+t;switch(e){case"assets":return this.fh(e,t,`https://${this.region}-assets.${n}`);case"api":return this.fh(e,t,`https://${this.region}.${n}`)}}};const Ut=xn("[Surveys]"),vI=e=>{try{const t=(n=>((r,s)=>`seenSurvey_${(function(i){return i.current_iteration&&i.current_iteration>0?`${i.id}_${i.current_iteration}`:i.id})(s)}`)(0,n))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(t){Ut.error("Failed to persist survey seen state",t)}},Qj=[e1.Popover,e1.Widget,e1.API],Jj={ignoreConditions:!1,ignoreDelay:!1,displayType:Y_.Popover},e7=xn("[PostHog ExternalIntegrations]"),t7={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var n7=class{constructor(e){this._instance=e}Bl(e,t){var n,r;(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,e,s=>{if(s)return e7.error("failed to load script",s);t()})}startIfEnabledOrStop(){var e;for(const[s,i]of Object.entries((e=this._instance.config.integrations)!==null&&e!==void 0?e:{})){var t,n,r;i&&!(!((t=et.__PosthogExtensions__)===null||t===void 0||(t=t.integrations)===null||t===void 0)&&t[s])&&this.Bl(t7[s],()=>{var o;(o=et.__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=et.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=et.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},yI=class{constructor(e){this.disabled=e===!1;const t=ut(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}};const nw=()=>typeof window>"u"?void 0:window,gf=()=>typeof document>"u"?void 0:document,a1="$copy_autocapture",r7=["password","hidden","file","checkbox","button","submit","reset","image"],om=xn("[AutoCapture]");function l1(e,t){return t.length>e?t.slice(0,e)+"...":t}function s7(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!pi(t));return t}function i7(e,{e:t,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var c,u;if(!pi(e))return{props:{}};const d=[e],f=new Set([e]);let p=e;for(;p.parentNode&&!Xn(p,"body")&&1e3>d.length;){if(k0(p.parentNode)){const O=p.parentNode.host;if(f.has(O))break;f.add(O),d.push(O),p=O;continue}if(!pi(p.parentNode)||f.has(p.parentNode))break;f.add(p.parentNode),d.push(p.parentNode),p=p.parentNode}const m=t.type==="click"&&e.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(O=>Xn(O,"button")||Xn(O,"a")):-1;m>0&&(r=r||d.slice(0,m+1).some(O=>!nl(O)||Yu(O)));const v=[],_={};let w,b=!1,S=!1;if(Zt(d,O=>{const M=nl(O);if(Xn(O,"a")&&!n&&!(s!=null&&s.includes("href"))){const A=O.getAttribute("href");b=!!(M&&A&&Au(A))&&(o?el(A):A)}We(fc(O),"ph-no-capture")&&(S=!0),v.push((function(A,L,V,W,z=!1){const X=A.tagName.toLowerCase(),Q={tag_name:X};lb.indexOf(X)>-1&&!V&&(Q.$el_text=X.toLowerCase()==="a"||X.toLowerCase()==="button"?l1(1024,d6(A)):l1(1024,oh(A)));const H=fc(A);L||W!=null&&W.includes("class")||0>=H.length||(Q.classes=H.filter(function(J){return J!==""})),Zt(A.attributes,function(J){var K;if((!Yu(A)||["name","id","class","aria-label"].indexOf(J.name)!==-1)&&!(W!=null&&W.includes(J.name))&&!L&&Au(J.value)&&(!ft(K=J.name)||K.substring(0,10)!=="_ngcontent"&&K.substring(0,7)!=="_nghost")){let D=J.value;J.name==="class"&&(D=ab(D).join(" ")),Q["attr__"+J.name]=l1(1024,J.name==="href"&&z?el(D):D)}});let Y=1,oe=1,U=A;for(;U=s7(U);)Y++,U.tagName===A.tagName&&oe++;return Q.nth_child=Y,Q.nth_of_type=oe,Q})(O,n,r,s,o)),Zt((function(A){if(!nl(A))return{};const L={};return Zt(A.attributes,function(V){if(V.name&&V.name.indexOf("data-ph-capture-attribute")===0){const W=V.name.replace("data-ph-capture-attribute-",""),z=V.value;W&&z&&Au(z)&&(L[W]=z)}}),L})(O),(A,L)=>{({}).hasOwnProperty.call(_,L)||(_[L]=A)})}),S)return{props:{},explicitNoCapture:S};if(m>0&&(e=d[m],v.splice(0,m)),r||(v[0].$el_text=Xn(e,"a")||Xn(e,"button")?d6(e):oh(e)),b){var E,C;v[0].attr__href=b;const O=(E=vo(b))===null||E===void 0?void 0:E.host,M=(C=nw())===null||C===void 0||(C=C.location)===null||C===void 0?void 0:C.host;O&&M&&O!==M&&(w=b)}return{props:pn((T=t.type,{$event_type:T,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(R=v,He(R)?(function(O){return O.map(M=>{var A,L;let V="";if(M.tag_name&&(V+=M.tag_name),M.attr_class){M.attr_class.sort();for(const X of M.attr_class)V+=`.${X.replace(/"/g,"")}`}const W=N(N(N(N({},M.text?{text:M.text}:{}),{},{"nth-child":(A=M.nth_child)!==null&&A!==void 0?A:0,"nth-of-type":(L=M.nth_of_type)!==null&&L!==void 0?L:0},M.href?{href:M.href}:{}),M.attr_id?{attr_id:M.attr_id}:{}),M.attributes),z={};return Zm(W).sort(([X],[Q])=>(function(H,Y){return Y>H?-1:H>Y?1:0})(X,Q)).forEach(([X,Q])=>z[f6(X.toString())]=f6(Q.toString())),V+=":",V+=Zm(z).map(([X,Q])=>`${X}="${Q}"`).join(""),V}).join(";")})((function(O){return O.map(M=>{var A,L;const V={text:(A=M.$el_text)===null||A===void 0?void 0:A.slice(0,400),tag_name:M.tag_name,href:(L=M.attr__href)===null||L===void 0?void 0:L.slice(0,2048),attr_class:wj(M),attr_id:M.attr__id,nth_child:M.nth_child,nth_of_type:M.nth_of_type,attributes:{}};return Zm(M).filter(([W])=>W.indexOf("attr__")===0).forEach(([W,z])=>V.attributes[W]=z),V})})(R)):"")},!((c=v[0])===null||c===void 0)&&c.$el_text?{$el_text:(u=v[0])===null||u===void 0?void 0:u.$el_text}:{},w&&t.type==="click"?{$external_click_url:w}:{},_),target:e};var R,T}const _I="autocapture";var o7=class{vl(){this.fl=void 0,clearTimeout(this.pl),this.pl=void 0}gl(e){var t;if(!nl(e))return!0;const n=(t=this.ml().css_selector_ignorelist)!==null&&t!==void 0?t:em,r=new Set;let s=e;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=fc(i);if(We(o,"ph-no-capture")||We(o,"ph-sensitive")||Yu(i)||n.some(u=>Pf(i,u)))return!0;const c=s.parentNode;s=k0(c)?c.host:c&&pi(c)?c:null}return!1}yl(e){if(!this.isEnabled||e.type==="pointercancel")return void this.vl();if(e.type==="pointerdown"){var t;this.vl();const r=Zf(e);return void(e.isPrimary&&e.button===0&&!e.ctrlKey&&r&&pi(r)&&(this.fl={target:r,excluded:this.gl(r),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:(t=this.Fa)===null||t===void 0?void 0:t.distinctId}))}const n=this.fl;n&&(e.pointerId!==n.id||Math.abs(e.clientX-n.x)>5||Math.abs(e.clientY-n.y)>5?this.vl():e.type==="pointerup"&&(n.released=!0,this.pl=setTimeout(()=>this.vl(),0)))}bl(e){var t;const n=this.fl;this.vl();const r=Zf(e);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((t=this.Fa)===null||t===void 0?void 0:t.distinctId)&&e.pointerId===n.id&&(e.detail>0||e.pointerType==="touch"||e.pointerType==="pen")&&e.button===0&&5>=Math.abs(e.clientX-n.x)&&5>=Math.abs(e.clientY-n.y)&&r&&(Xn(r,"html")||Xn(r,"body"))){var s,i,o;if(n.excluded)return null;const c=(s=this.ml().css_selector_ignorelist)!==null&&s!==void 0?s:em;return[r,(i=gf())===null||i===void 0?void 0:i.documentElement,(o=gf())===null||o===void 0?void 0:o.body].some(u=>{if(!u)return!1;const d=fc(u);return We(d,"ph-no-capture")||We(d,"ph-sensitive")||!nl(u)||Yu(u)||c.some(f=>Pf(u,f))})?null:n.target}}constructor(e){this.Na=e,this.name=_I,this._l=!1,this.wl=null,this.kl=!1,this.Sl=new Map,this.xl=!1,this.Fr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Ti=!1,this.Na.refresh(this.Fr),this.rageclicks=new yI(this.Fr.rageclick),this.$l=null}setup(e){this.Cl(),this.Fa=e;const t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Ti?t.dispose():(this.Za=t,this.startIfEnabled())}dispose(){var e;this.Ti||(this.Ti=!0,this.Fa=void 0,(e=this.Za)===null||e===void 0||e.dispose(),this.Za=void 0,this.Sl.clear(),this.$l=null,this.Tl())}ml(){return this.Na.refresh(this.Fr),this.Fr}Cl(){var e,t;return this.ml(),this.Fr.url_allowlist=(e=this.Fr.url_allowlist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Fr.url_ignorelist=(t=this.Fr.url_ignorelist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Fr}Il(){const e=nw(),t=gf();if(!this.isBrowserSupported())return void om.info("Disabling Automatic Event Collection because this browser is not supported");if(!e||!t)return;this.Ml=e,this.El=t;const n=this.Al=r=>{r=r||(e==null?void 0:e.event);try{if(r.type==="blur")return void this.vl();if(r.type.indexOf("pointer")===0)return void this.yl(r);const s=r.type==="click"?this.bl(r):void 0;if(kn(s))return;this.Rl(r,"$autocapture",s)}catch(s){om.error("Failed to capture event",s)}};if($t(e,"blur",n),$t(t,"submit",n,{capture:!0}),$t(t,"change",n,{capture:!0}),$t(t,"click",n,{capture:!0}),Zt(["pointerdown","pointermove","pointerup","pointercancel"],r=>{$t(t,r,n,{capture:!0})}),this.ml().capture_copied_text){const r=this.Pl=s=>{s=s||(e==null?void 0:e.event);try{this.Rl(s,a1)}catch(i){om.error("Failed to capture clipboard event",i)}};$t(t,"copy",r,{capture:!0}),$t(t,"cut",r,{capture:!0}),$t(t,"paste",r,{capture:!0})}}Tl(){const e=this.Ml,t=this.El;this.vl(),this.Al&&(e==null||e.removeEventListener("blur",this.Al),Zt(["pointerdown","pointermove","pointerup","pointercancel"],n=>{t==null||t.removeEventListener(n,this.Al,!0)}),t==null||t.removeEventListener("submit",this.Al,!0),t==null||t.removeEventListener("change",this.Al,!0),t==null||t.removeEventListener("click",this.Al,!0),this.Al=void 0),this.Pl&&(t==null||t.removeEventListener("copy",this.Pl,!0),t==null||t.removeEventListener("cut",this.Pl,!0),t==null||t.removeEventListener("paste",this.Pl,!0),this.Pl=void 0),this.Ml=void 0,this.El=void 0,this._l=!1}startIfEnabled(){this.isEnabled||this.vl(),!this.Ti&&this.Fa&&this.isEnabled&&!this._l&&(this.Il(),this._l=!0)}onRemoteConfig(e){if(this.Ti)return;if(this.kl=!0,!e.ok)return void this.startIfEnabled();const t=e.config;t.elementsChainAsString&&(this.xl=t.elementsChainAsString);const n=t.autocapture_opt_out;var r;ds(n)&&((r=this.Fa)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.wl=n),this.startIfEnabled()}setElementSelectors(e,t=this){if(this.Ti)return;e.size?this.Sl.set(t,new Set(e)):this.Sl.delete(t);const n=new Set;this.Sl.forEach(r=>{r.forEach(s=>n.add(s))}),this.$l=n}getElementSelectors(e,t){var n;const r=[];return(n=this.$l)===null||n===void 0||n.forEach(s=>{var i;const o=(i=gf())===null||i===void 0?void 0:i.querySelectorAll(s);o==null||o.forEach(c=>{e!==c&&t!==c||We(r,s)||r.push(s)})}),r}get isEnabled(){var e,t;if(this.Ti)return!1;const n=(e=this.Fa)===null||e===void 0?void 0:e.kv.get(sA),r=this.wl,s=this.ml();if(!s.remoteRequestsDisabled&&!this.kl)return!1;const i=s.remoteRequestsDisabled&&!this.kl;if(kn(r)&&!ds(n)&&!i)return!1;const o=(t=this.wl)!==null&&t!==void 0?t:!!n;return!!s.enabled&&!o}Rl(e,t="$autocapture",n){if(!this.isEnabled)return void this.vl();let r=n||Zf(e);RA(r)&&(r=r.parentNode||null);const s=this.Cl();var i;t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&s.rageclick&&(!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime()))&&OA(r,s.rageclick)&&this.Rl(e,"$rageclick",n);const o=t===a1,c=o?N(N({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(m,v,_,w,b,S){var E;const C=typeof window>"u"?void 0:window;if(!C||ub(m)||_!=null&&_.url_allowlist&&!r6(_.url_allowlist,S)||_!=null&&_.url_ignorelist&&r6(_.url_ignorelist,S))return!1;if(_!=null&&_.dom_event_allowlist){const M=_.dom_event_allowlist;if(M&&!M.some(A=>v.type===A))return!1}const{parentIsUsefulElement:R,targetElementList:T}=MA(m,w);if(!(function(M,A){const L=A==null?void 0:A.element_allowlist;if(le(L))return!0;for(const V of M)if(L.some(W=>V.tagName.toLowerCase()===W))return!0;return!1})(T,_)||!q_(T,_==null?void 0:_.css_selector_allowlist)||q_(T,(E=_==null?void 0:_.css_selector_ignorelist)!==null&&E!==void 0?E:em))return!1;try{const M=C.getComputedStyle(m);if(M&&M.getPropertyValue("cursor")==="pointer"&&v.type==="click")return!0}catch{}const O=m.tagName.toLowerCase();switch(O){case"html":return!1;case"form":return(b||["submit"]).indexOf(v.type)>=0;case"input":case"select":case"textarea":return(b||["change","click"]).indexOf(v.type)>=0;default:return R?(b||["click"]).indexOf(v.type)>=0:(b||["click"]).indexOf(v.type)>=0&&(lb.indexOf(O)>-1||m.getAttribute("contenteditable")==="true")}})(r,e,c,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var u;const{props:m,explicitNoCapture:v,target:_}=i7(r,{e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.xl,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(v)return!1;const w=this.getElementSelectors(r,_);if(w&&w.length>0&&(m.$element_selectors=w),t===a1){const b=e.type||"clipboard";if(b!=="paste"){var d,f;const S=(d=nw())===null||d===void 0||(d=d.getSelection())===null||d===void 0?void 0:d.toString(),E=TA(S);if(!E)return!1;m.$selected_content=E,m.$clipboard_text_length=(f=S==null?void 0:S.length)!==null&&f!==void 0?f:0}m.$copy_type=b}if(t==="$autocapture"&&e.type==="change"&&s.capture_value_css_selector_allowlist&&!s.maskAllText&&(Xn(p=r,"input")?!We(r7,p.type):Xn(p,"textarea")||Xn(p,"select")&&!p.multiple)&&(function(b,S){var E;if(!nl(b))return!1;const C=(E=S.css_selector_ignorelist)!==null&&E!==void 0?E:em,R=new Set;let T=b;for(Xn(b,"select")&&(T=b.options[b.selectedIndex]||b);T;){const O=T,M=fc(O);if(R.size>=1e3||R.has(T)||We(M,"ph-sensitive")||We(M,"ph-no-capture")||C.some(L=>Pf(O,L)))return!1;R.add(T);const A=T.assignedSlot||T.parentNode;T=k0(A)?A.host:A&&pi(A)?A:null}return!0})(r,s)&&!r.querySelector(".ph-no-capture, .ph-sensitive")){const b=s.capture_value_css_selector_allowlist;let S=!1;try{S=On(b)?!!b(r):He(b)&&b.some(E=>Pf(r,E))}catch(E){om.error("capture_value_css_selector_allowlist threw",E)}S&&(m.$input_value=r.value)}return(u=this.Fa)===null||u===void 0||u.capture(t,m),!0}var p}isBrowserSupported(){var e;return On((e=gf())===null||e===void 0?void 0:e.querySelectorAll)}};const wI="featureFlags",bI="logs",ch=()=>{var e;return!(ie==null||(e=ie.performance)===null||e===void 0)&&e.now?ie.performance.now():Date.now()},a7=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4];var l7=class{constructor(e){this._instance=e}initialize(){}get(e){const t=this._instance.persistence;if(typeof e=="string")return t==null?void 0:t.get_property(e);const n={};for(const r of e){const s=t==null?void 0:t.get_property(r);le(s)||(n[r]=s)}return n}set(e,t){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof e=="string"?{[e]:t}:e)}remove(e){var t;(t=this._instance.persistence)===null||t===void 0||t.unregister(e)}},c7=class{constructor(e){this.instance=e,this.R=me,this.kv=new l7(e),this.onSession=t=>sm(this.instance.onSessionId(n=>{try{t(n)}catch(r){this.R.error("Browser extension session listener failed",r)}})),this.onEvent=t=>sm(this.instance._addCaptureHook((n,r)=>{if(r)try{t({event:n,properties:r.properties})}catch(s){this.R.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=t=>{const n=s=>{try{t(s)}catch(i){this.R.error("Browser extension remote config listener failed",i)}},r=this.instance.dr.on("extensionsRemoteConfig",n);return this.instance.vr&&n(this.instance.vr),sm(r)}}get logger(){return this.R}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property("$device_id"))!==null&&e!==void 0?e:this.distinctId}get deviceId(){const e=this.instance.get_property(J2);return typeof e=="string"?e:void 0}get library(){return{name:Es.LIB_NAME,version:Es.LIB_VERSION}}get initialPersonProperties(){var e,t;return(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,n,r,s;const i=(e=this.instance.sessionManager)===null||e===void 0?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(t=i==null?void 0:i.sessionId)!==null&&t!==void 0?t:"",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 On(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var e;return!!(!((e=this.instance.rateLimiter)===null||e===void 0)&&e.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(e){let t;switch(e){case wI:case"featureFlagsCommon":t=this.instance.featureFlags;break;case bI:t=this.instance.logs;break;case"surveys":t=this.instance.surveys;break;case _I:t=this.instance.autocapture}return t}capture(e,t,n){if(!n)return this.pr(this.instance.capture(e,t));const r=N({timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce},n.delivery==="unload"?{transport:"sendBeacon",send_instantly:!0}:{});return this.pr(this.instance.capture(e,t,r))}pr(e){var t;return!le(e)||!(!((t=this.instance.rateLimiter)===null||t===void 0)&&t.lastEventRateLimited)}registerDynamicEventProperties(e){return sm(this.instance.mr(e))}sendRequest(e){var t=this;return cn(function*(n,r={}){var s;const i=(s=r.target)!==null&&s!==void 0?s:"api",o=r.query?bg(n,r.query):n,c=t.instance.requestRouter.endpointFor(i,o),u={method:r.method,url:c,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"?k_.Base64:void 0,timestampMode:r.sentAt};return i==="api"&&n==="/i/v1/logs"&&(u.batchKey="logs"),r.transport==="sendBeacon"?(t.instance._send_request(u),{statusCode:202}):new Promise(d=>{var f;if(u.callback=d,i==="flags"&&((f=t.instance.config.metrics)===null||f===void 0?void 0:f.flags)){let p;u.onDispatch=()=>{p=ch()},u.callback=m=>{le(p)||t.gr(c,m,ch()-p),d(m)}}t.instance._send_request(u)})}).apply(this,arguments)}gr(e,t,n){try{var r,s,i;const o=t.statusCode||void 0,c={"server.address":((r=(s=vo(e))===null||s===void 0?void 0:s.hostname)!==null&&r!==void 0?r:e).replace(/^\[(.*)\]$/,"$1")};o&&(c["http.response.status_code"]=o);const u=((f,p)=>f?400>f?void 0:String(f):(p==null?void 0:p.name)==="AbortError"?"timeout":"_OTHER")(o,t.error);u&&(c["error.type"]=u);const d=db();d&&(c["client.timezone"]=d),(i=this.instance.metrics)===null||i===void 0||i.histogram("posthog.flags.request.duration",n,{unit:"ms",attributes:c,bounds:a7})}catch(o){me.error("Failed to record the /flags request duration",o)}}};const Wf={};let c1=0;const Kf=()=>{},A6='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',iu="Surveys module not available",I6="sanitize_properties is deprecated. Use before_send instead",xI="Invalid value for property_denylist config: ",u7=["$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"],d7=["$feature_flag_called","$$heatmap","$snapshot"],O6=e=>e.charAt(0)==="$"&&!We(d7,e),f7=/^[A-Za-z0-9_-]{1,400}$/,M6=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,L6=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,h7=["token","distinct_id",hA],Rf="posthog",p7=[...R6].sort()[R6.length-1],m7=e=>{const t={};return e&&e!=="unset"&&("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0)),t},u1=e=>{var t;return N({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ij(Ie==null?void 0:Ie.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Kf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:an&&ft(an==null?void 0:an.search)&&an.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:(ie==null||(t=ie.location)===null||t===void 0?void 0:t.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){me.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:SA,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Kf},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:cb,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:m7(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)}))(e))},g7=[["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"]],$6=e=>{const t={};for(const[s,i]of g7)le(e[s])||(t[i]=e[s]);const n=pn({},t,e),r=e.__preview_external_dependency_versioned_paths;return le(r)||(le(e.strict_script_versioning)&&(n.strict_script_versioning=!!r),ft(r)&&le(e.asset_host)&&(n.asset_host=r)),He(e.property_blacklist)&&(le(e.property_denylist)?n.property_denylist=e.property_blacklist:He(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:me.error(xI+e.property_denylist)),n};var v7=class{constructor(){this.__forceAllowLocalhost=!1}get gh(){return this.__forceAllowLocalhost}set gh(e){me.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Gf=class Ma{mh(t){if(!t)return;const n=this.yh.indexOf(t);n!==-1&&this.yh.splice(n,1)}bh(t,n){var r;return this.mh(t),this.yh.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}_h(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}wh(){if(this.kh||this.config.reuseAnonymousId||this.config.segment||this._h())return;const t=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!t&&!this.config.disable_persistence||this.Sh)return;let n,r,s;t?(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.kh=!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}`)}xh(){const t=this.persistence;if(!t||this.$h)return;if(this._h())return void(this.config.cookieless_mode==="on_reject"&&this.get_distinct_id()!=="$posthog_cookieless"&&(this.Ch(),this.Th()));if(this.get_distinct_id()!=="$posthog_cookieless")return;this.Ih()||t.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(Di());this.register({distinct_id:r,$device_id:r}),t.set_property(Qr,Go)}this.Ch()}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.Mh=!1,this.Eh=!1,this.webPerformance=new v7,this.Ah=!1,this.version=Es.LIB_VERSION,this.Rh=new Set,this.Ph="",this.dr=new T0,this.yh=[],this.Oh=[],this.Fh=!1,this.Sh=!1,this.kh=!1,this.$h=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=u1(),this.SentryIntegration=Sj,this.sentryIntegration=r=>(function(s,i){const o=NA(s,i);return{name:$A,processEvent:c=>o(c)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Dh=!1,this.Lh=null,this.Nh=null,this.jh=null,this.scrollManager=new Wj(this),this.pageViewManager=new m6(this),this.rateLimiter=new Mj(this),this.requestRouter=new Xj(this),this.consent=new fj(this),this.externalIntegrations=new n7(this);const n=(t=Ma.__defaultExtensionClasses)!==null&&t!==void 0?t:{};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=ft(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=ft(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>me.info(`send "${r==null?void 0:r.event}"`,r))}init(t,n,r){if(r&&r!==Rf){var s;const i=(s=Wf[r])!==null&&s!==void 0?s:new Ma;return i._init(t,n,r),Wf[r]=i,Wf[Rf][r]=i,i}return this._init(t,n,r)}_init(t,n={},r){var s,i,o;const c=ft(t)?t.trim():"";if(!c)return me.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 c!==((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('${c}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=u1(n.defaults),n.debug=this.qh(n.debug),this.Bh=n,this.zh=[],n.person_profiles?this.Nh=n.person_profiles:n.process_person&&(this.Nh=n.process_person);const d=u1(n.defaults),f=$6(n),p=pn({},d,f,{name:r,token:c});ut(d.rageclick)&&ut(f.rageclick)&&(p.rageclick=pn({},d.rageclick,f.rageclick)),ut(d.session_recording)&&ut(f.session_recording)&&(p.session_recording=pn({},d.session_recording,f.session_recording)),this.set_config(p),this.config.on_xhr_error&&me.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Ws.GZipJS;const m=this.Ih(),v=!this._h();if(this.persistence=new Jy(this.config,m,!0,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Jy(N(N({},this.config),{},{persistence:"sessionStorage"}),m,!1,v),this.Ph="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!m&&ln.Ot()){const E=ln.Ft(this.Ph);He(E)&&E.forEach(C=>{ft(C)&&this.Rh.add(C)})}else ln.Dt(this.Ph);const _=N({},this.persistence.props),w=N({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Hh=new Uj((E,C)=>this.Uh(E,C),this.config.request_queue_config),this.Wh=new Bj(this),this.__request_queue=[];const b=this._h();b||(this.sessionManager=new P6(this),this.sessionPropsManager=new k6(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((E,C,R)=>{(R!=null&&R.activityTimeout||R!=null&&R.sessionPastMaximumLength||R!=null&&R.crossTabAdoption)&&this.Vh()})),this.Gh(),this.config.__preview_deferred_init_extensions?(me.info("Deferring extension initialization to improve startup performance"),this.Qh=setTimeout(()=>{this.Qh=void 0,this.Jh(b)},0)):(me.info("Initializing extensions synchronously"),this.Jh(b)),Es.DEBUG=Es.DEBUG||this.config.debug,Es.DEBUG&&me.info("Starting in debug mode",{this:this,config:n,thisC:N({},this.config),p:_,s:w}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=N(N({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const S=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.Sh=!!S&&!Df(S),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const E=n.bootstrap.distinctID,C=this.get_distinct_id(),R=this.persistence.get_property(Qr);if(n.bootstrap.isIdentifiedID&&C!=null&&C!==E&&R==="anonymous")this.identify(E);else if(n.bootstrap.isIdentifiedID&&C!=null&&C!==E&&R==="identified")me.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(Di()),O=n.bootstrap.isIdentifiedID?T:E;this.persistence.set_property(Qr,n.bootstrap.isIdentifiedID?Um:Go),this.register({distinct_id:E,$device_id:O})}}if(b)this.register_once({distinct_id:Zy,$device_id:null},"");else if(!this.get_distinct_id()){const E=this.config.get_device_id(Di());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(Qr,Go)}return $t(ie,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),$t(ie,"pageshow",E=>{if(this.Mh=!1,!this.Eh){var C;if(E.persisted&&this.persistence){const R=this.persistence.get_property(ui),T=this.persistence.get_property(Qr);this.persistence.load(),this.Zh()||R===this.persistence.get_property("distinct_id")&&T===this.persistence.get_property("$user_state")||this.Kh()}(C=this.Wh)===null||C===void 0||C.resume()}}),n.segment?p6(this,()=>this.Yh()):this.Yh(),On(this.config._onCapture)&&this.config._onCapture!==Kf&&(me.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",E=>this.config._onCapture(E.event,E))),this.config.ip&&me.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 hI.apply(this,arguments)})().then(E=>{E&&this.register({[Uy]:E})}).catch(Kf),this}Xh(t){const n=t;return ft(n.name)&&On(n.setup)}ed(t,n){var r=this;this.Xh(t)?n.push(cn(function*(){try{yield t.setup(r.nd())}catch(i){me.error(`Failed to set up extension "${t.name}"`,i);try{var s;yield(s=t.dispose)===null||s===void 0?void 0:s.call(t)}catch(o){me.error(`Failed to dispose extension "${t.name}"`,o)}}})):this.yh.push(t)}Gh(){var t,n,r,s=this;const i=(t=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&t!==void 0?t:(r=Ma.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var o,c,u;if(i)if(this.featureFlags&&this.featureFlags instanceof i||((o=this.sd)===null||o===void 0||o.call(this),this.sd=void 0,this.featureFlags=new i(this)),On(this.featureFlags.onReloading)&&On(this.featureFlags.setup)){if(!this.sd){this.sd=this.featureFlags.onReloading(()=>{this.dr.emit("featureFlagsReloading",!0)});const d=this.featureFlags;cn(function*(){try{yield d.setup(s.nd())}catch(f){me.error("Failed to set up feature flags",f);const p=s.sd;s.sd=void 0;try{p==null||p()}catch(m){me.error("Failed to unsubscribe feature flag reloading",m)}try{yield d.dispose()}catch(m){me.error("Failed to dispose feature flags",m)}}})()}}else(c=(u=this.featureFlags).initialize)===null||c===void 0||c.call(u)}Jh(t){const n=performance.now(),r=N(N({},Ma.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,c,u,d,f,p,m;r.exceptions&&this.yh.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.yh.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.yh.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.yh.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!t&&this.yh.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.ed(this.autocapture=new r.autocapture(this),s),r.surveys&&this.ed(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.ed(this.logs=(c=this.logs)!==null&&c!==void 0?c:new r.logs(this),s),r.metrics&&this.yh.push(this.metrics=(u=this.metrics)!==null&&u!==void 0?u:new r.metrics(this)),r.conversations&&this.yh.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.yh.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.yh.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.yh.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.yh.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.yh.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,xj)),r.toolbar&&this.yh.push(this.toolbar=(f=this.toolbar)!==null&&f!==void 0?f:new r.toolbar(this)),r.experiments&&this.yh.push(this.experiments=(p=this.experiments)!==null&&p!==void 0?p:new r.experiments(this)),r.webMCP&&this.yh.push(this.webMCP=(m=this.webMCP)!==null&&m!==void 0?m:new r.webMCP(this)),this.yh.forEach(v=>{v.initialize&&s.push(()=>{var _;(_=v.initialize)===null||_===void 0||_.call(v)})}),s.push(()=>{if(this.rd){const v=this.rd;this.rd=void 0,this.yh.forEach(_=>{var w;return(w=_.onRemoteConfig)===null||w===void 0?void 0:w.call(_,v)})}}),this.od(s,n)}od(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void(this.Qh=setTimeout(()=>{this.Qh=void 0,this.od(t,n)},0));const s=t.shift();if(s)try{s()}catch(i){me.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[pA]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[mA]:r}),this.config.__preview_deferred_init_extensions&&me.info(`PostHog extensions initialized (${r}ms)`)}ac(t){if(!Ie||!Ie.body)return me.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.ac(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.rd=t),this.vr=t,this.compression=void 0,t.ok){var n;const r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=We(r.supportedCompression,Ws.GZipJS)?Ws.GZipJS:We(r.supportedCompression,Ws.Base64)?Ws.Base64:void 0),!((n=r.analytics)===null||n===void 0)&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.Nh?this.Nh:SA}),this.dr.emit("extensionsRemoteConfig",t),this.yh.forEach(r=>{var s;return(s=r.onRemoteConfig)===null||s===void 0?void 0:s.call(r,t)})}Yh(){try{this.config.loaded(this)}catch(t){me.critical("`loaded` function failed",t)}if(this.ad(),this.config.internal_or_test_user_hostname&&(an==null?void 0:an.hostname)){const t=an.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this._h())&&this.ld()},1),this.ud=new GA(this),this.ud.load()}ad(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Hh)===null||t===void 0||t.enable())}_dom_loaded(){this.is_capturing()&&wu(this.__request_queue,t=>this.Uh(t)),this.__request_queue=[],this.ad()}_handle_unload(){var t,n,r,s,i,o;this.Mh=!0,(t=this.surveys)===null||t===void 0||(n=t.handlePageUnload)===null||n===void 0||n.call(t),(r=this.metrics)===null||r===void 0||r.flush("sendBeacon"),this.config.request_batching?(this.hd()&&this.capture(qk),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.Hh)===null||i===void 0||i.unload(),(o=this.Wh)===null||o===void 0||o.unload()):this.hd()&&this.capture(qk,null,{transport:"sendBeacon"})}_send_request(t){dI(this,t)}Uh(t,n){this.Wh?this.Wh.retriableRequest(t,n):this._send_request(n?N(N({},t),{},{transport:n}):t)}_execute_array(t){c1++;try{let n;const r=[],s=[],i=[];wu(t,c=>{if(c)if(n=c[0],He(n))i.push(c);else if(On(c))try{c.call(this)}catch(u){me.error("Error executing queued PostHog call",c,u)}else He(c)&&n==="alias"?r.push(c):He(c)&&n.indexOf("capture")!==-1&&On(this[n])?i.push(c):s.push(c)});const o=function(c,u){wu(c,function(d){try{if(He(d[0])){let f=u;Zt(d,function(p){f=f[p[0]].apply(f,p.slice(1))})}else u[d[0]].apply(u,d.slice(1))}catch(f){me.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{c1--}}push(t){if(c1>0&&He(t)&&ft(t[0])){const n=Ma.prototype[t[0]];return void(On(n)&&n.apply(this,t.slice(1)))}this._execute_array([t])}get dd(){return{property:Kk,persistenceKey:Tu,cookieName:"_fbc",pattern:M6,register:(t,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Tu]:{value:t,delivered:n}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(Tu)}}}get vd(){return{property:Gk,persistenceKey:Vf,cookieName:"_fbp",pattern:L6,register:(t,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Vf]:{value:t,delivered:n}})},unregister:()=>{var t;return(t=this.persistence)===null||t===void 0?void 0:t.unregister(Vf)}}}fd(t){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(t.persistenceKey);return ft(r)&&t.pattern.test(r)?{value:r,delivered:!1}:ut(r)&&ft(r.value)&&t.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}pd(t,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(t.register(n,!1),{value:n,pending:!0})}gd(t){if(!this.config.save_campaign_params||this._h())return;const n=Hf(t.cookieName);return ft(n)&&t.pattern.test(n)?n:void 0}md(t,n,r,s){if(!this.persistence)return;const i=this.dd;this.persistence.refreshMetaIdentifiers();const o=this.fd(i);if(s)return void i.unregister();if(r)return ft(n)&&M6.test(n)?this.pd(i,n,o):void i.unregister();const c=ft(t)&&f7.test(t)?t:void 0,u=this.gd(i);return u&&((d,f,p)=>{const m=d.split(".");if(f)return m[3]===f;if(!p)return!0;const v=p.value.split(".");return m[3]===v[3]||Number(m[2])>Number(v[2])})(u,c,o)?this.pd(i,u,o):c?(o==null?void 0:o.value.split(".")[3])===c?{value:o.value,pending:!o.delivered}:this.pd(i,`fb.1.${Date.now()}.${c}`,o):o?{value:o.value,pending:!o.delivered}:void 0}yd(t,n,r){if(!this.persistence)return;const s=this.vd;this.persistence.refreshMetaIdentifiers();const i=this.fd(s);if(r)return void s.unregister();if(n)return ft(t)&&L6.test(t)?this.pd(s,t,i):void s.unregister();const o=this.gd(s);return o?this.pd(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}bd(t,n){if(!this.persistence)return;this.persistence.refreshMetaIdentifiers();const r=this.fd(t);(r==null?void 0:r.value)!==n||r.delivered||t.register(n,!0)}capture(t,n,r){var s,i,o;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Hh))return void me.uninitializedWarning("posthog.capture");if(!this.is_capturing())return void me.info(`Event "${t}" was not captured because capturing is disabled (opted out or consent pending).`);if(le(t)||!ft(t))return void me.error("No event name provided to posthog.capture");if(this.xh(),t==="$snapshot"&&this._h())return;const c=!this.config.opt_out_useragent_filter&&this._is_bot();if(c&&!this.config.__preview_capture_bot_pageviews)return void me.info(`Event "${t}" was not captured because the user agent looks like a bot. Set \`opt_out_useragent_filter: true\` to capture it.`);const u=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(u!=null&&u.isRateLimited)return void me.critical("This capture call is ignored due to client rate limiting.");let d;n!=null&&n.$current_url&&!ft(n==null?void 0:n.$current_url)&&(me.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r._d||me.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&&(d=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 f=new Date,p=(r==null?void 0:r.timestamp)||f,m=Rk(r==null?void 0:r.uuid,Di);let v={uuid:m,event:t,properties:this.calculateEventProperties(t,n||{},p,m)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&c&&(v.event="$bot_pageview",v.properties.$browser_type="bot"),u&&(v.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);const _=t==="$feature_flag_called"&&v.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!_&&(v.$set=r==null?void 0:r.$set);const w=ut(n==null?void 0:n.$set)?n.$set:void 0,b=He(n==null?void 0:n.$unset)?n.$unset:[],S=(r==null?void 0:r.$unset)||[],E=H=>{var Y;const oe=!!(r!=null&&r.$set)&&H in r.$set;return{hasProvided:oe||!!w&&H in w,provided:oe?r==null||(Y=r.$set)===null||Y===void 0?void 0:Y[H]:w==null?void 0:w[H],unset:b.indexOf(H)!==-1||S.indexOf(H)!==-1}},C=E(Kk),R=E(Gk),T=[{channel:this.dd,hasProvided:C.hasProvided,update:this.md(d==null?void 0:d.fbclid,C.provided,C.hasProvided,C.unset)},{channel:this.vd,hasProvided:R.hasProvided,update:this.yd(R.provided,R.hasProvided,R.unset)}];for(const{channel:H,hasProvided:Y,update:oe}of T)oe&&v.properties.$process_person_profile===!0&&oe.pending&&!Y&&!_&&(v.$set=N({[H.property]:oe.value},v.$set));const O=r==null?void 0:r.$unset;O&&(v.$unset=O);const M=_?void 0:this.wd(r==null?void 0:r.$set_once,t!==Yk,t===EA);if(M&&(v.$set_once=M),r!=null&&r._noTruncate||(A=this.config.properties_string_max_length,v=(function(H,Y){const oe=new Set;return(function U(J,K){if(J!==Object(J))return Y?Y(J):J;if(oe.has(J))return;let D;if(oe.add(J),He(J))D=[],wu(J,q=>{D.push(U(q))});else{const q={};Zt(wd(J)?kA(J):J,(fe,ae)=>{oe.has(fe)||(q[ae]=U(fe))}),D=q}return D})(H)})(v,H=>ft(H)?H.slice(0,A):H)),v.timestamp=p,le(r==null?void 0:r.timestamp)||(v.properties.$event_time_override_provided=!0,v.properties.$event_time_override_system_time=f),_&&(v.properties=((H,Y=[])=>{const oe={},U=J=>{H[J]!==void 0&&(oe[J]=H[J])};return YF.forEach(U),Y.forEach(U),oe})(v.properties,h7)),t===Bs.DISMISSED||t===Bs.SENT){const H=n==null?void 0:n[t1.SURVEY_ID],Y=n==null?void 0:n[t1.SURVEY_ITERATION];vI({id:H,current_iteration:Y}),v.$set=N(N({},v.$set),{},{[Gj({id:H,current_iteration:Y},t===Bs.SENT?"responded":"dismissed")]:!0})}else t===Bs.SHOWN&&(v.$set=N(N({},v.$set),{},{[t1.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var A;if(t===Oj.SHOWN){const H=n==null?void 0:n[y6.TOUR_TYPE];H&&(v.$set=N(N({},v.$set),{},{[`${y6.TOUR_LAST_SEEN_DATE}/${H}`]:new Date().toISOString()}))}const L=N(N({},v.properties.$set),v.$set);if(ks(L)||this.setPersonPropertiesForFlags(L),!ot(this.config.before_send)){const H=this.Fs(v);if(!H)return;v=H,v.uuid=Rk(v.uuid,Di)}this.sessionRecording&&!this.Fh&&O6(t)&&(this.Fh=!0,setTimeout(()=>this.Fh=!1,3e4));const V=T.filter(({channel:H,update:Y})=>{var oe,U,J;const K=(oe=(U=v.$set)===null||U===void 0?void 0:U[H.property])!==null&&oe!==void 0?oe:ut((J=v.properties)===null||J===void 0?void 0:J.$set)?v.properties.$set[H.property]:void 0;return(Y==null?void 0:Y.pending)&&K===Y.value});this.dr.emit("eventCaptured",v);const W=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),z=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(W),X=N(N(N({method:"POST",url:W,data:v,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:z?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},z&&(!((i=v.properties)===null||i===void 0)&&i.$session_id)?{batchGroup:v.properties.$session_id+(v.properties.$window_id?`-${v.properties.$window_id}`:"")}:{}),r!=null&&r.transport?{transport:r.transport}:{}),V.length?{fireCallbackOnDrop:!0,callback:H=>{if(H.statusCode>=200&&300>H.statusCode)for(const{channel:Y,update:oe}of V)this.bd(Y,oe.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly){var Q;let H;!X.transport&&!X.callback&&ks((Q=this.config.request_headers)!==null&&Q!==void 0?Q:{})&&this.Mh&&(H="sendBeacon"),this.Uh(X,H)}else this.Hh.enqueue(X);return(o=this.featureFlags)===null||o===void 0||o.sendFlagCallsPendingCapture(),v}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}getExtension(t){var n;return(n=this.kd)===null||n===void 0?void 0:n.getExtension(t)}nd(){var t;return(t=this.kd)!==null&&t!==void 0?t:this.kd=new c7(this)}mr(t){this.Oh.push(t);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Oh.indexOf(t);r!==-1&&this.Oh.splice(r,1)}}Zh(t=!0){var n;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Kh(t),!0)}Kh(t=!0){var n,r,s;this.jh=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.Rh.clear(),this.Sd()),(r=this.featureFlags)===null||r===void 0||r.reset(),t&&this.reloadFeatureFlags()}calculateEventProperties(t,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.xh(),this.persistence.syncCookieProperties(),this.Zh();const o=i?void 0:this.persistence.remove_event_timer(t);let c=N({},n);if(c.token=this.config.token,c.$config_defaults=this.config.defaults==="latest"?p7:this.config.defaults,this._h()&&(c[hA]=!0),t==="$snapshot"){const E=N(N({},this.persistence.properties()),this.sessionPersistence.properties());return c.distinct_id=E.distinct_id,(!ft(c.distinct_id)&&!Fn(c.distinct_id)||Df(c.distinct_id))&&me.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}const u=(function(E,C,R,T=!1){var O,M,A,L;if(!cs)return{};const V=E?[...Qu,...C||[]]:[],[W,z]=A3(cs),[X,Q]=(function(ae){for(let ce=0;Pk.length>ce;ce++){const[he,ke,ge]=Pk[ce],pe=ae.match(he);if(pe){const Le=ge&&ae.match(ge)||pe;return[ke,(Le==null?void 0:Le[1])||""]}}return["",""]})(cs),H=(function(){const ae="u">typeof navigator?navigator:void 0;return ae!=null&&ae.brave?{brave:!0}:{}})(),Y={};le(R)||(Y.detectGoogleSearchApp=R);const oe={},U=(O=navigator)===null||O===void 0||(O=O.userAgentData)===null||O===void 0?void 0:O.platform,J=(M=navigator)===null||M===void 0?void 0:M.maxTouchPoints,K=ie==null||(A=ie.screen)===null||A===void 0?void 0:A.width,D=ie==null||(L=ie.screen)===null||L===void 0?void 0:L.height,q=ie==null?void 0:ie.devicePixelRatio;le(U)||(oe.userAgentDataPlatform=U),le(J)||(oe.maxTouchPoints=J),le(K)||(oe.screenWidth=K),le(D)||(oe.screenHeight=D),le(q)||(oe.devicePixelRatio=q);const fe=pn(ob({$os:W,$os_version:z,$browser:T3(cs,navigator.vendor,H,Y),$webview_app:X,$webview_app_version:Q,$device:I3(cs),$device_type:yF(cs,oe),$timezone:db(),$timezone_offset:Tj()}),{$current_url:ah(T?el(an==null?void 0:an.href):an==null?void 0:an.href,V,lh),$host:an==null?void 0:an.host,$pathname:an==null?void 0:an.pathname,$raw_user_agent:cs.length>1e3?cs.substring(0,997)+"...":cs,$browser_version:vF(cs,navigator.vendor,H,Y),$browser_language:UA(),$browser_language_prefix:Rj(),$screen_height:ie==null?void 0:ie.screen.height,$screen_width:ie==null?void 0:ie.screen.width,$viewport_height:ie==null?void 0:ie.innerHeight,$viewport_width:ie==null?void 0:ie.innerWidth,$lib:Yo.LIB_NAME,$lib_version:Yo.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Yo.SDK_DIST_CHANNEL&&(fe.$sdk_dist_channel=Yo.SDK_DIST_CHANNEL),fe})(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:E,windowId:C}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);c.$session_id=E,c.$window_id=C}this.sessionPropsManager&&pn(c,this.sessionPropsManager.getSessionProps());try{var d;if(this.sessionRecording){const E=this.sessionRecording.sdkDebugProperties,C=!this.Fh&&O6(t);for(const R in E)(C||We(u7,R))&&(c[R]=E[R])}c.$sdk_debug_retry_queue_size=(d=this.Wh)===null||d===void 0?void 0:d.length}catch(E){c.$sdk_debug_error_capturing_properties=String(E)}let f;if(this.requestRouter.region===tw&&(c.$lib_custom_api_host=this.config.api_host),f=t!=="$pageview"||i?t!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),c=pn(c,f),t==="$pageview"&&Ie&&(c.title=Ie.title),!le(o)){const E=r.getTime()-o;c.$duration=parseFloat((E/1e3).toFixed(3))}cs&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser");const p=this.persistence.properties(),m=this.sessionPersistence.properties(),v=c.$groups,_=p.$groups;ut(v)&&!ks(v)&&(c.$groups=N(N({},ut(_)?_:{}),v)),Zt(["$referrer","$referring_domain"],E=>{E in p&&delete m[E]});const w={};if(this.Oh.length>0)for(const E of this.Oh.slice())try{pn(w,E())}catch(C){me.error("Failed to produce browser extension event properties",C)}c=pn({},u,p,m,N(N({},w),c)),c.$is_identified=this._isIdentified(),He(this.config.property_denylist)?Zt(this.config.property_denylist,function(E){delete c[E]}):me.error(xI+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const b=this.config.sanitize_properties;b&&(me.error(I6),c=b(c,t));const S=this.xd();return c.$process_person_profile=S,S&&!i&&this.$d("_calculate_event_properties"),c}wd(t,n=!0,r=!1){var s;if(!this.persistence||!this.xd()||this.Ah&&!r)return t;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let c=pn({},i,o||{},t||{});const u=this.config.sanitize_properties;return u&&(me.error(I6),c=u(c,"$set_once")),n&&(this.Ah=!0),ks(c)?void 0:c}register(t,n){var r;(r=this.persistence)===null||r===void 0||r.register(t,n)}register_once(t,n,r){var s;(s=this.persistence)===null||s===void 0||s.register_once(t,n,r)}register_for_session(t){var n,r;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.Zh(),(r=this.sessionPersistence)===null||r===void 0||r.register(t),Object.keys(t).forEach(s=>this.Rh.add(s)),this.Sd()}unregister(t){var n;(n=this.persistence)===null||n===void 0||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(t),this.Rh.delete(t),this.Sd()}Cd(t,n){this.register({[t]:n})}Vh(){this.Rh.forEach(t=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(t)}),this.Rh.clear(),this.Sd()}Sd(){var t;if(!this.Ph)return;if(this.config.persistence==="memory"||!((t=this.sessionPersistence)===null||t===void 0)&&t.fi||!ln.Ot())return void ln.Dt(this.Ph);const n=[];this.Rh.forEach(r=>n.push(r)),n.length>0?ln.$t(this.Ph,n):ln.Dt(this.Ph)}getFeatureFlag(t,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(t,n)}getAllFeatureFlags(){var t,n;return(t=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&t!==void 0?t:[]}isFeatureEnabled(t,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?void 0:s.isFeatureEnabled(t,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var t;(t=this.featureFlags)===null||t===void 0||t.reloadFeatureFlags()}updateFlags(t,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.dr.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:iu}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n=!1){this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:iu})}getActiveMatchingSurveys(t,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:iu})}onActiveMatchingSurveysChanged(t){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(t):(t([],{isLoaded:!1,error:iu}),()=>{})}renderSurvey(t,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(t,n)}displaySurvey(t,n=Jj){var r;(r=this.surveys)===null||r===void 0||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:iu}}canRenderSurveyAsync(t,n=!1){var r,s;return(r=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:iu})}Td(t){return!t||Df(t)?(me.critical("Unique user id has not been set in posthog.identify"),!1):t==="$posthog_cookieless"?(me.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(me.critical(`The string "${t}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(t,n,r){if(!this.__loaded||!this.persistence)return me.uninitializedWarning("posthog.identify");if(Fn(t)&&(t=t.toString(),me.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.Td(t)||!this.$d("posthog.identify"))return;this.xh();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.Zh(!1),c=this.persistence.Ou();let u=!1;try{const f=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:f},""),t!==f&&t!==this.get_property("__alias")&&(this.unregister(S0),this.register({distinct_id:t}));const p=(this.persistence.get_property("$user_state")||"anonymous")===Go,m=t!==f,v=!m&&p;if(m&&p){var d;const _=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:f};this.persistence.set_property(Qr,Um),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Fu(),this.capture("$identify",_,{$set:n||{},$set_once:r||{}})&&(this.jh=o1(t,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:f)}else if(v){this.persistence.set_property(Qr,Um);const _=n||{},w=r||{};this.setPersonPropertiesForFlags({$set:_,$set_once:w},!1),this.config.cookieWinsOnConflict&&this.persistence.Fu(),this.capture("$set",{$set:_,$set_once:w})&&(this.jh=o1(t,n,r))}else(n||r)&&this.setPersonProperties(n,r);m||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(lo)):v&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{c&&this.persistence.Nu(u)}}setPersonProperties(t,n){if(!t&&!n||!this.$d("posthog.setPersonProperties"))return;const r=o1(this.get_distinct_id(),t,n);this.jh!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!0),this.capture("$set",{$set:t||{},$set_once:n||{}})&&(this.jh=r)):me.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(t){var n;const r=(He(t)?t:[t]).filter(s=>ft(s)&&s.length>0);r.length!==0&&this.$d("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.jh=null)}group(t,n,r){var s;if(!t||!n)return void me.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.Zh();const i=this.getGroups(),o=i[t]!==n;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:N(N({},i),{},{[t]:n})}),(o||r)&&this.xd()){const c={$group_type:t,$group_key:n};r&&(c.$group_set=r),this.capture(Yk,c)}r&&this.setGroupPropertiesForFlags({[t]:r}),o&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n=!0){var r;(r=this.featureFlags)===null||r===void 0||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(t=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,n=!0){var r;this.$d("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)===null||r===void 0||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(t)}reset(t){const n=ds(t)?t:t==null?void 0:t.resetDeviceID,r=ds(t)||t==null?void 0:t.bootstrap;this.Id(n,!1,r)}Id(t,n=!1,r){var s,i,o,c,u,d;if(me.info("reset"),!this.__loaded)return me.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Bh)===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.lc());const p=this.get_property(J2),m=this.get_property(Uy),v=this.get_property(zf);(c=this.sessionRecording)===null||c===void 0||c.flushBeforeIdentityReset();const _=this.is_capturing();n||this.consent.reset(),n||!_||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 w=(u=this.persistence)===null||u===void 0||(d=u.Ou)===null||d===void 0?void 0:d.call(u),b=this.$h;this.$h=b||n;let S=!1;try{var E,C,R,T,O,M,A,L,V,W,z,X,Q;if((E=this.persistence)===null||E===void 0||E.clear(),(C=this.sessionPersistence)===null||C===void 0||C.clear(),this.Rh.clear(),this.Sd(),le(v)||(W=this.persistence)===null||W===void 0||W.register({$session_recording_remote_config:v}),(R=this.surveys)===null||R===void 0||R.reset(),(T=this.featureFlags)===null||T===void 0||T.reset(),(O=this.conversations)===null||O===void 0||O.reset(),(M=this.logs)===null||M===void 0||M.reset(),(A=this.metrics)===null||A===void 0||A.reset(),(L=this.persistence)===null||L===void 0||L.set_property("$user_state","anonymous"),(V=this.sessionManager)===null||V===void 0||V.resetSessionId(),this.jh=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Zy,$device_id:null},"");else{const U=this.config.get_device_id(Di());this.register_once({distinct_id:U,$device_id:t?U:p},""),t||le(m)||this.register({[Uy]:m})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this._h()&&((Q=this.persistence)===null||Q===void 0||Q.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),(z=this.featureFlags)===null||z===void 0||z.initialize(),!ot(f)&&!(!((X=this.sessionManager)===null||X===void 0)&&X.setBootstrapSessionId(f,!0)))){const U=N({},r);delete U.sessionID,this.config.bootstrap=U}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,S=!0}finally{var H,Y;this.$h=b,w&&((H=this.persistence)===null||H===void 0||(Y=H.Nu)===null||Y===void 0||Y.call(H,S))}var oe;this.vr&&((oe=this.conversations)===null||oe===void 0||oe.onRemoteConfig(this.vr)),this.reloadFeatureFlags()}shutdown(t){var n=this;return cn(function*(){if(!n.__loaded)return void me.uninitializedWarning("posthog.shutdown");n.Eh=!0,clearTimeout(n.Qh),n.Qh=void 0;const r=n.sd;n.sd=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.Hh)===null||i===void 0?void 0:i.unload()},()=>{var i;return(i=n.Wh)===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&&On(i.then)&&i.then(void 0,o=>{me.error("Error during shutdown",o)})}catch(i){me.error("Error during shutdown",i)}})()}setIdentity(t,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=n,this.alias(t),(r=this.conversations)===null||r===void 0||r.Md()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(t=this.conversations)===null||t===void 0||t.Ed()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){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(t!=null&&t.withTimestamp&&r){var i;const o=(i=t.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(t,n){return t===this.get_property("$people_distinct_id")?(me.critical("Attempting to create alias for existing People user - aborting."),-2):this.$d("posthog.alias")?(le(n)&&(n=this.get_distinct_id()),t!==n?(this.Cd(S0,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(me.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){const n=N({},this.config);if(ut(t)){var r,s,i,o,c,u,d,f,p,m,v,_,w,b;pn(this.config,$6(t));const T=this.Ih();if(this.persistence){const M=this.config.persistence==="sessionStorage"||this.config.persistence==="memory";var S,E;if(M&&this.sessionPersistence!==this.persistence&&((S=this.sessionPersistence)===null||S===void 0||S.remove(),(E=this.sessionPersistence)===null||E===void 0||E.destroy()),this.persistence.update_config(this.config,n,T),M)this.sessionPersistence=this.persistence;else if(this.sessionPersistence===this.persistence)this.sessionPersistence=new Jy(N(N({},this.config),{},{persistence:"sessionStorage"}),T,!1);else{var C;(C=this.sessionPersistence)===null||C===void 0||C.update_config(N(N({},this.config),{},{persistence:"sessionStorage"}),N(N({},n),{},{persistence:"sessionStorage"}),T)}}const O=this.qh(this.config.debug);var R;ds(O)&&(this.config.debug=O),ds(this.config.debug)&&(this.config.debug?(Es.DEBUG=!0,It.Ot()&&It.$t("ph_debug",!0),me.info("set_config",{config:t,oldConfig:n,newConfig:N({},this.config)})):(Es.DEBUG=!1,It.Ot()&&It.Dt("ph_debug"))),(r=this.featureFlags)===null||r===void 0||(s=r.updateConfig)===null||s===void 0||s.call(r,this.config,this.lc()),(i=this.exceptionObserver)===null||i===void 0||i.onConfigChange(),(o=this.exceptions)===null||o===void 0||o.onConfigChange(),(c=this.metrics)===null||c===void 0||c.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(),(p=this.autocapture)===null||p===void 0||p.startIfEnabled(),(m=this.heatmaps)===null||m===void 0||m.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&((R=this.historyAutocapture)===null||R===void 0||R.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(_=this.deadClicksAutocapture)===null||_===void 0||_.startIfEnabledOrStop(),(w=this.surveys)===null||w===void 0||w.loadIfEnabled(),this.Ch(),(b=this.externalIntegrations)===null||b===void 0||b.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&p6(this,Kf,!1)}}_overrideSDKInfo(t,n){Es.LIB_NAME=t,Es.LIB_VERSION=n}startSessionRecording(t){const n=t===!0,r={sampling:n||!!(t!=null&&t.sampling),linked_flag:n||!!(t!=null&&t.linked_flag),url_trigger:n||!!(t!=null&&t.url_trigger),event_trigger:n||!!(t!=null&&t.event_trigger)};var s,i,o,c,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&&((c=this.sessionRecording)===null||c===void 0||c.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 t;return!!(!((t=this.sessionRecording)===null||t===void 0)&&t.started)}captureException(t,n){try{if(!this.exceptions)return;const r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(N(N({},r),n))}catch{return}}addExceptionStep(t,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(t,n)}captureLog(t){var n;(n=this.logs)===null||n===void 0||n.captureLog(t)}get logger(){var t,n;return(t=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&t!==void 0?t:Ma.Ad}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)===null||r===void 0?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[t]}toString(){var t;let n=(t=this.config.name)!==null&&t!==void 0?t:Rf;return n!==Rf&&(n="posthog."+n),n}_isIdentified(){var t,n;return((t=this.persistence)===null||t===void 0?void 0:t.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}xd(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&ks(this.getGroups())&&!(!((t=this.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}hd(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.xd()||this.$d("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.$d("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}$d(t){return this.config.person_profiles==="never"?(me.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.wh(),this.Cd(nb,!0),!0)}Ih(){if(this.config.cookieless_mode==="always")return!0;const t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}Ch(){var t,n;const r=this.Ih();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.Rd(),((t=this.persistence)===null||t===void 0?void 0:t.fi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.fi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),this.Sd(),r}opt_in_capturing(t){var n,r,s;if(this.config.cookieless_mode==="always")return void me.warn(A6);if(this._h()){var i,o,c,u,d,f;(i=this.sessionRecording)===null||i===void 0||i.dispose({discardBufferedEvents:!0}),this.Id(!0,!0),(o=this.sessionManager)===null||o===void 0||o.destroy(),(c=this.pageViewManager)===null||c===void 0||c.destroy(),this.sessionManager=new P6(this),this.pageViewManager=new m6(this),this.persistence&&(this.sessionPropsManager=new k6(this,this.sessionManager,this.persistence));const S=(u=(d=this.config.__extensionClasses)===null||d===void 0?void 0:d.sessionRecording)!==null&&u!==void 0?u:(f=Ma.__defaultExtensionClasses)===null||f===void 0?void 0:f.sessionRecording;var p,m;S&&(this.sessionRecording=this.bh(this.sessionRecording,new S(this)),this.vr&&((p=this.sessionRecording)===null||p===void 0||(m=p.onRemoteConfig)===null||m===void 0||m.call(p,this.vr)))}const v=this.consent.consent===1;var _,w,b;v&&this.xh(),this.consent.optInOut(!0),this.Ch(),this.ad(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((_=this.surveys)===null||_===void 0||_.loadIfEnabled(),(w=this.conversations)===null||w===void 0||w.loadIfEnabled()),v||!le(t==null?void 0:t.captureEventName)&&!(t!=null&&t.captureEventName)||this.capture((b=t==null?void 0:t.captureEventName)!==null&&b!==void 0?b:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),(r=this.persistence)===null||r===void 0||r.syncCookieProperties(),this.Zh(),(s=this.featureFlags)===null||s===void 0||s.sendFlagCallsPendingCapture(),this.config.capture_pageview&&this.ld()}opt_out_capturing(){this.config.cookieless_mode!=="always"?(this.consent.optInOut(!1),this.Ch(),this.config.cookieless_mode==="on_reject"&&this.Th()):me.warn(A6)}Th(){var t,n;const r=this.sessionRecording;r==null||r.dispose({discardBufferedEvents:!0}),this.get_distinct_id()!=="$posthog_cookieless"&&this.Id(!0,!0),this.register({distinct_id:Zy,$device_id:null}),this.mh(r),this.sessionRecording=void 0,(t=this.sessionManager)===null||t===void 0||t.destroy(),(n=this.pageViewManager)===null||n===void 0||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.ld(),this.ad()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return!this.$h&&(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.Ch()}_is_bot(){return Dr?fI(Dr,this.config.custom_blocked_useragents):void 0}ld(){Ie&&(Ie.visibilityState==="visible"?this.Dh||(this.Dh=!0,this.capture(ib,{title:Ie.title},{send_instantly:!0}),this.Lh&&(Ie.removeEventListener(Ru,this.Lh),this.Lh=null)):this.Lh||(this.Lh=this.ld.bind(this),$t(Ie,Ru,this.Lh)))}debug(t){t===!1?(ie==null||ie.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ie==null||ie.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}))}lc(){const t=this.Bh||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(me.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 c=r in n&&!ot(n[r]),u=s in n&&!ot(n[s]);return c?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])})(t,"advanced_disable_flags","advanced_disable_decide",0,me)}Fs(t){var n;if(ot(this.config.before_send))return t;const r=Object.keys((n=t.properties)!==null&&n!==void 0?n:{}).filter(aF),s=He(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=t;for(const o of s)try{if(i=o(i),ot(i)){const c=`Event '${t.event}' was rejected in beforeSend function`;return oF(t.event)?me.warn(`${c}. This can cause unexpected behavior.`):me.info(c),null}i.properties&&!ks(i.properties)||me.warn(`Event '${t.event}' has no properties after beforeSend function, this is likely an error.`)}catch(c){return me.error(`Error in beforeSend function for event '${t.event}':`,c),null}for(const o of r)if(i.properties&&ot(i.properties[o]))return me.warn(`Event '${t.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 t;return(t=this.pageViewManager.Ul)===null||t===void 0?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}qh(t){const n=ds(t)&&!t,r=It.Ot()&&It.Lt("ph_debug")==="true";return!n&&(!!r||t)}};Gf.__defaultExtensionClasses={},Gf.Ad=(()=>{const e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),(function(e,t){for(let n=0;t.length>n;n++)e.prototype[t[n]]=rj(e.prototype[t[n]])})(Gf,["identify"]);const y7=["[data-ph-capture-value]"];var _7=class{constructor(e){this._instance=e}refresh(e){var t;const n=this._instance.config,r=ut(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance.lc(),e.url_allowlist=r==null?void 0:r.url_allowlist,e.url_ignorelist=r==null?void 0:r.url_ignorelist,e.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,e.element_allowlist=r==null?void 0:r.element_allowlist,e.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,e.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,e.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,e.capture_copied_text=r==null?void 0:r.capture_copied_text,e.capture_value_css_selector_allowlist=(t=r==null?void 0:r.capture_value_css_selector_allowlist)!==null&&t!==void 0?t:y7}};const vf=xn("[ExceptionAutocapture]"),N6=()=>{},D6=e=>{var t;if(On(e))return(t=e.__posthog_layer__)!==null&&t!==void 0?t:e.__rrweb_layer__};function ed(e,t,n){try{if(!(t in e))return N6;const r={next:e[t]},s=n(function(...i){return r.next.apply(this,i)});return On(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=s,()=>{if(e[t]===s)return void(e[t]=r.next);let i=e[t],o=D6(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=D6(i)}}}catch{return N6}}const w7=xn("[TracingHeaders]"),jl=xn("[Web Vitals]"),F6=9e5,j6=["CLS","FCP","INP","LCP"],b7=["INP","LCP"],x7=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],d1="disabled",V6="lazy_loading",$o=xn("[SessionRecording]"),S7=[rb,sb,gA,vA,yA,_A,wA,bA,xA],E7=xn("[Heatmaps]");function f1(e){return ut(e)&&"clientX"in e&&"clientY"in e&&Fn(e.clientX)&&Fn(e.clientY)}const am=xn("[Product Tours]"),h1=e=>{var t;return!e.config.disable_product_tours&&!!(!((t=e.persistence)===null||t===void 0)&&t.get_property(tb))},k7=["$set_once","$set"],Qi=xn("[SiteApps]"),z6="Error while initializing PostHog app with config id ";function ou(e,t,n){if(ot(e))return!1;switch(n){case"exact":return e===t;case"contains":{const r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e)}case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var C7=class{constructor(e){this.$i=e,this.Ao=new Set,this.Ro=new Set,this.Po=new T0,this.Oo=(t,n)=>this.Fo(t,n)&&this.Do(t,n)&&this.Lo(t,n)&&this.No(t,n),this.Fo=(t,n)=>!(n!=null&&n.event)||(t==null?void 0:t.event)===(n==null?void 0:n.event)}init(){var e,t;le((e=this.$i)===null||e===void 0?void 0:e.subscribeCapture)||(this.jo=(t=this.$i)===null||t===void 0?void 0:t.subscribeCapture((n,r)=>{this.on(n,r)}))}dispose(){var e,t,n;(e=this.jo)===null||e===void 0||e.call(this),this.jo=void 0,(t=this.$i)===null||t===void 0||(n=t.setElementSelectors)===null||n===void 0||n.call(t,new Set,this),this.Po=new T0}register(e){var t,n;if(!le((t=this.$i)===null||t===void 0?void 0:t.subscribeCapture)&&(e.forEach(r=>{var s;this.Ao.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.Ro.add((i==null?void 0:i.event)||"")})}),(n=this.$i)===null||n===void 0?void 0:n.setElementSelectors)){const r=new Set;this.Ao.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this.$i.setElementSelectors(r,this)}}replace(e){this.Ao.clear(),this.Ro.clear(),this.register(e)}on(e,t){t!=null&&e.length!=0&&(this.Ro.has(e)||this.Ro.has(t.event))&&this.Ao.forEach(n=>{this.qo(t,n)&&this.Po.emit("actionCaptured",n.name)})}Bo(e){this.onAction("actionCaptured",t=>e(t))}qo(e,t){if((t==null?void 0:t.steps)==null)return!1;for(const n of t.steps)if(this.Oo(e,n))return!0;return!1}onAction(e,t){return this.Po.on(e,t)}Do(e,t){if(t!=null&&t.url){var n;let i=e==null||(n=e.properties)===null||n===void 0?void 0:n.$current_url;if(!(e!=null&&e.properties)||!("$current_url"in e.properties))try{var r,s;i=(r=this.$i)===null||r===void 0||(s=r.getActionUrl)===null||s===void 0?void 0:s.call(r)}catch{return!1}if(!i||typeof i!="string"||!ou(i,t.url,t.url_matching||"contains"))return!1}return!0}Lo(e,t){return!!this.zo(e,t)&&!!this.Ho(e,t)&&!!this.Uo(e,t)}zo(e,t){var n;if(!(t!=null&&t.href))return!0;const r=this.Wo(e);if(r.length>0)return r.some(i=>ou(i.href,t.href,t.href_matching||"exact"));const s=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&ou((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),t.href,t.href_matching||"exact")}Ho(e,t){var n;if(!(t!=null&&t.text))return!0;const r=this.Wo(e);if(r.length>0)return r.some(u=>ou(u.text,t.text,t.text_matching||"exact")||ou(u.$el_text,t.text,t.text_matching||"exact"));const s=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(u){const d=[],f=/(?::|")text="(.*?)"/g;let p;for(;!ot(p=f.exec(u));)d.includes(p[1])||d.push(p[1]);return d})(s),o=t.text,c=t.text_matching||"exact",i.some(u=>ou(u,o,c)));var i,o,c}Uo(e,t){var n,r;if(!(t!=null&&t.selector))return!0;const s=e==null||(n=e.properties)===null||n===void 0?void 0:n.$element_selectors;if(s!=null&&s.includes(t.selector))return!0;const i=(e==null||(r=e.properties)===null||r===void 0?void 0:r.$elements_chain)||"";if(t.selector_regex&&i)try{return new RegExp(t.selector_regex).test(i)}catch{}return!1}Wo(e){var t;return(e==null||(t=e.properties)===null||t===void 0?void 0:t.$elements)==null?[]:e==null?void 0:e.properties.$elements}No(e,t){return!(t!=null&&t.properties)||t.properties.length===0||gI(t.properties.reduce((n,r)=>{const s=He(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),e==null?void 0:e.properties)}},P7=class{constructor(e,t){this.Vo=t,this.Go=[],this.$i=e,this.Qo=new Map,this.Jo=new Map,this.Zo=new Map}Ko(){var e,t;this.Yo=(e=(t=this.$i).subscribeSession)===null||e===void 0?void 0:e.call(t,n=>this.Xo(n))}ta(e){return!1}ea(){return null}ia(e){}na(){}sa(e,t){return!!e&&gI(e.propertyFilters,t==null?void 0:t.properties)}ra(e,t){const n=new Map;return e.forEach(r=>{var s;(s=r.conditions)===null||s===void 0||(s=s[t])===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}oa(e,t,n){const r=(n===hf.Activation?this.Qo:this.Jo).get(e);let s=[];return this.aa(i=>{s=i.filter(o=>r==null?void 0:r.includes(o.id))}),s.filter(i=>{var o;const c=(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===e);return this.sa(c,t)})}register(e){this.la(e,!1)}replace(e){this.la(e,!0)}la(e,t){le(this.$i.subscribeCapture)||(this.ua(e,t),this.ca(e,t))}ca(e,t){const n=e.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(t&&this.Zo.clear(),n.length===0)return void(t&&((r=this.ha)===null||r===void 0||r.replace([])));this.ha||(this.ha=new C7(this.$i),this.ha.init(),this.ha.Bo(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(c=>{if(s.push(c),c.name){var u;const d=(u=this.Zo.get(c.name))!==null&&u!==void 0?u:[];d.includes(i.id)||d.push(i.id),this.Zo.set(c.name,d)}})}),t?this.ha.replace(s):this.ha.register(s)}da(e,t){t.forEach((n,r)=>{var s;const i=(s=e.get(r))!==null&&s!==void 0?s:[];n.forEach(o=>{i.includes(o)||i.push(o)}),e.set(r,i)})}ua(e,t){var n,r,s;const i=e.filter(d=>{var f,p;return((f=d.conditions)===null||f===void 0?void 0:f.events)&&((p=d.conditions)===null||p===void 0||(p=p.events)===null||p===void 0||(p=p.values)===null||p===void 0?void 0:p.length)>0}),o=e.filter(d=>{var f,p;return((f=d.conditions)===null||f===void 0?void 0:f.cancelEvents)&&((p=d.conditions)===null||p===void 0||(p=p.cancelEvents)===null||p===void 0||(p=p.values)===null||p===void 0?void 0:p.length)>0}),c=this.ra(e,hf.Activation),u=this.ra(e,hf.Cancellation);t?(this.Qo=c,this.Jo=u):(this.da(this.Qo,c),this.da(this.Jo,u)),(i.length!==0||o.length!==0||e.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.jo)!==null&&n!==void 0||(this.jo=(r=(s=this.$i).subscribeCapture)===null||r===void 0?void 0:r.call(s,(d,f)=>{this.onEvent(d,f)})))}onEvent(e,t){var n,r;const s=this.va(),i=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$survey_id)||(t==null||(r=t.properties)===null||r===void 0?void 0:r.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const c=this.fa(e,i,t);if(c==="consume")return s.info("event consumed activated item, removing it",{event:e,itemId:i}),void this.pa([i]);if(c==="persist")return s.info("shown item promoted to persisted activation",{event:e,itemId:i}),this.ga(i),void this.ma([i])}if(this.Jo.has(e)){const c=this.oa(e,t,hf.Cancellation);c.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map(u=>u.id)}),this.pa(c.map(u=>u.id)),c.forEach(u=>this.ya(u.id)))}if(!this.Qo.has(e))return;s.info("event name matched",{event:e,eventPayload:t,items:this.Qo.get(e)});const o=this.oa(e,t,hf.Activation);this.ba(o.map(c=>c.id))}onAction(e){this.Zo.has(e)&&this.ba(this.Zo.get(e)||[])}ba(e){if(e.length===0)return;const t=!!this.$i.getSessionId(),n=[];for(const r of e)t&&this.ta(r)?this.ga(r)&&this._a(r):n.push(r);n.length>0&&(this.Go=[...new Set([...this.Go,...n])]),this.va().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.wa()}ga(e){this.Go=this.Go.filter(n=>n!==e);const t=this.ka();return!t.includes(e)&&(this.Sa([...t,e]),this.xa(),!0)}pa(e){const t=new Set(e);this.Go=this.Go.filter(s=>!t.has(s));const n=this.$a(),r=n.filter(s=>!t.has(s));r.length!==n.length&&(this.Sa(r),r.length===0&&this.Ca()),this.ma(e),this.wa()}wa(){try{var e;(e=this.Vo)===null||e===void 0||e.call(this)}catch(t){this.va().error("Error while handling activated items change",t)}}Ta(){const e=this.ea();if(!e)return{};const t=this.$i.getProperty(e);return t&&typeof t=="object"?t:{}}_a(e){if(!this.ea())return;const t=this.Ta();this.ia(N(N({},t),{},{[e]:Date.now()}))}ma(e){if(!this.ea())return;const t=this.Ta(),n={};let r=!1;for(const[s,i]of Object.entries(t))e.includes(s)?r=!0:n[s]=i;r&&(ks(n)?this.na():this.ia(n))}Ia(){this.ea()&&this.na()}getActivationTimestamp(e){if(!this.ka().includes(e))return;const t=this.Ta()[e];return Fn(t)?t:void 0}$a(){const e=this.Ma();return this.$i.getProperty(e)||[]}ka(){const e=this.$a();if(e.length===0)return[];const t=this.$i.getProperty(this.Ea()),n=this.$i.getSessionId();return n&&t===n?e:[]}xa(){const e=this.$i.getSessionId();e&&this.Aa(e)}Ca(){this.Ra()}Xo(e){const t=this.$i.getProperty(this.Ea());if(t&&t!==e){const n=this.$a(),r=this.Ta();n.length>0&&(this.Sa([]),n.filter(s=>Fn(r[s])).forEach(s=>this.ya(s))),this.Ca(),this.Ia(),n.length>0&&this.wa()}}getActivatedIds(){return[...new Set([...this.ka(),...this.Go])].filter(e=>!this.Pa(e))}dispose(){var e,t,n;(e=this.Yo)===null||e===void 0||e.call(this),this.Yo=void 0,(t=this.jo)===null||t===void 0||t.call(this),this.jo=void 0,(n=this.ha)===null||n===void 0||n.dispose(),this.ha=void 0}reset(){this.Go=[],this.$a().length>0&&this.Sa([]),this.Ca(),this.Ia(),this.wa()}getEventToItemsMap(){return this.Qo}Oa(){return this.ha}},R7=class extends P7{constructor(e,t,n,r){var s;super({subscribeCapture(i){const o=e.onEvent(c=>i(c.event,c));return()=>o.dispose()},subscribeSession(i){const o=e.onSession(i);return()=>o.dispose()},getSessionId(){var i;return(i=e.session)===null||i===void 0?void 0:i.sessionId},getProperty:i=>e.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 c;return(c=e.getExtension("autocapture"))===null||c===void 0?void 0:c.setElementSelectors(i,o)}},r),this.Fa=e,this.Da=t,this.Ko()}Ma(){return j_}Ea(){return zm}ea(){return Hm}ia(e){this.Fa.kv.set({[Hm]:e})}na(){this.Fa.kv.remove(Hm)}ta(e){var t;let n;this.aa(s=>{n=s.find(i=>i.id===e)});const r=n==null||(t=n.appearance)===null||t===void 0?void 0:t.surveyPopupDelaySeconds;return Fn(r)&&r>0}La(){return Bs.SHOWN}aa(e){this.Da.getSurveys(e)}ya(e){this.Da.cancelPendingSurvey(e)}va(){return Ut}Sa(e){this.Fa.kv.set({[j_]:e})}Aa(e){this.Fa.kv.set({[zm]:e})}Ra(){this.Fa.kv.remove(zm)}Pa(){return!1}fa(e,t,n){var r;if(e===Bs.SENT&&(n==null||(r=n.properties)===null||r===void 0?void 0:r.$survey_completed)===!1)return"ignore";let s;return this.aa(i=>{s=i.find(o=>o.id===t)}),!s||(function(i){var o;return pI(i)&&!!(!((o=i.conditions)===null||o===void 0||(o=o.events)===null||o===void 0)&&o.repeatedActivation)||i.schedule==="always"})(s)?e===Bs.SHOWN?"consume":"ignore":e===Bs.SHOWN?"persist":e===Bs.DISMISSED||e===Bs.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}};const pb=(e,t)=>e!=null&&e.then?e.then(t):t(e),au="SDK is not enabled or survey functionality is not yet loaded",H6="Disabled. Not loading surveys.";var T7=class{constructor(e){this.Na=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.ja=!1,this.qa=!1,this.Ba=[],this.za=[],this.Ha=null,this.Ua=null,this.Ti=!1,this.Wa=new Set,this.onRemoteConfig=t=>{if(this.Ti||this.Fr.disableSurveys)return;if(!t.ok)return this.qa=!0,this.Va({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),Ut.warn("Remote config unavailable. Not loading surveys.");const n=t.config.surveys;if(ot(n))return Ut.warn("Flags not loaded yet. Not loading surveys.");this.Ga=ds(n)?n:n.length>0,Ut.info(`flags response received, isSurveysEnabled: ${this.Ga}`),this.loadIfEnabled()},this.Va=t=>{this.za.slice().forEach(n=>this.Qa(n,t))}}setup(e){if(!this.Ti)return this.Ja=e,pb(e.kv.initialize(),()=>{if(this.Ja!==e||this.Ti)return;this.Ja=void 0,this.Fa=e;const t=e.onRemoteConfig(this.onRemoteConfig);this.Ti?t.dispose():(this.Za=t,this.loadIfEnabled())})}dispose(){var e,t,n,r,s;this.Ti||(this.Ti=!0,this.Ja=void 0,this.Fa=void 0,(e=this.Za)===null||e===void 0||e.dispose(),this.Za=void 0,(t=this._surveyEventReceiver)===null||t===void 0||t.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.Ba=[],this.za.forEach(i=>{i.active=!1}),this.za=[],(s=this.Ka)===null||s===void 0||s.call(this),this.Ka=void 0,this.Ha=null,this.Wa.forEach(i=>clearTimeout(i)),this.Wa.clear())}get Fr(){return this.Na.get()}getRenderContext(){if(!this.Fa)return;const e=this;return{client:this.Fa,get config(){return e.Fr},surveys:e}}initialize(){this.loadIfEnabled()}reset(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.clearInMemoryInProgressSurveyState)===null||t===void 0||t.call(e);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.Va()}loadIfEnabled(){if(this.Ti||!this.Fa)return;const e=this.Fr;if(this._surveyManager)return;if(this.ja)return void Ut.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void Ut.info(H6);if(e.cookielessMode&&this.Fa.isOptedOut)return void Ut.info("Not loading surveys in cookieless mode without consent.");const t=this.Na.getExtensions();if(!t)return void this.Ya("PostHog Extensions not found.");if(le(this.Ga)&&!e.advancedEnableSurveys)return;const n=this.Ga||e.advancedEnableSurveys;this.ja=!0,this.qa=!1;try{const r=t.generateSurveys;if(r)return this.Xa(r,n),void(this.ja=!1);const s=t.loadExternalDependency;if(!s)return this.Ya(F_),void(this.ja=!1);s(i=>{try{if(this.Ti)return;const o=this.Na.getExtensions();i||!(o!=null&&o.generateSurveys)?this.Ya("Could not load surveys script",i):this.Xa(o.generateSurveys,n)}finally{this.ja=!1}})}catch(r){throw this.ja=!1,this.Ya("Error initializing surveys",r),r}}Xa(e,t){var n;if(this.Ti)return;this._surveyManager=e(t),this._surveyEventReceiver=this.tl(this.Fa,this.Va);const r=(n=this.Fa)===null||n===void 0?void 0:n.kv.get(Cf);r&&this.el(r),Ut.info("Surveys loaded successfully"),this.il(),this.Va(),this.nl({isLoaded:!0})}tl(e,t){return new R7(e,this,void 0,t)}Ya(e,t){this.qa=!0,Ut.error(e,t),this.Va({isLoaded:!1,error:e}),this.nl({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ba.push(e),this._surveyManager&&this.nl({isLoaded:!0}),()=>{this.Ba=this.Ba.filter(t=>t!==e)}}getSurveys(e,t=!1){if(this.Ti)return;const n=this.Fa;if(!n)return e([],{isLoaded:!1,error:au});if(this.Fr.disableSurveys)return Ut.info(H6),e([]);const r=n.kv.get(Cf);if(r&&!t)return e(r,{isLoaded:!0}),void(this.sl()&&this.getSurveys(()=>{},!0));if(this.Ha)return void this.Ha.then(({surveys:o,context:c})=>{this.Ti||e(o,c)}).catch(o=>Ut.error("Error in survey callback",o));const s=n.sendRequest("/api/surveys/",{method:"GET",query:{token:n.projectToken},sentAt:"query",timeoutMs:this.Fr.requestTimeoutMs}).then(o=>{try{return this.rl(n,o)}catch(c){return Ut.error("Error processing surveys response",c),this.rl(n,{statusCode:0,error:c})}},o=>this.rl(n,{statusCode:0,error:o}));this.Ha=s;const i=()=>{this.Ha===s&&(this.Ha=null)};s.then(o=>{i(),this.Ti||(this.Va(o.context),e(o.surveys,o.context))},i).catch(o=>Ut.error("Error in survey callback",o))}rl(e,t){if(this.Ti)return{surveys:[],context:{isLoaded:!1,error:au}};const n=t.statusCode;if(n!==200||!t.json){const s=`Surveys API could not be loaded, status: ${n}`;return n!==0?Ut.error(s):t.error||Ut.warn(s),this.Ua=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Ua=null;const r=t.json.surveys||[];return e.kv.set({[Cf]:r,[x0]:Date.now()}),this.el(r),{surveys:r,context:{isLoaded:!0}}}el(e){const t=e.filter(n=>(function(r){return!(!r.start_date||r.end_date)})(n)&&(pI(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.al(t)}al(e){var t;(t=this._surveyEventReceiver)===null||t===void 0||t.replace(e)}sl(){return this.ll()&&!this.Ha&&!this.ul()}ll(){var e;const t=(e=this.Fa)===null||e===void 0?void 0:e.kv.get(x0);return Fn(t)&&Date.now()-t>3e5}ul(){return Fn(this.Ua)&&3e5>Date.now()-this.Ua}markSurveyAsSeen(e,t){var n;const r={id:e,current_iteration:(n=t==null?void 0:t.iteration)!==null&&n!==void 0?n:null};vI(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Va()}nl(e){for(const t of this.Ba){if(this.Ti)return;try{e.isLoaded?this.getSurveys(t):t([],e)}catch(n){Ut.error("Error in survey callback",n)}}}getActiveMatchingSurveys(e,t=!1){if(!ot(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Ut.warn("init was not called")}onActiveMatchingSurveysChanged(e){var t;if(this.Ti)return()=>{};const n={callback:e,active:!0,revision:0};this.za.push(n),this.il();const r=(t=this.Fa)===null||t===void 0?void 0:t.kv.get(Cf);return this.Fr.disableSurveys||!this._surveyManager&&this.qa&&!this.ja||!r&&!ot(this.Ua)&&!this.Ha?this.Qa(n,{isLoaded:!1}):this._surveyManager&&this.Qa(n),()=>{var s;n.active=!1,this.za=this.za.filter(i=>i!==n),this.za.length===0&&((s=this.Ka)===null||s===void 0||s.call(this),this.Ka=void 0)}}il(){var e,t,n;this._surveyManager&&this.za.length>0&&((e=this.Ka)!==null&&e!==void 0||(this.Ka=(t=(n=this.Na).onMatchingConditionsChanged)===null||t===void 0?void 0:t.call(n,this.Va)))}Qa(e,t){if(this.Ti||!e.active)return;const n=++e.revision,r=s=>{if(!this.Ti&&e.active&&n===e.revision)try{const i=t??{isLoaded:!0},o=JSON.stringify([s,i]);if(o===e.lastResult)return;e.lastResult=o,e.callback(s,i)}catch(i){Ut.error("Error in active matching surveys callback",i)}};try{t&&!t.isLoaded?r([]):this.getActiveMatchingSurveys(r)}catch(s){Ut.error("Error in active matching surveys callback",s)}}cl(e){let t=null;return this.getSurveys(n=>{var r;t=(r=n.find(s=>s.id===e))!==null&&r!==void 0?r:null}),t}hl(e){if(ot(this._surveyManager))return{eligible:!1,reason:au};const t=typeof e=="string"?this.cl(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}dl(e){var t;if(!(!((t=this.Fa)===null||t===void 0)&&t.canCapture))return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(ot(this._surveyManager))return{eligible:!1,reason:au};const n=typeof e=="string"?this.cl(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ot(this._surveyManager))return Ut.warn("init was not called"),{visible:!1,disabledReason:au};const t=this.dl(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ot(this._surveyManager)?(Ut.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:au})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===e))!==null&&s!==void 0?s:null;if(i){const o=this.dl(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,n){var r,s,i;if(!(!((r=this.Fa)===null||r===void 0)&&r.canCapture))return;if(ot(this._surveyManager))return void Ut.warn("init was not called");const o=typeof e=="string"?this.cl(e):e;if(!(o!=null&&o.id))return void Ut.warn("Survey not found");if(!Qj.includes(o.type))return void Ut.warn(`Surveys of type ${o.type} cannot be rendered in the app`);const c=(s=typeof document>"u"?void 0:document)===null||s===void 0?void 0:s.querySelector(t);if(c){if(!((i=o.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){Ut.info(`Rendering survey ${o.id} with delay of ${o.appearance.surveyPopupDelaySeconds} seconds`);const u=setTimeout(()=>{var d,f,p;this.Wa.delete(u),!this.Ti&&(!((d=this.Fa)===null||d===void 0)&&d.canCapture)&&(Ut.info(`Rendering survey ${o.id} with delay of ${(f=o.appearance)===null||f===void 0?void 0:f.surveyPopupDelaySeconds} seconds`),(p=this._surveyManager)===null||p===void 0||p.renderSurvey(o,c,n),Ut.info(`Survey ${o.id} rendered`))},1e3*o.appearance.surveyPopupDelaySeconds);return void this.Wa.add(u)}this._surveyManager.renderSurvey(o,c,n)}else Ut.warn("Survey element not found")}displaySurvey(e,t){var n,r;if(!(!((n=this.Fa)===null||n===void 0)&&n.canCapture))return;if(ot(this._surveyManager))return void Ut.warn("init was not called");const s=this.cl(e);if(!s)return void Ut.warn("Survey not found");let i=s;if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=N(N({},s),{},{appearance:N(N({},s.appearance),{},{surveyPopupDelaySeconds:0})})),t.displayType!==Y_.Popover&&t.initialResponses&&Ut.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){const o=this.hl(s);if(!o.eligible)return void Ut.warn("Survey is not eligible to be displayed: ",o.reason)}t.displayType!==Y_.Inline?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}cancelPendingSurvey(e){ot(this._surveyManager)?Ut.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,t;(e=this._surveyManager)===null||e===void 0||(t=e.handlePageUnload)===null||t===void 0||t.call(e)}},A7=class{constructor(e){this._instance=e}get(){var e,t,n,r;const s=(e=this._instance)===null||e===void 0?void 0:e.config;return{disableSurveys:!!(s!=null&&s.disable_surveys),cookielessMode:!!(s!=null&&s.cookieless_mode),advancedEnableSurveys:!!(s!=null&&s.advanced_enable_surveys),requestTimeoutMs:(t=s==null?void 0:s.surveys_request_timeout_ms)!==null&&t!==void 0?t: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 e=et==null?void 0:et.__PosthogExtensions__;if(!e||!this._instance)return;const t=this._instance,{generateSurveys:n,loadExternalDependency:r}=e;return{generateSurveys:n?s=>n(t,s):void 0,loadExternalDependency:r?s=>r(t,"surveys",s):void 0}}onMatchingConditionsChanged(e){var t,n;const r=(t=this._instance)===null||t===void 0?void 0:t._addCaptureHook(c=>{c!=="$pageview"&&c!==Bs.SHOWN&&c!==Bs.DISMISSED&&c!==Bs.SENT||e()}),s=()=>e();$t(ie,"PHSurveyShown",s);let i=!1;const o=(n=this._instance)===null||n===void 0?void 0:n.onFeatureFlags(()=>{i&&e()});return i=!0,()=>{i=!1,r==null||r(),o==null||o(),ie==null||ie.removeEventListener("PHSurveyShown",s)}}};const I7=ie!=null&&ie.location?C0(ie.location.hash,"__posthog")||C0(location.hash,"state"):null,U6="_postHogToolbarParams",Z6=xn("[Toolbar]"),B6=xn("[FeatureFlags]"),Vl=xn("[FeatureFlags]",{debugEnabled:!0}),p1=`" failed. Feature flags didn't load in time.`,O7=[502,504],W6=["click","keydown","wheel","touchstart","pointerdown"],K6="connection_error",G6=e=>{const t={};for(let n=0;e.length>n;n++)t[e[n]]=!0;return t},q6=e=>{const t={};for(const[n,r]of Zm(e||{}))r&&(t[n]=r);return t},M7=(e,t)=>e.distinctId===t.distinctId&&e.sessionId===t.sessionId&&((n,r)=>{const s=Object.keys(n);return s.length===Object.keys(r).length&&s.every(i=>n[i]===r[i])})(e.groups,t.groups);var L7=class{constructor(e){this.name="featureFlags",this.Pd=!1,this.featureFlagEventHandlers=[],this.R=B6,this.Od={},this.Fd={},this.Dd=[],this.Ld=new Set,this.Nd=new Set,this.jd=!1,this.qd=!1,this.Bd=0,this.zd=!1,this.Hd=!1,this.Ud=!1,this.Wd=new Map,this.Vd=!1,this.Gd=!1,this.Qd=!1,this.Jd=0,this.Zd=!1,this.sn=()=>{const t=this.Kd();this.Jd=0,t&&this.reloadFeatureFlags()},this.Yd=()=>{var t,n;const r=this.Xd,s=(t=this.tv)!==null&&t!==void 0?t:r;le(r)||le(s)||this.Fr.remoteRequestsDisabled||!this.ev||this.ev.visibilityState==="hidden"||Date.now()-((n=this.iv)!==null&&n!==void 0?n:0)<s||(this.tv=this.Zd||!this.Fr.idleRefreshBackoff?r:Math.min(2*s,36e5),this.Zd=!1,this.reloadFeatureFlags(),this.nv())},this.sv=()=>{this.Zd&&this.tv===this.Xd||this.rv()},this.an=()=>{var t;((t=this.ev)===null||t===void 0?void 0:t.visibilityState)==="visible"&&this.rv()},this.Na=e}get ov(){}av(){this.Fa&&this.lv()}setup(e){try{this.uv=typeof window>"u"?void 0:window,this.ev=typeof document>"u"?void 0:document}catch{this.uv=void 0,this.ev=void 0}return this.Ja=e,this.R=e.logger.createLogger("[FeatureFlags]"),pb(e.kv.initialize(),()=>{this.Ja===e&&(this.Ja=void 0,this.Fa=e,this.hv(e))})}hv(e){var t;if(this.Fa===e)return this.uv&&$t(this.uv,"online",this.sn),this.lv(),this.dv=e.registerDynamicEventProperties(()=>this.vv()?this.Od:this.Fd),this.fv=(t=this.ov)===null||t===void 0?void 0:t.onCrossTabFeatureFlagChange(()=>{this.pv(),this.gv(),this.mv()}),this.gv(),this.initialize()}rv(){this.Zd=!0,this.tv=this.Xd,this.Yd()}lv(){var e;const t=this.Fr.refreshIntervalMs,n=!this.Fr.remoteRequestsDisabled&&this.ev&&!le(t)&&t>0?t:void 0;this.Fr.idleRefreshBackoff||(this.tv=n),n!==this.Xd&&(this.yv(),le(n)||(this.Xd=n,this.tv=n,this.nv(),!((e=this.ev)===null||e===void 0)&&e.addEventListener&&($t(this.ev,Ru,this.an),wu(W6,r=>{$t(this.ev,r,this.sv,{capture:!0})}))))}nv(){le(this.Xd)||(le(this.bv)||clearInterval(this.bv),this.iv=Date.now(),this.bv=setInterval(this.Yd,this.Xd))}yv(){var e,t;le(this.bv)||(clearInterval(this.bv),this.bv=void 0,(e=this.ev)===null||e===void 0||(t=e.removeEventListener)===null||t===void 0||t.call(e,"visibilitychange",this.an),wu(W6,n=>{var r,s;(r=this.ev)===null||r===void 0||(s=r.removeEventListener)===null||s===void 0||s.call(r,n,this.sv,{capture:!0})})),this.Xd=void 0,this.tv=void 0,this.Zd=!1,this.iv=void 0}destroy(){this._v()}dispose(){this._v()}_v(){var e,t,n;this.yv(),this.Bd++,this.Hd=!1,this.Ja=void 0,this.wv(this.Ld,"cancelled"),this.wv(this.Nd,"cancelled"),this.Fa&&(this.Sv(),(e=this.dv)===null||e===void 0||e.dispose(),this.dv=void 0,(t=this.fv)===null||t===void 0||t.call(this),this.fv=void 0,this.Dd=[],(n=this.uv)===null||n===void 0||n.removeEventListener("online",this.sn),this.Fa=void 0)}get Fr(){return this.Na.get()}xv(e){var t;return this.$v&&e in this.$v?this.$v[e]:(t=this.Fa)===null||t===void 0?void 0:t.kv.get(e)}pv(){return!!this.$v&&(this.$v=void 0,!0)}Cv(){var e;return!le((e=this.Fa)===null||e===void 0?void 0:e.kv.get("$enabled_feature_flags"))&&this.pv()}$t(e){this.Tv(()=>{var t;return(t=this.Fa)===null||t===void 0?void 0:t.kv.set(e)})}Iv(e,t,n){if(!this.ov||!e.$enabled_feature_flags)return;const r=this.xv("$enabled_feature_flags")||{},s=e.$enabled_feature_flags||{},i=t.flags||t.featureFlags,o=t.flags?Object.entries(t.flags).filter(([,b])=>!(b!=null&&b.failed)).map(([b])=>b):[],c=!!t.errorsWhileComputingFlags&&!!t.flags,u=c?o:n&&!He(i)?Object.keys(i||{}):Array.from(new Set([...Object.keys(r),...Object.keys(s)])),d=this.xv("$feature_flag_payloads")||{},f=e.$feature_flag_payloads||{},p=c||n?u:Array.from(new Set([...Object.keys(d),...Object.keys(f)])),m=!c&&!n,v=!!m||u,_=!!m||p,w={[Ko]:v,[Ni]:v,[Xa]:_};e.$feature_flag_details&&(w[uc]=v);for(const b of[dc,tl,jf])le(e[b])||(w[b]=!0);this.ov.markCrossTabFeatureFlagChanges(w)}Dt(e){this.Tv(()=>{var t;return(t=this.Fa)===null||t===void 0?void 0:t.kv.remove(e)})}Tv(e){try{e()}catch(t){this.R.error("Failed to update feature flag persistence",t)}}gv(){const e={};for(const r of[Ko,Xa,dc,no]){const s=this.xv(r);le(s)||(e[r]=s)}this.Od=e;const t=N({},e),n=this.xv(Ni);if(n)for(const[r,s]of Object.entries(n))t[`$feature/${r}`]=s;this.Fd=t}vv(){const e=this.Fr.cacheTtlMs;if(!e||0>=e)return!1;const t=this.xv(tl);return typeof t!="number"||Date.now()-t>e}Mv(){return!!this.vv()&&(this.Qd||this.qd||(this.Qd=!0,this.R.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ev(){const e=this.Fr.evaluationContexts;return e!=null&&e.length?e.filter(t=>{const n=t&&typeof t=="string"&&t.trim().length>0;return n||this.R.error("Invalid evaluation context found:",t,"Expected non-empty string"),n}):[]}Av(){const e=this.Fr.flagKeys;if(!le(e))return e.filter(t=>{const n=t&&typeof t=="string"&&t.trim().length>0;return n||this.R.error("Invalid flag key found:",t,"Expected non-empty string"),n})}initialize(){var e,t;const n=this.Fr,r=(e=(t=n.bootstrap)===null||t===void 0?void 0:t.featureFlags)!==null&&e!==void 0?e:{};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:{},c=Object.keys(r).filter(d=>!le(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),u=Object.keys(o).filter(d=>c[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.Rv({featureFlags:c,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(e,t,n){var r,s;const i=n!=null&&n.merge&&(r=this.xv("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.xv("$feature_flag_payloads"))!==null&&s!==void 0?s:{},c=N(N({},i),e),u=N(N({},o),t),d={};for(const[f,p]of Object.entries(c))d[f]={key:f,enabled:Dk(p),variant:Fk(p),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.Rv({flags:d})}get hasLoadedFlags(){return this.jd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const e=this.xv(uc),t=this.xv(no),n=this.xv(ql);if(!n&&!t)return e||{};const r=pn({},e||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(const c of s){var i,o;const u=r[c],d=t==null?void 0:t[c],f=le(d)?(i=u==null?void 0:u.enabled)!==null&&i!==void 0&&i:!!d,p=le(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[c],v=N(N({},u),{},{enabled:f,variant:f?p??(u==null?void 0:u.variant):void 0});f!==(u==null?void 0:u.enabled)&&(v.original_enabled=u==null?void 0:u.enabled),p!==(u==null?void 0:u.variant)&&(v.original_variant=u==null?void 0:u.variant),m&&(v.metadata=N(N({},u==null?void 0:u.metadata),{},{payload:m,original_payload:u==null||(o=u.metadata)===null||o===void 0?void 0:o.payload})),r[c]=v}return this.Pd||(this.R.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Pd=!0),r}getAllFeatureFlags(){const e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(n=>{const r=e[n];return{key:n,enabled:Dk(r),variant:Fk(r),payload:Nk(t[n])}})}getFlagVariants(){const e=this.xv(Ni),t=this.xv(no);if(!t)return e||{};const n=pn({},e||{}),r=Object.keys(t);for(let s=0;r.length>s;s++)n[r[s]]=t[r[s]];return this.Pd||(this.R.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Pd=!0),n}getFlagPayloads(){const e=this.xv(Xa),t=this.xv(ql);if(!t)return e||{};const n=pn({},e||{}),r=Object.keys(t);for(let s=0;r.length>s;s++)n[r[s]]=t[r[s]];return this.Pd||(this.R.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Pd=!0),n}reloadFeatureFlags(){this.zd||this.Fr.featureFlagsDisabled||this.Kd()||(this.Ud&&this.R.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.qd&&(this.Hd=!0),this.Pv||(this.Dd.slice().forEach(e=>{try{e()}catch(t){this.R.error("Error while running feature flags reloading callback",t)}}),this.Pv=setTimeout(()=>{this.Ov()},5)))}reloadFeatureFlagsAsync(){return!this.Fa||this.zd||this.Fr.featureFlagsDisabled||this.Fr.remoteRequestsDisabled||this.Kd()?Promise.resolve({status:"skipped"}):new Promise(e=>{this.Ld.add(e),this.reloadFeatureFlags()})}wv(e,t){e.forEach(n=>n({status:t})),e.clear()}Sv(){clearTimeout(this.Pv),this.Pv=void 0}onReloading(e){return this.Dd.push(e),()=>{this.Dd=this.Dd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.jd||this.qd||this.Pv||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.zd=e}resetFlagCallReported(){this.Dt(lo),this.Wd=new Map}sendFlagCallsPendingCapture(){var e;if(this.Wd.size!==0&&!this.Vd&&(!((e=this.Fa)===null||e===void 0)&&e.canCapture)&&!this.Fa.isRateLimited){this.Vd=!0;try{const t=this.getFlagVariants();for(const n of Array.from(this.Wd.keys())){const r=this.Wd.get(n);if(r){if(r.value!==String(t[n])||!M7(r.context,this.Fv())){this.Wd.delete(n);continue}if(this.getFeatureFlagResult(n),this.Wd.has(n))break}}}finally{this.Vd=!1}}}Ov(e){var t;this.Sv();const n=this.Fa;if(!n||this.Fr.remoteRequestsDisabled||this.Kd())return void this.wv(this.Ld,"skipped");if(this.qd)return void(this.Hd=!0);const r={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:N(N(N({},n.initialPersonProperties),this.xv("$stored_person_properties")||{}),{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this.xv(qa),timezone:db()};le(n.deviceId)||(r.$device_id=n.deviceId),(e!=null&&e.disableFlags||this.Fr.featureFlagsDisabled)&&(r.disable_flags=!0);const s=this.Ev();s.length&&(r.evaluation_contexts=s);const i=this.Av();le(i)||(r.flag_keys=i);const o=this.Fr.onlyEvaluateSurveyFeatureFlags,c="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),u=this.Bd,d=this.Ld;this.Ld=new Set,this.Nd=d,this.qd=!0;const f=()=>{this.Hd&&(this.Hd=!1,this.Ov())},p=b=>{var S,E;const C=(S=b.json)!==null&&S!==void 0?S:{},R=b.statusCode!==200;if(this.qd=!1,u!==this.Bd)return void f();if(this.Dv(b.statusCode),R||this.Hd||(this.$anon_distinct_id=void 0),r.disable_flags&&!this.Hd)return void this.wv(d,"skipped");this.Gd=!R;const T=[];b.error?T.push(b.error instanceof Error&&b.error.name==="AbortError"?"timeout":b.error instanceof Error?K6:"unknown_error"):b.statusCode!==200&&T.push(`api_error_${b.statusCode}`),C.errorsWhileComputingFlags&&T.push("errors_while_computing_flags");const O=!!(!((E=C.quotaLimited)===null||E===void 0)&&E.includes("feature_flags"));O&&T.push("quota_limited"),this.$t({[ih]:T}),O?this.R.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.Rv(C,R,{partialResponse:o}),this.wv(d,r.disable_flags?"skipped":T.length||!C.flags&&!C.featureFlags?"error":"loaded"),f()},m=b=>{this.qd=!1,u===this.Bd&&(this.$t({[ih]:[K6]}),this.R.error("Feature flag request failed",b),this.Cv()&&this.mv(!0),this.wv(d,"error")),f()};let v=(t=this.Fr.requestMaxRetries)!==null&&t!==void 0?t:1;const _=()=>v>0&&u===this.Bd,w=()=>{if(u!==this.Bd||!this.Fa||this.Fr.remoteRequestsDisabled)return this.qd=!1,this.wv(d,"skipped"),void f();try{n.sendRequest(c,{target:"flags",method:"POST",body:r,compression:this.Fr.compression,sentAt:"body",timeoutMs:this.Fr.requestTimeoutMs}).then(b=>{if((S=>O7.includes(S.statusCode)||(E=>E.statusCode===0&&E.error instanceof Error&&E.error.name==="AbortError")(S))(b)&&_())return v--,void setTimeout(w,500);p(b)}).catch(m)}catch(b){m(b)}};w()}Kd(){return FA(this.Jd,3)}Dv(e){this.Jd=jA(e,this.Jd,3,()=>this.R.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(e,t={}){var n;if(t.fresh&&!this.Gd)return;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return void this.R.warn('getFeatureFlag for key "'+e+p1);if(this.Mv())return;const r=this.getFeatureFlagResult(e,t);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){const t=this.getFeatureFlagResult(e,{send_event:!1});return t==null?void 0:t.payload}getFeatureFlagResult(e,t={}){if(t.fresh&&!this.Gd)return;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return void this.R.warn('getFeatureFlagResult for key "'+e+p1);if(this.Mv())return;const n=this.getFlagVariants(),r=e in n,s=n[e],i=this.getFlagPayloads()[e],o=String(s),c=this.xv("$feature_flag_request_id")||void 0,u=this.xv("$feature_flag_evaluated_at")||void 0;let d,f=this.xv("$flag_call_reported")||{};if(this.Fr.deduplicateCallsPerSession){var p;const X=(p=this.Fa)===null||p===void 0||(p=p.session)===null||p===void 0?void 0:p.sessionId,Q=this.xv(kf);X&&X!==Q&&(f={},d=X)}if(!t.send_event&&"send_event"in t)d&&this.$t({[lo]:f,[kf]:d});else{var m,v,_;const X=!(!((m=this.Fa)===null||m===void 0)&&m.canCapture),Q=!X&&!(!((v=this.Fa)===null||v===void 0)&&v.isRateLimited);var w;if(Q?this.Wd.delete(e):(X&&Object.keys(f).length>0&&(f={},this.$t({[lo]:f})),!((w=f[e])===null||w===void 0)&&w.includes(o)||this.Lv(e,o)),Q&&!(!((_=f[e])===null||_===void 0)&&_.includes(o))){var b,S,E,C,R,T,O,M,A,L,V,W,z;He(f[e])?f[e].push(o):f[e]=[o],this.$t(N({[lo]:f},d?{[kf]:d}:{}));const H=this.getFeatureFlagDetails(e),Y=[...(b=this.xv("$feature_flag_errors"))!==null&&b!==void 0?b:[]];le(s)&&Y.push("flag_missing");const oe={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:c,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(S=(E=this.Fr.bootstrap)===null||E===void 0||(E=E.featureFlags)===null||E===void 0?void 0:E[e])!==null&&S!==void 0?S:null,$feature_flag_bootstrapped_payload:(C=(R=this.Fr.bootstrap)===null||R===void 0||(R=R.featureFlagPayloads)===null||R===void 0?void 0:R[e])!==null&&C!==void 0?C:null,$used_bootstrap_value:!this.Gd};le(H==null||(T=H.metadata)===null||T===void 0?void 0:T.has_experiment)||(oe.$feature_flag_has_experiment=H.metadata.has_experiment),le(H==null||(O=H.metadata)===null||O===void 0?void 0:O.version)||(oe.$feature_flag_version=H.metadata.version);const U=(M=H==null||(A=H.reason)===null||A===void 0?void 0:A.description)!==null&&M!==void 0?M:H==null||(L=H.reason)===null||L===void 0?void 0:L.code;U&&(oe.$feature_flag_reason=U),!(H==null||(V=H.metadata)===null||V===void 0)&&V.id&&(oe.$feature_flag_id=H.metadata.id),le(H==null?void 0:H.original_variant)&&le(H==null?void 0:H.original_enabled)||(oe.$feature_flag_original_response=le(H.original_variant)?H.original_enabled:H.original_variant),!(H==null||(W=H.metadata)===null||W===void 0)&&W.original_payload&&(oe.$feature_flag_original_payload=H==null||(z=H.metadata)===null||z===void 0?void 0:z.original_payload),Y.length&&(oe.$feature_flag_error=Y.join(",")),this.Nv(oe)||(this.jv(e,o),this.Lv(e,o))}else d&&this.$t({[lo]:f,[kf]:d})}return r?{key:e,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:Nk(i)}:void 0}Nv(e){try{var t;return((t=this.Fa)===null||t===void 0?void 0:t.capture("$feature_flag_called",e))!==!1}catch(n){return this.R.error("Failed to capture feature flag call",n),!0}}Lv(e,t){this.Wd.set(e,{value:t,context:this.Fv()})}Fv(){var e,t,n;return{distinctId:(e=this.Fa)===null||e===void 0?void 0:e.distinctId,groups:N({},(t=this.Fa)===null||t===void 0?void 0:t.groups),sessionId:this.Fr.deduplicateCallsPerSession?(n=this.Fa)===null||n===void 0||(n=n.session)===null||n===void 0?void 0:n.sessionId:void 0}}jv(e,t){const n=this.xv("$flag_call_reported")||{},r=n[e];He(r)&&r.includes(t)&&(n[e]=r.filter(s=>s!==t),this.$t({[lo]:n}))}getRemoteConfigPayload(e,t){this.qv(e,t)}qv(e,t){var n=this;return cn(function*(){const r=n.Fa;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.Ev();i.length&&(s.evaluation_contexts=i);const o=n.Av();let c;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.Fr.compression,sentAt:"body",timeoutMs:n.Fr.requestTimeoutMs})).json)===null||u===void 0?void 0:u.featureFlagPayloads;c=(d==null?void 0:d[e])||void 0}catch(d){return void n.R.error("Remote config feature flag request failed",d)}try{t(c)}catch(d){n.R.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(e,t={}){if(t.fresh&&!this.Gd)return t.defaultValue;if(!(this.jd||this.getFlags()&&this.getFlags().length>0))return this.R.warn('isFeatureEnabled for key "'+e+p1),t.defaultValue;const n=this.getFeatureFlag(e,t);return le(n)?t.defaultValue:!!n}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,n){this.Rv(e,t,n)}Rv(e,t,n){if(!this.Fa)return;this.jd=!0;const r=((s,i={},o={},c={},u,d=B6)=>{const f=((C,R)=>{const T=C.flags;if(T){const O=Object.fromEntries(Object.keys(T).map(A=>{var L;return[A,(L=T[A].variant)!==null&&L!==void 0?L:T[A].enabled]})),M=Object.fromEntries(Object.keys(T).filter(A=>T[A].enabled).filter(A=>{var L;return!le((L=T[A].metadata)===null||L===void 0?void 0:L.payload)}).map(A=>{var L;return[A,(L=T[A].metadata)===null||L===void 0?void 0:L.payload]}));return N(N({},C),{},{featureFlags:O,featureFlagPayloads:M})}return C.featureFlags&&R.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(s,d),p=f.flags,m=f.featureFlags,v=f.featureFlagPayloads;if(!m)return;const _=s.requestId,w=s.evaluatedAt;if(He(m)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const C={};if(m)for(let R=0;m.length>R;R++)C[m[R]]=!0;return{[Ko]:m,[Ni]:C,[jf]:!1}}let b=m,S=v,E=p;if(u!=null&&u.partialResponse){const C=Object.keys(b),R=S||{};b=N(N({},i),b),S=N(N({},o),R),C.forEach(T=>{T in R||S==null||delete S[T]}),E=N(N({},c),E)}else if(s.errorsWhileComputingFlags)if(p){const C=new Set(Object.keys(p).filter(T=>{var O;return!(!((O=p[T])===null||O===void 0)&&O.failed)}));b=N(N({},i),Object.fromEntries(Object.entries(b).filter(([T])=>C.has(T))));const R=Object.fromEntries(Object.entries(S||{}).filter(([T])=>C.has(T)));S=N(N({},o),R),C.forEach(T=>{T in R||S==null||delete S[T]}),E=N(N({},c),Object.fromEntries(Object.entries(E||{}).filter(([T])=>C.has(T))))}else b=N(N({},i),b),S=N(N({},o),S),E=N(N({},c),E);return N(N({[Ko]:Object.keys(q6(b)),[Ni]:b||{},[Xa]:S||{},[uc]:E||{},[jf]:s.minimalFlagCalledEvents===!0},_?{[dc]:_}:{}),w?{[tl]:w}:{})})(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.R);if(r)if((n==null?void 0:n.persist)===!1){const s=!le(this.Fa.kv.get(Ni));this.$v=r,s||this.$t(r)}else this.pv(),this.Iv(r,e,!!(n!=null&&n.partialResponse)),this.$t(r);else t&&this.Cv();t||(this.Qd=!1),this.mv(t)}override(e,t=!1){this.R.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.Bv(e)}Bv(e){if(this.Fa){if(e===!1)return this.Dt([no,ql]),this.mv(),void Vl.info("All overrides cleared");if(He(e))return this.$t({[no]:G6(e)}),this.mv(),void Vl.info("Flag overrides set",{flags:e});if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t;const n=e;this.Pd=!!((t=n.suppressWarning)!==null&&t!==void 0&&t);const r={},s=n.flags,i=n.payloads;return s&&(r[no]=He(s)?G6(s):s),i&&(r[ql]=i),Object.keys(r).length&&this.$t(r),s===!1&&i===!1?this.Dt([no,ql]):s===!1?this.Dt(no):i===!1&&this.Dt(ql),this.mv(),s===!1?Vl.info("Flag overrides cleared"):s&&Vl.info("Flag overrides set",{flags:s}),void(i===!1?Vl.info("Payload overrides cleared"):i&&Vl.info("Payload overrides set",{payloads:i}))}if(e&&typeof e=="object")return this.$t({[no]:e}),this.mv(),void Vl.info("Flag overrides set",{flags:e});this.R.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.R.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.jd){const{flags:t,flagVariants:n}=this.zv();try{e(t,n)}catch(r){this.R.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;const s=(this.xv("$early_access_features")||[]).find(d=>d.flagKey===e),i={[`$feature_enrollment/${e}`]:t},o={$feature_flag:e,$feature_enrollment:t,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n);const c=N(N({},this.getFlagVariants()),{},{[e]:t});(r=this.ov)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[e],$enabled_feature_flags:[e],$stored_person_properties:Object.keys(i)}),this.$t({[Ko]:Object.keys(q6(c)),[Ni]:c,[Ya]:N(N({},this.xv("$stored_person_properties")||{}),i)}),this.mv();try{var u;(u=this.Fa)===null||u===void 0||u.capture("$feature_enrollment_update",o)}catch(d){this.R.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(e,t=!1,n){const r=this.xv(D_);!r||t?this.Hv(e,n):e(r)}Hv(e,t){var n=this;return cn(function*(){const r=n.Fa;if(!r)return;const s=t?`&${t.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.$t({[D_]:i})}catch(o){return void n.R.error("Early access feature request failed",o)}try{e(i)}catch(o){n.R.error("Early access feature callback failed",o)}})()}zv(){const e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}mv(e){this.gv();const{flags:t,flagVariants:n}=this.zv(),r=this.Ud;this.Ud=!0,this.featureFlagEventHandlers.forEach(s=>{try{s(t,n,{errorsLoading:e})}catch(i){this.R.error("Error while running feature flags callback",i)}}),this.Ud=r}setPersonPropertiesForFlags(e,t=!0){this.Uv(e,t)}Uv(e,t=!0){const n=this.xv("$stored_person_properties")||{},r=(e==null?void 0:e.$set)||(e!=null&&e.$set_once?{}:e),s=e==null?void 0:e.$set_once,i={};if(s)for(const o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.$t({[Ya]:N(N(N({},n),i),r)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t=!0){const n=N({},this.xv("$stored_person_properties")||{});e.forEach(r=>{delete n[r]}),this.$t({[Ya]:n}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e=!0){this.Dt(Ya),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t=!0){const n=this.xv("$stored_group_properties")||{},r=N({},n);for(const s of Object.keys(e))r[s]=N(N({},n[s]),e[s]);this.$t({[qa]:r}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){const t=this.xv("$stored_group_properties")||{};this.$t({[qa]:N(N({},t),{},{[e]:{}})})}else this.Dt(qa)}reset(){this.Bd++,this.wv(this.Ld,"cancelled"),this.wv(this.Nd,"cancelled"),this.Hd=!1,this.Od={},this.Fd={},this.$v=void 0,this.jd=!1,this.zd=!1,this.Gd=!1,this.$anon_distinct_id=void 0,this.Sv(),this.Pd=!1,this.Jd=0,this.Wd=new Map}};const Y6=xn("[FeatureFlags]");var $7=class{constructor(e,t=!1){this.Wv=!1,this.update(e,t)}update(e,t){this.Vv=((n,r)=>{var s,i,o,c,u,d,f,p;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(c=n.bootstrap)===null||c===void 0?void 0:c.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=(p=n.evaluation_contexts)!==null&&p!==void 0?p:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:He(n.flag_keys)?n.flag_keys:void 0}})(e,t),!e.evaluation_environments||e.evaluation_contexts||this.Wv||(Y6.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Wv=!0),le(e.flag_keys)||He(e.flag_keys)||Y6.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Vv}},lm=class extends L7{constructor(e){const t=new $7(e.config,e.lc());super(t),this.name=wI,this._instance=e,this.Gv=t}get ov(){return this._instance.persistence}updateConfig(e,t){this.Gv.update(e,t),this.av()}};const X6=e=>wd(e)&&(e.name==="RangeError"&&e.message.indexOf("Maximum call stack size exceeded")===0||e.name==="InternalError"&&e.message==="too much recursion"),Ti=xn("[Error tracking]"),rw="webkit-masked-url:",N7=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],D7=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",rw],F7=["__firefox__","__gCrWeb"];function Q6(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function j7(e,t){return(function(n){if(Array.isArray(n))return n})(e)||(function(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var i,o,c,u,d=[],f=!0,p=!1;try{if(c=(s=s.call(n)).next,r!==0)for(;!(f=(i=c.call(s)).done)&&(d.push(i.value),d.length!==r);f=!0);}catch(m){p=!0,o=m}finally{try{if(!f&&s.return!=null&&(u=s.return(),Object(u)!==u))return}finally{if(p)throw o}}return d}})(e,t)||(function(n,r){if(n){if(typeof n=="string")return Q6(n,r);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Q6(n,r):void 0}})(e,t)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
19
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}const SI=Object.entries,J6=Object.setPrototypeOf,V7=Object.isFrozen,z7=Object.getPrototypeOf,H7=Object.getOwnPropertyDescriptor;let Fr=Object.freeze,Vr=Object.seal,pu=Object.create,EI=typeof Reflect<"u"&&Reflect,sw=EI.apply,iw=EI.construct;Fr||(Fr=function(e){return e}),Vr||(Vr=function(e){return e}),sw||(sw=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;n>s;s++)r[s-2]=arguments[s];return e.apply(t,r)}),iw||(iw=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return new e(...n)});const lu=lr([].forEach),U7=lr([].lastIndexOf),eC=lr([].pop),cu=lr([].push),Z7=lr([].splice),Fa=Array.isArray,Tf=lr("".toLowerCase),m1=lr("".toString),tC=lr("".match),yf=lr("".replace),nC=lr("".indexOf),B7=lr("".trim),W7=lr(0 .toString),K7=lr(Boolean.prototype.toString),rC=typeof BigInt>"u"?null:lr(BigInt.prototype.toString),sC=typeof Symbol>"u"?null:lr(Symbol.prototype.toString),kr=lr({}.hasOwnProperty),cm=lr({}.toString),Sr=lr(/t/.test),zl=(iC=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];return iw(iC,t)});var iC;function lr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];return sw(e,t,r)}}function Ht(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Tf;if(J6&&J6(e,null),!Fa(t))return e;let r=t.length;for(;r--;){let s=t[r];if(typeof s=="string"){const i=n(s);i!==s&&(V7(t)||(t[r]=i),s=i)}e[s]=!0}return e}function G7(e){for(let t=0;e.length>t;t++)kr(e,t)||(e[t]=null);return e}function qr(e){const t=pu(null);for(const r of SI(e)){var n=j7(r,2);const s=n[0],i=n[1];kr(e,s)&&(t[s]=Fa(i)?G7(i):i&&typeof i=="object"&&i.constructor===Object?qr(i):i)}return t}function Ai(e,t){for(;e!==null;){const n=H7(e,t);if(n){if(n.get)return lr(n.get);if(typeof n.value=="function")return lr(n.value)}e=z7(e)}return function(){return null}}const oC=Fr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),g1=Fr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),v1=Fr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),q7=Fr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),y1=Fr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Y7=Fr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),aC=Fr(["#text"]),lC=Fr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),_1=Fr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),cC=Fr(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),um=Fr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),X7=Vr(/{{[\w\W]*|^[\w\W]*}}/g),Q7=Vr(/<%[\w\W]*|^[\w\W]*%>/g),J7=Vr(/\${[\w\W]*/g),eV=Vr(/^data-[\-\w.\u00B7-\uFFFF]+$/),tV=Vr(/^aria-[\-\w]+$/),uC=Vr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nV=Vr(/^(?:\w+script|data):/i),rV=Vr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sV=Vr(/^html$/i),iV=Vr(/^[a-z][.\w]*(-[.\w]+)+$/i),dC=Vr(/<[/\w!]/g),fC=Vr(/<[/\w]/g),oV=Vr(/<\/no(script|embed|frames)/i),aV=Vr(/\/>/i),lV=function(){return typeof window>"u"?null:window},Ia=function(e,t,n,r){return kr(e,t)&&Fa(e[t])?Ht(r.base?qr(r.base):{},e[t],r.transform):n};var cV=(function e(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lV();const n=$=>e($);if(n.version="3.4.13",n.removed=[],!t||!t.document||t.document.nodeType!==9||!t.Element)return n.isSupported=!1,n;let r=t.document;const s=r,i=s.currentScript,o=t.HTMLTemplateElement,c=t.Node,u=t.NodeFilter,d=t.DOMParser,f=t.trustedTypes,p=t.Element.prototype,m=Ai(p,"cloneNode"),v=Ai(p,"remove"),_=Ai(p,"nextSibling"),w=Ai(p,"childNodes"),b=Ai(p,"parentNode"),S=Ai(p,"shadowRoot"),E=Ai(p,"attributes"),C=c&&c.prototype?Ai(c.prototype,"nodeType"):null,R=c&&c.prototype?Ai(c.prototype,"nodeName"):null,T=c&&c.prototype?Ai(c.prototype,"ownerDocument"):null;if(typeof o=="function"){const $=r.createElement("template");$.content&&$.content.ownerDocument&&(r=$.content.ownerDocument)}let O,M,A="",L=!1,V=0;const W=function(){if(V>0)throw zl('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},z=function($){W(),V++;try{return O.createHTML($)}finally{V--}},X=r.implementation,Q=r.createNodeIterator,H=r.createDocumentFragment,Y=r.getElementsByTagName,oe=s.importNode;let U={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported=typeof SI=="function"&&typeof b=="function"&&X&&X.createHTMLDocument!==void 0;const J=X7,K=Q7,D=J7,q=eV,fe=tV,ae=nV,ce=rV,he=iV;let ke=uC,ge=null;const pe=Ht({},[...oC,...g1,...v1,...y1,...aC]);let Le=null;const Ae=Ht({},[...lC,..._1,...cC,...um]);let Ne=Object.seal(pu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Et=null,dn=null;const sn=Object.seal(pu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let kt=!0,Gt=!0,mn=!1,Xt=!0,Me=!1,Qe=!0,Te=!1,xt=!1,xe=null,Nt=null,dt=!1,gt=!1,Hn=!1,Js=!1,_n=!0,Gn=!1;const _i="user-content-";let ts=!0,zr=!1,Un={},fn=null;const Hr=Ht({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Qn=null;const Hi=Ht({},["audio","video","img","source","image","track"]);let Tr=null;const Zn=Ht({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vr="http://www.w3.org/1998/Math/MathML",$s="http://www.w3.org/2000/svg",qn="http://www.w3.org/1999/xhtml";let ns=qn,st=!1,rn=null;const Qt=Ht({},[vr,$s,qn],m1),hn=Fr(["mi","mo","mn","ms","mtext"]);let wn=Ht({},hn);const Bt=Fr(["annotation-xml"]);let Rn=Ht({},Bt);const Ur=Ht({},["title","style","font","a","script"]);let Bn=null;const cr=["application/xhtml+xml","text/html"];let zt=null,ei=null;const Id=r.createElement("form"),ua=function($){return $ instanceof RegExp||$ instanceof Function},Ui=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ei&&ei===$)return;$&&typeof $=="object"||($={}),$=qr($),Bn=cr.indexOf($.PARSER_MEDIA_TYPE)===-1?"text/html":$.PARSER_MEDIA_TYPE,zt=Bn==="application/xhtml+xml"?m1:Tf,ge=Ia($,"ALLOWED_TAGS",pe,{transform:zt}),Le=Ia($,"ALLOWED_ATTR",Ae,{transform:zt}),rn=Ia($,"ALLOWED_NAMESPACES",Qt,{transform:m1}),Tr=Ia($,"ADD_URI_SAFE_ATTR",Zn,{transform:zt,base:Zn}),Qn=Ia($,"ADD_DATA_URI_TAGS",Hi,{transform:zt,base:Hi}),fn=Ia($,"FORBID_CONTENTS",Hr,{transform:zt}),Et=Ia($,"FORBID_TAGS",qr({}),{transform:zt}),dn=Ia($,"FORBID_ATTR",qr({}),{transform:zt}),Un=!!kr($,"USE_PROFILES")&&($.USE_PROFILES&&typeof $.USE_PROFILES=="object"?qr($.USE_PROFILES):$.USE_PROFILES),kt=$.ALLOW_ARIA_ATTR!==!1,Gt=$.ALLOW_DATA_ATTR!==!1,mn=$.ALLOW_UNKNOWN_PROTOCOLS||!1,Xt=$.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Me=$.SAFE_FOR_TEMPLATES||!1,Qe=$.SAFE_FOR_XML!==!1,Te=$.WHOLE_DOCUMENT||!1,gt=$.RETURN_DOM||!1,Hn=$.RETURN_DOM_FRAGMENT||!1,Js=$.RETURN_TRUSTED_TYPE||!1,dt=$.FORCE_BODY||!1,_n=$.SANITIZE_DOM!==!1,Gn=$.SANITIZE_NAMED_PROPS||!1,ts=$.KEEP_CONTENT!==!1,zr=$.IN_PLACE||!1,ke=(function(ve){try{return Sr(ve,""),!0}catch{return!1}})($.ALLOWED_URI_REGEXP)?$.ALLOWED_URI_REGEXP:uC,ns=typeof $.NAMESPACE=="string"?$.NAMESPACE:qn,wn=kr($,"MATHML_TEXT_INTEGRATION_POINTS")&&$.MATHML_TEXT_INTEGRATION_POINTS&&typeof $.MATHML_TEXT_INTEGRATION_POINTS=="object"?qr($.MATHML_TEXT_INTEGRATION_POINTS):Ht({},hn),Rn=kr($,"HTML_INTEGRATION_POINTS")&&$.HTML_INTEGRATION_POINTS&&typeof $.HTML_INTEGRATION_POINTS=="object"?qr($.HTML_INTEGRATION_POINTS):Ht({},Bt);const ue=kr($,"CUSTOM_ELEMENT_HANDLING")&&$.CUSTOM_ELEMENT_HANDLING&&typeof $.CUSTOM_ELEMENT_HANDLING=="object"?qr($.CUSTOM_ELEMENT_HANDLING):pu(null);if(Ne=pu(null),kr(ue,"tagNameCheck")&&ua(ue.tagNameCheck)&&(Ne.tagNameCheck=ue.tagNameCheck),kr(ue,"attributeNameCheck")&&ua(ue.attributeNameCheck)&&(Ne.attributeNameCheck=ue.attributeNameCheck),kr(ue,"allowCustomizedBuiltInElements")&&typeof ue.allowCustomizedBuiltInElements=="boolean"&&(Ne.allowCustomizedBuiltInElements=ue.allowCustomizedBuiltInElements),Vr(Ne),Me&&(Gt=!1),Hn&&(gt=!0),Un&&(ge=Ht({},aC),Le=pu(null),Un.html===!0&&(Ht(ge,oC),Ht(Le,lC)),Un.svg===!0&&(Ht(ge,g1),Ht(Le,_1),Ht(Le,um)),Un.svgFilters===!0&&(Ht(ge,v1),Ht(Le,_1),Ht(Le,um)),Un.mathMl===!0&&(Ht(ge,y1),Ht(Le,cC),Ht(Le,um))),sn.tagCheck=null,sn.attributeCheck=null,kr($,"ADD_TAGS")&&(typeof $.ADD_TAGS=="function"?sn.tagCheck=$.ADD_TAGS:Fa($.ADD_TAGS)&&(ge===pe&&(ge=qr(ge)),Ht(ge,$.ADD_TAGS,zt))),kr($,"ADD_ATTR")&&(typeof $.ADD_ATTR=="function"?sn.attributeCheck=$.ADD_ATTR:Fa($.ADD_ATTR)&&(Le===Ae&&(Le=qr(Le)),Ht(Le,$.ADD_ATTR,zt))),kr($,"ADD_URI_SAFE_ATTR")&&Fa($.ADD_URI_SAFE_ATTR)&&Ht(Tr,$.ADD_URI_SAFE_ATTR,zt),kr($,"FORBID_CONTENTS")&&Fa($.FORBID_CONTENTS)&&(fn===Hr&&(fn=qr(fn)),Ht(fn,$.FORBID_CONTENTS,zt)),kr($,"ADD_FORBID_CONTENTS")&&Fa($.ADD_FORBID_CONTENTS)&&(fn===Hr&&(fn=qr(fn)),Ht(fn,$.ADD_FORBID_CONTENTS,zt)),ts&&(ge["#text"]=!0),Te&&Ht(ge,["html","head","body"]),ge.table&&(Ht(ge,["tbody"]),delete Et.tbody),$.TRUSTED_TYPES_POLICY){if(typeof $.TRUSTED_TYPES_POLICY.createHTML!="function")throw zl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof $.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw zl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ve=O;O=$.TRUSTED_TYPES_POLICY;try{A=z("")}catch(Se){throw O=ve,Se}}else $.TRUSTED_TYPES_POLICY===null?(O=void 0,A=""):(O===void 0&&(L||(M=(function(ve,Se){if(typeof ve!="object"||typeof ve.createPolicy!="function")return null;let Ue=null;const ht="data-tt-policy-suffix";Se&&Se.hasAttribute(ht)&&(Ue=Se.getAttribute(ht));const Ct="dompurify"+(Ue?"#"+Ue:"");try{return ve.createPolicy(Ct,{createHTML:Tt=>Tt,createScriptURL:Tt=>Tt})}catch{return console.warn("TrustedTypes policy "+Ct+" could not be created."),null}})(f,i),L=!0),O=M),O&&typeof A=="string"&&(A=z("")));Fr&&Fr($),ei=$},yr=Ht({},[...g1,...v1,...q7]),ti=Ht({},[...y1,...Y7]),ms=function($){cu(n.removed,{element:$});try{b($).removeChild($)}catch{if(v($),!b($))throw zl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},wi=function($){Ns($);const ue=w($);if(ue){const Se=[];lu(ue,Ue=>{cu(Se,Ue)}),lu(Se,Ue=>{try{v(Ue)}catch{}})}const ve=E($);if(ve)for(let Se=ve.length-1;Se>=0;--Se){const Ue=ve[Se],ht=Ue&&Ue.name;if(typeof ht=="string")try{$.removeAttribute(ht)}catch{}}},gs=function($,ue){try{cu(n.removed,{attribute:ue.getAttributeNode($),from:ue})}catch{cu(n.removed,{attribute:null,from:ue})}if(ue.removeAttribute($),$==="is")if(gt||Hn)try{ms(ue)}catch{}else try{ue.setAttribute($,"")}catch{}},da=function($){const ue=E($);if(ue)for(let ve=ue.length-1;ve>=0;--ve){const Se=ue[ve],Ue=Se&&Se.name;if(typeof Ue=="string"&&!Le[zt(Ue)])try{$.removeAttribute(Ue)}catch{}}},Ns=function($){const ue=[$];for(;ue.length>0;){const ve=ue.pop();(C?C(ve):ve.nodeType)===1&&da(ve);const Se=w(ve);if(Se)for(let Ue=Se.length-1;Ue>=0;--Ue)ue.push(Se[Ue])}},wl=function($){let ue=null,ve=null;if(dt)$="<remove></remove>"+$;else{const ht=tC($,/^[\r\n\t ]+/);ve=ht&&ht[0]}Bn==="application/xhtml+xml"&&ns===qn&&($='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+$+"</body></html>");const Se=O?z($):$;if(ns===qn)try{ue=new d().parseFromString(Se,Bn)}catch{}if(!ue||!ue.documentElement){ue=X.createDocument(ns,"template",null);try{ue.documentElement.innerHTML=st?A:Se}catch{}}const Ue=ue.body||ue.documentElement;return $&&ve&&Ue.insertBefore(r.createTextNode(ve),Ue.childNodes[0]||null),ns===qn?Y.call(ue,Te?"html":"body")[0]:Te?ue.documentElement:Ue},Rc=function($){const ue=T?T($):$.ownerDocument;return Q.call(ue||$,$,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},fa=function($){return $=yf($,J," "),$=yf($,K," "),yf($,D," ")},on=function($){var ue;$.normalize();const ve=T?T($):$.ownerDocument,Se=Q.call(ve||$,$,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let Ue=Se.nextNode();for(;Ue;)Ue.data=fa(Ue.data),Ue=Se.nextNode();const ht=(ue=$.querySelectorAll)===null||ue===void 0?void 0:ue.call($,"template");ht&&lu(ht,Ct=>{Ds(Ct.content)&&on(Ct.content)})},Zi=function($){const ue=R?R($):null;return typeof ue=="string"&&zt(ue)==="form"&&(typeof $.nodeName!="string"||typeof $.textContent!="string"||typeof $.removeChild!="function"||$.attributes!==E($)||typeof $.removeAttribute!="function"||typeof $.setAttribute!="function"||typeof $.namespaceURI!="string"||typeof $.insertBefore!="function"||typeof $.hasChildNodes!="function"||$.nodeType!==C($)||$.childNodes!==w($))},Ds=function($){if(!C||typeof $!="object"||$===null)return!1;try{return C($)===11}catch{return!1}},Bi=function($){if(!C||typeof $!="object"||$===null)return!1;try{return typeof C($)=="number"}catch{return!1}};function Ar($,ue,ve){$.length!==0&&lu($,Se=>{Se.call(n,ue,ve,ei)})}const bl=function($,ue,ve,Se){return $.length===0?ue:ue===ve||ue===Se?qr(ue):ue},xl=function($,ue){if(Ar(U.beforeSanitizeElements,$,null),$!==ue&&b($)===null)return zr&&Ns($),!0;if(Zi($))return ms($),!0;const ve=zt(R?R($):$.nodeName);if(ge=bl(U.uponSanitizeElement,ge,pe,xe),Ar(U.uponSanitizeElement,$,{tagName:ve,allowedTags:ge}),$!==ue&&b($)===null)return zr&&Ns($),!0;if((function(Se,Ue){return!!(Qe&&Se.hasChildNodes()&&!Bi(Se.firstElementChild)&&Sr(dC,Se.textContent)&&Sr(dC,Se.innerHTML))||!(!Qe||Se.namespaceURI!==qn||Ue!=="style"||!Bi(Se.firstElementChild))||Se.nodeType===7||!(!Qe||Se.nodeType!==8||!Sr(fC,Se.data))})($,ve))return ms($),!0;if(Et[ve]||!(sn.tagCheck instanceof Function&&sn.tagCheck(ve))&&!ge[ve]){const Se=(function(Ue,ht,Ct){if(!Et[ht]&&Sl(ht)&&(Ne.tagNameCheck instanceof RegExp&&Sr(Ne.tagNameCheck,ht)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(ht)))return!1;if(ts&&!fn[ht]){const Tt=b(Ue),Jt=w(Ue);if(Jt&&Tt)for(let pt=Jt.length-1;pt>=0;--pt){const Tn=Ue===Ct?m(Jt[pt],!0):Jt[pt];Tt.insertBefore(Tn,_(Ue))}}return ms(Ue),!0})($,ve,ue);return Se===!1&&Ar(U.afterSanitizeElements,$,null),Se}if((C?C($):$.nodeType)===1&&!(function(Se){let Ue=b(Se);Ue&&Ue.tagName||(Ue={namespaceURI:ns,tagName:"template"});const ht=Tf(Se.tagName),Ct=Tf(Ue.tagName);return!!rn[Se.namespaceURI]&&(Se.namespaceURI===$s?(function(Tt,Jt,pt){return Jt.namespaceURI===qn?Tt==="svg":Jt.namespaceURI===vr?Tt==="svg"&&(pt==="annotation-xml"||wn[pt]):!!yr[Tt]})(ht,Ue,Ct):Se.namespaceURI===vr?(function(Tt,Jt,pt){return Jt.namespaceURI===qn?Tt==="math":Jt.namespaceURI===$s?Tt==="math"&&Rn[pt]:!!ti[Tt]})(ht,Ue,Ct):Se.namespaceURI===qn?(function(Tt,Jt,pt){return!(Jt.namespaceURI===$s&&!Rn[pt])&&!(Jt.namespaceURI===vr&&!wn[pt])&&!ti[Tt]&&(Ur[Tt]||!yr[Tt])})(ht,Ue,Ct):!(Bn!=="application/xhtml+xml"||!rn[Se.namespaceURI]))})($)||(ve==="noscript"||ve==="noembed"||ve==="noframes")&&Sr(oV,$.innerHTML))return ms($),!0;if(Me&&$.nodeType===3){const Se=fa($.textContent);$.textContent!==Se&&(cu(n.removed,{element:$.cloneNode()}),$.textContent=Se)}return Ar(U.afterSanitizeElements,$,null),!1},So=function($,ue,ve){if(dn[ue]||Qe&&ue==="patchsrc"||Qe&&ue==="for"&&$!=="label"&&$!=="output"||_n&&(ue==="id"||ue==="name")&&(ve in r||ve in Id))return!1;const Se=Le[ue]||sn.attributeCheck instanceof Function&&sn.attributeCheck(ue,$);if(!(Gt&&Sr(q,ue))){if(!(kt&&Sr(fe,ue))){if(Se){if(!Tr[ue]){if(!Sr(ke,yf(ve,ce,""))){if((ue!=="src"&&ue!=="xlink:href"&&ue!=="href"||$==="script"||nC(ve,"data:")!==0||!Qn[$])&&!(mn&&!Sr(ae,yf(ve,ce,"")))){if(ve)return!1}}}}else if(!(Sl($)&&(Ne.tagNameCheck instanceof RegExp&&Sr(Ne.tagNameCheck,$)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck($))&&(Ne.attributeNameCheck instanceof RegExp&&Sr(Ne.attributeNameCheck,ue)||Ne.attributeNameCheck instanceof Function&&Ne.attributeNameCheck(ue,$))||ue==="is"&&Ne.allowCustomizedBuiltInElements&&(Ne.tagNameCheck instanceof RegExp&&Sr(Ne.tagNameCheck,ve)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(ve))))return!1}}return!0},Zr=Ht({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Sl=function($){return!Zr[Tf($)]&&Sr(he,$)},rs=function($,ue,ve,Se){if(O&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ve)switch(f.getAttributeType($,ue)){case"TrustedHTML":return z(Se);case"TrustedScriptURL":return(function(Ue){W(),V++;try{return O.createScriptURL(Ue)}finally{V--}})(Se)}return Se},Od=function($,ue,ve,Se){try{ve?$.setAttributeNS(ve,ue,Se):$.setAttribute(ue,Se),Zi($)?ms($):eC(n.removed)}catch{gs(ue,$)}},Tc=function($){Ar(U.beforeSanitizeAttributes,$,null);const ue=$.attributes;if(!ue||Zi($))return;Le=bl(U.uponSanitizeAttribute,Le,Ae,Nt);const ve={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Le,forceKeepAttr:void 0};let Se=ue.length;const Ue=zt($.nodeName);for(;Se--;){const ht=ue[Se],Ct=ht.name,Tt=ht.namespaceURI,Jt=ht.value,pt=zt(Ct),Tn=Jt;let it=Ct==="value"?Tn:B7(Tn);ve.attrName=pt,ve.attrValue=it,ve.keepAttr=!0,ve.forceKeepAttr=void 0,Ar(U.uponSanitizeAttribute,$,ve),it=ve.attrValue,!Gn||pt!=="id"&&pt!=="name"||nC(it,_i)===0||(gs(Ct,$),it=_i+it),Qe&&Sr(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,it)||pt==="attributename"&&tC(it,"href")?gs(Ct,$):ve.forceKeepAttr||(!ve.keepAttr||!Xt&&Sr(aV,it)?gs(Ct,$):(Me&&(it=fa(it)),So(Ue,pt,it)?(it=rs(Ue,pt,Tt,it),it!==Tn&&Od($,Ct,Tt,it)):gs(Ct,$)))}Ar(U.afterSanitizeAttributes,$,null)},ha=function($){let ue=null;const ve=Rc($);for(Ar(U.beforeSanitizeShadowDOM,$,null);ue=ve.nextNode();)if(Ar(U.uponSanitizeShadowNode,ue,null),xl(ue,$),Tc(ue),Ds(ue.content)&&ha(ue.content),(C?C(ue):ue.nodeType)===1){const Se=S(ue);Ds(Se)&&(ni(Se),ha(Se))}Ar(U.afterSanitizeShadowDOM,$,null)},ni=function($){const ue=[{node:$,shadow:null}];for(;ue.length>0;){const ve=ue.pop();if(ve.shadow){ha(ve.shadow);continue}const Se=ve.node,Ue=(C?C(Se):Se.nodeType)===1,ht=w(Se);if(ht)for(let Ct=ht.length-1;Ct>=0;--Ct)ue.push({node:ht[Ct],shadow:null});if(Ue){const Ct=R?R(Se):null;if(typeof Ct=="string"&&zt(Ct)==="template"){const Tt=Se.content;Ds(Tt)&&ue.push({node:Tt,shadow:null})}}if(Ue){const Ct=S(Se);Ds(Ct)&&ue.push({node:null,shadow:Ct},{node:Ct,shadow:null})}}};return n.sanitize=function($){let ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ve=null,Se=null,Ue=null,ht=null;if(st=!$,st&&($="<!-->"),typeof $!="string"&&!Bi($)&&typeof($=(function(pt){switch(typeof pt){case"string":return pt;case"number":return W7(pt);case"boolean":return K7(pt);case"bigint":return rC?rC(pt):"0";case"symbol":return sC?sC(pt):"Symbol()";case"undefined":default:return cm(pt);case"function":case"object":{if(pt===null)return cm(pt);const Tn=pt,it=Ai(Tn,"toString");if(typeof it=="function"){const Ir=it(Tn);return typeof Ir=="string"?Ir:cm(Ir)}return cm(pt)}}})($))!="string")throw zl("dirty is not a string, aborting");if(!n.isSupported)return $;xt?(ge=xe,Le=Nt):Ui(ue),(U.uponSanitizeElement.length>0||U.uponSanitizeAttribute.length>0)&&(ge=qr(ge)),U.uponSanitizeAttribute.length>0&&(Le=qr(Le)),n.removed=[];const Ct=zr&&typeof $!="string"&&Bi($);if(Ct){(function(Tn){if(!Qe)return;const it=[Tn];for(;it.length>0;){const Ir=it.pop(),Eo=C?C(Ir):Ir.nodeType;if(Eo===7||Eo===8&&Sr(fC,Ir.data)){try{v(Ir)}catch{}continue}if(Eo===1){const Or=Ir,Wi=zt(R?R(Ir):Ir.nodeName);try{Or.hasAttribute&&Or.hasAttribute("patchsrc")&&Or.removeAttribute("patchsrc"),Or.hasAttribute&&Or.hasAttribute("for")&&Wi!=="label"&&Wi!=="output"&&Or.removeAttribute("for")}catch{}}const ko=w(Ir);if(ko)for(let Or=ko.length-1;Or>=0;--Or)it.push(ko[Or])}})($);const pt=R?R($):$.nodeName;if(typeof pt=="string"){const Tn=zt(pt);if(!ge[Tn]||Et[Tn])throw wi($),zl("root node is forbidden and cannot be sanitized in-place")}if(Zi($))throw wi($),zl("root node is clobbered and cannot be sanitized in-place");try{ni($)}catch(Tn){throw wi($),Tn}}else if(Bi($))ve=wl("<!---->"),Se=ve.ownerDocument.importNode($,!0),Se.nodeType===1&&Se.nodeName==="BODY"||Se.nodeName==="HTML"?ve=Se:ve.appendChild(Se),ni(Se);else{if(!gt&&!Me&&!Te&&$.indexOf("<")===-1)return O&&Js?z($):$;if(ve=wl($),!ve)return gt?null:Js?A:""}ve&&dt&&ms(ve.firstChild);const Tt=Ct?$:ve;try{const pt=Rc(Tt);for(;Ue=pt.nextNode();)xl(Ue,Tt),Tc(Ue),Ds(Ue.content)&&ha(Ue.content)}catch(pt){throw Ct&&(wi($),lu(n.removed,Tn=>{Tn.element&&Ns(Tn.element)})),pt}if(Ct)return lu(n.removed,pt=>{pt.element&&Ns(pt.element)}),Me&&on($),$;if(gt){if(Me&&on(ve),Hn)for(ht=H.call(ve.ownerDocument);ve.firstChild;)ht.appendChild(ve.firstChild);else ht=ve;return(Le.shadowroot||Le.shadowrootmode)&&(ht=oe.call(s,ht,!0)),ht}let Jt=Te?ve.outerHTML:ve.innerHTML;return Te&&ge["!doctype"]&&ve.ownerDocument&&ve.ownerDocument.doctype&&ve.ownerDocument.doctype.name&&Sr(sV,ve.ownerDocument.doctype.name)&&(Jt="<!DOCTYPE "+ve.ownerDocument.doctype.name+`>
|
|
20
|
+
`+Jt),Me&&(Jt=fa(Jt)),O&&Js?z(Jt):Jt},n.setConfig=function(){Ui(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),xt=!0,xe=ge,Nt=Le},n.clearConfig=function(){ei=null,xt=!1,xe=null,Nt=null,O=M,A=""},n.isValidAttribute=function($,ue,ve){ei||Ui({});const Se=zt($),Ue=zt(ue);return So(Se,Ue,ve)},n.addHook=function($,ue){typeof ue=="function"&&kr(U,$)&&cu(U[$],ue)},n.removeHook=function($,ue){if(kr(U,$)){if(ue!==void 0){const ve=U7(U[$],ue);return ve===-1?void 0:Z7(U[$],ve,1)[0]}return eC(U[$])}},n.removeHooks=function($){kr(U,$)&&(U[$]=[])},n.removeAllHooks=function(){U={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n})();const hC="Refusing to render web experiment since the viewer is a likely bot",pC={ADD_ATTR:(e,t)=>e==="target"&&t==="a"||e==="form"&&/^(button|fieldset|input|output|select|textarea)$/.test(t),ADD_URI_SAFE_ATTR:["form"]};let mC;const uV={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>A0(t,e),not_regex:(e,t)=>!A0(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},ci=xn("[Conversations]"),Hl="Conversations not available yet.";function gC(e,t){var n,r,s,i,o,c,u;const d=(n=e==null?void 0:e.flushIntervalMs)!==null&&n!==void 0?n:3e3,f=(r=e==null?void 0:e.maxBufferSize)!==null&&r!==void 0?r:100,p=t!=null&&t.consoleCapture?void 0:(s=e==null?void 0:e.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,m=le(p)?Math.max(f,2048):Math.max(f,p),v=N(N({},(function(){let _="",w="";try{var b;const S="u">typeof globalThis?globalThis:"u">typeof window?window:void 0,E=S==null||(b=S.navigator)===null||b===void 0?void 0:b.userAgent;E&&([_,w]=A3(E))}catch{}return(function(S,E){const C=(function(R){if(R)return{}.hasOwnProperty.call(Uk,R)?Uk[R]:R})(S);return N(N({},C?{"os.name":C}:{}),E?{"os.version":E}:{})})(_,w)})()),e==null?void 0:e.resourceAttributes);return{serviceName:(i=(o=v==null?void 0:v["service.name"])!==null&&o!==void 0?o:e==null?void 0:e.serviceName)!==null&&i!==void 0?i:t==null?void 0:t.serviceNameDefault,serviceVersion:(c=v==null?void 0:v["service.version"])!==null&&c!==void 0?c:e==null?void 0:e.serviceVersion,environment:(u=v==null?void 0:v["deployment.environment"])!==null&&u!==void 0?u:e==null?void 0:e.environment,resourceAttributes:v,beforeSend:e==null?void 0:e.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:m,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:p,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const dV=["debug","log","warn","error","info"],fV=e=>{for(;e!=null&&e.__rrweb_original__;)e=e.__rrweb_original__;return e},vC="console",kI="__posthogHandledLogsRequestError",w1=(e,t)=>{const n=e instanceof Error?e:new Error(t);return n[kI]=!0,n},yC=e=>!!e&&typeof e=="object"&&e[kI]===!0;var hV=class{get Qv(){return N(N({},this.R),{},{error:(...e)=>{e.some(yC)||this.R.error(...e)}})}constructor(e,t){var n;this.Na=e,this.Jv=t,this.name="logs",this.Zv=!1,this.Kv=!1,this.Yv=!1,this.R=xn("[logs]"),this.cc=[],this.Xv=[],this.Jd=0,this.tf=!1,this.Ti=!1,this.ef=[],this.if=[],this.nf=!1,this.sf=!1,this.rf=!1,this.af=()=>{var r,s;this.Ti||(this.Jd=0,(r=this.lf)===null||r===void 0||r.onReconnect(),(s=this.uf)===null||s===void 0||s.onReconnect())},this.Zv=!!(!((n=e.get())===null||n===void 0)&&n.captureConsoleLogs)}get cf(){return!0}hf(){}df(){if(!this.rf){try{this.uv=typeof window>"u"?void 0:window}catch{this.uv=void 0}this.uv&&($t(this.uv,"online",this.af),this.rf=!0)}}vf(e,t,n,r){this.df();const s=gC(this.Na.get(),n);return[new T9(this.ff(e,t),s,this.Qv,()=>this.Jv(),i=>i(),void 0,r),s]}pf(){const e=this.Na.get();var t;return this.lf&&this.gf===e||((t=this.lf)===null||t===void 0||t.reset(),this.gf=e,[this.lf,this.mf]=this.vf(()=>this.cc,n=>{this.cc=n})),this.lf}yf(){const e=this.Na.get();var t;return this.uf&&this.bf===e||((t=this.uf)===null||t===void 0||t.reset(),this.bf=e,[this.uf,this._f]=this.vf(()=>this.Xv,n=>{this.Xv=n},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},vC)),this.uf}setup(e){if(!this.Ti&&!this.tf)return this.tf=!0,this.Fa=e,this.R=e.logger.createLogger("[logs]"),pb(e.kv.initialize(),()=>{this.Ti||this.hv(e)})}hv(e){var t;this.df(),!((t=this.Na.get())===null||t===void 0)&&t.captureConsoleLogs&&(this.Zv=!0),(this.Zv||this.Na.remoteConfigWillArrive&&e.kv.get(this.Na.captureHintKey))&&this.wf();let n=!1;const r=e.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.Ti?r.dispose():(this.Za=r,n||this.loadIfEnabled())}dispose(){var e,t,n,r,s,i,o;this.Ti||(this.Ti=!0,this.kf(),(e=this.Za)===null||e===void 0||e.dispose(),this.Za=void 0,this.Fa=void 0,this.Yv=!1,(t=this.uv)===null||t===void 0||t.removeEventListener("online",this.af),(n=this.Sf)===null||n===void 0||n.call(this),this.Sf=void 0,(r=this.lf)===null||r===void 0||r.clearQueue(),(s=this.uf)===null||s===void 0||s.clearQueue(),(i=this.lf)===null||i===void 0||i.reset(),(o=this.uf)===null||o===void 0||o.reset())}onRemoteConfig(e){var t,n;if(this.Ti)return;const r=e.ok?(t=e.config.logs)===null||t===void 0?void 0:t.captureConsoleLogs:void 0;ot(r)?this.xf():((n=this.Fa)===null||n===void 0||n.kv.set(this.Na.captureHintKey,!!r),r?(this.Zv=!0,this.Kv||this.wf(),this.loadIfEnabled()):this.xf())}reset(){var e,t,n,r;this.kf(),(e=this.lf)===null||e===void 0||e.clearQueue(),this.cc=[],(t=this.lf)===null||t===void 0||t.reset(),(n=this.uf)===null||n===void 0||n.clearQueue(),this.Xv=[],(r=this.uf)===null||r===void 0||r.reset(),this.Jd=0}captureLog(e){!this.Ti&&this.Fa&&this.pf().captureLog(e)}captureConsoleLog(e){!this.Ti&&this.Fa&&this.yf().captureLog(e)}captureBufferedConsoleLog(e,t,n){!this.Ti&&this.Fa&&this.yf().captureLog(e,{context:t,occurredAtMs:n})}Rd(){var e;this.kf(),(e=this.uf)===null||e===void 0||e.clearQueue(),this.Xv=[]}xf(){this.Zv||this.kf()}wf(){var e;if(this.nf||!(!((e=this.uv)===null||e===void 0)&&e.console))return;const t=gC(this.Na.get()).maxBufferSize;let n=!0;this.if.push(()=>{n=!1});for(const r of dV){let s;try{s=fV(this.uv.console[r])}catch{continue}s&&this.if.push(ed(this.uv.console,r,i=>{const o=(...c)=>{try{n&&this.$f(r,c,t)}catch{}return i.apply(this.uv.console,c)};return o.__rrweb_original__=s,o}))}this.nf=!0,this.Cf=setTimeout(()=>{this.kf()},3e4)}$f(e,t,n){var r;if(this.nf&&!this.sf&&t.length!==0)if(!((r=this.Fa)===null||r===void 0)&&r.canCapture){if(n>this.ef.length){this.sf=!0;try{this.ef.push({level:e,args:t,occurredAtMs:Date.now(),context:this.Jv()})}finally{this.sf=!1}}}else this.kf()}kf(){if(this.ef=[],this.nf){this.nf=!1,this.Cf&&(clearTimeout(this.Cf),this.Cf=void 0);for(const e of this.if)e();this.if=[]}}Tf(){const e=this.ef;return this.kf(),e}get logger(){return this.If||(this.If={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.If}flushLogs(e){this.Fa&&(e?this.Mf(e):(this.lf&&this.lf.flush().catch(t=>this.Ef(t)),this.uf&&this.uf.flush().catch(t=>this.Ef(t))))}flush(){var e=this;return cn(function*(){var t,n;const r=(t=e.lf)===null||t===void 0?void 0:t.flush().catch(i=>e.Ef(i)),s=(n=e.uf)===null||n===void 0?void 0:n.flush().catch(i=>e.Ef(i));yield r,yield s})()}Ef(e){yC(e)||this.R.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.Ti||!this.Zv||this.Kv||this.Yv)return;const e=this.hf();if(e){this.Yv=!0;try{e((t,n)=>{if(this.Yv=!1,!this.Ti&&this.Zv)if(t||!n)this.R.error("Could not load logs script",t),this.kf();else{const r=this.Tf();this.Sf=n.initialize(this.Fa),this.Kv=!0,r.length>0&&n.replay(this.Fa,r)}})}catch(t){throw this.Yv=!1,t}}else this.kf()}ff(e,t){const n=this.Fa;return{get isDisabled(){return!1},get optedOut(){return!n.canCapture},getPersistedProperty:r=>r===ro.LogsQueue?e():void 0,setPersistedProperty(r,s){r===ro.LogsQueue&&t(s??[])},qs:r=>this.qs(r),getLibraryId:()=>n.library.name,getLibraryVersion:()=>n.library.version}}qs(e){return new Promise(t=>{if(FA(this.Jd,3))return void t({kind:"fatal",error:w1(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=o=>{n||(n=!0,clearTimeout(s),t(o))},s=setTimeout(()=>{this.R.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:w1(void 0,"logs request timed out")})},9e4),i=this.cf;this.Fa.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.Fa.projectToken},body:e,compression:"best-available",timeoutMs:6e4}).then(o=>{var c;const u=o.statusCode;this.Af(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.R.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:w1(o.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(c=o.error)!==null&&c!==void 0?c:new Error(`logs request failed with status ${u}`)})},o=>{r({kind:"retry-later",error:o})})})}Af(e,t){(e!==0||t)&&(this.Jd=jA(e,this.Jd,3,()=>this.R.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.")))}Mf(e){this.cc.length>0&&this.Rf(e,this.cc,this.mf,this.Fa.library.name,t=>{this.cc=t}),this.Xv.length>0&&this.Rf(e,this.Xv,this._f,vC,t=>{this.Xv=t})}Rf(e,t,n,r,s){if(t.length===0)return;const i=t.map(c=>c.record);s([]);const o=J3(i,Q3(n,this.Fa.library.name,this.Fa.library.version),r,this.Fa.library.version);this.Fa.sendRequest("/i/v1/logs",{method:"POST",query:{token:this.Fa.projectToken},body:o,compression:"best-available",transport:e,timeoutMs:6e4}).catch(c=>this.Ef(c))}};const I0=xn("[NetworkMetrics]"),pV={"http:":80,"https:":443},mV=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),CI=(e,t)=>{var n;const r=String(t);return{method:String(e).toUpperCase(),url:((n=vo(r))===null||n===void 0?void 0:n.href)||r}},ow=(e,t,n,r,s,i,o=!1)=>{try{var c,u;const d=s();if(!d)return;const f=n||void 0,p=ch()-r,m=vo(t.url);if(m&&m.protocol!=="http:"&&m.protocol!=="https:")return;const v={url:(m==null?void 0:m.href)||t.url,method:t.method},_=On(d.name)?d.name(v):ft(d.name)?d.name:"http.client.request.duration";if(!_)return;const w=o&&!f?void 0:((S,E)=>S?400>S?void 0:String(S):(E==null?void 0:E.name)||"_OTHER")(f,i),b=N(N(N(N(N({},(S=>{const E=mV.has(S)?S:"_OTHER";return N({"http.request.method":E},E==="_OTHER"&&S!==E?{"http.request.method_original":S}:{})})(v.method)),m?(S=>{return{"server.address":S.hostname.startsWith("[")&&S.hostname.endsWith("]")?S.hostname.slice(1,-1):S.hostname,"server.port":Number(S.port)||pV[S.protocol],"url.scheme":S.protocol.slice(0,-1),"url.template":(E=S.pathname,E.split("/").map(C=>(R=>/^\d+$/.test(R)||R.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(R))(C)?":id":C).join("/"))};var E})(m):{}),f?{"http.response.status_code":f}:{}),w?{"error.type":w}:{}),(c=d.attributes)===null||c===void 0?void 0:c.call(d,v,{status:f,durationMs:p}));(u=e.metrics)===null||u===void 0||u.histogram(_,p,{unit:"ms",attributes:b})}catch(d){I0.error("Failed to record network metric",d)}},PI=()=>{},gV=(e,t)=>On(ie==null?void 0:ie.fetch)?ed(ie,"fetch",n=>function(...r){const s=ch(),i=n.apply(this,r);if(!t())return i;try{var o,c,u;const[d,f]=r,p=CI((o=(c=f==null?void 0:f.method)!==null&&c!==void 0?c: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=>(ow(e,p,m==null?void 0:m.status,s,t,void 0,!0),m),m=>{throw ow(e,p,void 0,s,t,m),m})}catch(d){return I0.error("Failed to observe fetch",d),i}}):PI,vV=(e,t)=>{var n;const r=ie==null||(n=ie.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return PI;const s=new WeakMap,i=ed(r,"open",c=>function(...u){try{eI.has(this)||s.set(this,CI(u[0],u[1]))}catch(d){I0.error("Failed to observe XHR open",d)}return c.apply(this,u)}),o=ed(r,"send",c=>function(...u){let d;try{const f=s.get(this);if(f&&t()){const p=ch();d=()=>{this.removeEventListener("loadend",d),ow(e,f,this.status,p,t)},$t(this,"loadend",d)}}catch(f){I0.error("Failed to observe XHR send",f)}try{return c.apply(this,u)}catch(f){throw d&&this.removeEventListener("loadend",d),f}});return()=>{i(),o()}},_C=new WeakMap,yV=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),_V={maxStringLength:2048,truncationSuffix:"..."},wV={maxStringLength:2048,truncationSuffix:"..."};function wC(e){if(e)return e===!0?{intent:!0,model:!0}:{intent:e.intent!==!1,model:e.model!==!1}}function b1(e,t){return{}.hasOwnProperty.call(e,t)}function x1(e,t){const n=Object.create(e);return t&&Object.defineProperty(n,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:t}),n}function bC(e,t,n=!1){if(!ft(e))return;const r=e.trim();return r?(n?K3(r,_V):r).slice(0,t):void 0}function xC(e){try{return ut(e)&&e.isError===!0}catch{return!1}}function RI(e){return K3(e||"Unknown error",wV).slice(0,2048)}function bV(e,t){try{return RI(t?(function(n){try{return!ut(n)||!He(n.content)?void 0:n.content.filter(r=>ut(r)&&r.type==="text"&&ft(r.text)).map(r=>r.text).join(" ").trim()||void 0}catch{return}})(e):ut(e)&&ft(e.message)?e.message:ft(e)?e:String(e))}catch{return"Unknown error"}}function xV(e,t,n){return t.errorResult?[{type:"Error",value:n,mechanism:{type:"generic",handled:!0,synthetic:!0,exception_id:0}}]:e.buildProperties(t.error,{handled:!0}).$exception_list.map(r=>N(N({},r),{},{value:RI(r.value)}))}function SV(e,t){if(t)return"Error";try{if(!ut(e))return"Error";let n=ft(e.name)?e.name.trim():"";const r=e.constructor;return n&&n!=="Error"||!On(r)||r.name==="Error"||(n=r.name),(n||"Error").slice(0,256)}catch{return"Error"}}function EV(e,t){return{message:bV(e,t),type:SV(e,t)}}Gf.__defaultExtensionClasses=N({},((...e)=>pn({},...e))({featureFlags:lm},{sessionRecording:class{get Fr(){return this._instance.config}get Pc(){return this._instance.persistence}get started(){var e;return!!(!((e=this.Pf)===null||e===void 0)&&e.isStarted)}get status(){var e,t;return this.Of==="awaiting_config"||this.Of==="missing_config"?this.Of:(e=(t=this.Pf)===null||t===void 0?void 0:t.status)!==null&&e!==void 0?e:this.Of}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.Of=d1,this.Ff=void 0,this.Df=!1,this.Ye=(()=>{var t,n;if(!(Ie!=null&&Ie.visibilityState)||Ie.visibilityState==="visible")return!0;const r=ie==null||(t=ie.performance)===null||t===void 0||(n=t.getEntriesByType)===null||n===void 0?void 0:n.call(t,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.an=()=>{var t,n;(Ie==null?void 0:Ie.visibilityState)==="visible"&&(this.Ye=!0,(t=this.Pf)===null||t===void 0||(n=t.setDocumentWasEverVisible)===null||n===void 0||n.call(t,!0))},!this._instance.sessionManager)throw $o.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Fr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');Ie!=null&&Ie.addEventListener&&$t(Ie,"visibilitychange",this.an)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:e=!1}={}){var t;this.Df=!0,Ie==null||(t=Ie.removeEventListener)===null||t===void 0||t.call(Ie,"visibilitychange",this.an),e?this.Lf(!0):this.stopRecording()}get Nf(){var e;const t=!!(!((e=this._instance.get_property("$session_recording_remote_config"))===null||e===void 0)&&e.enabled),n=!this.Fr.disable_session_recording,r=this.Fr.disable_session_recording||this._instance.consent.isOptedOut();return ie&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(this.Df||this.Nf&&(!((t=this.Pf)===null||t===void 0)&&t.isStarted))return;const n=!le(Object.assign)&&!le(Array.from);this.Nf&&n?(this.jf(e),$o.info("starting")):(this.Of=d1,this.stopRecording())}jf(e){var t,n;if(this.Nf)if(this.Of!=="awaiting_config"&&this.Of!=="missing_config"&&(this.Of=V6),(et==null||(t=et.__PosthogExtensions__)===null||t===void 0||(t=t.rrweb)===null||t===void 0?void 0:t.record)&&((n=et.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.qf(e);else{var r,s;const i=this._instance.sessionManager;(r=et.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.Bf,o=>{if(!this.Df&&this.Nf&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),$o.error("could not load recorder",o)):void this.qf(e);this.Of="disabled"})}}stopRecording(){var e,t;(e=this.Ff)===null||e===void 0||e.call(this),this.Ff=void 0,(t=this.Pf)===null||t===void 0||t.stop()}Lf(e=!1){var t,n;(t=this.Ff)===null||t===void 0||t.call(this),this.Ff=void 0,(n=this.Pf)===null||n===void 0||n.discard({discardProducerEvents:e})}zf(){var e,t;(e=this.Pc)===null||e===void 0||e.unregister("$session_is_sampled"),(t=this.Pc)===null||t===void 0||t.unregister("$replay_sample_rate")}Hf(e,t){if(ot(e))return null;const n=Fn(e)?e:parseFloat(e);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?($o.warn(`${t} must be between 0 and 1. Ignoring invalid value:`,e),null):n;var r}Uf(e){if(this.Pc){var t,n;const r=this.Pc,s=()=>{var i;const o=e.sessionRecording===!1?void 0:e.sessionRecording,c=this.Hf((i=this.Fr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.Hf(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=c??u;ot(d)&&this.zf();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[zf]:N(N({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:N({capturePerformance:e.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(),(t=this.Ff)===null||t===void 0||t.call(this),this.Ff=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(s)}}onRemoteConfig(e){const t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?t.sessionRecording===!1?(this.Uf(t),void this.Lf()):(this.Uf(t),void this.startIfEnabledOrStop()):(this.Of==="awaiting_config"&&(this.Of="missing_config",this._instance.register_for_session({[sb]:!0}),$o.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t="log"){var n;!((n=this.Pf)===null||n===void 0)&&n.log?this.Pf.log(e,t):$o.warn("log called before recorder was ready")}get Bf(){var e,t;const n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.get_property(zf);return(n==null||(t=n.scriptConfig)===null||t===void 0?void 0:t.script)||"lazy-recorder"}Wf(){const e=this._instance.get_property(zf);if(!e)return!1;let t;try{t=typeof e=="object"?e:JSON.parse(e)}catch(n){return $o.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!ot(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}qf(e){var t,n,r;if(!this.Df&&this.Nf&&this._instance.sessionManager){if(!(!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.initSessionRecording))return $o.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[rb]:!0});var s;if(this.Pf||(this.Pf=(s=et.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Ye),this.Pf._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Wf())return this.Of==="missing_config"||this.Of==="awaiting_config"?void 0:(this.Of="awaiting_config",$o.info("persisted remote config is stale, requesting fresh config before starting"),void new GA(this._instance).load());this.Of=V6,(n=(r=this.Pf).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Ye),this.Pf.start(e)}else this.Of=d1}onRRwebEmit(e){var t,n;(t=this.Pf)===null||t===void 0||(n=t.onRRwebEmit)===null||n===void 0||n.call(t,e)}overrideLinkedFlag(){var e,t;this.Pf||(t=this.Pc)===null||t===void 0||t.register({$replay_override_linked_flag:!0}),(e=this.Pf)===null||e===void 0||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Pf||(t=this.Pc)===null||t===void 0||t.register({$replay_override_sampling:!0}),(e=this.Pf)===null||e===void 0||e.overrideSampling()}overrideTrigger(e){var t,n;this.Pf||(n=this.Pc)===null||n===void 0||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.Pf)===null||t===void 0||t.overrideTrigger(e)}get sdkDebugProperties(){var e;const t={};for(const r of S7){var n;const s=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(r);le(s)||(t[r]=s)}return N(N({},t),((e=this.Pf)===null||e===void 0?void 0:e.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(e,t){var n;return!!(!((n=this.Pf)===null||n===void 0)&&n.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e,t;(e=this.Pf)===null||e===void 0||(t=e.flushBeforeIdentityReset)===null||t===void 0||t.call(e)}}},{autocapture:class extends o7{constructor(e){super(new _7(e)),this.instance=e}},historyAutocapture:class{constructor(e){this.Vf=!1,this._instance=e,this.Gf=this.Qf()}initialize(){this.startIfEnabled()}get isEnabled(){const e=this.Jf();return!!(e.path||e.search||this.Zf(e))}startIfEnabled(){this.isEnabled&&(me.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Gf=this.Qf(),this.startIfEnabled()}stop(){this.Kf&&this.Kf(),this.Kf=void 0,this.Yf&&this.Yf(),this.Yf=void 0,me.info("History API monitoring stopped")}monitorHistoryChanges(){ie&&ie.history&&(this.Xf("pushState"),this.Xf("replaceState"),this.tp(),this.Zf()&&this.ep())}Xf(e){var t;if(!ie||!((t=ie.history[e])===null||t===void 0)&&t.__posthog_wrapped__)return;const n=this;ed(ie.history,e,r=>function(s,i,o){var c;n.np(o)&&n.sp(),r.call(this,s,i,o),n.rp(e,!n.Vf&&(ie==null||(c=ie.event)===null||c===void 0?void 0:c.type)!=="popstate")})}Qf(){const e=ie==null?void 0:ie.location;if(e!=null&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}Jf(){const e=this._instance.config.capture_pageview;return e==="history_change"?{path:!0}:ut(e)?e:{}}Zf(e=this.Jf()){return!!e.hash&&!this._instance.config.disable_capture_url_hashes}op(e){const t=this.Jf(),n=this.Gf;return!(!n||!(t.path&&e.pathname!==n.pathname||t.search&&e.search!==n.search||this.Zf(t)&&e.hash!==n.hash))}rp(e,t=!1){try{t||this.sp();const n=this.Qf();if(!n)return;if(this.op(n)){const r=()=>this._instance.capture(ib,{navigation_type:e});t?(this.ap=r,Promise.resolve().then(()=>this.sp())):r()}this.Gf=n}catch(n){me.error(`Error capturing ${e} pageview`,n)}}np(e){var t,n;return!(ot(e)||!ie)&&((t=vo(String(e)))===null||t===void 0?void 0:t.href)!==((n=ie.location)===null||n===void 0?void 0:n.href)}sp(){const e=this.ap;if(e){this.ap=void 0,this.Vf=!0;try{e()}catch(t){me.error("Error capturing deferred pageview",t)}finally{this.Vf=!1}this.Gf=this.Qf()}}tp(){if(this.Kf)return;const e=()=>{this.rp("popstate")};$t(ie,"popstate",e),this.Kf=()=>{ie&&ie.removeEventListener("popstate",e)}}ep(){if(this.Yf)return;const e=()=>{this.rp("hashchange")};$t(ie,"hashchange",e),this.Yf=()=>{ie&&ie.removeEventListener("hashchange",e)}}},heatmaps:class{get Fr(){return this.instance.config}constructor(e){var t;this.lp=!1,this._l=!1,this.up=null,this.instance=e,this.lp=!!(!((t=this.instance.persistence)===null||t===void 0)&&t.props[z_]),this.rageclicks=new yI(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let e=5e3;return ut(this.Fr.capture_heatmaps)&&this.Fr.capture_heatmaps.flush_interval_milliseconds&&(e=this.Fr.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ot(this.Fr.capture_heatmaps)?ot(this.Fr.enable_heatmaps)?this.lp:this.Fr.enable_heatmaps:this.Fr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._l)return;E7.info("starting..."),this.cp(),this.an()}else{var e;clearInterval((e=this.up)!==null&&e!==void 0?e:void 0),this.hp(),this.getAndClearBuffer()}}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if(!("heatmaps"in t))return;const n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[z_]:n}),this.lp=n,this.startIfEnabled()}getAndClearBuffer(){const e=this.Rt;return this.Rt=void 0,e}dp(e){f1(e.originalEvent)&&this.Pr(e.originalEvent,"deadclick")}an(){this.up&&clearInterval(this.up),this.up=(Ie==null?void 0:Ie.visibilityState)==="visible"?setInterval(this.bc.bind(this),this.flushIntervalMilliseconds):null}cp(){ie&&Ie&&(this.vp=this.bc.bind(this),$t(ie,E0,this.vp),this.fp=e=>this.Pr(e||(ie==null?void 0:ie.event)),$t(Ie,"click",this.fp,{capture:!0}),this.pp=e=>this.gp(e||(ie==null?void 0:ie.event)),$t(Ie,"mousemove",this.pp,{capture:!0}),this.mp=new h6(this.instance,bj,this.dp.bind(this)),this.mp.startIfEnabledOrStop(),this.yp=this.an.bind(this),$t(Ie,Ru,this.yp),this._l=!0)}hp(){var e;ie&&Ie&&(this.vp&&ie.removeEventListener(E0,this.vp),this.fp&&Ie.removeEventListener("click",this.fp,{capture:!0}),this.pp&&Ie.removeEventListener("mousemove",this.pp,{capture:!0}),this.yp&&Ie.removeEventListener(Ru,this.yp),clearTimeout(this.bp),(e=this.mp)===null||e===void 0||e.stop(),this._l=!1)}_p(e,t){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,c,u){let d=o;for(;d&&pi(d)&&!Xn(d,"body");){if(d===u)return!1;let v;try{var f,p,m;v=(f=(p=(m=d.ownerDocument)===null||m===void 0?void 0:m.defaultView)!==null&&p!==void 0?p:ie)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(We(c,v))return!0;d=AA(d)}return!1})(Zf(e),["fixed","sticky"],s);return{x:e.clientX+(i?0:r),y:e.clientY+(i?0:n),target_fixed:i,type:t}}Pr(e,t="click"){var n;if(n6(e.target)||!f1(e))return;const r=this._p(e,t);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&OA(Zf(e),this.instance.config.rageclick)&&this.Ks(N(N({},r),{},{type:"rageclick"})),this.Ks(r)}gp(e){!n6(e.target)&&f1(e)&&(clearTimeout(this.bp),this.bp=setTimeout(()=>{this.Ks(this._p(e,"mousemove"))},500))}Ks(e){if(!ie)return;const t=this.Fr.disable_capture_url_hashes?el(ie.location.href):ie.location.href,n=this.Fr.custom_personal_data_properties,r=this.Fr.mask_personal_data_properties?[...Qu,...n||[]]:[],s=ah(t,r,lh);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(e)}bc(){this.Rt&&!ks(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:h6,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.lp=!1,this._l=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.wp=(n=!1)=>{clearTimeout(this.kp),this.kp=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",N({$current_url:this.Rt.url},this.Rt.metrics.reduce((r,s)=>N(N({},r),{},{[`$web_vitals_${s.name}_event`]:N({},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.Sp=n=>{var r;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},ot(n==null?void 0:n.name)||ot(n==null?void 0:n.value))return void jl.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.xp(s);if(le(i))return;const o=Fn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.$p&&n.value>=this.$p)return void jl.error("Ignoring metric with value >= "+this.$p,n);this.Rt.navigationKey!==o&&(this.wp(),this.kp=setTimeout(this.wp,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 c=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),u=N(N(N({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,ut(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of x7){const p=f==="url"&&typeof n.attribution[f]=="string"?this.xp(n.attribution[f]):n.attribution[f];le(p)||(d[f]=p)}u.attribution=d}else delete u.attribution;le(c)||(u.$session_id=c.sessionId,u.$window_id=c.windowId),this.Rt.metrics.push(u),this.Rt.metrics.length===this.allowedMetrics.length&&this.wp()},this.Cp=()=>{if(this._l)return;let n,r,s,i,o=!1;const c=et.__PosthogExtensions__,u=c==null?void 0:c.postHogWebVitalsCallbacksByFlavor,d=(u==null?void 0:u[this.Tp])||(this.Tp==="web-vitals"&&le(u)?c==null?void 0:c.postHogWebVitalsCallbacks:void 0);if(!le(d)){const v=d.withoutAttribution,_=this.attributionMetrics;o=!le(v),n=_.indexOf("LCP")>-1?d.onLCP:(v==null?void 0:v.onLCP)||d.onLCP,r=_.indexOf("CLS")>-1?d.onCLS:(v==null?void 0:v.onCLS)||d.onCLS,s=_.indexOf("FCP")>-1?d.onFCP:(v==null?void 0:v.onFCP)||d.onFCP,i=_.indexOf("INP")>-1?d.onINP:(v==null?void 0:v.onINP)||d.onINP}if(!(n&&r&&s&&i))return void jl.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},p=o&&this.attributionMetrics.indexOf("INP")>-1?N(N({},f),{},{includeProcessedEventEntries:!1}):f;this.allowedMetrics.indexOf("LCP")>-1&&n(this.Sp.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Sp.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Sp.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.Sp.bind(this),p);const m=ie==null?void 0:ie.document;$t(m,Ru,()=>{(m==null?void 0:m.visibilityState)==="hidden"&&this.wp(!0)}),$t(ie,"pagehide",()=>this.wp(!0)),this._l=!0},this.lp=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[Z_]),this.startIfEnabled()}get Ip(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t;const n=ut(this.Ip)?(e=this.Ip)===null||e===void 0?void 0:e.web_vitals_allowed_metrics:void 0;return ot(n)?((t=this._instance.persistence)===null||t===void 0?void 0:t.props.$web_vitals_allowed_metrics)||j6:n}get flushToCaptureTimeoutMs(){return(ut(this.Ip)?this.Ip.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const e=ut(this.Ip)?this.Ip.web_vitals_attribution:void 0;return ds(e)?e?j6:[]:He(e)?e:b7}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const e=ut(this.Ip)?this.Ip.__preview_web_vitals_soft_navs:void 0;return e!=null&&e}get $p(){const e=ut(this.Ip)&&Fn(this.Ip.__web_vitals_max_value)?this.Ip.__web_vitals_max_value:F6;return e>0&&6e4>=e?F6:e}get isEnabled(){const e=an==null?void 0:an.protocol;if(e!=="http:"&&e!=="https:")return jl.info("Web Vitals are disabled on non-http/https protocols"),!1;const t=ut(this.Ip)?this.Ip.web_vitals:ds(this.Ip)?this.Ip:void 0;return ds(t)?t:this.lp}startIfEnabled(){this.isEnabled&&!this._l&&(jl.info("enabled, starting..."),this.Bl(this.Cp))}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if(!("capturePerformance"in t))return;const n=ut(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=ut(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Z_]:n}),this._instance.persistence.register({[aA]:r})),this.lp=n,this.startIfEnabled()}get Tp(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Bl(e){var t;const n=et.__PosthogExtensions__,r=this.Tp,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&le(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?e():n==null||(t=n.loadExternalDependency)===null||t===void 0||t.call(n,this._instance,r,i=>{i?jl.error("failed to load script",i):e()})}xp(e){const t=e||(ie==null?void 0:ie.location.href);if(!t)return void jl.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?el(t):t,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Qu,...r||[]]:[];return ah(n,s,lh)}}},{exceptionObserver:class{constructor(e){var t;this.Cp=()=>{var n;if(!ie||!this.isEnabled||!(!((n=et.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=et.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=et.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=et.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Mp&&this.Fr.capture_unhandled_errors&&(this.Mp=r(this.captureException.bind(this))),!this.Ep&&this.Fr.capture_unhandled_rejections&&(this.Ep=s(this.captureException.bind(this))),!this.Ap&&this.Fr.capture_console_errors&&(this.Ap=i(this.captureException.bind(this)))}catch(o){vf.error("failed to start",o),this.Rp()}},this._instance=e,this.Pp=!!(!((t=this._instance.persistence)===null||t===void 0)&&t.props[H_]),this.kt=new dF(N(N({},(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,R:vf})),this.Fr=this.Op(),this.startIfEnabledOrStop()}Op(){const e=this._instance.config.capture_exceptions;let t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ut(e)?t=N(N({},t),e):(le(e)?this.Pp:e)&&(t=N(N({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Fr.capture_console_errors||this.Fr.capture_unhandled_errors||this.Fr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(vf.info("enabled"),this.Rp(),this.Bl(this.Cp)):this.Rp()}Bl(e){var t,n,r;!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.errorWrappingFunctions?e():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return vf.error("failed to load script",s);e()})}Rp(){var e,t,n;(e=this.Mp)===null||e===void 0||e.call(this),this.Mp=void 0,(t=this.Ep)===null||t===void 0||t.call(this),this.Ep=void 0,(n=this.Ap)===null||n===void 0||n.call(this),this.Ap=void 0}onRemoteConfig(e){if(!e.ok)return;const t=e.config;"autocaptureExceptions"in t&&(this.Pp=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[H_]:this.Pp}),this.Fr=this.Op(),this.startIfEnabledOrStop())}onConfigChange(){this.Fr=this.Op()}captureException(e){try{var t,n,r;const s=(t=e==null||(n=e.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&t!==void 0?t:"Exception";if(this.kt.consumeRateLimit(s))return void vf.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(e)}catch{}}},exceptions:class{constructor(e){var t,n;this.Fp=[],this.Dp=new xF([new DF,new WF,new jF,new FF,new ZF,new UF,new zF,new BF],(function(r,...s){return(i,o=0)=>{const c=[],u=i.split(`
|
|
21
|
+
`),d=Math.min(u.length,o+1e3),f=[];for(let v=o;d>v;v++){const _=u[v];if(_.length>1024)continue;const w=$k.test(_)?_.replace($k,"$1"):_;if(!w.match(/\S*Error: /)){for(const b of s){const S=b(w,r);if(S){c.push(S);const E=MF(c);if(E){for(let C=f.length-1;C>=0;C--){const R=f[C];if(E.start>=R.start+R.length)break;f.pop()}f.push(E)}break}}if($F(c,f)>=50)break}}const p=[...f].sort((v,_)=>_.start-v.start),m=p[p.length-1];if(m){const v=F3(c,m);c.splice(m.start-v,v);for(const _ of p)_.start-=v}for(const v of p)LF(c,v);return f.some(v=>v.start===0&&c.length===v.length)&&(function(v){const _=v.map(b=>`${b.function}|${b.filename}|${b.lineno}|${b.colno}|${b.module}`);let w=0;for(let b=1;_.length>b;b++)NF(_,b,w)&&(w=b);v.push(...v.splice(0,w))})(c),(function(v){if(!v.length)return[];const _=Array.from(v);return _.reverse(),_.slice(0,50).map(w=>{return N(N({},w),{},{filename:w.filename||(b=_,b[b.length-1]||{}).filename,function:w.function||"?"});var b})})(c)}})("web:javascript",TF,OF)),this._instance=e,this.Fp=(t=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&t!==void 0?t:[],this.Lp=y0(this.Np()),this.jp=new GF(this.Lp)}onConfigChange(){this.Lp=y0(this.Np()),this.jp.setConfig(this.Lp)}onRemoteConfig(e){var t,n,r;if(!e.ok)return;const s=e.config;if(!("errorTracking"in s))return;const i=(t=(n=s.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],o=(r=s.errorTracking)===null||r===void 0?void 0:r.captureExtensionExceptions;this.Fp=i,this._instance.persistence&&this._instance.persistence.register({[iA]:this.Fp,[U_]:o})}get qp(){var e;const t=!!this._instance.get_property(U_),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.Dp.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}addExceptionStep(e,t){if(this.Lp.enabled)try{if(!ft(e)||e.trim().length===0)return void Ti.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,c)=>KF.has(c)?(i.push(c),o):(o[c]=s[c],o),{}),droppedKeys:i}})(this.Bp(t));r.length>0&&Ti.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.jp.add(N({[g0]:e,[v0]:new Date().toISOString()},n))}catch(n){Ti.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(e){try{const t=e.$exception_list;if(this.zp(t)){if(this.Hp(t))return this.Up("Exception dropped: matched a suppression rule"),void Ti.info("Skipping exception capture because a suppression rule matched");if(!this.qp&&this.Wp(t))return this.Up("Exception dropped: thrown by a browser extension"),void Ti.info("Skipping exception capture because it was thrown by an extension");if(!this.qp&&this.Vp(t))return this.Up("Exception dropped: thrown by an injected browser script"),void Ti.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Gp(t))return this.Up("Exception dropped: thrown by the PostHog SDK"),void Ti.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.Lp.enabled&&ot(e.$exception_steps)?this.Qp(e):e,r=(function(){if("u">typeof process){var s;const o=(s=tF.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",_d:!0});return s&&this.jp.clear(),s}catch(s){return X6(s)||Ti.error("Failed to capture exception event. Dropping this exception.",s),void this.jp.clear()}}catch(t){return void(X6(t)||Ti.error("Failed to process exception event. Ignoring this exception.",t))}}Qp(e){try{const t=this.jp.getAttachable();return t.length===0?e:N(N({},e),{},{$exception_steps:t})}catch(t){return Ti.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Up(e){this.Lp.enabled&&this.jp.add({[g0]:e,[v0]:new Date().toISOString()})}Bp(e){return ut(e)?N({},e):{}}Np(){var e,t;return(e=(t=this._instance.config.error_tracking)===null||t===void 0?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}Hp(e){if(e.length===0)return!1;try{const t=e.reduce((n,{type:r,value:s})=>(ft(r)&&r.length>0&&n.$exception_types.push(r),ft(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.Fp.some(n=>{const r=n.values.map(s=>{const i=mI[s.operator],o=t[s.key];if(!i||!o)return!1;const c=He(s.value)?s.value:[s.value];return c.length>0&&i(c,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(t){return Ti.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Wp(e){const t=e.flatMap(r=>{var s,i;return(s=(i=r.stacktrace)===null||i===void 0?void 0:i.frames)!==null&&s!==void 0?s:[]}),n=t.filter(({filename:r})=>!!r&&D7.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(rw))||e.some(({type:r,value:s})=>r==="NoResponse"||ft(s)&&N7.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!t.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(rw))))}Vp(e){return e.some(({value:t})=>ft(t)&&F7.some(n=>t.includes(n)))}Gp(e){if(e.length>0){var t,n,r,s;const i=(t=(n=e[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&t!==void 0?t:[],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}zp(e){return!ot(e)&&He(e)}}},{productTours:class{get Pc(){return this._instance.persistence}constructor(e){this.Jp=null,this.Zp=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if("productTours"in t){var n,r;if(this.Pc&&this.Pc.register({[tb]:!!t.productTours}),!h1(this._instance))return!this.Jp&&ot((n=this.Pc)===null||n===void 0?void 0:n.props.ph_product_tours)||am.info("product tours disabled; stopping and clearing cached tours"),(r=this.Jp)===null||r===void 0||r.stop(),this.Jp=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Jp&&h1(this._instance)&&this.Bl(()=>this.Kp())}Bl(e){var t,n,r;!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours?e():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?am.error("Could not load product tours script",s):e()})}Kp(){var e;!this.Jp&&(!((e=et.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours)&&(this.Jp=et.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(He(this.Zp)&&!t)return void e(this.Zp,{isLoaded:!0});const n=this.Pc;if(n){const r=n.props[B_];if(He(r)&&!t)return this.Zp=r,void e(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(!h1(this._instance))return void e([],{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||am.warn(o):am.error(o),void e([],{isLoaded:!1,error:o})}const i=He(r.json.product_tours)?r.json.product_tours:[];this.Zp=i,n&&n.register({[B_]:i}),e(i,{isLoaded:!0})}})}getActiveProductTours(e){ot(this.Jp)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Jp.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Jp)===null||t===void 0||t.showTourById(e)}previewTour(e){this.Jp?this.Jp.previewTour(e):this.Bl(()=>{var t;this.Kp(),(t=this.Jp)===null||t===void 0||t.previewTour(e)})}dismissProductTour(){var e;(e=this.Jp)===null||e===void 0||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Jp)===null||e===void 0||e.nextStep()}previousStep(){var e;(e=this.Jp)===null||e===void 0||e.previousStep()}clearCache(){var e;this.Zp=null,(e=this.Pc)===null||e===void 0||e.unregister("ph_product_tours")}resetTour(e){var t;(t=this.Jp)===null||t===void 0||t.resetTour(e)}resetAllTours(){var e;(e=this.Jp)===null||e===void 0||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Jp)===null||t===void 0||t.cancelPendingTour(e)}},featureFlags:lm},{siteApps:class{constructor(e){this._instance=e,this.Yp=0,this.Xp=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}tg(e,t){if(!t)return;const n=this.globalsForEvent(t);this.Xp.push(n),this.Xp.length>1e3&&(this.Xp=this.Xp.slice(10))}get siteAppLoaders(){var e;return(e=et._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.siteApps}initialize(){if(this.isEnabled){const e=this._instance._addCaptureHook(this.tg.bind(this));this.eg=()=>{e(),this.Xp=[],this.eg=void 0}}}globalsForEvent(e){var t,n,r,s,i,o,c;if(!e)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,_]of Object.entries(f))u[v]={id:d[v],type:v,properties:_};const{$set_once:p,$set:m}=e;return{event:N(N({},H3(e,k7)),{},{properties:N(N(N({},e.properties),m?{$set:N(N({},(t=(n=e.properties)===null||n===void 0?void 0:n.$set)!==null&&t!==void 0?t:{}),m)}:{}),p?{$set_once:N(N({},(r=(s=e.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),p)}:{}),elements_chain:(i=(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(c=e.properties)===null||c===void 0?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}ig(e){var t;const n=(t=e.tagName)===null||t===void 0?void 0:t.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Qi.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Qi.error("prepare_external_dependency_script returned null"),null):e}ng(){var e,t,n,r,s,i,o,c;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const u=Ie==null?void 0:Ie.defaultView,d=u==null||(e=u.Node)===null||e===void 0?void 0:e.prototype;if(!u||!d)return()=>{};if(this.Yp++,this.sg)return this.rg();const f=[],p=this,m=new WeakSet,v=(b,S,E)=>{if(!(b!=null&&b[S]))return;const C=b[S];b[S]=E(C),f.push(()=>{b[S]=C})},_=b=>{if(m.has(b))return b;const S=p.ig(b);return S&&m.add(S),S},w=b=>b.map(S=>typeof S=="string"?S:_(S)).filter(S=>!kn(S));return v(d,"appendChild",b=>function(S){const E=_(S);return E?b.call(this,E):S}),v(d,"insertBefore",b=>function(S,E){const C=_(S);return C?b.call(this,C,E):S}),v(d,"replaceChild",b=>function(S,E){const C=_(S);return C?b.call(this,C,E):E}),[(t=u.Element)===null||t===void 0?void 0:t.prototype,(n=u.Document)===null||n===void 0?void 0:n.prototype,(r=u.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(b=>{v(b,"append",S=>function(...E){return S.apply(this,w(E))}),v(b,"prepend",S=>function(...E){return S.apply(this,w(E))})}),[(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(b=>{v(b,"before",S=>function(...E){return S.apply(this,w(E))}),v(b,"after",S=>function(...E){return S.apply(this,w(E))}),v(b,"replaceWith",S=>function(...E){const C=w(E);return E.length&&!C.length?void 0:S.apply(this,C)})}),v((c=u.Element)===null||c===void 0?void 0:c.prototype,"insertAdjacentElement",b=>function(S,E){const C=_(E);return C?b.call(this,S,C):null}),this.sg=()=>{f.forEach(b=>b()),this.sg=void 0},this.rg()}rg(){let e=!1;return()=>{var t;e||(e=!0,this.Yp--,this.Yp===0&&((t=this.sg)===null||t===void 0||t.call(this)))}}og(e,t=!0){const n=this.ng();try{const r=e(n);return t&&n(),r}catch(r){throw n(),r}}setupSiteApp(e){const t=this.apps[e.id],n=()=>{var i;!t.errored&&this.Xp.length&&(Qi.info(`Processing ${this.Xp.length} events for site app with id ${e.id}`),this.Xp.forEach(o=>this.og(()=>{var c;return(c=t.processEvent)===null||c===void 0?void 0:c.call(t,o)})),t.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((i=this.eg)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{t.errored=!i,t.loaded=!0,Qi.info(`Site app with id ${e.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.og(o=>e.init({posthog:this._instance,callback(c){o(),s(c)}}),!1);i&&(t.processEvent=i),r=!0}catch(i){Qi.error(z6+e.id,i),s(!1)}if(r&&t.loaded)try{n()}catch(i){Qi.error(`Error while processing buffered events PostHog app with config id ${e.id}`,i),t.errored=!0}}ag(){const e=this.siteAppLoaders||[];for(const t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(const t of e)this.setupSiteApp(t)}lg(e){if(Object.keys(this.apps).length===0)return;const t=this.globalsForEvent(e);for(const n of Object.values(this.apps))try{this.og(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,t)})}catch(r){Qi.error(`Error while processing event ${e.event} for site app ${n.id}`,r)}}onRemoteConfig(e){var t,n,r;if(!((t=this.siteAppLoaders)===null||t===void 0)&&t.length)return this.isEnabled?(this.ag(),void this._instance.on("eventCaptured",c=>this.lg(c))):void Qi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.eg)===null||n===void 0||n.call(this),!e.ok)return;const s=e.config;if(!((r=s.siteApps)===null||r===void 0)&&r.length)if(this.isEnabled)for(const{id:c,url:u}of s.siteApps){var i,o;et[`__$$ph_site_app_${c}`]=this._instance,(i=et.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,u,d=>{if(d)return Qi.error(z6+c,d)})}else Qi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},{surveys:class extends T7{constructor(e){super(new A7(e))}},featureFlags:lm},{tracingHeaders:class{constructor(e){this._instance=e,this.ug=void 0,this.cg=void 0,this.hg=void 0,this.Cp=()=>{const t=this.dg();var n,r;t?(le(this.ug)&&(this.ug=(n=et.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),le(this.cg)&&(this.cg=(r=et.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchFetch(t,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Rp()}}initialize(){this.startIfEnabledOrStop()}Bl(e){var t,n,r;!((t=et.__PosthogExtensions__)===null||t===void 0)&&t.tracingHeadersPatchFns?e():(n=et.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return w7.error("failed to load script",s);e()})}vg(){var e,t;return(e=(t=this._instance.config.tracing_headers)!==null&&t!==void 0?t:this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}dg(){const e=this.vg();return He(e)?(He(this.hg)?this.hg.splice(0,this.hg.length,...e):this.hg=[...e],e.length>0?this.hg:void 0):(He(this.hg)&&this.hg.splice(0),this.hg=e||void 0,this.hg)}Rp(){var e,t;(e=this.ug)===null||e===void 0||e.call(this),(t=this.cg)===null||t===void 0||t.call(this),this.ug=void 0,this.cg=void 0}startIfEnabledOrStop(){this.dg()?this.Bl(this.Cp):this.Rp()}}},{toolbar:class{constructor(e){this.instance=e}fg(e){et.ph_toolbar_state=e}pg(){var e;return(e=et.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e=void 0,t=void 0,n=void 0){var r,s;if(By(this.instance.config)||!ie||!Ie)return!1;e=(r=e)!==null&&r!==void 0?r:ie.location,n=(s=n)!==null&&s!==void 0?s:ie.history;try{if(!t){try{ie.localStorage.setItem("test","test"),ie.localStorage.removeItem("test")}catch{return!1}t=ie==null?void 0:ie.localStorage}const i=I7||C0(e.hash,"__posthog")||C0(e.hash,"state");let o;const c=i?Tk(()=>JSON.parse(atob(decodeURIComponent(i))))||Tk(()=>JSON.parse(decodeURIComponent(i))):null;return c&&c.action==="ph_authorize"?(o=c,o.source="url",o&&Object.keys(o).length>0&&(c.desiredHash?e.hash=c.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):(o=JSON.parse(t.getItem(U6)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}gg(e){const t=et.ph_load_toolbar||et.ph_load_editor;!ot(t)&&On(t)?t(e,this.instance):Z6.warn("No toolbar load function found")}loadToolbar(e){const t=!!(Ie!=null&&Ie.getElementById("__POSTHOG_TOOLBAR__"));if(!ie||t)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=N(N({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ie.localStorage.setItem(U6,JSON.stringify(N(N({},r),{},{source:void 0}))),this.pg()===2)this.gg(r);else if(this.pg()===0){var s,i;this.fg(1),(s=et.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return Z6.error("[Toolbar] Failed to load",o),void this.fg(0);this.fg(2),this.gg(r)}),$t(ie,"turbolinks:load",()=>{this.fg(0),this.loadToolbar(r)})}return!0}mg(e){return this.loadToolbar(e)}maybeLoadEditor(e=void 0,t=void 0,n=void 0){return this.maybeLoadToolbar(e,t,n)}}},{experiments:class nr{get Fr(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{nr.yg("retrieved web experiments from the server"),this.bg=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.bg&&(nr.yg("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.bg)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);ft(o)&&s.variants[o]&&this._g(s,o)}else if(s.variants)for(const o in s.variants){const c=s.variants[o];nr.wg(c,this._instance)&&this.kg(s.name,o,c.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(t){if(this._is_bot())nr.yg(hC);else if(!this.Fr.disable_web_experiments){if(ot(this.bg))return this.bg=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nr.yg("applying feature flags",t),t.forEach(n=>{var r;if(this.bg&&(!((r=this.bg)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.bg)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this._g(o,i)}})}}previewWebExperiment(){const t=nr.getWindowLocation();if(t!=null&&t.search){const n=Xu(t==null?void 0:t.search,"__experiment_id"),r=Xu(t==null?void 0:t.search,"__experiment_variant");n&&r&&(nr.yg(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.Sg(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Fr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.Fr.disable_web_experiments&&!r)return t([]);const s=this._instance.get_property("$web_experiments");if(s&&!n)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Fr.token}`),method:"GET",timestampMode:"query",callback:i=>t(i.statusCode===200&&i.json&&i.json.experiments||[])})}Sg(t,n,r){const s=r.filter(i=>i.id===t);s&&s.length>0&&(nr.yg(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.kg(s[0].name,n,s[0].variants[n].transforms))}_g(t,n){const r=t.variants[n];nr.xg(r,this._instance)?this.kg(t.name,n,r.transforms):nr.yg(`skipping variant ${n} of experiment ${t.name} because this page does not match its url conditions`)}static wg(t,n){return!ot(t.conditions)&&nr.xg(t,n)&&nr.$g(t)}static xg(t,n){var r;if(ot(t.conditions)||ot((r=t.conditions)===null||r===void 0?void 0:r.url))return!0;const s=nr.getWindowLocation();if(s){var i,o,c;const u=PA(n,s.href);return!(!((i=t.conditions)===null||i===void 0)&&i.url)||uV[(o=(c=t.conditions)===null||c===void 0?void 0:c.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,u)}return!1}static getWindowLocation(){return ie==null?void 0:ie.location}static $g(t){var n;if(ot(t.conditions)||ot((n=t.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=VA();if(r.utm_source){var s,i,o,c,u,d,f,p;const m=!(!((s=t.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=t.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=t.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((c=t.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0?void 0:c.utm_source)==r.utm_source,_=!(!((u=t.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_medium)||((d=t.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,w=!(!((f=t.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0)&&f.utm_term)||((p=t.conditions)===null||p===void 0||(p=p.utm)===null||p===void 0?void 0:p.utm_term)==r.utm_term;return m&&_&&w&&v}return!1}static yg(t,...n){me.info(`[WebExperiments] ${t}`,n)}static Cg(t,...n){me.warn(`[WebExperiments] ${t}`,n)}static Tg(t){(t.namespaceURI==="http://www.w3.org/1999/xhtml"&&t.localName==="template"?t.content:t).querySelectorAll("a[target], template").forEach(n=>{var r;if(n.localName==="template")return void(n.namespaceURI==="http://www.w3.org/1999/xhtml"&&nr.Tg(n));if(n.namespaceURI!=="http://www.w3.org/1999/xhtml"||((r=n.getAttribute("target"))===null||r===void 0?void 0:r.toLowerCase())!=="_blank")return void n.removeAttribute("target");const s=(n.getAttribute("rel")||"").split(/\s+/).filter(i=>i&&!/^(opener|noopener)$/i.test(i));s.push("noopener"),n.setAttribute("rel",s.join(" "))})}kg(t,n,r){this._is_bot()?nr.yg(hC):n!=="control"?r.forEach(s=>{if(s.selector){var i;nr.yg(`applying transform of variant ${n} for experiment ${t} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);if(!(o!=null&&o.length))return void nr.Cg(`no element on this page matches selector ${s.selector} of variant ${n} for experiment ${t}`);const c=new Map;o==null||o.forEach(u=>{if(u.localName.toLowerCase()==="script")return;const d=u;if(s.html){var f;const m=u.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&u.localName==="annotation-xml"&&((f=u.getAttribute("encoding"))===null||f===void 0?void 0:f.toLowerCase())||"",v=JSON.stringify([u.namespaceURI,u.localName,m]);let _=c.get(v);if(ot(_)){var p;const w=(p=mC)!==null&&p!==void 0?p:mC=cV(),b=u.ownerDocument.implementation.createHTMLDocument(""),S=b.createElementNS(u.namespaceURI,u.localName);m&&S.setAttribute("encoding",m);const E=b.createRange();E.selectNodeContents(S);const C=u.namespaceURI==="http://www.w3.org/2000/svg"&&/^(foreignObject|desc|title)$/.test(u.localName)||/^(text\/html|application\/xhtml\+xml)$/.test(m)?"http://www.w3.org/1999/xhtml":u.namespaceURI,R=E.createContextualFragment(s.html);u.namespaceURI==="http://www.w3.org/1998/Math/MathML"&&/^(mi|mo|mn|ms|mtext)$/.test(u.localName)?(S.appendChild(R),w.sanitize(S,N(N({},pC),{},{NAMESPACE:C||void 0,IN_PLACE:!0}))):(S.namespaceURI==="http://www.w3.org/1999/xhtml"&&S.localName==="template"?S.content:S).appendChild(w.sanitize(R,N(N({},pC),{},{NAMESPACE:C||void 0,RETURN_DOM_FRAGMENT:!0}))),nr.Tg(S),_=S.innerHTML,c.set(v,_)}d.innerHTML=_}s.css&&d.setAttribute("style",s.css)})}}):nr.yg("Control variants leave the page unmodified.")}_is_bot(){return Dr&&this._instance?fI(Dr,this.Fr.custom_blocked_useragents):void 0}},featureFlags:lm},{conversations:class{constructor(e){this._instance=e,this.Ig=void 0,this._conversationsManager=null,this.Mg=!1,this.ie=null,this.Eg=!1,this.Ag=0,this.Rg=null,this.Pg=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations)return void(this.Rg=null);if(this.Og=e.ok,!e.ok)return;const t=e.config.conversations;ot(t)?this.Rg=null:(ds(t)?this.Ig=t:(this.Ig=t.enabled,this.ie=t),this.Ig||(this.Rg=null),this.loadIfEnabled())}reset(){var e;(e=this._conversationsManager)===null||e===void 0||e.reset(),this._conversationsManager=null,this.Ag++,this.Ig=void 0,this.ie=null,this.Og=void 0,this.Eg=!1,this.Rg=null}loadIfEnabled(){if(this._conversationsManager||this.Mg||this._instance.config.disable_conversations||By(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const e=et==null?void 0:et.__PosthogExtensions__;if(e&&!le(this.Ig)&&this.Ig)if(this.ie&&this.ie.token){this.Mg=!0;try{const t=e.initConversations;if(t)return this.Fg(t),void(this.Mg=!1);const n=e.loadExternalDependency;if(!n)return void this.Dg(F_);const r=this.Ag;n(this._instance,"conversations",s=>{if(r!==this.Ag)return this.Mg=!1,void this.loadIfEnabled();s||!e.initConversations?this.Dg("Could not load conversations script",s):this.Fg(e.initConversations),this.Mg=!1})}catch(t){this.Dg("Error initializing conversations",t),this.Mg=!1}}else ci.error("Conversations enabled but missing token in remote config.")}Fg(e){if(this.ie){try{this._conversationsManager=e(this.ie,this._instance),this.Eg=!1,ci.info("Conversations loaded successfully")}catch(t){return void this.Dg("Error completing conversations initialization",t)}this.Pg&&this._conversationsManager.setTheme(this.Pg),this.Lg()}else ci.error("Cannot complete initialization: remote config is null")}Lg(){const e=this.Rg;this.Rg=null,this._conversationsManager&&e&&(e==="open"?this._conversationsManager.open():this._conversationsManager.close())}Dg(e,t){ci.error(e,t),this._conversationsManager=null,this.Mg=!1,this.Eg=!0}show(){this._conversationsManager?this._conversationsManager.show():ci.warn("Conversations not loaded yet.")}hide(){this.Rg==="open"&&(this.Rg=null),this._conversationsManager&&this._conversationsManager.hide()}open(){this._conversationsManager?(this.Rg=null,this._conversationsManager.open()):this.Rg="open"}close(){this._conversationsManager?(this.Rg=null,this._conversationsManager.close()):this.Rg="close"}setTheme(e){var t,n;this.Pg=N(N(N({},this.Pg),e),{},{dark:N(N({},(t=this.Pg)===null||t===void 0?void 0:t.dark),e==null?void 0:e.dark)}),(n=this._conversationsManager)===null||n===void 0||n.setTheme(e)}isAvailable(){return this.Ig===!0&&!kn(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":By(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Og===!1?"remote_config_failed":le(this.Ig)?this.Og?"disabled_in_project":"remote_config_pending":this.Ig?ot(this.ie)||!this.ie.token?"missing_token":et!=null&&et.__PosthogExtensions__?this.Mg?"initializing":this.Eg?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return cn(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(ci.warn(Hl),null)})()}getMessages(e,t){var n=this;return cn(function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(ci.warn(Hl),null)})()}markAsRead(e){var t=this;return cn(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ci.warn(Hl),null)})()}getTickets(e){var t=this;return cn(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ci.warn(Hl),null)})()}requestRestoreLink(e){var t=this;return cn(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ci.warn(Hl),null)})()}restoreFromToken(e){var t=this;return cn(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ci.warn(Hl),null)})()}restoreFromUrlToken(){var e=this;return cn(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ci.warn(Hl),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)===null||t===void 0?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}Md(){var e;(e=this._conversationsManager)===null||e===void 0||e.setIdentity()}Ed(){var e;(e=this._conversationsManager)===null||e===void 0||e.clearIdentity()}}},{logs:class extends hV{constructor(e){super({get(){var t;return e==null||(t=e.config)===null||t===void 0?void 0:t.logs},captureHintKey:oA,get remoteConfigWillArrive(){var t,n;return!(!((t=e.lc)===null||t===void 0)&&t.call(e))||!!(!((n=et._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[e.config.token])===null||n===void 0)&&n.config)}},()=>(function(t){var n;const r={};if(r.distinctId=t.get_distinct_id(),t.sessionManager){const{sessionId:s,windowId:i,sessionStartTimestamp:o,lastActivityTimestamp:c}=t.sessionManager.checkAndGetSessionAndWindowId(!0);r.sessionId=s,r.windowId=i,ot(o)||(r.sessionStartTimestamp=o),ot(c)||(r.lastActivityTimestamp=c)}if(!(et==null||(n=et.location)===null||n===void 0)&&n.href&&(r.currentUrl=t.config.disable_capture_url_hashes?el(et.location.href):et.location.href),t.featureFlags){const s=t.featureFlags.getFlags();s&&s.length>0&&(r.activeFeatureFlags=s)}return r})(e)),this._instance=e,this.name=bI,this.df()}get cf(){return this._instance.__loaded}hf(){const e=xn("[logs]"),t=et==null?void 0:et.__PosthogExtensions__;if(!t)return void e.error("PostHog Extensions not found.");const n=t.loadExternalDependency;if(n)return r=>{n(this._instance,"logs",s=>{const i=t.logs;r(s,i!=null&&i.initializeLogs?{initialize:o=>i.initializeLogs(o),replay(o,c){var u;return(u=i.replayConsoleBuffer)===null||u===void 0?void 0:u.call(i,o,c)}}:void 0)})};e.error(F_)}}},{metrics:class{constructor(e){this._instance=e,this.R=xn("[metrics]"),this.Ti=!1}initialize(){this.onConfigChange()}onConfigChange(){var e;if(this.Ti)return;const t=!!(!((e=this._instance.config.metrics)===null||e===void 0)&&e.network);t&&!this.Ng?this.Ng=(n=>{let r=!0;const s=()=>r?(c=>{var u;const d=(u=c.config.metrics)===null||u===void 0?void 0:u.network;return d===!0?{}:d||void 0})(n):void 0,i=gV(n,s),o=vV(n,s);return()=>{r=!1,i(),o()}})(this._instance):!t&&this.Ng&&(this.Ng(),this.Ng=void 0)}pf(){var e;if(this.Ti)return;const t=(e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.metrics;var n;return this.lf&&this.gf===t||((n=this.lf)===null||n===void 0||n.reset(),this.gf=t,this.lf=new M9(this.ff(),(function(r){var s,i,o,c,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:(c=r==null?void 0:r.flushIntervalMs)!==null&&c!==void 0?c:1e4,maxSeriesPerFlush:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(t),this.R)),this.lf}count(e,t=1,n){var r;(r=this.pf())===null||r===void 0||r.count(e,t,n)}gauge(e,t,n){var r;(r=this.pf())===null||r===void 0||r.gauge(e,t,n)}histogram(e,t,n){var r;(r=this.pf())===null||r===void 0||r.histogram(e,t,n)}flush(e){if(!this.lf)return Promise.resolve();if(e){const t=this.lf.drainWindow();return t&&this.To(t,e),Promise.resolve()}return this.lf.flush().catch(t=>this.R.error("PostHog metrics flush failed:",t))}reset(){var e;(e=this.lf)===null||e===void 0||e.reset()}dispose(){var e,t;this.Ti=!0,(e=this.Ng)===null||e===void 0||e.call(this),this.Ng=void 0,(t=this.lf)===null||t===void 0||t.reset()}ff(){const e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},To:n=>t.To(n),getLibraryId:()=>Es.LIB_NAME,getLibraryVersion:()=>Es.LIB_VERSION}}To(e,t){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(N(N({method:"POST",url:this.jg(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(o){const c=o.statusCode;if(c>=200&&300>c)s({kind:"ok"});else if(c===413)s({kind:"too-large"});else if(c!==0&&c!==408&&c!==429&&500>c)s({kind:"fatal",error:new Error(`metrics request failed with status ${c}`)});else{var u;s({kind:"retry-later",error:(u=o.error)!==null&&u!==void 0?u:new Error(`metrics request failed with status ${c}`)})}}}))})}jg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},{webMCP:class{constructor(e){this._instance=e,this.qg=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.qg)return;const e=Ie==null?void 0:Ie.modelContext;if(!e||!On(e.registerTool))return;const t=_C.get(e);if(t)return t.instances.add(this._instance),void(this.qg=!0);const n={instances:new Set([this._instance])},r=e.registerTool,s=this;ed(e,"registerTool",i=>{const o=i;return function(c,...u){let d=c;try{d=s.Bg(c,n)}catch{return o.call(this,c,...u)}return o.call(this,d,...u)}}),e.registerTool!==r&&(_C.set(e,n),this.qg=!0)}Bg(e,t){if(!e||!On(e.execute))return e;const n=e.execute,r=this,{tool:s,injected:i}=(function(o,c){const u={intent:!1,model:!1},d=o.inputSchema;if(!(function(_){return!!le(_)||ut(_)&&Object.keys(_).every(w=>yV.has(w)||w.startsWith("x-"))&&_.additionalProperties!==!0&&!ut(_.additionalProperties)&&(!_.type||_.type==="object")&&(!_.properties||ut(_.properties))&&(!_.required||He(_.required))})(d))return{tool:x1(o),injected:u};const f=(d==null?void 0:d.properties)||{},p=_=>b1(f,_)||He(d==null?void 0:d.required)&&d.required.includes(_);if(u.intent=c.intent&&!p("context"),u.model=c.model&&!p("llm_model"),!u.intent&&!u.model)return{tool:x1(o),injected:u};const m=N({},f),v=He(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 model identifier you are running as, for example "claude-opus-4-8" or "gpt-5.2". Pass "unknown" if you are not certain. Recorded for the site developer's analytics.`},v.includes("llm_model")||v.push("llm_model")),{tool:x1(o,N(N({},d),{},{type:(d==null?void 0:d.type)||"object",properties:m,required:v})),injected:u}})(e,(function(o){const c={intent:!1,model:!1};for(const u of o.instances){const d=wC(u.config.capture_webmcp);c.intent||(c.intent=(d==null?void 0:d.intent)===!0),c.model||(c.model=(d==null?void 0:d.model)===!0)}return c})(t));return Object.defineProperty(s,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){const c=new Date,u=(function(v,_){if(!ut(v))return{};try{const w=_.intent?bC(v.context,2048,!0):void 0,b=_.model?bC(v.llm_model,256):void 0;return N(N({},w&&w!=="{}"?{intent:w}:{}),b&&b.toLowerCase()!=="unknown"?{model:b}:{})}catch{return{}}})(o[0],i),d=(function(v,_){const w=v[0];if(!ut(w))return v;try{const b=_.intent&&b1(w,"context"),S=_.model&&b1(w,"llm_model");if(!b&&!S)return v;const E=N({},w);return b&&delete E.context,S&&delete E.llm_model,[E,...v.slice(1)]}catch{return v}})(o,i);let f;try{f=n.apply(this===s?e:this,d)}catch(v){throw r.zg(t,s,c,{error:v,errorResult:!1},u),v}if((p=f)&&typeof p.then=="function")return Promise.resolve(f).then(v=>{const _=xC(v)?{error:v,errorResult:!0}:void 0;return r.zg(t,s,c,_,u),v},v=>{throw r.zg(t,s,c,{error:v,errorResult:!1},u),v});var p;const m=xC(f)?{error:f,errorResult:!0}:void 0;return r.zg(t,s,c,m,u),f}}),s}zg(e,t,n,r,s){const i=Date.now()-n.getTime();let o;for(const u of e.instances){var c;const d=wC(u.config.capture_webmcp);if(d){r&&!o&&(o=EV(r.error,r.errorResult));try{u.capture("$mcp_tool_call",N(N(N({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:an==null?void 0:an.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&&(!((c=u.exceptionObserver)===null||c===void 0)&&c.isEnabled))try{const f={$exception_list:xV(u.exceptions,r,o.message),$exception_level:"error",$exception_source:"mcp.tool_call",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:an==null?void 0:an.hostname};u.exceptionObserver.captureException(f)}catch{}}}}}}));const kV=(function(){Es.SDK_DIST_CHANNEL="npm";const e=Wf[Rf]=new Gf;return(function(){function t(){t.done||(t.done=!0,uI=!1,Zt(Wf,function(n){n._dom_loaded()}))}Ie!=null&&Ie.addEventListener?Ie.readyState==="complete"?t():$t(Ie,"DOMContentLoaded",t,{capture:!1}):ie&&me.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),e})();var Xe=kV;function aw(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function SC(e,t="|"){return e.map(n=>MI(n)).join(t)}function lw(e,t){return typeof t=="bigint"?t.toString():t}class CV{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function xg(e){return new CV(e)}function PV(e){return e==null}function mb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function RV(e,t){const n=e/t,r=Math.round(n),s=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}function aa(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function gb(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t!=null&&t.get?t.get.raw:t==null?void 0:t.value}function na(e){return gb(e._zod.def)??e._zod.def.shape}function TI(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return aa(this,t,r),r},enumerable:!0,configurable:!0})}function AI(e,t,n){t in e?aa(e,t,n):e[t]=n}function wc(e,t,n,r){const s=na(t);for(const i of n){const o=Object.getOwnPropertyDescriptor(s,i);o.enumerable&&(o.get?TI(e,i,()=>{const c=t._zod.def.shape[i];return r?r(c,i):c}):AI(e,i,r?r(o.value,i):o.value))}}function TV(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?TI(e,n,()=>t[n]):AI(e,n,r.value))}}function Ks(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function AV(e){return JSON.stringify(e)}function IV(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const II="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function uh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const OV=xg(()=>{var e;if(Vi.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function td(e){if(uh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(uh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function OI(e){return td(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const MV=new Set(["string","number","symbol"]);function nd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gl(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function nt(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function MI(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function LV(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const LI={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$V={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function NV(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i={};return wc(i,e,Sg(e,t)),gl(e,Ks(n,{shape:i,checks:[]}))}function Sg(e,t){var s;const n=na(e),r=[];for(const i of Reflect.ownKeys(t)){if(!((s=Object.getOwnPropertyDescriptor(n,i))!=null&&s.enumerable))throw new Error(`Unrecognized key: "${String(i)}"`);t[i]&&r.push(i)}return r}function DV(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=new Set(Sg(e,t)),o={};return wc(o,e,Reflect.ownKeys(na(e)).filter(c=>!i.has(c))),gl(e,Ks(n,{shape:o,checks:[]}))}function FV(e,t){if(!td(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=na(e);for(const i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return gl(e,Ks(e._zod.def,{shape:$I(e,t)}))}function $I(e,t){const n={};return wc(n,e,Reflect.ownKeys(na(e))),TV(n,t),n}function jV(e,t){if(!td(t))throw new Error("Invalid input to safeExtend: expected a plain object");return gl(e,Ks(e._zod.def,{shape:$I(e,t)}))}function VV(e,t){var s,i;if(!((s=t==null?void 0:t._zod)!=null&&s.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((i=e._zod.def.checks)!=null&&i.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};wc(n,e,Reflect.ownKeys(na(e))),wc(n,t,Reflect.ownKeys(na(t)));const r=Ks(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return gl(e,r)}function EC(e,t,n,r="partial"){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const c=n?new Set(Sg(t,n)):void 0,u={};return wc(u,t,Reflect.ownKeys(na(t)),e&&((d,f)=>c&&!c.has(f)?d:new e({type:"optional",innerType:d}))),gl(t,Ks(t._zod.def,{shape:u,checks:[]}))}function zV(e,t,n){const r=n?new Set(Sg(t,n)):void 0,s={};return wc(s,t,Reflect.ownKeys(na(t)),(i,o)=>r&&!r.has(o)?i:new e({type:"nonoptional",innerType:i})),gl(t,Ks(t._zod.def,{shape:s}))}function Xo(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function HV(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function xu(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function _f(e){return typeof e=="string"?e:e==null?void 0:e.message}function kC(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const s=r.maximum??r.length??r.size;s>=0&&t.push([s,n])}return t}function cw(e,t,n){var r;for(let s=t;s<e.length;s++)(r=e[s]).schema??(r.schema=n)}function ol(e,t,n){var u,d,f,p,m,v,_,w,b,S;var r;const s=(d=(u=e.inst)==null?void 0:u._zod)==null?void 0:d.traits;s!=null&&s.has("$ZodType")&&(s.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const i=e.schema!==e.inst?(p=(f=e.schema)==null?void 0:f._zod.def)==null?void 0:p.error:void 0,o=e.message?e.message:_f((_=(v=(m=e.inst)==null?void 0:m._zod.def)==null?void 0:v.error)==null?void 0:_.call(v,e))??_f(i==null?void 0:i(e))??_f((w=t==null?void 0:t.error)==null?void 0:w.call(t,e))??_f((b=n.customError)==null?void 0:b.call(n,e))??_f((S=n.localeError)==null?void 0:S.call(n,e))??"Invalid input",c={};for(const E of Object.keys(e))E==="inst"||E==="schema"||E==="continue"||E==="input"||E==="__proto__"||(c[E]=e[E]);return c.path??(c.path=[]),c.message=o,t!=null&&t.reportInput&&(c.input=e.input),c}const UV=/[\uD800-\uDBFF]/;function vb(e){const t=e.length;if(!UV.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function yb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ZV(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function dh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function BV(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):WV(e,n,r.value)}}function al(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function NI(e,t,n){return al(e,t,n,!1)}function DI(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return al(this,n,r(this))},set(s){al(this,n,s)}})}return t}function WV(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:al(this,t,n.bind(this))},set(r){al(this,t,r)}})}function KV(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}let S1,La=!1;const GV={configurable:!0,get(){La=!0}};function tn(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&S1!==e._zod){S1=void 0;return}S1=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,GV);const s=La;La=!1;try{const i=n(this);return La?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),La=La||s,i}catch(i){throw delete this[t],La=La||s,i}},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s})}})}function qV(e,t,n,r){const s=KV(e,t);s&&Object.defineProperty(s,t,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:i})}})}const YV="~constantCatch";function XV(e){const t=()=>e;return t[YV]=!0,t}var CC;const FI=Object.freeze({status:"aborted"}),E1={value:void 0,enumerable:!1};let PC="captureStackTrace"in Error?Error:null;function QV(e){const t=PC;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return PC=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function de(e,t,n,r){const s={};function i(m){this.def=m,this.constr=p,this.traits=new Set}i.prototype=s;const o=n,c=o&&new WeakSet;function u(m,v){if(m._zod){if(m._zod.traits.has(e))return}else{E1.value=new i(v);try{Object.defineProperty(m,"_zod",E1)}finally{E1.value=void 0}}if(m._zod.traits.add(e),t(m,v),c){const w=Object.getPrototypeOf(m),b=m._zod.constr.prototype;let S=w;for(;S&&S!==b;)S=Object.getPrototypeOf(S);const E=S??w;c.has(E)||(c.add(E),BV(E,o))}const _=p.prototype;for(const w in _)Object.prototype.hasOwnProperty.call(_,w)&&(w in m||(m[w]=_[w].bind(m)))}const d=(r==null?void 0:r.Parent)??Object;class f extends d{}Object.defineProperty(f,"name",{value:e});function p(m){var b;const v=r!=null&&r.Parent?QV(f):this;u(v,m);const _=v._zod.deferred;if(_){for(const S of _)S();v._zod.deferred=void 0}const w=(b=globalThis.__zod_globalConfig)==null?void 0:b.postProcessor;return w&&w(v),v}return Object.defineProperty(p,"init",{value:u}),Object.defineProperty(p,Symbol.hasInstance,{value:m=>{var v,_;return r!=null&&r.Parent&&m instanceof r.Parent?!0:(_=(v=m==null?void 0:m._zod)==null?void 0:v.traits)==null?void 0:_.has(e)}}),Object.defineProperty(p,"name",{value:e}),p}class hc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class jI extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(CC=globalThis).__zod_globalConfig??(CC.__zod_globalConfig={});const Vi=globalThis.__zod_globalConfig;function yo(e){return e&&Object.assign(Vi,e),Vi}function JV(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,lw,2)),e.message}function ez(e){this._zod.message=e}const tz={get:JV,set:ez,enumerable:!0,configurable:!0},k1={value:void 0,enumerable:!1},RC=new WeakSet([Object.prototype,Error.prototype]),nz=(e,t)=>{e.name="$ZodError",k1.value=t,Object.defineProperty(e,"issues",k1),k1.value=void 0,Object.defineProperty(e,"message",tz);const n=Object.getPrototypeOf(e);RC.has(n)||(RC.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},rz=de("$ZodError",nz);function sz(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function iz(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?sz(n,s.path[0],()=>[]).push(t(s)):r.push(t(s));return{formErrors:r,fieldErrors:n}}function oz(e,t=n=>n.message){const n={_errors:[]},r=(s,i=[])=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(c=>r({issues:c},[...i,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...i,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...i,...o.path]);else{const c=[...i,...o.path];if(c.length===0)n._errors.push(t(o));else{let u=n,d=0;for(;d<c.length;){const f=c[d],p=d===c.length-1;if(f==="_errors"){p&&u._errors.push(t(o)),d++;continue}Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const m=u[f];p&&m._errors.push(t(o)),u=m,d++}}}};return r(e),n}function Eg(e,t){return{callee:(t==null?void 0:t.callee)??e,Err:t==null?void 0:t.Err}}const _b=e=>{const t=(n,r,s,i)=>{const o=s?{...s,async:!1}:{async:!1},c=n._zod.run({value:r,issues:[]},o);if(c instanceof Promise)throw new hc;if(c.issues.length){const u=new((i==null?void 0:i.Err)??e)(c.issues.map(d=>ol(d,o,yo())));throw II(u,(i==null?void 0:i.callee)??t),u}return c.value};return t},wb=e=>{const t=async(n,r,s,i)=>{const o=s?{...s,async:!0}:{async:!0};let c=n._zod.run({value:r,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const u=new((i==null?void 0:i.Err)??e)(c.issues.map(d=>ol(d,o,yo())));throw II(u,(i==null?void 0:i.callee)??t),u}return c.value};return t},bb=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new hc;return i.issues.length?VI(e,i.issues,s):{success:!0,data:i.value}};function VI(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(s=>ol(s,n,yo()))),t=void 0,n=void 0),r},set error(s){r=s,t=void 0,n=void 0}}}const xb=e=>async(t,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?VI(e,i.issues,s):{success:!0,data:i.value}},az=Symbol.for("zod.compile.invalid"),lz=Symbol.for("zod.compile.fallback"),cz=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==az)return!0;if(r.definite===!0&&n===void 0)return!1}return uz(e,t,n)});function uz(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=e._zod.bag.fallbackRun;let i;if(s?(r[lz]=!0,i=s({value:t,issues:[]},r)):i=e._zod.run({value:t,issues:[]},r),i instanceof Promise)throw new hc;return i.issues.length===0}const dz=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let s=e._zod.run({value:t,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length===0},fz=e=>{const t=_b(e),n=(r,s,i,o)=>{const c=i?{...i,direction:"backward"}:{direction:"backward"};return t(r,s,c,Eg(n,o))};return n},hz=e=>{const t=_b(e),n=(r,s,i,o)=>t(r,s,i,Eg(n,o));return n},pz=e=>{const t=wb(e),n=async(r,s,i,o)=>{const c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(r,s,c,Eg(n,o))};return n},mz=e=>{const t=wb(e),n=async(r,s,i,o)=>await t(r,s,i,Eg(n,o));return n},gz=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return bb(e)(t,n,s)},vz=e=>(t,n,r)=>bb(e)(t,n,r),yz=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return xb(e)(t,n,s)},_z=e=>async(t,n,r)=>xb(e)(t,n,r),wz=/^[cC][0-9a-z]{6,}$/,bz=/^[0-9a-z]+$/,xz=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Sz=/^[0-9a-vA-V]{20}$/,Ez=/^[A-Za-z0-9]{27}$/,kz=/^[a-zA-Z0-9_-]{21}$/;function Cz(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const Pz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Rz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,TC=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Tz=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Az="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Iz(){return new RegExp(Az,"u")}const Oz=/^(?:(?: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])$/,Mz=/^(([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}:){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}|:))$/,Lz=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,$z=/^(([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}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Dz=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Fz=/^https?$/,jz=/^\+[1-9]\d{6,14}$/,zI="(?:(?:\\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])))";function Vz(e){return new RegExp(`^${e}$`)}const zz=Vz(zI);function uw(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Hz(e){return new RegExp(`^${uw(e)}$`)}function Uz(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${uw({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${uw({precision:e.precision})}`:n;return new RegExp(`^${zI}T(?:${r})$`)}const Zz=/^[\s\S]{0,}$/,Bz=/^-?\d+$/,Sb=/^-?\d+(?:\.\d+)?$/,Wz=/^(?:true|false)$/i,Kz=/^[^A-Z]*$/,Gz=/^[^a-z]*$/,Os=de("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Eb=e=>{const t=e.value;return!PV(t)&&t.length!==void 0},O0={number:"number",bigint:"bigint",object:"date"},HI=de("$ZodCheckLessThan",(e,t)=>{Os.init(e,t);const n=O0[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:O0[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),UI=de("$ZodCheckGreaterThan",(e,t)=>{Os.init(e,t);const n=O0[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:O0[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qz=de("$ZodCheckMultipleOf",(e,t)=>{Os.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):RV(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Yz=de("$ZodCheckNumberFormat",(e,t)=>{var o;Os.init(e,t),t.format=t.format||"float64";const n=(o=t.format)==null?void 0:o.includes("int"),r=n?"int":"number",[s,i]=LI[t.format];e._zod.check=c=>{const u=c.value;if(n){if(!Number.isInteger(u)){c.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?c.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):c.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}u<s&&c.issues.push({origin:"number",input:u,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),u>i&&c.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Xz=de("$ZodCheckMaxLength",(e,t)=>{var n;Os.init(e,t),(n=e._zod.def).when??(n.when=Eb),e._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>t.maximum?vb(s):i)<=t.maximum)return;const c=yb(s);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Qz=de("$ZodCheckMinLength",(e,t)=>{var n;Os.init(e,t),(n=e._zod.def).when??(n.when=Eb),e._zod.check=r=>{const s=r.value,i=s.length;if((typeof s=="string"&&i>=t.minimum&&i<t.minimum*2?vb(s):i)>=t.minimum)return;const c=yb(s);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Jz=de("$ZodCheckLengthEquals",(e,t)=>{var n;Os.init(e,t),(n=e._zod.def).when??(n.when=Eb),e._zod.check=r=>{const s=r.value,i=s.length,o=typeof s=="string"&&i>=t.length&&i<=t.length*2?vb(s):i;if(o===t.length)return;const c=yb(s),u=o>t.length;r.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),kg=de("$ZodCheckStringFormat",(e,t)=>{var n,r;Os.init(e,t),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),eH=de("$ZodCheckRegex",(e,t)=>{kg.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),tH=de("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Kz),kg.init(e,t)}),nH=de("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Gz),kg.init(e,t)}),rH=de("$ZodCheckIncludes",(e,t)=>{Os.init(e,t);const n=nd(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),sH=de("$ZodCheckStartsWith",(e,t)=>{Os.init(e,t);const n=new RegExp(`^${nd(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),iH=de("$ZodCheckEndsWith",(e,t)=>{Os.init(e,t);const n=new RegExp(`.*${nd(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),oH=de("$ZodCheckOverwrite",(e,t)=>{Os.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class aH{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
22
|
+
`).filter(o=>o),s=Math.min(...r.map(o=>o.length-o.trimStart().length)),i=r.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of i)this.content.push(o)}compile(){const t=Function,n=(this==null?void 0:this.content)??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
23
|
+
${n.join(`
|
|
24
|
+
`)}
|
|
25
|
+
};`)(...Object.values(this.closed))}}const lH={major:4,minor:6,patch:7},jn=de("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lH;const r=e._zod.def.checks,s=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r!=null&&r.length?[...r]:[];for(const o of s)for(const c of o._zod.onattach)c(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const o=(u,d,f)=>{if(u.memo)return u;let p=Xo(u),m;for(const v of d){if(v._zod.def.when){if(HV(u)||!v._zod.def.when(u))continue}else if(p)continue;const _=u.issues.length,w=v._zod.check(u);if(w instanceof Promise&&(f==null?void 0:f.async)===!1)throw new hc;if(m||w instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await w,u.issues.length!==_&&(cw(u.issues,_,e),p||(p=Xo(u,_)))});else{if(u.issues.length===_)continue;cw(u.issues,_,e),p||(p=Xo(u,_))}}return m?m.then(()=>u):u},c=(u,d,f)=>{if(Xo(u))return u.aborted=!0,u;const p=o(d,s,f);if(p instanceof Promise){if(f.async===!1)throw new hc;return p.then(m=>e._zod.parse(m,f))}return e._zod.parse(p,f)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const p=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(m=>c(m,u,d)):c(p,u,d)}const f=e._zod.parse(u,d);if(f instanceof Promise){if(d.async===!1)throw new hc;return f.then(p=>o(p,s,d))}return o(f,s,d)}}},{get"~standard"(){return NI(this,"~standard",BI(this))},set"~standard"(e){al(this,"~standard",e)}}),ZI=(e,t)=>e.issues.length?{issues:e.issues.map(n=>ol(n,t,yo()))}:{value:e.value};async function cH(e,t){const n={async:!0};return ZI(await e._zod.run({value:t,issues:[]},n),n)}function BI(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return ZI(r,n)}catch{}return cH(e,t)},vendor:"zod",version:1}}const kb=de("$ZodString",(e,t)=>{jn.init(e,t),e._zod.pattern=t.pattern??Zz,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Mn=de("$ZodStringFormat",(e,t)=>{kg.init(e,t),kb.init(e,t)}),uH=de("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Rz),Mn.init(e,t)}),dH=de("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=TC(r))}else t.pattern??(t.pattern=TC());Mn.init(e,t)}),fH=de("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Tz),Mn.init(e,t)}),WI=1,M0=2;function KI(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function hH(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?KI(e)||M0:pH(e,t)}function pH(e,t){var n;if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===Fz.source&&!/^https?:\/\//i.test(e))return WI;try{if(typeof URL<"u"){const r=URL;if(typeof r.parse=="function")return r.parse(e)??M0}return new URL(e)}catch{return M0}}const mH=/[\t\n\r]/g;function AC(e){return e.replace(mH,"")}function gH(e,t){return t.lastIndex=0,t.test(e.hostname)}function vH(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const yH=de("$ZodURL",(e,t)=>{Mn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=hH(r,t);if(s===WI){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(s===M0){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(s===!0){n.value=AC(r);return}t.hostname&&!gH(s,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!vH(s,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?s.href:AC(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),_H=de("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Iz()),Mn.init(e,t)}),wH=de("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?kz:Cz(t.length)),Mn.init(e,t)}),bH=de("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=wz),Mn.init(e,t)}),xH=de("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=bz),Mn.init(e,t)}),SH=de("$ZodULID",(e,t)=>{t.pattern??(t.pattern=xz),Mn.init(e,t)}),EH=de("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Sz),Mn.init(e,t)}),kH=de("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ez),Mn.init(e,t)}),CH=de("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Uz(t)),Mn.init(e,t)}),PH=de("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zz),Mn.init(e,t)}),RH=de("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Hz(t)),Mn.init(e,t)}),TH=de("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Pz),Mn.init(e,t)}),AH=de("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Oz),Mn.init(e,t)}),IH=/^[0-9a-fA-F:.]+$/;function GI(e){return IH.test(e)?KI(`http://[${e}]`):!1}const OH=de("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Mz),Mn.init(e,t),e._zod.check=n=>{GI(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),MH=de("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Lz),Mn.init(e,t)});function LH(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;if(!r)return!1;const s=Number(r);return`${s}`!==r||s<0||s>128?!1:GI(n)}const $H=de("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=$z),Mn.init(e,t),e._zod.check=n=>{LH(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function qI(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const YI=/^[0-9a-zA-Z+/]*={0,2}$/,NH=de("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=YI),Mn.init(e,t),e._zod.check=n=>{qI(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Cb=/^[A-Za-z0-9_-]*$/;function DH(e){if(!Cb.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return qI(n)}const FH=de("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Cb),Mn.init(e,t),e._zod.check=n=>{DH(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),jH=de("$ZodE164",(e,t)=>{t.pattern??(t.pattern=jz),Mn.init(e,t)});function VH(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const zH=de("$ZodJWT",(e,t)=>{Mn.init(e,t),e._zod.check=n=>{VH(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),XI=de("$ZodNumber",(e,t)=>{jn.init(e,t),e._zod.pattern=Sb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:String(s):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),HH=de("$ZodNumberFormat",(e,t)=>{Yz.init(e,t),XI.init(e,t)}),UH=de("$ZodBoolean",(e,t)=>{jn.init(e,t),e._zod.pattern=Wz,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),ZH=de("$ZodUnknown",(e,t)=>{jn.init(e,t),e._zod.parse=n=>n}),BH=de("$ZodNever",(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function WH(e,t){const n=kC(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(i=>i[0])),s=e._zod.parse;e._zod.parse=(i,o)=>{const c=t(i.value);if(c>r&&!(o!=null&&o.skipChecks)&&(o==null?void 0:o.direction)!=="backward"){for(const[u,d]of kC(e._zod.def.checks))if(c>u&&d._zod.def.when(i)){const f=i.issues.length;return d._zod.check(i),i.issues[f].continue=!1,cw(i.issues,f,e),i}}return s(i,o)}}const KH=e=>Array.isArray(e)?e.length:-1;function IC(e,t,n){e.issues.length&&t.issues.push(...xu(n,e.issues)),t.value[n]=e.value}const GH=de("$ZodArray",(e,t)=>{jn.init(e,t);const n=Vi.memoizer;n==null||n.attach(e),e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=n?n.alloc(e,r,Array(i.length),s):Array(i.length);const o=[],c=s==null?void 0:s.abortEarly;for(let u=0;u<i.length;u++){const d=i[u],f=t.element._zod.run({value:d,issues:[]},s);if(f instanceof Promise)o.push(f.then(p=>IC(p,r,u)));else if(IC(f,r,u),c&&f.issues.length!==0&&Xo(f))break}return o.length?Promise.all(o).then(()=>r):r},WH(e,KH)});function L0(e,t,n,r,s,i){const o=n in r,c=i==="optional";if(!(!o&&c&&s==="optional")){if(e.issues.length){if(s!==void 0&&c&&!o)return;t.issues.push(...xu(n,e.issues))}if(!o&&s===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(o||s==="defaulted"&&!c)&&(t.value[n]=void 0):t.value[n]=e.value}}const qH=[];function QI(e){var o,c,u,d;const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:qH,s=r.length?[...t,...r]:t;for(const f of s)if(!((d=(u=(c=(o=e.shape)==null?void 0:o[f])==null?void 0:c._zod)==null?void 0:u.traits)!=null&&d.has("$ZodType")))throw new Error(`Invalid element at key "${String(f)}": expected a Zod schema`);const i=LV(e.shape);return{...e,allKeys:s,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function JI(e,t,n,r,s,i,o){const c=[],u=s.keySet,d=s.catchall._zod,f=d.def.type,p=d.optin,m=d.optout;let v=0;for(const _ in t){if(o&&n.issues.length!==v){if(Xo(n,v))break;v=n.issues.length}if(u.has(_))continue;if(_==="__proto__"){f==="never"&&c.push(_);continue}if(f==="never"){c.push(_);continue}const w=d.run({value:t[_],issues:[]},r);w instanceof Promise?e.push(w.then(b=>L0(b,n,_,t,p,m))):L0(w,n,_,t,p,m)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const YH=de("$ZodObject",(e,t)=>{jn.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n!=null&&n.get?n.get.raw:t.shape??{};if(r){const d=()=>{const f={...r};return Object.defineProperty(t,"shape",{value:f}),d.raw=f,f};d.raw=r,Object.defineProperty(t,"shape",{get:d})}const s=xg(()=>QI(t));tn(e,"propValues",d=>{const f=d.def.shape,p={};for(const m in f){const v=f[m]._zod;if(v.values){Object.prototype.hasOwnProperty.call(p,m)||aa(p,m,new Set);for(const _ of v.values)p[m].add(_);v.optin!==void 0&&p[m].add(void 0)}}return p});const i=uh,o=t.catchall;let c;const u=Vi.memoizer;u==null||u.attach(e),e._zod.parse=(d,f)=>{c??(c=s.value);const p=d.value;if(!i(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d;d.value=u?u.alloc(e,d,{},f):{};const m=[],v=c.shape,_=f==null?void 0:f.abortEarly;let w=d.issues.length;for(const b of c.allKeys){if(_&&d.issues.length!==w){if(Xo(d,w))break;w=d.issues.length}if(b==="__proto__")continue;const S=v[b],E=S._zod.optin,C=S._zod.optout,R=S._zod.run({value:p[b],issues:[]},f);R instanceof Promise?m.push(R.then(T=>L0(T,d,b,p,E,C))):L0(R,d,b,p,E,C)}return o?JI(m,p,d,f,s.value,e,_===!0):m.length?Promise.all(m).then(()=>d):d}}),XH=de("$ZodObjectJIT",(e,t)=>{YH.init(e,t);const n=e._zod.parse,r=xg(()=>QI(t)),s=Vi.memoizer,i=v=>{var T,O;const _=r.value,w=_.symbolKeys,b=new aH(["payload","ctx"],{shape:v,inst:e,memo:s,syms:w}),S=M=>`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`,E=(M,A)=>`
|
|
26
|
+
let ${M}_ab = false;
|
|
27
|
+
for (let i = 0; i < ${M}.issues.length; i++) {
|
|
28
|
+
const iss = ${M}.issues[i];
|
|
29
|
+
iss.path = iss.path ? [${A}, ...iss.path] : [${A}];
|
|
30
|
+
payload.issues.push(iss);
|
|
31
|
+
if (iss.continue !== true) ${M}_ab = true;
|
|
32
|
+
}
|
|
33
|
+
if (${M}_ab && ctx && ctx.abortEarly) {
|
|
34
|
+
payload.value = newResult;
|
|
35
|
+
return payload;
|
|
36
|
+
}`;b.write("const input = payload.value;");const C=Object.create(null);let R=0;for(const M of _.allKeys)C[M]=`key_${R++}`;b.write(s?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const M of _.allKeys){if(M==="__proto__")continue;const A=C[M],L=typeof M=="symbol"?`syms[${w.indexOf(M)}]`:AV(M),V=`${L} in input`,W=v[M],z=(T=W==null?void 0:W._zod)==null?void 0:T.optin,X=z!==void 0,Q=((O=W==null?void 0:W._zod)==null?void 0:O.optout)==="optional";if(b.write(`const ${A} = ${S(L)};`),X&&Q){const H=z==="optional"?`${A}_present`:`${A}.value !== undefined || ${A}_present`;b.write(`
|
|
37
|
+
const ${A}_present = ${V};
|
|
38
|
+
if (!${A}.issues.length || ${A}_present) {
|
|
39
|
+
if (${A}.issues.length) {${E(A,L)}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (${H}) {
|
|
43
|
+
newResult[${L}] = ${A}.value;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
`)}else X?(b.write(`
|
|
48
|
+
if (${A}.issues.length) {${E(A,L)}
|
|
49
|
+
}
|
|
50
|
+
`),z==="defaulted"?b.write(`newResult[${L}] = ${A}.value;`):b.write(`
|
|
51
|
+
if (${A}.value !== undefined || ${V}) {
|
|
52
|
+
newResult[${L}] = ${A}.value;
|
|
53
|
+
}
|
|
54
|
+
`)):b.write(`
|
|
55
|
+
const ${A}_present = ${V};
|
|
56
|
+
if (${A}.issues.length) {${E(A,L)}
|
|
57
|
+
}
|
|
58
|
+
if (!${A}_present && !${A}.issues.length) {
|
|
59
|
+
payload.issues.push({
|
|
60
|
+
code: "invalid_type",
|
|
61
|
+
expected: "nonoptional",
|
|
62
|
+
input: undefined,
|
|
63
|
+
path: [${L}]
|
|
64
|
+
});
|
|
65
|
+
if (ctx && ctx.abortEarly) {
|
|
66
|
+
payload.value = newResult;
|
|
67
|
+
return payload;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (${A}_present) {
|
|
72
|
+
newResult[${L}] = ${A}.value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
`)}return b.write("payload.value = newResult;"),b.write("return payload;"),b.compile()};let o;const c=uh,u=!Vi.jitless,f=u&&OV.value,p=t.catchall;let m;e._zod.parse=(v,_)=>{m??(m=r.value);const w=v.value;return c(w)?u&&f&&(_==null?void 0:_.async)===!1&&_.jitless!==!0?(o||(o=i(t.shape)),v=o(v,_),p?JI([],w,v,_,m,e,(_==null?void 0:_.abortEarly)===!0):v):n(v,_):(v.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),v)}});function OC(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!Xo(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>ol(o,r,yo())))}),t)}const eO=de("$ZodUnion",(e,t)=>{jn.init(e,t),tn(e,"optin",r=>r.def.options.some(s=>s._zod.optin==="defaulted")?"defaulted":r.def.options.some(s=>s._zod.optin!==void 0)?"optional":void 0),tn(e,"optout",r=>r.def.options.some(s=>s._zod.optout==="optional")?"optional":void 0),tn(e,"values",r=>{if(r.def.options.every(s=>s._zod.values))return new Set(r.def.options.flatMap(s=>Array.from(s._zod.values)))}),tn(e,"pattern",r=>{if(r.def.options.every(s=>s._zod.pattern)){const s=r.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>mb(i.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const o=[];for(const c of t.options){const u=c._zod.run({value:r.value,issues:[]},s);if(u instanceof Promise)o.push(u),i=!0;else{if(u.issues.length===0)return u;o.push(u)}}return i?Promise.all(o).then(c=>OC(c,r,e,s)):OC(o,r,e,s)}});function QH(e){var n;const t=new Map;for(const r of e.options){const s=(n=r._zod.propValues)==null?void 0:n[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(const i of s)if(t.has(i)){if(i!==void 0)throw new Error(`Duplicate discriminator value "${String(i)}"`);t.set(i,null)}else t.set(i,r)}return t}const JH=de("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,eO.init(e,t);const n=e._zod.parse;tn(e,"propValues",s=>{var c,u;const i={};let o=0;for(const d of s.def.options){const f=d._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${s.def.options.indexOf(d)}"`);(c=f[s.def.discriminator])!=null&&c.has(void 0)&&o++;for(const[p,m]of Object.entries(f)){Object.prototype.hasOwnProperty.call(i,p)||aa(i,p,new Set);for(const v of m)i[p].add(v)}}return!s.def.unionFallback&&o>1&&((u=i[s.def.discriminator])==null||u.delete(void 0)),i}),t.options.forEach((s,i)=>{const o=gb(s._zod.def);if(o&&!Object.prototype.hasOwnProperty.call(o,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});const r=xg(()=>QH(t));e._zod.parse=(s,i)=>{const o=s.value;if(!uh(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const c=o==null?void 0:o[t.discriminator],u=r.value.get(c);return u&&(c!==void 0||i.direction!=="backward")?u._zod.run(s,i):t.unionFallback||i.direction==="backward"?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(d=>r.value.get(d)!==null),input:o,path:[t.discriminator],inst:e}),s)}}),eU=de("$ZodIntersection",(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),o=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([u,d])=>MC(n,u,d)):MC(n,i,o)}});function dw(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(td(e)&&td(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(const i of r){if(i==="__proto__")continue;const o=dw(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],o=dw(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function MC(e,t,n){const r=new Map;let s;const i=new Map,o=(d,f)=>{var m,v;let p;if(d.code==="unrecognized_keys"&&!((m=d.path)!=null&&m.length))s??(s=d),p=d.keys;else if(d.code==="invalid_key"&&d.origin==="record"&&((v=d.path)==null?void 0:v.length)===1){const _=String(d.path[0]);i.has(_)||i.set(_,d),p=[_]}else return!1;for(const _ of p)r.has(_)||r.set(_,{}),r.get(_)[f]=!0;return!0};for(const d of t.issues)o(d,"l")||e.issues.push(d);for(const d of n.issues)o(d,"r")||e.issues.push(d);const c=[...r].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(c.length){const d=s?c.filter(f=>s.keys.includes(f)):[];d.length&&e.issues.push({...s,keys:d});for(const f of c)!d.includes(f)&&i.has(f)&&e.issues.push(i.get(f))}const u=dw(t.value,n.value);if(!u.valid){if(Xo(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}const tU=de("$ZodRecord",(e,t)=>{jn.init(e,t);const n=Vi.memoizer;n==null||n.attach(e),e._zod.parse=(r,s)=>{const i=r.value;if(!td(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;const o=[],c=t.keyType._zod.values;if(c&&!t.partial){r.value=n?n.alloc(e,r,{},s):{};const u=new Set;for(const f of c)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){if(u.add(typeof f=="number"?f.toString():f),f==="__proto__")continue;const p=t.keyType._zod.run({value:f,issues:[]},s);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(_=>ol(_,s,yo())),input:f,path:[f],inst:e});continue}const m=p.value;if(m==="__proto__")continue;const v=t.valueType._zod.run({value:i[f],issues:[]},s);v instanceof Promise?o.push(v.then(_=>{_.issues.length&&r.issues.push(...xu(f,_.issues)),r.value[m]=_.value})):(v.issues.length&&r.issues.push(...xu(f,v.issues)),r.value[m]=v.value)}let d;for(const f in i)if(!u.has(f))if(t.mode==="loose"){if(f==="__proto__")continue;r.value[f]=i[f]}else d=d??[],d.push(f);d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d,continue:!0})}else{r.value=n?n.alloc(e,r,{},s):{};let u;for(const d of Reflect.ownKeys(i)){if(d==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,d))continue;let f=t.keyType._zod.run({value:d,issues:[]},s);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&Sb.test(d)&&f.issues.length){const _=t.keyType._zod.run({value:Number(d),issues:[]},s);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(f=_)}if(f.issues.length){t.mode==="loose"?r.value[d]=i[d]:c?(u=u??[],u.push(d)):r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(_=>ol(_,s,yo())),input:d,path:[d],inst:e});continue}const m=f.value;if(m==="__proto__")continue;const v=t.valueType._zod.run({value:i[d],issues:[]},s);v instanceof Promise?o.push(v.then(_=>{_.issues.length&&r.issues.push(...xu(d,_.issues)),r.value[m]=_.value})):(v.issues.length&&r.issues.push(...xu(d,v.issues)),r.value[m]=v.value)}u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),nU=de("$ZodEnum",(e,t)=>{jn.init(e,t);const n=aw(t.entries),r=new Set(n);e._zod.values=r,tn(e,"pattern",s=>{const i=aw(s.def.entries).filter(o=>MV.has(typeof o));return new RegExp(i.length?`^(${i.map(o=>nd(o.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),rU=de("$ZodLiteral",(e,t)=>{jn.init(e,t);const n=new Set(t.values);e._zod.values=n,tn(e,"pattern",r=>{const s=r.def.values;return new RegExp(s.length?`^(${s.map(i=>typeof i=="string"?nd(i):i?nd(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),sU=de("$ZodTransform",(e,t)=>{var n;jn.init(e,t),e._zod.optin="optional",(n=Vi.memoizer)==null||n.guard(e),e._zod.parse=(r,s)=>{if(s.direction==="backward")throw new jI(e.constructor.name);const i=t.transform(r.value,r);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new hc;return r.value=i,r}});function LC(e,t){return e.value=t.issues.length?void 0:t.value,e}const tO=de("$ZodOptional",(e,t)=>{jn.init(e,t),tn(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",tn(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),tn(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${mb(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const s=t.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>LC(n,i)):LC(n,s)}return t.innerType._zod.run(n,r)}}),iU=de("$ZodExactOptional",(e,t)=>{tO.init(e,t),tn(e,"values",n=>n.def.innerType._zod.values),tn(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),oU=de("$ZodNullable",(e,t)=>{jn.init(e,t),tn(e,"optin",n=>n.def.innerType._zod.optin),tn(e,"optout",n=>n.def.innerType._zod.optout),tn(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${mb(r.source)}|null)$`):void 0}),tn(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),aU=de("$ZodDefault",(e,t)=>{jn.init(e,t),e._zod.optin="defaulted",tn(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>$C(i,t)):$C(s,t)}});function $C(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const lU=de("$ZodPrefault",(e,t)=>{jn.init(e,t),e._zod.optin="defaulted",tn(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),cU=de("$ZodNonOptional",(e,t)=>{jn.init(e,t),tn(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>NC(i,e)):NC(s,e)}});function NC(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function DC(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(s=>ol(s,r,yo()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const uU=de("$ZodCatch",(e,t)=>{jn.init(e,t),tn(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),tn(e,"optout",n=>n.def.innerType._zod.optout),tn(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run({value:n.value,issues:[]},r);return s instanceof Promise?s.then(i=>DC(n,i,t,r)):DC(n,s,t,r)}}),dU=de("$ZodPipe",(e,t)=>{jn.init(e,t),tn(e,"values",n=>n.def.in._zod.values),tn(e,"optin",n=>n.def.in._zod.optin),tn(e,"optout",n=>n.def.out._zod.optout),tn(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>dm(o,t.in,r)):dm(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>dm(i,t.out,r)):dm(s,t.out,r)}});function dm(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const fU=de("$ZodReadonly",(e,t)=>{jn.init(e,t),tn(e,"propValues",n=>n.def.innerType._zod.propValues),tn(e,"values",n=>n.def.innerType._zod.values),tn(e,"optin",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optin}),tn(e,"optout",n=>{var r,s;return(s=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:s.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(FC):FC(s)}});function FC(e){return e.memo||(e.value=Object.freeze(e.value)),e}const hU=de("$ZodCustom",(e,t)=>{Os.init(e,t),jn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>jC(i,n,r,e));jC(s,n,r,e)}});function jC(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(dh(s))}}class pU extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const fw="~memo",VC=[];function nO(e){return e!==null&&typeof e=="object"}function C1(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const rO=new WeakMap,Af=0,Wm=1,qf=2;function Km(e,t,n){const r=rO.get(e);if(r!==void 0)return r?qf:Af;if(t.has(e))return qf;t.add(e);let s=Af;const i=f=>{if(s!==qf&&(f!=null&&f._zod)){const p=Km(f,t);p>s&&(s=p)}},o=(f,p)=>{var v;let m=Af;for(const _ of Reflect.ownKeys(f)){const w=Object.getOwnPropertyDescriptor(f,_);if(!w.enumerable)continue;const b=w.get?Wm:(v=w.value)!=null&&v._zod?Km(w.value,t):Af;b>m&&(m=b)}return m},c=f=>{f>s&&(s=f)},u=e._zod.def;switch(u.type){case"object":{const f=gb(u);c(f?o(f):Wm),i(u.catchall);break}case"array":i(u.element);break;case"tuple":for(const f of u.items)i(f);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(const f of u.options)i(f);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{const f=u._cachedInner??void 0;c(f?Km(f,t):Wm);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const f in u){const p=Object.getOwnPropertyDescriptor(u,f);if(!p||p.get)continue;const m=p.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(const v of m)i(v)}}}return t.delete(e),mU(e,s)}function mU(e,t){return t!==Wm&&rO.set(e,t===qf),t}function gU(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let fm;const hm=[],vU={alloc(e,t,n){const r=fm;if(!r)return n;fm=void 0;const s={value:n,issues:null};return r.set(t.value,s),hm.push(s),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(s,i)=>{if(i.direction!=="backward"&&_U(i,s.value))throw new pU;return n(s,i)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,s,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const o=e._zod.parse,c=(u,d)=>{if(n===void 0){const S=Km(e,new Set);if(S===Af)return e._zod.parse=o,e._zod.run===c&&(e._zod.run=o),o(u,d);S===qf||r?n=!0:r=!0}const f=u.value;if(!nO(f))return o(u,d);let p=d[fw];p||(p={buckets:new WeakMap,backEdges:void 0},d[fw]=p);let m;s===d?m=i:(m=gU(p,e),s=d,i=m);const v=m.get(f);if(v)return u.value=v.value,v.issues?v.issues.length&&u.issues.push(...C1(v.issues)):(u.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(v.value)),u;fm=m;const _=hm.length,w=o(u,d);fm=void 0;const b=hm.length>_?hm.pop():void 0;return w instanceof Promise?w.then(S=>(b&&(b.issues=S.issues.length?C1(S.issues):VC),S)):(b&&(b.issues=w.issues.length?C1(w.issues):VC),w)};e._zod.parse=c,e._zod.run===o&&(e._zod.run=c)})}};function yU(){return vU}function _U(e,t){var r;const n=(r=e[fw])==null?void 0:r.backEdges;return n!==void 0&&nO(t)&&n.has(t)}const wU=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function s(i,o){return i==="number"&&typeof o=="number"&&!Number.isFinite(o)?String(o):r[i]??i}return i=>{switch(i.code){case"invalid_type":{const o=s(i.expected),c=ZV(i.input),u=s(c,i.input);return`Invalid input: expected ${o}, received ${u}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${MI(i.values[0])}`:`Invalid option: expected one of ${SC(i.values,"|")}`;case"too_big":{const o=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);return c?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{const o=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);return c?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${c.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${SC(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(c=>`'${c}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function bU(){return{localeError:wU()}}var zC;class xU{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function SU(){return new xU}(zC=globalThis).__zod_globalRegistry??(zC.__zod_globalRegistry=SU());const If=globalThis.__zod_globalRegistry;function sO(e){return e.checks&&(e.checks=[...e.checks]),e}function EU(e,t){return new e(sO({type:"string",...nt(t)}))}function kU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...nt(t)})}function CU(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...nt(t)})}function PU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...nt(t)})}function RU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...nt(t)})}function TU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...nt(t)})}function AU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...nt(t)})}function IU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...nt(t)})}function OU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...nt(t)})}function MU(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...nt(t)})}function LU(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...nt(t)})}function $U(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...nt(t)})}function NU(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...nt(t)})}function DU(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...nt(t)})}function FU(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...nt(t)})}function jU(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...nt(t)})}function VU(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...nt(t)})}function zU(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...nt(t)})}function HU(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...nt(t)})}function UU(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...nt(t)})}function ZU(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...nt(t)})}function BU(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...nt(t)})}function WU(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...nt(t)})}function KU(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...nt(t)})}function GU(e,t){return new e({type:"string",format:"date",check:"string_format",...nt(t)})}function qU(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...nt(t)})}function YU(e,t){return new e({type:"string",format:"duration",check:"string_format",...nt(t)})}function XU(e,t){return new e(sO({type:"number",checks:[],...nt(t)}))}function QU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...nt(t)})}function JU(e,t){return new e({type:"boolean",...nt(t)})}function eZ(e){return new e({type:"unknown"})}function tZ(e,t){return new e({type:"never",...nt(t)})}function HC(e,t){return new HI({check:"less_than",...nt(t),value:e,inclusive:!1})}function P1(e,t){return new HI({check:"less_than",...nt(t),value:e,inclusive:!0})}function UC(e,t){return new UI({check:"greater_than",...nt(t),value:e,inclusive:!1})}function R1(e,t){return new UI({check:"greater_than",...nt(t),value:e,inclusive:!0})}function ZC(e,t){return new qz({check:"multiple_of",...nt(t),value:e})}function iO(e,t){return new Xz({check:"max_length",...nt(t),maximum:e})}function $0(e,t){return new Qz({check:"min_length",...nt(t),minimum:e})}function oO(e,t){return new Jz({check:"length_equals",...nt(t),length:e})}function nZ(e,t){return new eH({check:"string_format",format:"regex",...nt(t),pattern:e})}function rZ(e){return new tH({check:"string_format",format:"lowercase",...nt(e)})}function sZ(e){return new nH({check:"string_format",format:"uppercase",...nt(e)})}function iZ(e,t){return new rH({check:"string_format",format:"includes",...nt(t),includes:e})}function oZ(e,t){return new sH({check:"string_format",format:"starts_with",...nt(t),prefix:e})}function aZ(e,t){return new iH({check:"string_format",format:"ends_with",...nt(t),suffix:e})}function bd(e){return new oH({check:"overwrite",tx:e})}function lZ(e){return bd(t=>t.normalize(e))}function cZ(){return bd(e=>e.trim())}function uZ(){return bd(e=>e.toLowerCase())}function dZ(){return bd(e=>e.toUpperCase())}function fZ(){return bd(e=>IV(e))}function hZ(e,t,n){return new e({type:"array",element:t,...nt(n)})}function pZ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...nt(n)})}function mZ(e,t){const n=gZ(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(dh(s,r.value,n._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(dh(i))}},e(r.value,r)),t);return n}function gZ(e,t){const n=new Os({check:"custom",...nt(t)});return n._zod.check=e,n}function Yf(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&aa(e,r,n[r]);return e}function aO(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??If,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",intersections:[],deferred:[],external:(e==null?void 0:e.external)??void 0}}function ll(e,t,n,r,s){const i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:s}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(s);return Object.assign(n,i),!0}function ar(e,t,n={path:[],schemaPath:[]}){var f,p;var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const c=(p=(f=e._zod).toJSONSchema)==null?void 0:p.call(f);if(c)o.schema=c;else{const m={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,m);else{const _=o.schema,w=t.processors[s.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);w(e,t,_,m)}const v=e._zod.parent;v&&(o.ref||(o.ref=v),ar(v,t,m),t.seen.get(v).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Yf(o.schema,u),t.io==="input"&&os(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function BC(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function lO(e,t){var o,c,u,d;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const f of e.seen.entries()){const p=(o=e.metadataRegistry.get(f[0]))==null?void 0:o.id;if(p){const m=r.get(p);if(m&&m!==f[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(p,f[0])}}const s=f=>{var w;const p=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const b=(w=e.external.registry.get(f[0]))==null?void 0:w.id,S=e.external.uri??(C=>C);if(b)return{ref:S(b)};const E=f[1].defId??f[1].schema.id??`schema${e.counter++}`;return f[1].defId=E,{defId:E,ref:`${S("__shared")}#/${p}/${BC(E)}`}}const m="#",v=`${m}/${p}/`;if(f[1]===n&&!f[1].schema.id)return{ref:m};const _=f[1].schema.id??`__schema${e.counter++}`;return{defId:_,ref:v+BC(_)}},i=f=>{if(f[1].schema.$ref)return;const p=f[1],{ref:m,defId:v}=s(f);p.def={...p.schema},v&&(p.defId=v);const _=p.schema;for(const w in _)delete _[w];_.$ref=m};if(e.cycles==="throw")for(const f of e.seen.entries()){const p=f[1];if(p.cycle)throw new Error(`Cycle detected: #/${(c=p.cycle)==null?void 0:c.join("/")}/<root>
|
|
76
|
+
|
|
77
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of e.seen.entries()){const p=f[1];if(t===f[0]){i(f);continue}if(e.external){const v=(u=e.external.registry.get(f[0]))==null?void 0:u.id;if(t!==f[0]&&v){i(f);continue}}if((d=e.metadataRegistry.get(f[0]))==null?void 0:d.id){i(f);continue}if(p.cycle){i(f);continue}p.count>1&&e.reused==="ref"&&i(f)}e.external&&(e.sharedDefsExtractedFor=e.external)}function cO(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;cO(r);const s=Object.keys(r);if(s.length!==1||s[0]!=="type")return;const i=r.type;for(const o of Array.isArray(i)?i:[i]){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const uO=new Set(["type","properties","required","additionalProperties"]),WC=["oneOf","anyOf"];function KC(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function hw(e){var i;const t=[];for(const o of e){if(typeof o!="object"||o.type!=="object")return null;for(const c in o)if(!uO.has(c))return null;t.push(o)}const n={},r=new Set;for(const o of t){for(const c in o.properties){if(Object.prototype.hasOwnProperty.call(n,c))continue;const u=[];for(const f of t){const p=((i=f.properties)==null?void 0:i[c])??KC(f);p!=null&&(u.some(m=>JSON.stringify(m)===JSON.stringify(p))||u.push(p))}const d=u.length===1?u[0]:hw(u)??{allOf:u};aa(n,c,d)}for(const c of o.required??[])r.add(c)}const s={type:"object",properties:n};if(r.size&&(s.required=[...r]),t.every(o=>o.additionalProperties===!1))s.additionalProperties=!1;else{const o=[];for(const c of t){const u=KC(c);u&&!o.some(d=>JSON.stringify(d)===JSON.stringify(u))&&o.push(u)}o.length===1?s.additionalProperties=o[0]:o.length>1&&(s.additionalProperties={allOf:o})}return s}function vZ(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const s of uO)if(s in e)return;const n=t.filter(s=>WC.some(i=>Array.isArray(s[i])));let r=null;if(!n.length)r=hw(t);else{const s=n[0],i=WC.find(u=>Array.isArray(s[u]));if(Object.keys(s).length!==1)return;const o=t.filter(u=>u!==s),c=s[i].map(u=>hw([...o,u]));if(c.some(u=>!u))return;r={[i]:c}}r&&(delete e.allOf,Yf(e,r))}function dO(e,t){var c,u,d,f;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=p=>{const m=e.seen.get(p);if(m.ref===null)return;const v=m.def??m.schema,_={...v},w=m.ref;if(m.ref=null,w){r(w);const S=e.seen.get(w),E=S.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(E)):Yf(v,E),Yf(v,_),p._zod.parent===w)for(const R in v)R==="$ref"||R==="allOf"||R in _||delete v[R];if(E.$ref&&S.def)for(const R in v)R==="$ref"||R==="allOf"||R in S.def&&JSON.stringify(v[R])===JSON.stringify(S.def[R])&&delete v[R]}const b=p._zod.parent;if(b&&b!==w){r(b);const S=e.seen.get(b);if(S!=null&&S.schema.$ref&&(v.$ref=S.schema.$ref,S.def))for(const E in v)E==="$ref"||E==="allOf"||E in S.def&&JSON.stringify(v[E])===JSON.stringify(S.def[E])&&delete v[E]}e.override({zodSchema:p,jsonSchema:v,path:m.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const p of[...e.seen.entries()].reverse())r(p[0]);if(e.target!=="openapi-3.0")for(const p of e.seen.entries())cO(p[1].def??p[1].schema);for(const p of e.deferred)p();if(e.intersections.length){const p=new Map;for(const m of e.seen.values())for(const v of[m.schema,m.def]){const _=v==null?void 0:v.allOf;if(!Array.isArray(_))continue;const w=p.get(_);w?w.push(v):p.set(_,[v])}for(const m of e.intersections)for(const v of p.get(m)??[])vZ(v)}}const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,(c=e.external)!=null&&c.uri){const p=(u=e.external.registry.get(t))==null?void 0:u.id;if(!p)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(p)}Yf(s,n.defId?n.schema:n.def??n.schema);const i=(d=e.metadataRegistry.get(t))==null?void 0:d.id;i!==void 0&&s.id===i&&delete s.id;const o=((f=e.external)==null?void 0:f.defs)??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const p of e.seen.entries()){const m=p[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,aa(o,m.defId,m.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const p=JSON.parse(JSON.stringify(s));return Object.defineProperty(p,"~standard",{value:{...t["~standard"],jsonSchema:{input:N0(t,"input",e.processors),output:N0(t,"output",e.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function os(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return os(r.element,n);if(r.type==="set")return os(r.valueType,n);if(r.type==="lazy")return os(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return os(r.innerType,n);if(r.type==="intersection")return os(r.left,n)||os(r.right,n);if(r.type==="record"||r.type==="map")return os(r.keyType,n)||os(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:os(r.in,n)||os(r.out,n);if(r.type==="object"){for(const s in r.shape)if(os(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(os(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(os(s,n))return!0;return!!(r.rest&&os(r.rest,n))}return!1}const yZ=(e,t={})=>n=>{const r=aO({...n,processors:t});return ar(e,r),lO(r,e),dO(r,e)},N0=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=aO({...s??{},target:i,io:t,processors:n});return ar(e,o),lO(o,e),dO(o,e)},rd=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},sd=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},GC=(e,t)=>{rd(e,"minimum",t),sd(e,"maximum",t)},fO=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},hO=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},pO=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},mO=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},qC=(e,t)=>rd(e,"minimum",t.minimum),YC=(e,t)=>sd(e,"maximum",t.maximum),XC=e=>(t,n)=>{mO(t,n.format);const[r,s]=e[n.format];rd(t,"minimum",r),sd(t,"maximum",s)},T1={greater_than:(e,t)=>rd(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>sd(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>fO(e,t.value),number_format:XC(LI),bigint_format:XC($V),min_length:qC,max_length:YC,length_equals:(e,t)=>GC(e,t.length),min_size:qC,max_size:YC,size_equals:(e,t)=>GC(e,t.size),string_format:(e,t)=>{mO(e,t.format),t.pattern&&hO(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>pO(e,t.mime)};function Fi(e){var i;const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const o of r)(i=T1[o._zod.def.check])==null||i.call(T1,t,o._zod.def);const s=e._zod.bag;s.minimum!==void 0&&rd(t,"minimum",s.minimum),s.exclusiveMinimum!==void 0&&rd(t,"exclusiveMinimum",s.exclusiveMinimum),s.maximum!==void 0&&sd(t,"maximum",s.maximum),s.exclusiveMaximum!==void 0&&sd(t,"exclusiveMaximum",s.exclusiveMaximum),s.multipleOf!==void 0&&fO(t,s.multipleOf),s.format!==void 0&&(t.format??(t.format=s.format),s.format.includes("int")&&(t.isInt=!0)),s.mime&&pO(t,s.mime);for(const o of s.patterns??[])hO(t,o);return t}const _Z={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},wZ=new Map([[YI,Nz],[Cb,Dz]]),gO=e=>wZ.get(e)??e,bZ=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:c,patterns:u,contentEncoding:d,laxFormat:f}=Fi(e);if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),c&&(s.format=_Z[c]??c,s.format===""&&delete s.format,(c==="time"||f)&&delete s.format),d&&(s.contentEncoding=d),u&&u.size>0){const p=[...u].map(gO);p.length===1?s.pattern=p[0].source:p.length>1&&(s.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},xZ=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d,isInt:f}=Fi(e);s.type=f?"integer":"number";const p=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(o??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";if(p?v?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof i=="number"&&(s.minimum=i),m?v?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u:typeof o=="number"&&(s.maximum=o),c){const _=new Set;for(const S of c)Number.isFinite(S)&&S!==0?_.add(Math.abs(S)):ll(e,t,s,r,`A multipleOf divisor of ${S} cannot be represented in JSON Schema`);const[w,...b]=_;w!==void 0&&(s.multipleOf=w),b.length&&(s.allOf=[...s.allOf??[],...b.map(S=>({multipleOf:S}))])}},SZ=(e,t,n,r)=>{n.type="boolean"},EZ=(e,t,n,r)=>{n.not={}},kZ=(e,t,n,r)=>{},CZ=(e,t,n,r)=>{const s=e._zod.def,i=aw(s.entries);if(i.length===0){n.not={};return}i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},PZ=(e,t,n,r)=>{const s=e._zod.def;if(s.values.length===0){n.not={};return}const i=[];for(const o of s.values)if(o===void 0){if(ll(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o=="bigint"){if(ll(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},RZ=(e,t,n,r)=>{ll(e,t,n,r,"Custom types cannot be represented in JSON Schema")},TZ=(e,t,n,r)=>{ll(e,t,n,r,"Transforms cannot be represented in JSON Schema")},AZ=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:c}=Fi(e);typeof o=="number"&&(s.minItems=o),typeof c=="number"&&(s.maxItems=c),s.type="array",s.items=ar(i.element,t,{...r,path:[...r.path,"items"]})};function D0(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?D0(t.out):t.type==="catch"?D0(t.innerType):e._zod.optin}const IZ=(e,t,n,r)=>{var d;const s=n,i=e._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&ll(e,t,s,r,"Symbol keys cannot be represented in JSON Schema"))return;s.type="object",s.properties={};for(const f in o)aa(s.properties,f,ar(o[f],t,{...r,path:[...r.path,"properties",f]}));const u=[];for(const f of Object.keys(o)){const p=i.shape[f];(t.io==="input"?D0(p)===void 0:p._zod.optout===void 0)&&u.push(f)}u.length>0&&(s.required=u),((d=i.catchall)==null?void 0:d._zod.def.type)==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=ar(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},OZ=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((c,u)=>ar(c,t,{...r,path:[...r.path,i?"oneOf":"anyOf",u]}));i?n.oneOf=o:n.anyOf=o},MZ=(e,t,n,r)=>{const s=e._zod.def,i=ar(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=ar(s.right,t,{...r,path:[...r.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,u=[...c(i)?i.allOf:[i],...c(o)?o.allOf:[o]];n.allOf=u,t.intersections.push(u)};function pw(e,t,n){var _;if(t.$ref){if(n.has(t))return t;n.add(t);const w=(_=e.get(t))==null?void 0:_.def;if(!w)return t;const b=pw(e,w,n);return b===w?t:b}for(const w of["anyOf","oneOf"]){const b=t[w];if(!Array.isArray(b))continue;const S=b.map(E=>pw(e,E,n));S.some((E,C)=>E!==b[C])&&(t={...t,[w]:S})}const r=Array.isArray(t.type)?t.type:[t.type],s=!r.includes("string")&&r.some(w=>w==="number"||w==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!s&&!(i!=null&&i.some(w=>typeof w=="number")))return t;const{minimum:o,maximum:c,exclusiveMinimum:u,exclusiveMaximum:d,multipleOf:f,format:p,id:m,...v}=t;return v.enum?v.enum=v.enum.map(w=>typeof w=="number"?String(w):w):typeof v.const=="number"&&(v.const=String(v.const)),s&&(v.type="string",i||(v.pattern=(r.includes("number")?Sb:Bz).source)),v}const mw=new WeakMap;function LZ(e){var r;const t=new Map;for(const s of e.seen.values())s.def&&!t.has(s.schema)&&t.set(s.schema,s);const n=new Map;for(const s of mw.get(e)??[]){const i=e.seen.get(s),o=(r=(i==null?void 0:i.def)??(i==null?void 0:i.schema))==null?void 0:r.propertyNames;if(!o||o===!0||n.has(o))continue;const c=pw(t,o,new Set);c!==o&&n.set(o,c)}if(n.size)for(const s of e.seen.values())for(const i of[s.schema,s.def]){const o=i&&n.get(i.propertyNames);o&&(i.propertyNames=o)}}const $Z=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,c=Fi(o).patterns;if(i.mode==="loose"&&c&&c.size>0){const f=ar(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const p of c)aa(s.patternProperties,gO(p).source,f)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){s.propertyNames=ar(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let f=mw.get(t);f||(f=[],mw.set(t,f),t.deferred.push(()=>LZ(t))),f.push(e)}s.additionalProperties=ar(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}const u=o._zod.values,d=t.io==="input"&&D0(i.valueType)!==void 0;if(u&&!i.partial&&!d){const f=[...u].filter(p=>typeof p=="string"||typeof p=="number");f.length>0&&(s.required=f.map(String))}},NZ=(e,t,n,r)=>{const s=e._zod.def,i=ar(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},DZ=(e,t,n,r)=>{const s=e._zod.def;ar(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},Pb=Symbol();function vO(e,t,n,r,s){let i=!1;const o=JSON.stringify(e,(c,u)=>typeof u!="bigint"?u:(i=!0,null));return i?(ll(t,n,r,s,"BigInt defaults cannot be represented in JSON Schema"),Pb):JSON.parse(o)}const FZ=(e,t,n,r)=>{const s=e._zod.def;ar(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;const o=vO(s.defaultValue,e,t,n,r);o!==Pb&&(n.default=o)},jZ=(e,t,n,r)=>{const s=e._zod.def;ar(s.innerType,t,r);const i=t.seen.get(e);if(i.ref=s.innerType,t.io!=="input")return;const o=vO(s.defaultValue,e,t,n,r);o!==Pb&&(n._prefault=o)},VZ=(e,t,n,r)=>{const s=e._zod.def;ar(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{ll(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=o},zZ=(e,t,n,r)=>{const s=e._zod.def,i=s.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?i?s.out:s.in:s.out;ar(o,t,r);const c=t.seen.get(e);c.ref=o},HZ=(e,t,n,r)=>{const s=e._zod.def;ar(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},yO=(e,t,n,r)=>{const s=e._zod.def;ar(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},QC=new WeakSet([Object.prototype,Error.prototype]);function pm(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const UZ=(e,t)=>{rz.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);QC.has(n)||(QC.add(n),pm(n,"format",r=>s=>oz(r,s)),pm(n,"flatten",r=>s=>iz(r,s)),pm(n,"addIssue",r=>s=>{r.issues.push(s),r.message=JSON.stringify(r.issues,lw,2)}),pm(n,"addIssues",r=>s=>{r.issues.push(...s),r.message=JSON.stringify(r.issues,lw,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},vi=de("ZodError",UZ,void 0,{Parent:Error}),ZZ=_b(vi),BZ=wb(vi),WZ=bb(vi),KZ=xb(vi),GZ=fz(vi),qZ=hz(vi),YZ=pz(vi),XZ=mz(vi),QZ=gz(vi),JZ=vz(vi),eB=yz(vi),tB=_z(vi);function nB(){Vi.localeError||yo(bU())}function Cg(){Vi.memoizer||yo({memoizer:yU()})}const Vn=de("ZodType",(e,t)=>(nB(),jn.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(Ks(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return gl(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(JB(e,t))},superRefine(e,t){return this.check(eW(e,t))},overwrite(e){return this.check(bd(e))},optional(){return t8(this)},exactOptional(){return VB(this)},nullable(){return n8(this)},nullish(){return t8(n8(this))},nonoptional(e){return WB(this,e)},array(){return Rt(this)},or(e){return zh([this,e])},and(e){return NB(this,e)},transform(e){return r8(this,jB(e))},default(e){return UB(this,e)},prefault(e){return BB(this,e)},catch(e){return GB(this,e)},pipe(e){return r8(this,e)},readonly(){return XB(this)},describe(e){const t=this.clone();return If.add(t,{description:e}),t},meta(...e){if(e.length===0)return If.get(this);const t=this.clone();return If.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return NI(this,"~standard",{...BI(this),jsonSchema:{input:N0(this,"input"),output:N0(this,"output")}})},set"~standard"(e){al(this,"~standard",e)},parse:function e(t,n){return ZZ(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await BZ(this,t,n,{callee:e})},safeParse(e,t){return WZ(this,e,t)},async safeParseAsync(e,t){return KZ(this,e,t)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(e){al(this,"spa",e)},validate(e,t){return cz(this,e,t)},validateAsync(e,t){return dz(this,e,t)},encode:function e(t,n){return GZ(this,t,n,{callee:e})},decode:function e(t,n){return qZ(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await YZ(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await XZ(this,t,n,{callee:e})},safeEncode(e,t){return QZ(this,e,t)},safeDecode(e,t){return JZ(this,e,t)},async safeEncodeAsync(e,t){return eB(this,e,t)},async safeDecodeAsync(e,t){return tB(this,e,t)},toJSONSchema(e){return yZ(this,{})(e)},get description(){var e;return(e=If.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),_O=de("_ZodString",(e,t)=>{kb.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bZ(e,n,r)},DI({format:e=>Fi(e).format??null,minLength:e=>Fi(e).minimum??null,maxLength:e=>Fi(e).maximum??null},{regex(...e){return this.check(nZ(...e))},includes(...e){return this.check(iZ(...e))},startsWith(...e){return this.check(oZ(...e))},endsWith(...e){return this.check(aZ(...e))},min(...e){return this.check($0(...e))},max(...e){return this.check(iO(...e))},length(...e){return this.check(oO(...e))},nonempty(...e){return this.check($0(1,...e))},lowercase(e){return this.check(rZ(e))},uppercase(e){return this.check(sZ(e))},trim(){return this.check(cZ())},normalize(...e){return this.check(lZ(...e))},toLowerCase(){return this.check(uZ())},toUpperCase(){return this.check(dZ())},slugify(){return this.check(fZ())}})),rB=de("ZodString",(e,t)=>{kb.init(e,t),_O.init(e,t)},{email(e){return this.check(kU(lB,e))},url(e){return this.check(IU(uB,e))},jwt(e){return this.check(WU(kB,e))},emoji(e){return this.check(OU(dB,e))},guid(e){return this.check(CU(cB,e))},uuid(e){return this.check(PU(mm,e))},uuidv4(e){return this.check(RU(mm,e))},uuidv6(e){return this.check(TU(mm,e))},uuidv7(e){return this.check(AU(mm,e))},nanoid(e){return this.check(MU(fB,e))},cuid(e){return this.check(LU(hB,e))},cuid2(e){return this.check($U(pB,e))},ulid(e){return this.check(NU(mB,e))},base64(e){return this.check(UU(xB,e))},base64url(e){return this.check(ZU(SB,e))},xid(e){return this.check(DU(gB,e))},ksuid(e){return this.check(FU(vB,e))},ipv4(e){return this.check(jU(yB,e))},ipv6(e){return this.check(VU(_B,e))},cidrv4(e){return this.check(zU(wB,e))},cidrv6(e){return this.check(HU(bB,e))},e164(e){return this.check(BU(EB,e))},datetime(e){return this.check(KU(sB,e))},date(e){return this.check(GU(iB,e))},time(e){return this.check(qU(oB,e))},duration(e){return this.check(YU(aB,e))}});function ne(e){return EU(rB,e)}const zn=de("ZodStringFormat",(e,t)=>{Mn.init(e,t),_O.init(e,t)}),sB=de("ZodISODateTime",(e,t)=>{CH.init(e,t),zn.init(e,t)}),iB=de("ZodISODate",(e,t)=>{PH.init(e,t),zn.init(e,t)}),oB=de("ZodISOTime",(e,t)=>{RH.init(e,t),zn.init(e,t)}),aB=de("ZodISODuration",(e,t)=>{TH.init(e,t),zn.init(e,t)}),lB=de("ZodEmail",(e,t)=>{fH.init(e,t),zn.init(e,t)}),cB=de("ZodGUID",(e,t)=>{uH.init(e,t),zn.init(e,t)}),mm=de("ZodUUID",(e,t)=>{dH.init(e,t),zn.init(e,t)}),uB=de("ZodURL",(e,t)=>{yH.init(e,t),zn.init(e,t)}),dB=de("ZodEmoji",(e,t)=>{_H.init(e,t),zn.init(e,t)}),fB=de("ZodNanoID",(e,t)=>{wH.init(e,t),zn.init(e,t)}),hB=de("ZodCUID",(e,t)=>{bH.init(e,t),zn.init(e,t)}),pB=de("ZodCUID2",(e,t)=>{xH.init(e,t),zn.init(e,t)}),mB=de("ZodULID",(e,t)=>{SH.init(e,t),zn.init(e,t)}),gB=de("ZodXID",(e,t)=>{EH.init(e,t),zn.init(e,t)}),vB=de("ZodKSUID",(e,t)=>{kH.init(e,t),zn.init(e,t)}),yB=de("ZodIPv4",(e,t)=>{AH.init(e,t),zn.init(e,t)}),_B=de("ZodIPv6",(e,t)=>{OH.init(e,t),zn.init(e,t)}),wB=de("ZodCIDRv4",(e,t)=>{MH.init(e,t),zn.init(e,t)}),bB=de("ZodCIDRv6",(e,t)=>{$H.init(e,t),zn.init(e,t)}),xB=de("ZodBase64",(e,t)=>{NH.init(e,t),zn.init(e,t)}),SB=de("ZodBase64URL",(e,t)=>{FH.init(e,t),zn.init(e,t)}),EB=de("ZodE164",(e,t)=>{jH.init(e,t),zn.init(e,t)}),kB=de("ZodJWT",(e,t)=>{zH.init(e,t),zn.init(e,t)}),wO=de("ZodNumber",(e,t)=>{XI.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>xZ(e,n,r,s),e.isFinite=!0},DI({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=Fi(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=Fi(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=Fi(e);return!!t||!!(n!=null&&n.some(Number.isSafeInteger))},format:e=>Fi(e).format??null},{gt(e,t){return this.check(UC(e,t))},gte(e,t){return this.check(R1(e,t))},min(e,t){return this.check(R1(e,t))},lt(e,t){return this.check(HC(e,t))},lte(e,t){return this.check(P1(e,t))},max(e,t){return this.check(P1(e,t))},int(e){return this.check(JC(e))},safe(e){return this.check(JC(e))},positive(e){return this.check(UC(0,e))},nonnegative(e){return this.check(R1(0,e))},negative(e){return this.check(HC(0,e))},nonpositive(e){return this.check(P1(0,e))},multipleOf(e,t){return this.check(ZC(e,t))},step(e,t){return this.check(ZC(e,t))},finite(){return this}}));function Pn(e){return XU(wO,e)}const CB=de("ZodNumberFormat",(e,t)=>{HH.init(e,t),wO.init(e,t)});function JC(e){return QU(CB,e)}const PB=de("ZodBoolean",(e,t)=>{UH.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>SZ(e,n,r)});function Rs(e){return JU(PB,e)}const RB=de("ZodUnknown",(e,t)=>{ZH.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>kZ()});function gw(){return eZ(RB)}const TB=de("ZodNever",(e,t)=>{BH.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>EZ(e,n,r)});function AB(e){return tZ(TB,e)}const IB=de("ZodArray",(e,t)=>{Cg(),GH.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>AZ(e,n,r,s),e.element=t.element},{min(e,t){return this.check($0(e,t))},nonempty(e){return this.check($0(1,e))},max(e,t){return this.check(iO(e,t))},length(e,t){return this.check(oO(e,t))},unwrap(){return this.element}});function Rt(e,t){return hZ(IB,e,t)}const OB=de("ZodObject",(e,t)=>{Cg(),XH.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>IZ(e,n,r,s),qV(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Vt(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Ks(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Ks(this._zod.def,{catchall:gw()}))},loose(){return this.clone(Ks(this._zod.def,{catchall:gw()}))},strict(){return this.clone(Ks(this._zod.def,{catchall:AB()}))},strip(){return this.clone(Ks(this._zod.def,{catchall:void 0}))},extend(e){return FV(this,e)},safeExtend(e){return jV(this,e)},merge(e){return VV(this,e)},pick(e){return NV(this,e)},omit(e){return DV(this,e)},partial(...e){return EC(xO,this,e[0])},exactPartial(...e){return EC(SO,this,e[0],"exactPartial")},required(...e){return zV(EO,this,e[0])}});function Ve(e,t){const n={type:"object",shape:e??{},...nt(t)};return new OB(n)}const bO=de("ZodUnion",(e,t)=>{eO.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>OZ(e,n,r,s),e.options=t.options});function zh(e,t){return new bO({type:"union",options:e,...nt(t)})}const MB=de("ZodDiscriminatedUnion",(e,t)=>{bO.init(e,t),JH.init(e,t)});function LB(e,t,n){return new MB({type:"union",options:t,discriminator:e,...nt(n)})}const $B=de("ZodIntersection",(e,t)=>{eU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>MZ(e,n,r,s)});function NB(e,t){return new $B({type:"intersection",left:e,right:t})}const e8=de("ZodRecord",(e,t)=>{Cg(),tU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>$Z(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function Rb(e,t,n){return!t||!t._zod?new e8({type:"record",keyType:ne(),valueType:e,...nt(t)}):new e8({type:"record",keyType:e,valueType:t,...nt(n)})}const vw=de("ZodEnum",(e,t)=>{nU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(r,s,i)=>CZ(e,r,s),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new vw({...t,checks:[],...nt(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new vw({...t,checks:[],...nt(s),entries:i})}});function Vt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new vw({type:"enum",entries:n,...nt(t)})}const DB=de("ZodLiteral",(e,t)=>{rU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>PZ(e,n,r,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function id(e,t){return new DB({type:"literal",values:Array.isArray(e)?e:[e],...nt(t)})}const FB=de("ZodTransform",(e,t)=>{Cg(),sU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>TZ(e,n,r,s),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new jI(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(dh(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=n.value),o.inst??(o.inst=e),n.issues.push(dh(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function jB(e){return new FB({type:"transform",transform:e})}const xO=de("ZodOptional",(e,t)=>{tO.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yO(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function t8(e){return new xO({type:"optional",innerType:e})}const SO=de("ZodExactOptional",(e,t)=>{iU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yO(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function VB(e){return new SO({type:"optional",innerType:e})}const zB=de("ZodNullable",(e,t)=>{oU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>NZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function n8(e){return new zB({type:"nullable",innerType:e})}const HB=de("ZodDefault",(e,t)=>{aU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>FZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function UB(e,t){return new HB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():OI(t)}})}const ZB=de("ZodPrefault",(e,t)=>{lU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>jZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function BB(e,t){return new ZB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():OI(t)}})}const EO=de("ZodNonOptional",(e,t)=>{cU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>DZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function WB(e,t){return new EO({type:"nonoptional",innerType:e,...nt(t)})}const KB=de("ZodCatch",(e,t)=>{uU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>VZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function GB(e,t){return new KB({type:"catch",innerType:e,catchValue:typeof t=="function"?t:XV(t)})}const qB=de("ZodPipe",(e,t)=>{dU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>zZ(e,n,r,s),e.in=t.in,e.out=t.out});function r8(e,t){return new qB({type:"pipe",in:e,out:t})}const YB=de("ZodReadonly",(e,t)=>{fU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>HZ(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function XB(e){return new YB({type:"readonly",innerType:e})}const QB=de("ZodCustom",(e,t)=>{hU.init(e,t),Vn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>RZ(e,n,r,s)});function JB(e,t={}){return pZ(QB,e,t)}function eW(e,t){return mZ(e,t)}const kO={custom:"custom"},Ps=(e,t=String(e))=>e instanceof Error?e.message:t,tW=["multiple_lockfiles","unsupported_package_manager","invalid_package_manager_field","invalid_manifest","invalid_workspace","path_outside_workspace","dangling_symlink","version_unreadable","version_mismatch","no_install_command","install_failed","lockfile_outdated","engine_incompatible","install_script_failed","installer_unstoppable","inputs_changed"],CO=["ENOENT","EACCES","EPERM","EEXIST","ENOTDIR","EISDIR","ELOOP","ENOSPC","EMFILE","EADDRINUSE","ECONNREFUSED","ECONNRESET","ETIMEDOUT","EBUSY","ENOTSUP","EINVAL","ENOTEMPTY","EROFS","EAI_AGAIN"],nW=["timeout","aborted","unknown"],PO=[...tW,...CO,...nW];new Set(PO);new Set(CO);const Zs=Pn().finite().nonnegative().max(Number.MAX_SAFE_INTEGER),rW=Ve({command:Vt(["open","status","stop","wait","auth.status","variants.start","variants.status","variants.get","variants.list","variants.complete","variants.cancel","reference.fetch","evidence.capture","context.add","context.update","context.list","context.show","context.enable","context.disable","context.remove","context.resolve","context.inspect","context.verifier","context.verify"]).optional(),tool_name:Vt(["rivet_login","rivet_explore_designs","rivet_get_exploration","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:Vt(["claude","codex","cursor","unknown","other"]).optional(),mcp_editor:Vt(["claude","claude-desktop","codex","cursor","unknown","other"]).optional(),source:Vt(["cli","mcp","core","ui","visual_editor"]).optional(),surface:Vt(["cli","mcp","visual_editor"]).optional(),mode:Vt(["initial_generation","zero_to_one","source_grounded","comment_refine","vary","history_adoption","commit","unknown"]).optional(),entry_point:Vt(["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:Vt(["existing","fresh"]).optional(),preview_kind:Vt(["dev_server","static_artifact"]).optional(),provider:Vt(["pinterest","arena","cosmos","x"]).optional(),request_status:Vt(["accepted","rejected","completed","failed","cancelled","degraded","superseded"]).optional(),error_code:Vt(["OPERATION_FAILED","USAGE_ERROR","AUTH_REQUIRED","SERVER_UNAVAILABLE","WAIT_TIMEOUT","SESSION_NOT_FOUND","WORK_ITEM_NOT_FOUND","DIRECTION_AMBIGUOUS","MCP_REMOVED","STATIC_PREVIEW_FAILED","DEV_SERVER_FAILED","PREVIEW_UNAVAILABLE","DEPENDENCY_INSTALL_FAILED","DEV_SERVER_START_FAILED","DEV_SCRIPT_MISSING"]).optional(),reason_code:Vt(PO).optional(),failure_reason:Vt(["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","direction_ambiguous","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(),verification_outcome:Vt(["pass","fail","blocked","package_required","verifier_missing","verifier_stale","cancelled","timeout","output_limit","process_failed","invalid_result","invalid_evidence","cleanup_failed","setup_failed"]).optional(),verification_check_count:Zs.int().optional(),verification_duration_ms:Zs.optional(),ok:Rs().optional(),is_recoverable:Rs().optional(),is_fresh:Rs().optional(),duration_ms:Zs.optional(),dwell_ms_from_terminal:Zs.optional(),exit_code:Zs.optional(),requested_count:Zs.optional(),accepted_count:Zs.optional(),work_item_count:Zs.optional(),completed_count:Zs.optional(),failed_count:Zs.optional(),cancelled_count:Zs.optional(),reference_count:Zs.optional(),changed_files_count:Zs.optional()}),sW=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.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"]),iW=(e,t)=>{if(!sW.has(e))return null;const n={};for(const[r,s]of Object.entries(rW.shape)){const i=s.safeParse(t[r]);i.success&&i.data!==void 0&&(n[r]=i.data)}return n};var Yt;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(const c of i)o[c]=s[c];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.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},e.find=(s,i)=>{for(const o of s)if(i(o))return o},e.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)}e.joinValues=r,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Yt||(Yt={}));var s8;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(s8||(s8={}));const Ye=Yt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Da=e=>{switch(typeof e){case"undefined":return Ye.undefined;case"string":return Ye.string;case"number":return Number.isNaN(e)?Ye.nan:Ye.number;case"boolean":return Ye.boolean;case"function":return Ye.function;case"bigint":return Ye.bigint;case"symbol":return Ye.symbol;case"object":return Array.isArray(e)?Ye.array:e===null?Ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ye.promise:typeof Map<"u"&&e instanceof Map?Ye.map:typeof Set<"u"&&e instanceof Set?Ye.set:typeof Date<"u"&&e instanceof Date?Ye.date:Ye.object;default:return Ye.unknown}},Re=Yt.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 ra extends Error{get errors(){return this.issues}constructor(t){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=t}format(t){const n=t||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 c=r,u=0;for(;u<o.path.length;){const d=o.path[u],f=u===o.path.length-1;if(d==="_errors"){f&&c._errors.push(n(o)),u++;continue}Object.prototype.hasOwnProperty.call(c,d)||(d==="__proto__"?Object.defineProperty(c,d,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):c[d]={_errors:[]}),c=c[d],f&&c._errors.push(n(o)),u++}}};return s(this),r}static assert(t){if(!(t instanceof ra))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Yt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ra.create=e=>new ra(e);const yw=(e,t)=>{let n;switch(e.code){case Re.invalid_type:e.received===Ye.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Yt.jsonStringifyReplacer)}`;break;case Re.unrecognized_keys:n=`Unrecognized key(s) in object: ${Yt.joinValues(e.keys,", ")}`;break;case Re.invalid_union:n="Invalid input";break;case Re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Yt.joinValues(e.options)}`;break;case Re.invalid_enum_value:n=`Invalid enum value. Expected ${Yt.joinValues(e.options)}, received '${e.received}'`;break;case Re.invalid_arguments:n="Invalid function arguments";break;case Re.invalid_return_type:n="Invalid function return type";break;case Re.invalid_date:n="Invalid date";break;case Re.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Yt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Re.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Re.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Re.custom:n="Invalid input";break;case Re.invalid_intersection_types:n="Intersection results could not be merged";break;case Re.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Re.not_finite:n="Number must be finite";break;default:n=t.defaultError,Yt.assertNever(e)}return{message:n}};let oW=yw;function aW(){return oW}const lW=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let c="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)c=d(o,{data:t,defaultError:c}).message;return{...s,path:i,message:c}};function je(e,t){const n=aW(),r=lW({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===yw?void 0:yw].filter(s=>!!s)});e.common.issues.push(r)}class qs{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return vt;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return qs.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return vt;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}}const vt=Object.freeze({status:"aborted"}),Of=e=>({status:"dirty",value:e}),yi=e=>({status:"valid",value:e}),i8=e=>e.status==="aborted",o8=e=>e.status==="dirty",od=e=>e.status==="valid",F0=e=>typeof Promise<"u"&&e instanceof Promise;var tt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(tt||(tt={}));class cl{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,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 a8=(e,t)=>{if(od(t))return{success:!0,data:t.value};if(!e.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 ra(e.common.issues);return this._error=n,this._error}}};function Mt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,c)=>{const{message:u}=e;return o.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??r??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},description:s}}class Kt{get description(){return this._def.description}_getType(t){return Da(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Da(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qs,ctx:{common:t.parent.common,data:t.data,parsedType:Da(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(F0(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,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:t,parsedType:Da(t)},s=this._parseSync({data:t,path:r.path,parent:r});return a8(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Da(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return od(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:t,path:[],parent:n}).then(i=>od(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,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:t,parsedType:Da(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(F0(s)?s:Promise.resolve(s));return a8(r,i)}refine(t,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=t(s),c=()=>i.addIssue({code:Re.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new ld({schema:this,typeName:yt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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 rl.create(this,this._def)}nullable(){return cd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mo.create(this)}promise(){return H0.create(this,this._def)}or(t){return V0.create([this,t],this._def)}and(t){return z0.create(this,t,this._def)}transform(t){return new ld({...Mt(this._def),schema:this,typeName:yt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ww({...Mt(this._def),innerType:this,defaultValue:n,typeName:yt.ZodDefault})}brand(){return new IW({typeName:yt.ZodBranded,type:this,...Mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new bw({...Mt(this._def),innerType:this,catchValue:n,typeName:yt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Tb.create(this,t)}readonly(){return xw.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cW=/^c[^\s-]{8,}$/i,uW=/^[0-9a-z]+$/,dW=/^[0-9A-HJKMNP-TV-Z]{26}$/i,fW=/^[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,hW=/^[a-z0-9_-]{21}$/i,pW=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,mW=/^[-+]?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)?)??$/,gW=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vW="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";let A1;const yW=/^(?:(?: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])$/,_W=/^(?:(?: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])$/,wW=/^(([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]))$/,bW=/^(([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])$/,xW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,SW=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,RO="((\\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])))",EW=new RegExp(`^${RO}$`);function TO(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function kW(e){return new RegExp(`^${TO(e)}$`)}function CW(e){let t=`${RO}T${TO(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function PW(e,t){return!!((t==="v4"||!t)&&yW.test(e)||(t==="v6"||!t)&&wW.test(e))}function RW(e,t){if(!pW.test(e))return!1;try{const[n]=e.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||t&&s.alg!==t)}catch{return!1}}function TW(e,t){return!!((t==="v4"||!t)&&_W.test(e)||(t==="v6"||!t)&&bW.test(e))}class Qa extends Kt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ye.string){const i=this._getOrReturnCtx(t);return je(i,{code:Re.invalid_type,expected:Ye.string,received:i.parsedType}),vt}const r=new qs;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),je(s,{code:Re.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),je(s,{code:Re.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,c=t.data.length<i.value;(o||c)&&(s=this._getOrReturnCtx(t,s),o?je(s,{code:Re.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&je(s,{code:Re.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")gW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"email",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")A1||(A1=new RegExp(vW,"u")),A1.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"emoji",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")fW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"uuid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")hW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"nanoid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")cW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"cuid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")uW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"cuid2",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")dW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"ulid",code:Re.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),je(s,{validation:"url",code:Re.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"regex",code:Re.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),je(s,{code:Re.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),je(s,{code:Re.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),je(s,{code:Re.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?CW(i).test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{code:Re.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?EW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{code:Re.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?kW(i).test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{code:Re.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?mW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"duration",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?PW(t.data,i.version)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"ip",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?RW(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"jwt",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?TW(t.data,i.version)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"cidr",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?xW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"base64",code:Re.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?SW.test(t.data)||(s=this._getOrReturnCtx(t,s),je(s,{validation:"base64url",code:Re.invalid_string,message:i.message}),r.dirty()):Yt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Re.invalid_string,...tt.errToObj(r)})}_addCheck(t){return new Qa({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...tt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...tt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...tt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...tt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...tt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...tt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...tt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...tt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...tt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...tt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...tt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...tt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...tt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...tt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...tt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...tt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...tt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...tt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...tt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...tt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...tt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...tt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...tt.errToObj(n)})}nonempty(t){return this.min(1,tt.errToObj(t))}trim(){return new Qa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Qa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Qa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Qa.create=e=>new Qa({checks:[],typeName:yt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Mt(e)});function AW(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return i%o/10**s}class fh extends Kt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ye.number){const i=this._getOrReturnCtx(t);return je(i,{code:Re.invalid_type,expected:Ye.number,received:i.parsedType}),vt}let r;const s=new qs;for(const i of this._def.checks)i.kind==="int"?Yt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),je(r,{code:Re.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),je(r,{code:Re.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),je(r,{code:Re.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?AW(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),je(r,{code:Re.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),je(r,{code:Re.not_finite,message:i.message}),s.dirty()):Yt.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,tt.toString(n))}setLimit(t,n,r,s){return new fh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:tt.toString(s)}]})}_addCheck(t){return new fh({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:tt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:tt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:tt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:tt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:tt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Yt.isInteger(t.value))}get isFinite(){let t=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"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}fh.create=e=>new fh({checks:[],typeName:yt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Mt(e)});class hh extends Kt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ye.bigint)return this._getInvalidInput(t);let r;const s=new qs;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),je(r,{code:Re.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),je(r,{code:Re.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),je(r,{code:Re.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Yt.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return je(n,{code:Re.invalid_type,expected:Ye.bigint,received:n.parsedType}),vt}gte(t,n){return this.setLimit("min",t,!0,tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,tt.toString(n))}setLimit(t,n,r,s){return new hh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:tt.toString(s)}]})}_addCheck(t){return new hh({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:tt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}hh.create=e=>new hh({checks:[],typeName:yt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Mt(e)});class l8 extends Kt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ye.boolean){const r=this._getOrReturnCtx(t);return je(r,{code:Re.invalid_type,expected:Ye.boolean,received:r.parsedType}),vt}return yi(t.data)}}l8.create=e=>new l8({typeName:yt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Mt(e)});class j0 extends Kt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ye.date){const i=this._getOrReturnCtx(t);return je(i,{code:Re.invalid_type,expected:Ye.date,received:i.parsedType}),vt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return je(i,{code:Re.invalid_date}),vt}const r=new qs;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),je(s,{code:Re.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),je(s,{code:Re.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Yt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new j0({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:tt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:tt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}j0.create=e=>new j0({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:yt.ZodDate,...Mt(e)});class c8 extends Kt{_parse(t){if(this._getType(t)!==Ye.symbol){const r=this._getOrReturnCtx(t);return je(r,{code:Re.invalid_type,expected:Ye.symbol,received:r.parsedType}),vt}return yi(t.data)}}c8.create=e=>new c8({typeName:yt.ZodSymbol,...Mt(e)});class u8 extends Kt{_parse(t){if(this._getType(t)!==Ye.undefined){const r=this._getOrReturnCtx(t);return je(r,{code:Re.invalid_type,expected:Ye.undefined,received:r.parsedType}),vt}return yi(t.data)}}u8.create=e=>new u8({typeName:yt.ZodUndefined,...Mt(e)});class d8 extends Kt{_parse(t){if(this._getType(t)!==Ye.null){const r=this._getOrReturnCtx(t);return je(r,{code:Re.invalid_type,expected:Ye.null,received:r.parsedType}),vt}return yi(t.data)}}d8.create=e=>new d8({typeName:yt.ZodNull,...Mt(e)});class f8 extends Kt{constructor(){super(...arguments),this._any=!0}_parse(t){return yi(t.data)}}f8.create=e=>new f8({typeName:yt.ZodAny,...Mt(e)});class h8 extends Kt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return yi(t.data)}}h8.create=e=>new h8({typeName:yt.ZodUnknown,...Mt(e)});class ul extends Kt{_parse(t){const n=this._getOrReturnCtx(t);return je(n,{code:Re.invalid_type,expected:Ye.never,received:n.parsedType}),vt}}ul.create=e=>new ul({typeName:yt.ZodNever,...Mt(e)});class p8 extends Kt{_parse(t){if(this._getType(t)!==Ye.undefined){const r=this._getOrReturnCtx(t);return je(r,{code:Re.invalid_type,expected:Ye.void,received:r.parsedType}),vt}return yi(t.data)}}p8.create=e=>new p8({typeName:yt.ZodVoid,...Mt(e)});class mo extends Kt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Ye.array)return je(n,{code:Re.invalid_type,expected:Ye.array,received:n.parsedType}),vt;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,c=n.data.length<s.exactLength.value;(o||c)&&(je(n,{code:o?Re.too_big:Re.too_small,minimum:c?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&&(je(n,{code:Re.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&&(je(n,{code:Re.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,c)=>s.type._parseAsync(new cl(n,o,n.path,c)))).then(o=>qs.mergeArray(r,o));const i=[...n.data].map((o,c)=>s.type._parseSync(new cl(n,o,n.path,c)));return qs.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new mo({...this._def,minLength:{value:t,message:tt.toString(n)}})}max(t,n){return new mo({...this._def,maxLength:{value:t,message:tt.toString(n)}})}length(t,n){return new mo({...this._def,exactLength:{value:t,message:tt.toString(n)}})}nonempty(t){return this.min(1,t)}}mo.create=(e,t)=>new mo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:yt.ZodArray,...Mt(t)});function mu(e){if(e instanceof rr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=rl.create(mu(r))}return new rr({...e._def,shape:()=>t})}else return e instanceof mo?new mo({...e._def,type:mu(e.element)}):e instanceof rl?rl.create(mu(e.unwrap())):e instanceof cd?cd.create(mu(e.unwrap())):e instanceof bc?bc.create(e.items.map(t=>mu(t))):e}class rr extends Kt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Yt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ye.object){const d=this._getOrReturnCtx(t);return je(d,{code:Re.invalid_type,expected:Ye.object,received:d.parsedType}),vt}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof ul&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||c.push(d);const u=[];for(const d of o){const f=i[d],p=s.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new cl(s,p,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof ul){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of c)u.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")c.length>0&&(je(s,{code:Re.unrecognized_keys,keys:c}),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 c){const p=s.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new cl(s,p,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const p=await f.key,m=await f.value;d.push({key:p,value:m,alwaysSet:f.alwaysSet})}return d}).then(d=>qs.mergeObjectSync(r,d)):qs.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return tt.errToObj,new rr({...this._def,unknownKeys:"strict",...t!==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:tt.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new rr({...this._def,unknownKeys:"strip"})}passthrough(){return new rr({...this._def,unknownKeys:"passthrough"})}extend(t){return new rr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new rr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:yt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new rr({...this._def,catchall:t})}pick(t){const n={};for(const r of Yt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new rr({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Yt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new rr({...this._def,shape:()=>n})}deepPartial(){return mu(this)}partial(t){const n={};for(const r of Yt.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new rr({...this._def,shape:()=>n})}required(t){const n={};for(const r of Yt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof rl;)i=i._def.innerType;n[r]=i}return new rr({...this._def,shape:()=>n})}keyof(){return AO(Yt.objectKeys(this.shape))}}rr.create=(e,t)=>new rr({shape:()=>e,unknownKeys:"strip",catchall:ul.create(),typeName:yt.ZodObject,...Mt(t)});rr.strictCreate=(e,t)=>new rr({shape:()=>e,unknownKeys:"strict",catchall:ul.create(),typeName:yt.ZodObject,...Mt(t)});rr.lazycreate=(e,t)=>new rr({shape:e,unknownKeys:"strip",catchall:ul.create(),typeName:yt.ZodObject,...Mt(t)});class V0 extends Kt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(i){for(const c of i)if(c.result.status==="valid")return c.result;for(const c of i)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=i.map(c=>new ra(c.ctx.common.issues));return je(n,{code:Re.invalid_union,unionErrors:o}),vt}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 c=o.map(u=>new ra(u));return je(n,{code:Re.invalid_union,unionErrors:c}),vt}}get options(){return this._def.options}}V0.create=(e,t)=>new V0({options:e,typeName:yt.ZodUnion,...Mt(t)});function _w(e,t){const n=Da(e),r=Da(t);if(e===t)return{valid:!0,data:e};if(n===Ye.object&&r===Ye.object){const s=Yt.objectKeys(t),i=Yt.objectKeys(e).filter(c=>s.indexOf(c)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const c of i){if(c==="__proto__")continue;const u=_w(e[c],t[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(n===Ye.array&&r===Ye.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const o=e[i],c=t[i],u=_w(o,c);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===Ye.date&&r===Ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class z0 extends Kt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,o)=>{if(i8(i)||i8(o))return vt;const c=_w(i.value,o.value);return c.valid?((o8(i)||o8(o))&&n.dirty(),{status:n.value,value:c.data}):(je(r,{code:Re.invalid_intersection_types}),vt)};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}))}}z0.create=(e,t,n)=>new z0({left:e,right:t,typeName:yt.ZodIntersection,...Mt(n)});class bc extends Kt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.array)return je(r,{code:Re.invalid_type,expected:Ye.array,received:r.parsedType}),vt;if(r.data.length<this._def.items.length)return je(r,{code:Re.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vt;!this._def.rest&&r.data.length>this._def.items.length&&(je(r,{code:Re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new cl(r,o,r.path,c)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>qs.mergeArray(n,o)):qs.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new bc({...this._def,rest:t})}}bc.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bc({items:e,typeName:yt.ZodTuple,rest:null,...Mt(t)})};class m8 extends Kt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.map)return je(r,{code:Re.invalid_type,expected:Ye.map,received:r.parsedType}),vt;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([c,u],d)=>({key:s._parse(new cl(r,c,r.path,[d,"key"])),value:i._parse(new cl(r,u,r.path,[d,"value"]))}));if(r.common.async){const c=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 vt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),c.set(d.value,f.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of o){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return vt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),c.set(d.value,f.value)}return{status:n.value,value:c}}}}m8.create=(e,t,n)=>new m8({valueType:t,keyType:e,typeName:yt.ZodMap,...Mt(n)});class ph extends Kt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.set)return je(r,{code:Re.invalid_type,expected:Ye.set,received:r.parsedType}),vt;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(je(r,{code:Re.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&&(je(r,{code:Re.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 vt;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const c=[...r.data.values()].map((u,d)=>i._parse(new cl(r,u,r.path,d)));return r.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(t,n){return new ph({...this._def,minSize:{value:t,message:tt.toString(n)}})}max(t,n){return new ph({...this._def,maxSize:{value:t,message:tt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ph.create=(e,t)=>new ph({valueType:e,minSize:null,maxSize:null,typeName:yt.ZodSet,...Mt(t)});class g8 extends Kt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}g8.create=(e,t)=>new g8({getter:e,typeName:yt.ZodLazy,...Mt(t)});class v8 extends Kt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return je(n,{received:n.data,code:Re.invalid_literal,expected:this._def.value}),vt}return{status:"valid",value:t.data}}get value(){return this._def.value}}v8.create=(e,t)=>new v8({value:e,typeName:yt.ZodLiteral,...Mt(t)});function AO(e,t){return new ad({values:e,typeName:yt.ZodEnum,...Mt(t)})}class ad extends Kt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return je(n,{expected:Yt.joinValues(r),received:n.parsedType,code:Re.invalid_type}),vt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return je(n,{received:n.data,code:Re.invalid_enum_value,options:r}),vt}return yi(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ad.create(t,{...this._def,...n})}exclude(t,n=this._def){return ad.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ad.create=AO;class y8 extends Kt{_parse(t){const n=Yt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ye.string&&r.parsedType!==Ye.number){const s=Yt.objectValues(n);return je(r,{expected:Yt.joinValues(s),received:r.parsedType,code:Re.invalid_type}),vt}if(this._cache||(this._cache=new Set(Yt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Yt.objectValues(n);return je(r,{received:r.data,code:Re.invalid_enum_value,options:s}),vt}return yi(t.data)}get enum(){return this._def.values}}y8.create=(e,t)=>new y8({values:e,typeName:yt.ZodNativeEnum,...Mt(t)});class H0 extends Kt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ye.promise&&n.common.async===!1)return je(n,{code:Re.invalid_type,expected:Ye.promise,received:n.parsedType}),vt;const r=n.parsedType===Ye.promise?n.data:Promise.resolve(n.data);return yi(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}H0.create=(e,t)=>new H0({type:e,typeName:yt.ZodPromise,...Mt(t)});class ld extends Kt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===yt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:o=>{je(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 c=>{if(n.value==="aborted")return vt;const u=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return u.status==="aborted"?vt:u.status==="dirty"||n.value==="dirty"?Of(u.value):u});{if(n.value==="aborted")return vt;const c=this._def.schema._parseSync({data:o,path:r.path,parent:r});return c.status==="aborted"?vt:c.status==="dirty"||n.value==="dirty"?Of(c.value):c}}if(s.type==="refinement"){const o=c=>{const u=s.refinement(c,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 c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?vt:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?vt:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.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(!od(o))return vt;const c=s.transform(o.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>od(o)?Promise.resolve(s.transform(o.value,i)).then(c=>({status:n.value,value:c})):vt);Yt.assertNever(s)}}ld.create=(e,t,n)=>new ld({schema:e,typeName:yt.ZodEffects,effect:t,...Mt(n)});ld.createWithPreprocess=(e,t,n)=>new ld({schema:t,effect:{type:"preprocess",transform:e},typeName:yt.ZodEffects,...Mt(n)});class rl extends Kt{_parse(t){return this._getType(t)===Ye.undefined?yi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}rl.create=(e,t)=>new rl({innerType:e,typeName:yt.ZodOptional,...Mt(t)});class cd extends Kt{_parse(t){return this._getType(t)===Ye.null?yi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}cd.create=(e,t)=>new cd({innerType:e,typeName:yt.ZodNullable,...Mt(t)});class ww extends Kt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ye.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ww.create=(e,t)=>new ww({innerType:e,typeName:yt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Mt(t)});class bw extends Kt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return F0(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ra(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ra(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}bw.create=(e,t)=>new bw({innerType:e,typeName:yt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Mt(t)});class _8 extends Kt{_parse(t){if(this._getType(t)!==Ye.nan){const r=this._getOrReturnCtx(t);return je(r,{code:Re.invalid_type,expected:Ye.nan,received:r.parsedType}),vt}return{status:"valid",value:t.data}}}_8.create=e=>new _8({typeName:yt.ZodNaN,...Mt(e)});class IW extends Kt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Tb extends Kt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);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"?vt:i.status==="dirty"?(n.dirty(),Of(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"?vt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new Tb({in:t,out:n,typeName:yt.ZodPipeline})}}class xw extends Kt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(od(s)&&(s.value=Object.freeze(s.value)),s);return F0(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}xw.create=(e,t)=>new xw({innerType:e,typeName:yt.ZodReadonly,...Mt(t)});var yt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(yt||(yt={}));const Su=Qa.create;ul.create;const OW=mo.create,IO=rr.create;V0.create;z0.create;bc.create;const MW=ad.create;H0.create;rl.create;cd.create;const LW=IO({hash:Su().regex(/^[a-f0-9]{64}$/),mimeType:MW(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),OO=IO({id:Su().min(1),title:Su().trim().min(1),url:Su().url().refine(e=>{try{const t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}}).optional(),reason:Su().optional(),image:LW.optional().catch(void 0)}).refine(e=>!!(e.url||e.image),{message:"A reference requires a public URL or an image"}),$W=(...e)=>{const t=[],n=new Set,r=new Set;for(const s of e.flatMap(i=>i??[])){const i=OO.safeParse(s);if(!i.success)continue;const o=i.data,c=o.url?new URL(o.url).href:void 0;if(n.has(o.id)||c&&r.has(c)){const u=t.find(d=>d.url===c&&(c!==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}t.push({...o,...c?{url:c}:{}}),n.add(o.id),c&&r.add(c)}return t.length?t:void 0},NW=6,mh=100,w8=100,DW=35*1024*1024,b8=Math.ceil(DW/3)*4,FW=Vt(["pinterest","arena","x","cosmos"]),Ab=Vt(["image",...FW.options,"text","pdf","variant"]),Hh=Vt(["codex","claude","cursor"]),MO=Ve({projectId:ne().min(1).max(200),sessionId:ne().min(1).max(200),variantId:ne().min(1).max(200)}).strict();MO.extend({runtime:Hh,note:ne().trim().max(500).optional(),imageFile:ne().min(1).max(2048).optional()});const LO=MO.extend({treeSha:ne().max(100).optional()}),jW=Ve({hash:ne().regex(/^[a-f0-9]{64}$/),mimeType:Vt(["image/png","image/jpeg","image/webp","image/gif"]),bytes:Pn().int().positive(),representation:Vt(["image","video-cover","page","variant"]).default("image"),page:Pn().int().positive().optional()});Ve({provider:Ab,remoteId:ne().trim().min(1).max(2048),title:ne().trim().min(1).max(500),url:ne().url().optional()});const $O=Ve({provider:Ab,remoteId:ne().trim().min(1).max(2048),title:ne().max(1e3),text:ne().max(1e5),url:ne().url().optional(),media:Rt(jW).max(100),remoteImages:Rt(ne().url()).max(100).optional(),remoteImageRepresentations:Rt(Vt(["image","video-cover"])).max(100).optional(),unsupportedReason:ne().max(1e3).optional(),variant:LO.optional(),note:ne().max(500).optional()}),NO=Ve({inputTokens:Pn().nonnegative().optional(),outputTokens:Pn().nonnegative().optional(),cachedInputTokens:Pn().nonnegative().optional(),allocation:id("equal-share").optional()}),eue=Ve({referenceId:ne().min(1),revision:Pn().int().positive(),description:ne().trim().min(1).max(8e3),runtime:zh([Hh,id("user")]),evidence:Vt(["observation","preference"]),usage:NO.optional()}),tue=$O.extend({id:ne(),revision:Pn()}),VW=Ve({requestId:ne().min(1).max(200),instruction:ne().min(1).max(3e4),runtime:Hh,mode:Vt(["auto","off","uploads"]).default("off"),excludedSourceIds:Rt(ne()).max(100).default([]),excludedReferenceIds:Rt(ne()).max(100).default([]),excludedMediaHashes:Rt(ne()).max(100).default([]),suppliedInputHashes:Rt(ne().regex(/^[a-f0-9]{64}$/)).max(mh).optional()});VW.extend({mode:Vt(["auto","off","uploads"]).default("uploads"),uploads:Rt(ne().max(b8+w8)).max(mh).optional()}).refine(e=>(e.uploads??[]).reduce((t,n)=>t+n.length,0)<=b8+mh*w8,"Supplied images exceed the profile upload budget");const zW=gw().transform((e,t)=>{const n=OO.safeParse(e);return n.success?n.data:(t.addIssue({code:kO.custom,message:"Invalid supplied image reference"}),FI)}),x8=Ve({suppliedReferences:Rt(zW).max(mh).optional(),failedUploadCount:Pn().int().min(0).max(mh).optional(),usage:NO.optional(),requestId:ne(),status:Vt(["selected","empty","off","unavailable","timeout"]),queries:Rt(ne()),candidateIds:Rt(ne()),selected:Rt(Ve({id:ne(),revision:Pn(),title:ne().optional(),url:ne().url().optional(),mediaHashes:Rt(ne().regex(/^[a-f0-9]{64}$/)).optional(),reason:ne(),sourceTitles:Rt(ne()),variant:LO.optional()})),contextText:ne().max(6e3),images:Rt(Ve({path:ne(),hash:ne().regex(/^[a-f0-9]{64}$/),mimeType:Vt(["image/png","image/jpeg","image/webp","image/gif"])})).max(NW),durationMs:Pn()});x8.pick({requestId:!0,suppliedReferences:!0,failedUploadCount:!0,status:!0,selected:!0,images:!0,durationMs:!0}).extend({requestId:ne().min(1).max(200),selected:x8.shape.selected.max(3)});const nue=200,Ib=Ve({id:ne(),name:ne(),pinnedAt:ne().nullable().optional(),lastOpenedAt:ne(),projectPath:ne(),isAvailable:Rs(),storageKind:Vt(["project","bundle"]),issue:ne().optional(),historyIssue:ne().optional()}),HW=Ve({dataUrl:ne(),label:ne(),capturedAt:ne()}),UW=Ve({projectId:ne(),sessionId:ne(),variantId:ne(),label:ne(),brief:ne(),createdAt:ne(),hasStaticPreview:Rs(),hasInteractivePreview:Rs()}),rue=Ve({projects:Rt(Ib),variants:Rt(UW)}),DO=Ve({error:ne()}),ZW=Ve({errorCode:ne(),message:ne()}),BW=Ve({error:ne().optional(),details:zh([ne(),Ve({formErrors:Rt(ne()).optional(),fieldErrors:Rb(ne(),Rt(ne()).optional()).optional()})]).optional()}),WW=Ve({token:ne().min(1)}),KW=Ve({url:ne().url()}),sue=Ve({projects:Rt(Ib)}),iue=Ve({project:Ib}),oue=Ve({projectId:ne()}),aue=Ve({preview:HW.nullable()}),lue=Ve({projectPath:ne().nullable()}),cue=Ve({editorUrl:ne()}),uue=Ve({url:ne()}),due=Ve({saved:id(!0)}),GW=Ve({requestId:ne(),sequence:Pn(),projectId:ne().optional(),sessionId:ne().optional(),variantId:ne().optional()}),fue=Ve({navigations:Rt(GW)}),hue=Ve({acknowledged:Rs()}),FO=Ve({profile:Ve({isEnabled:Rs()}),sources:Rt(Ve({provider:Ab,title:ne(),url:ne().nullable()}))}),jO=Ve({id:ne(),revision:ne(),collectionCount:Pn(),referenceCount:Pn(),imageCount:Pn(),reusableCount:Pn(),unsupportedCount:Pn(),scopeDisclosure:ne(),usageDisclosure:ne()}),qW=Ve({isAuthenticated:Rs(),email:ne().optional(),name:ne().optional(),userId:ne().optional()}),I1=ne().min(1).max(500),VO=Ve({pinned:Rt(I1).max(1e3),order:Ve({groups:Rt(I1).max(1e3),rows:Rb(ne(),Rt(I1).max(1e3))})}),YW=Ve({projectPath:ne(),uiState:VO});Ve({uiState:VO,projectPath:ne().optional()});const XW=e=>WW.parse(e).token,S8="The library returned an invalid response.",Pg="rivet_library_token";let sa="",ud=0,Qo=null,U0=null,E8=!1;const Sw=new Set,gh=()=>Sw.forEach(e=>e()),pue=()=>Qo??U0,mue=()=>ud,vh=()=>{try{const e=window.localStorage.getItem(Pg)??"";sa!==e&&(ud+=1),sa=e,Qo=null}catch{Qo="Rivet cannot access browser storage. Allow site storage and try again."}},zO=()=>{E8||(window.addEventListener("storage",e=>{e.key!==Pg&&e.key!==null||(vh(),gh())}),E8=!0)},gue=()=>!!sa,vue=e=>(zO(),Sw.add(e),()=>Sw.delete(e)),QW=(e,t)=>{if(t!==void 0&&vh(),t!==void 0&&t!==ud)throw new Error("Sign-in was cancelled because the browser login changed.");try{window.localStorage.setItem(Pg,e)}catch{throw Qo="Rivet cannot save browser access. Allow site storage and try again.",gh(),new Error(Qo)}sa=e,ud+=1,Qo=null,U0=null,gh()},HO=()=>{sa="",ud+=1,Qo=null;try{window.localStorage.removeItem(Pg)}catch{Qo="Rivet cannot clear browser storage. Allow site storage and try again."}gh()},JW=async()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;zO(),vh();const e=ud,t=new URLSearchParams(window.location.hash.slice(1)).get("code");if(t){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:t})});if(n.ok){QW(XW(await n.json()),e);return}n.status>=500&&!sa&&(U0="Rivet is temporarily unavailable. Please retry this link.")}catch{!sa&&!Qo&&(U0="Rivet could not open this link. Please retry when the server is available.")}}gh()},UO=async(e,t={})=>{vh();const n=sa,r=new Headers(t.headers);r.set("Authorization",`Bearer ${n}`);const s=await fetch(e,{...t,headers:r});return s.status===401&&(vh(),sa===n&&HO()),s},eK=async(e,{schema:t,...n})=>{const r=await UO(`/api/library${e}`,{method:n.method??"GET",signal:n.signal,headers:{"Content-Type":"application/json"},...n.body!==void 0?{body:JSON.stringify(n.body)}:{}});return tK(r,t)},tK=async(e,t)=>{const n=await e.text();let r;try{r=JSON.parse(n)}catch{if(e.ok)throw new Error(S8)}if(!e.ok){if(e.status===401)throw new Error("Sign in to access this library.");const i=DO.safeParse(r),o=i.success&&i.data.error.trim()?i.data.error:`Library request failed (${e.status}).`;throw new Error(o)}const s=t.safeParse(r);if(!s.success)throw new Error(S8);return s.data},Dt=(e,t={})=>{if(!window.location.pathname.startsWith("/rivet/library")){const n=new Headers(t.headers),r=eF();return r&&QD(e,t.method)&&n.set(qD,r),fetch(e,{...t,headers:n,redirect:"error"})}return UO(e,t)};let ZO="off";const k8=e=>{ZO=e},nK=()=>ZO==="full",BO=({userId:e,email:t})=>{nK()&&(e?(Xe.identify(e,t?{email:t}:{}),t&&Xe.alias(t,e)):t&&Xe.identify(t,{email:t}))},rK="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",sK=3e3,iK=/^plugin-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,oK=e=>({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:e,isIdentifiedID:!1},before_send:t=>{const n=iW(t.event,t.properties);return n&&Dt("/api/telemetry/events",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:t.event,properties:n}),keepalive:!0}).catch(()=>{}),null}}),aK=async()=>{try{const e=await Dt("/api/telemetry",{signal:AbortSignal.timeout(sK),cache:"no-store"});if(!e.ok)return;const t=await e.json();if(t.mode!=="full"&&t.mode!=="metrics"||t.mode==="metrics"&&(typeof t.distinctId!="string"||!iK.test(t.distinctId)))return;const n=t.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.28.2",env:"production"})};n==="metrics"&&Object.assign(s,oK(t.distinctId),{api_host:window.location.origin}),Xe.init(rK,s),k8(n)}catch{k8("off")}},WO=g.createContext(void 0),Uh=e=>{const t=g.useContext(WO);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},lK=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),P.jsx(WO.Provider,{value:e,children:t})),cK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var Va,Z2,UT,uK=(UT=class{constructor(){rt(this,Va,cK);rt(this,Z2,!1)}setTimeoutProvider(e){$e(this,Va,e)}setTimeout(e,t){return Z(this,Va).setTimeout(e,t)}clearTimeout(e){Z(this,Va).clearTimeout(e)}setInterval(e,t){return Z(this,Va).setInterval(e,t)}clearInterval(e){Z(this,Va).clearInterval(e)}},Va=new WeakMap,Z2=new WeakMap,UT);const Ql=new uK;function dK(e){setTimeout(e,0)}const fK=typeof window>"u"||"Deno"in globalThis;function us(){}function hK(e,t){return typeof e=="function"?e(t):e}function KO(e){return typeof e=="number"&&e>=0&&e!==1/0}function GO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function In(e,t){return typeof e=="function"?e(t):e}function C8(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==Ob(o,t.options))return!1}else if(!dd(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||s&&s!==t.state.fetchStatus||i&&!i(t))}function P8(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(xc(t.options.mutationKey)!==xc(i))return!1}else if(!dd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Ob(e,t){return((t==null?void 0:t.queryKeyHashFn)||xc)(e)}function xc(e){return JSON.stringify(e,(t,n)=>Ew(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function dd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(!dd(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!dd(e[r],t[r]))return!1;return!0}return!1}const qO=Object.prototype.hasOwnProperty;function YO(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=R8(e)&&R8(t);if(!r&&!(Ew(e)&&Ew(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),o=i.length,c=r?new Array(o):{};let u=0;for(let d=0;d<o;d++){const f=r?d:i[d],p=e[f],m=t[f];if(p===m){c[f]=p,(r?d<s:qO.call(e,f))&&u++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){c[f]=m;continue}const v=YO(p,m,n+1);c[f]=v,v===p&&u++}return s===o&&u===s?e:c}function Gm(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!qO.call(t,n)||e[n]!==t[n])return!1;return!0}function R8(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ew(e){if(!T8(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!T8(r)||!r.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function T8(e){return Object.prototype.toString.call(e)==="[object Object]"}function pK(e){return new Promise(t=>{Ql.setTimeout(t,e)})}function kw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?YO(e,t):t}function mK(e){return e}function gK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(-n):r}function vK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,n):r}const Mb=Symbol();function XO(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Mb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Lb(e,t){return typeof e=="function"?e(...t):!!e}const $b=Symbol();function yK(e,t,n,r){let s=!1,i;return Object.defineProperties(e,{[$b]:{value:r},signal:{enumerable:!0,get:()=>(i??(i=t()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}}),e}let _K=()=>fK;const Nb=()=>_K();var xd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tc,za,Nu,ZT,wK=(ZT=class extends xd{constructor(){super();rt(this,tc);rt(this,za);rt(this,Nu);$e(this,Nu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,za)||this.setEventListener(Z(this,Nu))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,za))==null||t.call(this),$e(this,za,void 0))}setEventListener(t){var n;$e(this,Nu,t),(n=Z(this,za))==null||n.call(this),$e(this,za,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,tc)!==t&&($e(this,tc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Z(this,tc)=="boolean"?Z(this,tc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},tc=new WeakMap,za=new WeakMap,Nu=new WeakMap,ZT);const Db=new wK,bK=dK;function xK(){let e=[],t=0,n=c=>{c()},r=c=>{c()},s=bK;const i=c=>{t?e.push(c):s(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&s(()=>{r(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;t++;try{u=c()}finally{t--,t||o()}return u},batchCalls:c=>(...u)=>{i(()=>{c(...u)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{s=c}}}const pr=xK();var Du,Ha,Fu,BT,SK=(BT=class extends xd{constructor(){super();rt(this,Du,!0);rt(this,Ha);rt(this,Fu);$e(this,Fu,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,Ha)||this.setEventListener(Z(this,Fu))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,Ha))==null||t.call(this),$e(this,Ha,void 0))}setEventListener(t){var n;$e(this,Fu,t),(n=Z(this,Ha))==null||n.call(this),$e(this,Ha,t(this.setOnline.bind(this)))}setOnline(t){Z(this,Du)!==t&&($e(this,Du,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return Z(this,Du)}},Du=new WeakMap,Ha=new WeakMap,Fu=new WeakMap,BT);const Z0=new SK;function EK(e){return Math.min(1e3*2**e,3e4)}function QO(e){return(e??"online")==="online"?Z0.isOnline():!0}var Cw=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function JO(e){let t=!1,n=0,r,s="pending",i,o;const c=new Promise((E,C)=>{i=E,o=C});c.catch(us);const u=()=>s!=="pending",d=E=>{var C;if(!u()){const R=new Cw(E);w(R),(C=e.onCancel)==null||C.call(e,R)}},f=()=>{t=!0},p=()=>{t=!1},m=()=>Db.isFocused()&&(e.networkMode==="always"||Z0.isOnline())&&e.canRun(),v=()=>QO(e.networkMode)&&e.canRun(),_=E=>{u()||(r==null||r(),s="resolved",i(E))},w=E=>{u()||(r==null||r(),s="rejected",o(E))},b=E=>new Promise(C=>{var R;r=T=>{(u()||E())&&C(T)},(R=e.onPause)==null||R.call(e)}).then(()=>{var C;r=void 0,u()||(C=e.onContinue)==null||C.call(e)}),S=()=>{if(u())return;let E;const C=n===0?e.initialPromise:void 0;try{E=C??e.fn()}catch(R){E=Promise.reject(R)}Promise.resolve(E).then(_).catch(R=>{var L;if(u())return;const T=e.retry??(Nb()?0:3),O=e.retryDelay??EK,M=typeof O=="function"?O(n,R):O,A=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,R);if(t||!A){w(R);return}n++,(L=e.onFail)==null||L.call(e,n,R),pK(M).then(()=>u()||m()?void 0:b(m)).then(()=>{t?w(R):S()})})};return{promise:c,status:()=>s,cancel:d,continue:()=>(r==null||r(),c),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?S():b(v).then(S),c)}}var nc,WT,eM=(WT=class{constructor(){rt(this,nc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),KO(this.gcTime)&&$e(this,nc,Ql.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nb()?1/0:3e5))}clearGcTimeout(){Z(this,nc)!==void 0&&(Ql.clearTimeout(Z(this,nc)),$e(this,nc,void 0))}},nc=new WeakMap,WT);function kK(e){return{onFetch:(t,n)=>{var f,p,m,v,_;const r=t.options,s=(m=(p=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((v=t.state.data)==null?void 0:v.pages)||[],o=((_=t.state.data)==null?void 0:_.pageParams)||[];let c={pages:[],pageParams:[]},u=0;const d=async()=>{let w=!1;const b=t,S=R=>{yK(R,()=>t.signal,()=>w=!0,b[$b])},E=XO(t.options,t.fetchOptions),C=async(R,T,O)=>{if(w)return Promise.reject(t.signal.reason);if(T==null&&R.pages.length)return Promise.resolve(R);const A=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:T,direction:O?"backward":"forward",meta:t.options.meta};return S(z),z})(),L=await E(A),{maxPages:V}=t.options,W=O?vK:gK;return{pages:W(R.pages,L,V),pageParams:W(R.pageParams,T,V)}};if(s&&i.length){const R=s==="backward",T=R?CK:A8,O={pages:i,pageParams:o};c=await C(O,T(r,O),R)}else{const R=e??i.length;do{const T=u===0?o[0]===void 0?r.initialPageParam:o[0]:A8(r,c);if(u>0&&T==null)break;c=await C(c,T),u++}while(u<R)}return c};t.options.persister?t.fetchFn=()=>{var w,b;return(b=(w=t.options).persister)==null?void 0:b.call(w,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function A8(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function CK(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ju,rc,Vu,di,sc,Cr,Zo,Lh,ic,Li,zo,KT,PK=(KT=class extends eM{constructor(t){super();rt(this,Li);rt(this,ju);rt(this,rc);rt(this,Vu);rt(this,di);rt(this,sc);rt(this,Cr);rt(this,Zo);rt(this,Lh);rt(this,ic);$e(this,ic,!1),$e(this,Lh,t.defaultOptions),this.setOptions(t.options),this.observers=[],$e(this,sc,t.client),$e(this,di,Z(this,sc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,$e(this,rc,O8(this.options)),this.state=t.state??Z(this,rc),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return Z(this,ju)}get promise(){var t;return(t=Z(this,Cr))==null?void 0:t.promise}setOptions(t){if(this.options={...Z(this,Lh),...t},t!=null&&t._type&&$e(this,ju,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=O8(this.options);n.data!==void 0&&(this.setState(I8(n.data,n.dataUpdatedAt)),$e(this,rc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Z(this,di).remove(this)}setData(t,n){const r=kw(this.state.data,t,this.options);return bt(this,Li,zo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){bt(this,Li,zo).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=Z(this,Cr))==null?void 0:r.promise;return(s=Z(this,Cr))==null||s.cancel(t),n?n.then(us).catch(us):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Z(this,rc)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>In(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mb||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data===void 0?!1:this.getObserversCount()>0?this.observers.some(t=>In(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!GO(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Cr))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Cr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Z(this,di).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(Z(this,Cr)&&(Z(this,ic)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?Z(this,Cr).cancel({revert:!0}):Z(this,Cr).cancelRetry()),this.scheduleGc()),Z(this,di).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||bt(this,Li,zo).call(this,{type:"invalidate"})}async fetch(t,n){var f,p,m,v;if(this.state.fetchStatus!=="idle"&&((f=Z(this,Cr))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,Cr)&&Z(this,Zo))return Z(this,Cr).continueRetry(),Z(this,Zo)}if(t&&this.setOptions(t),!this.options.queryFn){const _=this.observers.find(w=>w.options.queryFn);_&&this.setOptions(_.options)}const r=new AbortController,s=_=>{Object.defineProperties(_,{[$b]:{value:r.signal,enumerable:!0},signal:{enumerable:!0,get:()=>($e(this,ic,!0),r.signal)}})},i=()=>{const _=XO(this.options,n),b=(()=>{const S={client:Z(this,sc),queryKey:this.queryKey,meta:this.meta};return s(S),S})();return $e(this,ic,!1),this.options.persister?this.options.persister(_,b,this):_(b)},c=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Z(this,sc),state:this.state,fetchFn:i};return s(_),_})();(p=Z(this,ju)==="infinite"?kK(this.options.pages):this.options.behavior)==null||p.onFetch(c,this),$e(this,Vu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&bt(this,Li,zo).call(this,{type:"fetch",meta:(v=c.fetchOptions)==null?void 0:v.meta});const u=$e(this,Cr,JO({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:_=>{_ instanceof Cw&&_.revert&&this.setState({...Z(this,Vu),fetchStatus:"idle"}),r.abort()},onFail:(_,w)=>{bt(this,Li,zo).call(this,{type:"failed",failureCount:_,error:w})},onPause:()=>{bt(this,Li,zo).call(this,{type:"pause"})},onContinue:()=>{bt(this,Li,zo).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0})),d=(async()=>{var _,w,b,S,E,C,R,T;try{const O=await u.promise;if(O===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(O),(w=(_=Z(this,di).config).onSuccess)==null||w.call(_,O,this),(S=(b=Z(this,di).config).onSettled)==null||S.call(b,O,this.state.error,this),O}catch(O){if(O instanceof Cw){if(O.silent){if(Z(this,Cr)!==u&&Z(this,Zo))return Z(this,Zo);throw O}else if(O.revert){if(this.state.data===void 0)throw O;return this.state.data}}throw bt(this,Li,zo).call(this,{type:"error",error:O}),(C=(E=Z(this,di).config).onError)==null||C.call(E,O,this),(T=(R=Z(this,di).config).onSettled)==null||T.call(R,this.state.data,O,this),O}finally{Z(this,Cr)===u&&($e(this,Cr,void 0),$e(this,Zo,void 0)),this.scheduleGc()}})();return $e(this,Zo,d),u.start(),d}},ju=new WeakMap,rc=new WeakMap,Vu=new WeakMap,di=new WeakMap,sc=new WeakMap,Cr=new WeakMap,Zo=new WeakMap,Lh=new WeakMap,ic=new WeakMap,Li=new WeakSet,zo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...tM(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...I8(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return $e(this,Vu,t.manual?s:void 0),s;case"error":const i=t.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,...t.state}}};this.state=n(this.state),pr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),Z(this,di).notify({query:this,type:"updated",action:t})})},KT);function tM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:QO(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function I8(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function O8(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 as,jt,$h,ls,oc,zu,Bo,Nh,Hu,Uu,ac,lc,Ua,Zu,nn,Mf,Pw,Rw,Tw,Aw,Iw,Ow,Mw,Lw,GT,RK=(GT=class extends xd{constructor(t,n){super();rt(this,nn);rt(this,as);rt(this,jt);rt(this,$h);rt(this,ls);rt(this,oc);rt(this,zu);rt(this,Bo);rt(this,Nh);rt(this,Hu);rt(this,Uu);rt(this,ac);rt(this,lc);rt(this,Ua);rt(this,Zu,new Set);this.options=n,$e(this,as,t),$e(this,Bo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,jt).addObserver(this),M8(Z(this,jt),this.options)?bt(this,nn,Mf).call(this):this.updateResult(),bt(this,nn,Iw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $w(Z(this,jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $w(Z(this,jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,bt(this,nn,Ow).call(this),bt(this,nn,Mw).call(this),Z(this,jt).removeObserver(this)}setOptions(t){const n=this.options,r=Z(this,jt);if(this.options=Z(this,as).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof In(this.options.enabled,Z(this,jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");bt(this,nn,Lw).call(this),Z(this,jt).setOptions(this.options),n._defaulted&&!Gm(this.options,n)&&Z(this,as).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,jt),observer:this});const s=this.hasListeners();s&&L8(Z(this,jt),r,this.options,n)&&bt(this,nn,Mf).call(this),this.updateResult(),s&&(Z(this,jt)!==r||In(this.options.enabled,Z(this,jt))!==In(n.enabled,Z(this,jt))||In(this.options.staleTime,Z(this,jt))!==In(n.staleTime,Z(this,jt)))&&bt(this,nn,Rw).call(this);const i=bt(this,nn,Tw).call(this);s&&(Z(this,jt)!==r||In(this.options.enabled,Z(this,jt))!==In(n.enabled,Z(this,jt))||i!==Z(this,Ua))&&bt(this,nn,Aw).call(this,i)}getOptimisticResult(t){const n=Z(this,as).getQueryCache().build(Z(this,as),t),r=this.createResult(n,t);return Gm(this.getCurrentResult(),r)||($e(this,ls,r),$e(this,zu,this.options),$e(this,oc,Z(this,jt).state)),r}getCurrentResult(){return Z(this,ls)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(t){Z(this,Zu).add(t)}getCurrentQuery(){return Z(this,jt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,as).defaultQueryOptions(t),r=Z(this,as).getQueryCache().build(Z(this,as),n);let s=()=>{},i;const o=new Promise(c=>{i=c,s=Z(this,as).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),c(this.createResult(r,n)))})});return Promise.race([r.fetch(n).then(()=>{const c=this.createResult(r,n);return i==null||i(c),c}).finally(()=>{s()}),o])}fetch(t){return bt(this,nn,Mf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,ls)))}createResult(t,n){var O;const r=Z(this,jt),s=this.options,i=Z(this,ls),o=Z(this,oc),c=Z(this,zu),u=t!==r?t.state:Z(this,$h),{state:d}=t;let f={...d},p=!1,m;if(n._optimisticResults){const M=this.hasListeners(),A=!M&&M8(t,n),L=M&&L8(t,r,n,s);(A||L)&&(f={...f,...tM(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:_,status:w}=f;m=f.data;let b=!1;if(n.placeholderData!==void 0&&m===void 0&&w==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(M=i.data,b=!0):M=typeof n.placeholderData=="function"?n.placeholderData((O=Z(this,Uu))==null?void 0:O.state.data,Z(this,Uu)):n.placeholderData,M!==void 0&&(w="success",m=kw(i==null?void 0:i.data,M,n),p=!0)}if(n.select&&m!==void 0&&!b)if(i&&m===(o==null?void 0:o.data)&&n.select===Z(this,Nh))m=Z(this,Hu);else try{$e(this,Nh,n.select),m=n.select(m),m=kw(i==null?void 0:i.data,m,n),$e(this,Hu,m),$e(this,Bo,null)}catch(M){$e(this,Bo,M)}else m===void 0&&$e(this,Bo,null);Z(this,Bo)&&(v=Z(this,Bo),m=Z(this,Hu),_=(i==null?void 0:i.error)===v?i.errorUpdatedAt:Date.now(),w="error",p=!1);const S=f.fetchStatus==="fetching",E=w==="pending",C=w==="error",R=E&&S,T=m!==void 0;return{status:w,fetchStatus:f.fetchStatus,isPending:E,isSuccess:w==="success",isError:C,isInitialLoading:R,isLoading:R,data:m,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:_,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!E,isLoadingError:C&&!T,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:C&&T,isStale:Fb(t,n),refetch:this.refetch,isEnabled:In(n.enabled,t)!==!1}}updateResult(){const t=Z(this,ls),n=this.createResult(Z(this,jt),this.options);if($e(this,oc,Z(this,jt).state),$e(this,zu,this.options),Z(this,oc).data!==void 0&&$e(this,Uu,Z(this,jt)),Gm(n,t))return;$e(this,ls,n);const s=(()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!Z(this,Zu).size||this.options.throwOnError&&Z(this,ls).error!==t.error)return!0;for(const c of o??Z(this,Zu))if(Z(this,ls)[c]!==t[c])return!0;return!1})();pr.batch(()=>{s&&this.listeners.forEach(i=>{i(Z(this,ls))}),Z(this,as).getQueryCache().notify({query:Z(this,jt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&bt(this,nn,Iw).call(this)}},as=new WeakMap,jt=new WeakMap,$h=new WeakMap,ls=new WeakMap,oc=new WeakMap,zu=new WeakMap,Bo=new WeakMap,Nh=new WeakMap,Hu=new WeakMap,Uu=new WeakMap,ac=new WeakMap,lc=new WeakMap,Ua=new WeakMap,Zu=new WeakMap,nn=new WeakSet,Mf=function(t){bt(this,nn,Lw).call(this);let n=Z(this,jt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(us)),n},Pw=function(t){return!Nb()&&In(this.options.enabled,Z(this,jt))!==!1&&KO(t)},Rw=function(){bt(this,nn,Ow).call(this);const t=In(this.options.staleTime,Z(this,jt));if(Z(this,ls).isStale||!bt(this,nn,Pw).call(this,t))return;const n=GO(Z(this,ls).dataUpdatedAt,t)+1;$e(this,ac,Ql.setTimeout(()=>{Z(this,ls).isStale||this.updateResult()},n))},Tw=function(){return In(this.options.refetchInterval,Z(this,jt))??!1},Aw=function(t){bt(this,nn,Mw).call(this),$e(this,Ua,t),!(Z(this,Ua)===0||!bt(this,nn,Pw).call(this,Z(this,Ua)))&&$e(this,lc,Ql.setInterval(()=>{(this.options.refetchIntervalInBackground||Db.isFocused())&&bt(this,nn,Mf).call(this)},Z(this,Ua)))},Iw=function(){bt(this,nn,Rw).call(this),bt(this,nn,Aw).call(this,bt(this,nn,Tw).call(this))},Ow=function(){Z(this,ac)!==void 0&&(Ql.clearTimeout(Z(this,ac)),$e(this,ac,void 0))},Mw=function(){Z(this,lc)!==void 0&&(Ql.clearInterval(Z(this,lc)),$e(this,lc,void 0))},Lw=function(){const t=Z(this,as).getQueryCache().build(Z(this,as),this.options);if(t===Z(this,jt))return;const n=Z(this,jt);$e(this,jt,t),$e(this,$h,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},GT);function TK(e,t){return In(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&In(t.retryOnMount,e)===!1)}function M8(e,t){return TK(e,t)||e.state.data!==void 0&&$w(e,t,t.refetchOnMount)}function $w(e,t,n){if(In(t.enabled,e)!==!1&&In(t.staleTime,e)!=="static"){const r=In(n,e);return r==="always"||r!==!1&&Fb(e,t)}return!1}function L8(e,t,n,r){return(e!==t||In(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Fb(e,n)}function Fb(e,t){return In(t.enabled,e)!==!1&&e.isStaleByTime(In(t.staleTime,e))}var Dh,io,Yr,cc,oo,$a,qT,AK=(qT=class extends eM{constructor(t){super();rt(this,oo);rt(this,Dh);rt(this,io);rt(this,Yr);rt(this,cc);$e(this,Dh,t.client),this.mutationId=t.mutationId,$e(this,Yr,t.mutationCache),$e(this,io,[]),this.state=t.state||nM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,io).includes(t)||(Z(this,io).push(t),this.clearGcTimeout(),Z(this,Yr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){$e(this,io,Z(this,io).filter(n=>n!==t)),this.scheduleGc(),Z(this,Yr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,io).length||(this.state.status==="pending"?this.scheduleGc():Z(this,Yr).remove(this))}continue(){var t;return((t=Z(this,cc))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var c,u,d,f,p,m,v,_,w,b,S,E,C,R,T,O,M,A;const n=()=>{bt(this,oo,$a).call(this,{type:"continue"})},r={client:Z(this,Dh),meta:this.options.meta,mutationKey:this.options.mutationKey},s=$e(this,cc,JO({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,V)=>{bt(this,oo,$a).call(this,{type:"failed",failureCount:L,error:V})},onPause:()=>{bt(this,oo,$a).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Z(this,Yr).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{bt(this,oo,$a).call(this,{type:"pending",variables:t,isPaused:o}),Z(this,Yr).config.onMutate&&await Z(this,Yr).config.onMutate(t,this,r);const V=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t,r));V!==this.state.context&&bt(this,oo,$a).call(this,{type:"pending",context:V,variables:t,isPaused:o})}this.state.isPaused&&s.canStart()&&n();const L=await s.start();return await((f=(d=Z(this,Yr).config).onSuccess)==null?void 0:f.call(d,L,t,this.state.context,this,r)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,L,t,this.state.context,r)),await((_=(v=Z(this,Yr).config).onSettled)==null?void 0:_.call(v,L,null,this.state.variables,this.state.context,this,r)),await((b=(w=this.options).onSettled)==null?void 0:b.call(w,L,null,t,this.state.context,r)),bt(this,oo,$a).call(this,{type:"success",data:L}),L}catch(L){try{await((E=(S=Z(this,Yr).config).onError)==null?void 0:E.call(S,L,t,this.state.context,this,r))}catch(V){Promise.reject(V)}try{await((R=(C=this.options).onError)==null?void 0:R.call(C,L,t,this.state.context,r))}catch(V){Promise.reject(V)}try{await((O=(T=Z(this,Yr).config).onSettled)==null?void 0:O.call(T,void 0,L,this.state.variables,this.state.context,this,r))}catch(V){Promise.reject(V)}try{await((A=(M=this.options).onSettled)==null?void 0:A.call(M,void 0,L,t,this.state.context,r))}catch(V){Promise.reject(V)}throw bt(this,oo,$a).call(this,{type:"error",error:L}),L}finally{Z(this,cc)===s&&$e(this,cc,void 0),Z(this,Yr).runNext(this)}}},Dh=new WeakMap,io=new WeakMap,Yr=new WeakMap,cc=new WeakMap,oo=new WeakSet,$a=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),pr.batch(()=>{Z(this,io).forEach(r=>{r.onMutationUpdate(t)}),Z(this,Yr).notify({mutation:this,type:"updated",action:t})})},qT);function nM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Za,$i,Fh,YT,IK=(YT=class extends xd{constructor(t={}){super();rt(this,Za);rt(this,$i);rt(this,Fh);this.config=t,$e(this,Za,new Set),$e(this,$i,new Map),$e(this,Fh,0)}build(t,n,r){const s=new AK({client:t,mutationCache:this,mutationId:++Yp(this,Fh)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){Z(this,Za).add(t);const n=gm(t);if(typeof n=="string"){const r=Z(this,$i).get(n);r?r.push(t):Z(this,$i).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Z(this,Za).delete(t)){const n=gm(t);if(typeof n=="string"){const r=Z(this,$i).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&Z(this,$i).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=gm(t);if(typeof n=="string"){const s=(r=Z(this,$i).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r,s;const n=gm(t);return typeof n=="string"?((s=(r=Z(this,$i).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){pr.batch(()=>{const t=this.getAll();Z(this,Za).clear(),Z(this,$i).clear(),t.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(Z(this,Za))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>P8(n,r))}findAll(t={}){return this.getAll().filter(n=>P8(t,n))}notify(t){pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return pr.batch(()=>Promise.all(t.map(n=>n.continue().catch(us))))}},Za=new WeakMap,$i=new WeakMap,Fh=new WeakMap,YT);function gm(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Wo,Ba,Xr,jh,po,Lf,Nw,XT,OK=(XT=class extends xd{constructor(n,r){super();rt(this,po);rt(this,Wo);rt(this,Ba);rt(this,Xr);rt(this,jh);$e(this,Wo,n),this.setOptions(r),this.bindMethods(),bt(this,po,Lf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=Z(this,Wo).defaultMutationOptions(n),Gm(this.options,r)||Z(this,Wo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Z(this,Xr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&xc(r.mutationKey)!==xc(this.options.mutationKey)?this.reset():((s=Z(this,Xr))==null?void 0:s.state.status)==="pending"&&Z(this,Xr).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&Z(this,Xr)&&(Z(this,Xr).addObserver(this),bt(this,po,Lf).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=Z(this,Xr))==null||n.removeObserver(this)}onMutationUpdate(n){bt(this,po,Lf).call(this),bt(this,po,Nw).call(this,n)}getCurrentResult(){return Z(this,Ba)}reset(){var n;(n=Z(this,Xr))==null||n.removeObserver(this),$e(this,Xr,void 0),bt(this,po,Lf).call(this),bt(this,po,Nw).call(this)}mutate(n,r){var s;return $e(this,jh,r),(s=Z(this,Xr))==null||s.removeObserver(this),$e(this,Xr,Z(this,Wo).getMutationCache().build(Z(this,Wo),this.options)),Z(this,Xr).addObserver(this),Z(this,Xr).execute(n)}},Wo=new WeakMap,Ba=new WeakMap,Xr=new WeakMap,jh=new WeakMap,po=new WeakSet,Lf=function(){var r;const n=((r=Z(this,Xr))==null?void 0:r.state)??nM();$e(this,Ba,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Nw=function(n){pr.batch(()=>{var s,i,o,c;const r=Z(this,jh);if(r&&this.hasListeners()){const u=Z(this,Ba).variables,d=Z(this,Ba).context,f={client:Z(this,Wo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=r.onSuccess)==null||s.call(r,n.data,u,d,f)}catch(p){Promise.reject(p)}try{(i=r.onSettled)==null||i.call(r,n.data,null,u,d,f)}catch(p){Promise.reject(p)}}else if((n==null?void 0:n.type)==="error"){try{(o=r.onError)==null||o.call(r,n.error,u,d,f)}catch(p){Promise.reject(p)}try{(c=r.onSettled)==null||c.call(r,void 0,n.error,u,d,f)}catch(p){Promise.reject(p)}}}this.listeners.forEach(u=>{u(Z(this,Ba))})})},XT),ao,QT,MK=(QT=class extends xd{constructor(t={}){super();rt(this,ao);this.config=t,$e(this,ao,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??Ob(s,n);let o=this.get(i);return o||(o=new PK({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){Z(this,ao).has(t.queryHash)||(Z(this,ao).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){Z(this,ao).get(t.queryHash)===t&&(t.destroy(),Z(this,ao).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,ao).get(t)}getAll(){return[...Z(this,ao).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>C8(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>C8(t,r)):n}notify(t){pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){pr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ao=new WeakMap,QT),Dn,Wa,Ka,Bu,Wu,Ga,Ku,Gu,JT,LK=(JT=class{constructor(e={}){rt(this,Dn);rt(this,Wa);rt(this,Ka);rt(this,Bu);rt(this,Wu);rt(this,Ga);rt(this,Ku);rt(this,Gu);$e(this,Dn,e.queryCache||new MK),$e(this,Wa,e.mutationCache||new IK),$e(this,Ka,e.defaultOptions||{}),$e(this,Bu,new Map),$e(this,Wu,new Map),$e(this,Ga,0)}mount(){Yp(this,Ga)._++,Z(this,Ga)===1&&($e(this,Ku,Db.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,Dn).onFocus())})),$e(this,Gu,Z0.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,Dn).onOnline())})))}unmount(){var e,t;Yp(this,Ga)._--,Z(this,Ga)===0&&((e=Z(this,Ku))==null||e.call(this),$e(this,Ku,void 0),(t=Z(this,Gu))==null||t.call(this),$e(this,Gu,void 0))}isFetching(e){return Z(this,Dn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,Wa).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,Dn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Z(this,Dn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(In(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Z(this,Dn).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var o;const r=this.defaultQueryOptions({queryKey:e}),s=(o=Z(this,Dn).get(r.queryHash))==null?void 0:o.state.data,i=hK(t,s);if(i!==void 0)return Z(this,Dn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return pr.batch(()=>Z(this,Dn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,Dn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Z(this,Dn);pr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,Dn);return pr.batch(()=>{const r=n.findAll(e),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=pr.batch(()=>Z(this,Dn).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(us).catch(us)}invalidateQueries(e,t={}){return pr.batch(()=>(Z(this,Dn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=pr.batch(()=>Z(this,Dn).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);const o=s.state.fetchStatus==="paused";return(!n.throwOnError||o)&&(i=i.catch(us)),o?Promise.resolve():i}));return Promise.all(r).then(us)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Z(this,Dn).build(this,t),r=n.isStaleByTime(In(t.staleTime,n))?await n.fetch(t):n.state.data,s=t.select;return s?s(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Z(this,Dn).build(this,t);return n.isStaleByTime(In(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(us).catch(us)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(us).catch(us)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Z0.isOnline()?Z(this,Wa).resumePausedMutations():Promise.resolve()}getQueryCache(){return Z(this,Dn)}getMutationCache(){return Z(this,Wa)}getDefaultOptions(){return Z(this,Ka)}setDefaultOptions(e){$e(this,Ka,e)}setQueryDefaults(e,t){Z(this,Bu).set(xc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,Bu).values()],n={};return t.forEach(r=>{dd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Z(this,Wu).set(xc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,Wu).values()],n={};return t.forEach(r=>{dd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Z(this,Ka).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ob(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Mb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,Ka).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,Dn).clear(),Z(this,Wa).clear()}},Dn=new WeakMap,Wa=new WeakMap,Ka=new WeakMap,Bu=new WeakMap,Wu=new WeakMap,Ga=new WeakMap,Ku=new WeakMap,Gu=new WeakMap,JT);const rM=g.createContext(!1),$K=()=>g.useContext(rM);rM.Provider;function NK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const DK=g.createContext(NK()),FK=()=>g.useContext(DK),jK=(e,t,n)=>{const r=(n==null?void 0:n.state.status)==="error"&&typeof e.throwOnError=="function"?Lb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},VK=e=>{g.useEffect(()=>{e.clearReset()},[e])},zK=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Lb(n,[e.error,r])),HK=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},UK=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ZK=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function BK(e,t,n){const r=$K(),s=FK(),i=Uh(),o=i.defaultQueryOptions(e),c=i.getQueryCache().get(o.queryHash),u=e.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,HK(o),jK(o,s,c),VK(s);const[d]=g.useState(()=>new t(i,o)),f=d.getOptimisticResult(o);g.useEffect(()=>{d.setOptions(o)},[o,d]);const p=!r&&u;if(g.useSyncExternalStore(g.useCallback(m=>{const v=p?d.subscribe(pr.batchCalls(m)):us;return d.updateResult(),v},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),UK(o,f))throw ZK(o,d,s);if(zK({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function _o(e,t){return BK(e,RK)}function sM(e,t){const n=Uh(),[r]=g.useState(()=>new OK(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const s=g.useSyncExternalStore(g.useCallback(o=>r.subscribe(pr.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=g.useCallback((...o)=>{r.mutate(o[0],o[1]).catch(us)},[r]);if(s.error&&Lb(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const jb=g.createContext({});function Rg(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const WK=typeof window<"u",Vb=WK?g.useLayoutEffect:g.useEffect,Tg=g.createContext(null);function zb(e,t){e.indexOf(t)===-1&&e.push(t)}function B0(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const wo=(e,t,n)=>n>t?t:n<e?e:n;let Ag=()=>{};const dl={},iM=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),oM=e=>typeof e=="object"&&e!==null,aM=e=>/^0[^.\s]+$/u.test(e);function lM(e){let t;return()=>(t===void 0&&(t=e()),t)}const gi=e=>e,Zh=(...e)=>e.reduce((t,n)=>r=>n(t(r))),yh=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Hb{constructor(){this.subscriptions=[]}add(t){return zb(this.subscriptions,t),()=>B0(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Gs=e=>e*1e3,hi=e=>e/1e3,cM=(e,t)=>t?e*(1e3/t):0,uM=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,KK=1e-7,GK=12;function qK(e,t,n,r,s){let i,o,c=0;do o=t+(n-t)/2,i=uM(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>KK&&++c<GK);return o}function Bh(e,t,n,r){if(e===t&&n===r)return gi;const s=i=>qK(i,0,1,e,n);return i=>i===0||i===1?i:uM(s(i),t,r)}const dM=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fM=e=>t=>1-e(1-t),hM=Bh(.33,1.53,.69,.99),Ub=fM(hM),pM=dM(Ub),mM=e=>e>=1?1:(e*=2)<1?.5*Ub(e):.5*(2-Math.pow(2,-10*(e-1))),Zb=e=>1-Math.sin(Math.acos(e)),gM=fM(Zb),vM=dM(Zb),YK=Bh(.42,0,1,1),XK=Bh(0,0,.58,1),yM=Bh(.42,0,.58,1),QK=e=>Array.isArray(e)&&typeof e[0]!="number",_M=e=>Array.isArray(e)&&typeof e[0]=="number",JK={linear:gi,easeIn:YK,easeInOut:yM,easeOut:XK,circIn:Zb,circInOut:vM,circOut:gM,backIn:Ub,backInOut:pM,backOut:hM,anticipate:mM},eG=e=>typeof e=="string",$8=e=>{if(_M(e)){Ag(e.length===4);const[t,n,r,s]=e;return Bh(t,n,r,s)}else if(eG(e))return JK[e];return e},vm=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tG(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function c(d){i.has(d)&&(u.schedule(d),e()),d(o)}const u={schedule:(d,f=!1,p=!1)=>{const v=p&&r?t: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=t;t=n,n=f,t.forEach(c),t.clear(),r=!1,s&&(s=!1,u.process(d))}};return u}const nG=40;function wM(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=vm.reduce((C,R)=>(C[R]=tG(i),C),{}),{setup:c,read:u,resolveKeyframes:d,preUpdate:f,update:p,preRender:m,render:v,postRender:_}=o,w=()=>{const C=dl.useManualTiming,R=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(R-s.timestamp,nG),1)),s.timestamp=R,s.isProcessing=!0,c.process(s),u.process(s),d.process(s),f.process(s),p.process(s),m.process(s),v.process(s),_.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(w))},b=()=>{n=!0,r=!0,s.isProcessing||e(w)};return{schedule:vm.reduce((C,R)=>{const T=o[R];return C[R]=(O,M=!1,A=!1)=>(n||b(),T.schedule(O,M,A)),C},{}),cancel:C=>{for(let R=0;R<vm.length;R++)o[vm[R]].cancel(C)},state:s,steps:o}}const{schedule:yn,cancel:fl,state:Nr,steps:O1}=wM(typeof requestAnimationFrame<"u"?requestAnimationFrame:gi,!0);let qm;function rG(){qm=void 0}const fs={now:()=>(qm===void 0&&fs.set(Nr.isProcessing||dl.useManualTiming?Nr.timestamp:performance.now()),qm),set:e=>{qm=e,queueMicrotask(rG)}},bM=e=>t=>typeof t=="string"&&t.startsWith(e),xM=bM("--"),sG=bM("var(--"),Bb=e=>sG(e)?iG.test(e.split("/*")[0].trim()):!1,iG=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function N8(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Sd={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},_h={...Sd,transform:e=>wo(0,1,e)},ym={...Sd,default:1},Xf=e=>Math.round(e*1e5)/1e5,Wb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function oG(e){return e==null}const aG=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Kb=(e,t)=>n=>!!(typeof n=="string"&&aG.test(n)&&n.startsWith(e)||t&&!oG(n)&&Object.prototype.hasOwnProperty.call(n,t)),SM=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,c]=r.match(Wb);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:c!==void 0?parseFloat(c):1}},lG=e=>wo(0,255,e),M1={...Sd,transform:e=>Math.round(lG(e))},Jl={test:Kb("rgb","red"),parse:SM("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+M1.transform(e)+", "+M1.transform(t)+", "+M1.transform(n)+", "+Xf(_h.transform(r))+")"};function cG(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Dw={test:Kb("#"),parse:cG,transform:Jl.transform},Wh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ho=Wh("deg"),go=Wh("%"),Ge=Wh("px"),uG=Wh("vh"),dG=Wh("vw"),D8={...go,parse:e=>go.parse(e)/100,transform:e=>go.transform(e*100)},Eu={test:Kb("hsl","hue"),parse:SM("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+go.transform(Xf(t))+", "+go.transform(Xf(n))+", "+Xf(_h.transform(r))+")"},sr={test:e=>Jl.test(e)||Dw.test(e)||Eu.test(e),parse:e=>Jl.test(e)?Jl.parse(e):Eu.test(e)?Eu.parse(e):Dw.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Jl.transform(e):Eu.transform(e),getAnimatableNone:e=>{const t=sr.parse(e);return t.alpha=0,sr.transform(t)}},fG=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function hG(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Wb))==null?void 0:t.length)||0)+(((n=e.match(fG))==null?void 0:n.length)||0)>0}const EM="number",kM="color",pG="var",mG="var(",F8="${}",gG=/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 fd(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const c=t.replace(gG,u=>(sr.test(u)?(r.color.push(i),s.push(kM),n.push(sr.parse(u))):u.startsWith(mG)?(r.var.push(i),s.push(pG),n.push(u)):(r.number.push(i),s.push(EM),n.push(parseFloat(u))),++i,F8)).split(F8);return{values:n,split:c,indexes:r,types:s}}function vG(e){return fd(e).values}function CM({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const o=t[i];o===EM?s+=Xf(r[i]):o===kM?s+=sr.transform(r[i]):s+=r[i]}return s}}function yG(e){return CM(fd(e))}const _G=e=>typeof e=="number"?0:sr.test(e)?sr.getAnimatableNone(e):e,wG=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:_G(e);function bG(e){const t=fd(e);return CM(t)(t.values.map((r,s)=>wG(r,t.split[s])))}const ji={test:hG,parse:vG,createTransformer:yG,getAnimatableNone:bG};function L1(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function xG({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const c=n<.5?n*(1+t):n+t-n*t,u=2*n-c;s=L1(u,c,e+1/3),i=L1(u,c,e),o=L1(u,c,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function W0(e,t){return n=>n>0?t:e}const vn=(e,t,n)=>e+(t-e)*n,$1=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},SG=[Dw,Jl,Eu],EG=e=>SG.find(t=>t.test(e));function j8(e){const t=EG(e);if(!t)return!1;let n=t.parse(e);return t===Eu&&(n=xG(n)),n}const V8=(e,t)=>{const n=j8(e),r=j8(t);if(!n||!r)return W0(e,t);const s={...n};return i=>(s.red=$1(n.red,r.red,i),s.green=$1(n.green,r.green,i),s.blue=$1(n.blue,r.blue,i),s.alpha=vn(n.alpha,r.alpha,i),Jl.transform(s))},Fw=new Set(["none","hidden"]);function kG(e,t){return Fw.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function CG(e,t){return n=>vn(e,t,n)}function Gb(e){return typeof e=="number"?CG:typeof e=="string"?Bb(e)?W0:sr.test(e)?V8:TG:Array.isArray(e)?PM:typeof e=="object"?sr.test(e)?V8:PG:W0}function PM(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Gb(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function PG(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Gb(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function RG(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],c=e.values[o]??0;n[s]=c,r[i]++}return n}const TG=(e,t)=>{const n=ji.createTransformer(t),r=fd(e),s=fd(t);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?Fw.has(e)&&!s.values.length||Fw.has(t)&&!r.values.length?kG(e,t):Zh(PM(RG(r,s),s.values),n):W0(e,t)};function RM(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vn(e,t,n):Gb(e)(e,t)}const AG=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>yn.update(t,n),stop:()=>fl(t),now:()=>Nr.isProcessing?Nr.timestamp:fs.now()}},TM=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},K0=2e4;function qb(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<K0;)t+=n,r=e.next(t);return t>=K0?1/0:t}function IG(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(qb(r),K0);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:hi(s)}}const Kn={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 jw(e,t){return e*Math.sqrt(1-t*t)}const OG=12;function MG(e,t,n){let r=n;for(let s=1;s<OG;s++)r=r-e(r)/t(r);return r}const N1=.001;function LG({duration:e=Kn.duration,bounce:t=Kn.bounce,velocity:n=Kn.velocity,mass:r=Kn.mass}){let s,i,o=1-t;o=wo(Kn.minDamping,Kn.maxDamping,o),e=wo(Kn.minDuration,Kn.maxDuration,hi(e)),o<1?(s=d=>{const f=d*o,p=f*e,m=f-n,v=jw(d,o),_=Math.exp(-p);return N1-m/v*_},i=d=>{const p=d*o*e,m=p*n+n,v=Math.pow(o,2)*Math.pow(d,2)*e,_=Math.exp(-p),w=jw(Math.pow(d,2),o);return(-s(d)+N1>0?-1:1)*((m-v)*_)/w}):(s=d=>{const f=Math.exp(-d*e),p=(d-n)*e+1;return-N1+f*p},i=d=>{const f=Math.exp(-d*e),p=(n-d)*(e*e);return f*p});const c=5/e,u=MG(s,i,c);if(e=Gs(e),isNaN(u))return{stiffness:Kn.stiffness,damping:Kn.damping,duration:e};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:e}}}const $G=["duration","bounce"],NG=["stiffness","damping","mass"];function z8(e,t){return t.some(n=>e[n]!==void 0)}function DG(e){let t={velocity:Kn.velocity,stiffness:Kn.stiffness,damping:Kn.damping,mass:Kn.mass,isResolvedFromDuration:!1,...e};if(!z8(e,NG)&&z8(e,$G))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*wo(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Kn.mass,stiffness:s,damping:i}}else{const n=LG({...e,velocity:0});t={...t,...n,mass:Kn.mass},t.isResolvedFromDuration=!0}return t}function G0(e=Kn.visualDuration,t=Kn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],c={done:!1,value:i},{stiffness:u,damping:d,mass:f,duration:p,velocity:m,isResolvedFromDuration:v}=DG({...n,velocity:-hi(n.velocity||0)}),_=m||0,w=d/(2*Math.sqrt(u*f)),b=o-i,S=hi(Math.sqrt(u/f)),E=Math.abs(b)<5;r||(r=E?Kn.restSpeed.granular:Kn.restSpeed.default),s||(s=E?Kn.restDelta.granular:Kn.restDelta.default);let C,R,T,O,M,A;if(w<1)T=jw(S,w),O=(_+w*S*b)/T,C=V=>{const W=Math.exp(-w*S*V);return o-W*(O*Math.sin(T*V)+b*Math.cos(T*V))},M=w*S*O+b*T,A=w*S*b-O*T,R=V=>Math.exp(-w*S*V)*(M*Math.sin(T*V)+A*Math.cos(T*V));else if(w===1){C=W=>o-Math.exp(-S*W)*(b+(_+S*b)*W);const V=_+S*b;R=W=>Math.exp(-S*W)*(S*V*W-_)}else{const V=S*Math.sqrt(w*w-1);C=Q=>{const H=Math.exp(-w*S*Q),Y=Math.min(V*Q,300);return o-H*((_+w*S*b)*Math.sinh(Y)+V*b*Math.cosh(Y))/V};const W=(_+w*S*b)/V,z=w*S*W-b*V,X=w*S*b-W*V;R=Q=>{const H=Math.exp(-w*S*Q),Y=Math.min(V*Q,300);return H*(z*Math.sinh(Y)+X*Math.cosh(Y))}}const L={calculatedDuration:v&&p||null,velocity:V=>Gs(R(V)),next:V=>{if(!v&&w<1){const z=Math.exp(-w*S*V),X=Math.sin(T*V),Q=Math.cos(T*V),H=o-z*(O*X+b*Q),Y=Gs(z*(M*X+A*Q));return c.done=Math.abs(Y)<=r&&Math.abs(o-H)<=s,c.value=c.done?o:H,c}const W=C(V);if(v)c.done=V>=p;else{const z=Gs(R(V));c.done=Math.abs(z)<=r&&Math.abs(o-W)<=s}return c.value=c.done?o:W,c},toString:()=>{const V=Math.min(qb(L),K0),W=TM(z=>L.next(V*z).value,V,30);return V+"ms "+W},toTransition:()=>{}};return L}G0.applyToOptions=e=>{const t=IG(e,100,G0);return e.ease=t.ease,e.duration=Gs(t.duration),e.type="keyframes",e};const FG=5;function AM(e,t,n){const r=Math.max(t-FG,0);return cM(n-e(r),t-r)}function Vw({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:c,max:u,restDelta:d=.5,restSpeed:f}){const p=e[0],m={done:!1,value:p},v=A=>c!==void 0&&A<c||u!==void 0&&A>u,_=A=>c===void 0?u:u===void 0||Math.abs(c-A)<Math.abs(u-A)?c:u;let w=n*t;const b=p+w,S=o===void 0?b:o(b);S!==b&&(w=S-p);const E=A=>-w*Math.exp(-A/r),C=A=>S+E(A),R=A=>{const L=E(A),V=C(A);m.done=Math.abs(L)<=d,m.value=m.done?S:V};let T,O;const M=A=>{v(m.value)&&(T=A,O=G0({keyframes:[m.value,_(m.value)],velocity:AM(C,A,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return M(0),{calculatedDuration:null,next:A=>{let L=!1;return!O&&T===void 0&&(L=!0,R(A),M(A)),T!==void 0&&A>=T?O.next(A-T):(!L&&R(A),m)}}}function jG(e,t,n){const r=[],s=n||dl.mix||RM,i=e.length-1;for(let o=0;o<i;o++){let c=s(e[o],e[o+1]);if(t){const u=Array.isArray(t)?t[o]||gi:t;c=Zh(u,c)}r.push(c)}return r}function VG(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Ag(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=jG(t,r,s),u=c.length,d=f=>{if(o&&f<e[0])return t[0];let p=0;if(u>1)for(;p<e.length-2&&!(f<e[p+1]);p++);const m=yh(e[p],e[p+1],f);return c[p](m)};return n?f=>d(wo(e[0],e[i-1],f)):d}function zG(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=yh(0,t,r);e.push(vn(n,1,s))}}function HG(e){const t=[0];return zG(t,e.length-1),t}function UG(e,t){return e.map(n=>n*t)}function ZG(e,t){return e.map(()=>t||yM).splice(0,e.length-1)}function Qf({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=QK(r)?r.map($8):$8(r),i={done:!1,value:t[0]},o=UG(n&&n.length===t.length?n:HG(t),e),c=VG(o,t,{ease:Array.isArray(s)?s:ZG(t,s)});return{calculatedDuration:e,next:u=>(i.value=c(u),i.done=u>=e,i)}}const BG=e=>e!==null;function Ig(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(BG),c=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!c||r===void 0?i[c]:r}const WG={decay:Vw,inertia:Vw,tween:Qf,keyframes:Qf,spring:G0};function IM(e){typeof e.type=="string"&&(e.type=WG[e.type])}class Yb{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const KG=e=>e/100;class q0 extends Yb{constructor(t){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!==fs.now()&&this.tick(fs.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;IM(t);const{type:n=Qf,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:c}=t;const u=n||Qf;u!==Qf&&typeof c[0]!="number"&&(this.mixKeyframes=Zh(KG,RM(c[0],c[1])),c=[0,100]);const d=u({...t,keyframes:c});i==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...c].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=qb(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:c,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:p,repeatType:m,repeatDelay:v,type:_,onUpdate:w,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const S=this.currentTime-d*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,R=r;if(p){const A=Math.min(this.currentTime,s)/c;let L=Math.floor(A),V=A%1;!V&&A>=1&&(V=1),V===1&&L--,L=Math.min(L,p+1),!!(L%2)&&(m==="reverse"?(V=1-V,v&&(V-=v/c)):m==="mirror"&&(R=o)),C=wo(0,1,V)*c}let T;E?(this.delayState.value=f[0],T=this.delayState):T=R.next(C),i&&!E&&(T.value=i(T.value));let{done:O}=T;!E&&u!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return M&&_!==Vw&&(T.value=Ig(f,this.options,b,this.speed)),w&&w(T.value),M&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return hi(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+hi(t)}get time(){return hi(this.currentTime)}set time(t){t=Gs(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return AM(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(fs.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=hi(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=AG,startTime:n}=this.options;this.driver||(this.driver=t(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(fs.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function GG(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ec=e=>e*180/Math.PI,zw=e=>{const t=ec(Math.atan2(e[1],e[0]));return Hw(t)},qG={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:zw,rotateZ:zw,skewX:e=>ec(Math.atan(e[1])),skewY:e=>ec(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Hw=e=>(e=e%360,e<0&&(e+=360),e),H8=zw,U8=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Z8=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),YG={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:U8,scaleY:Z8,scale:e=>(U8(e)+Z8(e))/2,rotateX:e=>Hw(ec(Math.atan2(e[6],e[5]))),rotateY:e=>Hw(ec(Math.atan2(-e[2],e[0]))),rotateZ:H8,rotate:H8,skewX:e=>ec(Math.atan(e[4])),skewY:e=>ec(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Uw(e){return e.includes("scale")?1:0}function Zw(e,t){if(!e||e==="none")return Uw(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=YG,s=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=qG,s=c}if(!s)return Uw(t);const i=r[t],o=s[1].split(",").map(QG);return typeof i=="function"?i(o):o[i]}const XG=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Zw(n,t)};function QG(e){return parseFloat(e.trim())}const Ed=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],kd=new Set([...Ed,"pathRotation"]),B8=e=>e===Sd||e===Ge,JG=new Set(["x","y","z"]),eq=Ed.filter(e=>!JG.has(e));function tq(e){const t=[];return eq.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ja={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Zw(t,"x"),y:(e,{transform:t})=>Zw(t,"y")};Ja.translateX=Ja.x;Ja.translateY=Ja.y;const pc=new Set;let Bw=!1,Ww=!1,Kw=!1;function OM(){if(Ww){const e=Array.from(pc).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=tq(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var c;(c=r.getValue(i))==null||c.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ww=!1,Bw=!1,pc.forEach(e=>e.complete(Kw)),pc.clear()}function MM(){pc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ww=!0)})}function nq(){Kw=!0,MM(),OM(),Kw=!1}class Xb{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(pc.add(this),Bw||(Bw=!0,yn.read(MM),yn.resolveKeyframes(OM))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const c=r.readValue(n,o);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}GG(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),pc.delete(this)}cancel(){this.state==="scheduled"&&(pc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const rq=e=>e.startsWith("--");function LM(e,t,n){rq(t)?e.style.setProperty(t,n):e.style[t]=n}const sq={};function $M(e,t){const n=lM(e);return()=>sq[t]??n()}const iq=$M(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),NM=$M(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$f=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,W8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$f([0,.65,.55,1]),circOut:$f([.55,0,1,.45]),backIn:$f([.31,.01,.66,-.59]),backOut:$f([.33,1.53,.69,.99])};function DM(e,t){if(e)return typeof e=="function"?NM()?TM(e,t):"ease-out":_M(e)?$f(e):Array.isArray(e)?e.map(n=>DM(n,t)||W8.easeOut):W8[e]}function oq(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:c="easeOut",times:u}={},d=void 0){const f={[t]:n};u&&(f.offset=u);const p=DM(c,s);Array.isArray(p)&&(f.easing=p);const m={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),e.animate(f,m)}function FM(e){return typeof e=="function"&&"applyToOptions"in e}function aq({type:e,...t}){return FM(e)&&NM()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class jM extends Yb{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:c,onComplete:u}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,Ag(typeof t.type!="string");const d=aq(t);this.animation=oq(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=Ig(s,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(f),LM(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 t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return hi(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+hi(t)}get time(){return hi(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Gs(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&iq()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),gi):s(this)}}const VM={anticipate:mM,backInOut:pM,circInOut:vM};function lq(e){return e in VM}function cq(e){typeof e.ease=="string"&&lq(e.ease)&&(e.ease=VM[e.ease])}const D1=10;class uq extends jM{constructor(t){cq(t),IM(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new q0({...o,autoplay:!1}),u=Math.max(D1,fs.now()-this.startTime),d=wo(0,D1,u-D1),f=c.sample(u).value,{name:p}=this.options;i&&p&&LM(i,p,f),n.setWithVelocity(c.sample(Math.max(0,u-d)).value,f,d),c.stop()}}const K8=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ji.test(e)||e==="0")&&!e.startsWith("url("));function dq(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function fq(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=K8(s,t),c=K8(i,t);return!o||!c?!1:dq(e)||(n==="spring"||FM(n))&&r}function Gw(e){e.duration=0,e.type="keyframes"}const zM=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),hq=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function pq(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&hq.test(e[t]))return!0;return!1}const mq=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),gq=lM(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function vq(e){var p;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:c}=e,u=(p=t==null?void 0:t.owner)==null?void 0:p.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=t.owner.getProps();return gq()&&n&&(zM.has(n)||mq.has(n)&&pq(c))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const yq=40;class _q extends Yb{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:c,name:u,motionValue:d,element:f,...p}){var _;super(),this.stop=()=>{var w,b;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=fs.now();const m={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:f,...p},v=(f==null?void 0:f.KeyframeResolver)||Xb;this.keyframeResolver=new v(c,(w,b,S)=>this.onKeyframesResolved(w,b,m,!S),u,d,f),(_=this.keyframeResolver)==null||_.scheduleResolve()}onKeyframesResolved(t,n,r,s){var S,E;this.keyframeResolver=void 0;const{name:i,type:o,velocity:c,delay:u,isHandoff:d,onUpdate:f}=r;this.resolvedAt=fs.now();let p=!0;fq(t,i,o,c)||(p=!1,(dl.instantAnimations||!u)&&(f==null||f(Ig(t,r,n))),t[0]=t[t.length-1],Gw(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>yq?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},_=p&&!d&&vq(v),w=(E=(S=v.motionValue)==null?void 0:S.owner)==null?void 0:E.current;let b;if(_)try{b=new uq({...v,element:w})}catch{b=new q0(v)}else b=new q0(v);b.finished.then(()=>{this.notifyFinished()}).catch(gi),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),nq()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function HM(e,t,n,r=0,s=1){const i=Array.from(e).sort((d,f)=>d.sortNodePosition(f)).indexOf(t),o=e.size,c=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:c-i*r}const G8=30,wq=e=>!isNaN(parseFloat(e));class bq{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=fs.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(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=fs.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=wq(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Hb);const r=this.events[t].add(n);return t==="change"?()=>{r(),yn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=fs.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>G8)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,G8);return cM(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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 t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function hd(e,t){return new bq(e,t)}function Qb(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Jb(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Qb(n,e):n}const xq={type:"spring",stiffness:500,damping:25,restSpeed:10},Sq=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Eq={type:"keyframes",duration:.8},kq={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Cq=(e,{keyframes:t})=>t.length>2?Eq:kd.has(e)?e.startsWith("scale")?Sq(t[1]):xq:kq,Pq=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Rq(e){for(const t in e)if(!Pq.has(t))return!0;return!1}const ex=(e,t,n,r={},s,i)=>o=>{const c=Jb(r,e)||{},u=c.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Gs(u);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-d,onUpdate:m=>{t.set(m),c.onUpdate&&c.onUpdate(m)},onComplete:()=>{o(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:i?void 0:s};Rq(c)||Object.assign(f,Cq(e,f)),f.duration&&(f.duration=Gs(f.duration)),f.repeatDelay&&(f.repeatDelay=Gs(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let p=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(Gw(f),f.delay===0&&(p=!0)),(dl.instantAnimations||dl.skipAnimations||s!=null&&s.shouldSkipAnimations||c.skipAnimations)&&(p=!0,Gw(f),f.delay=0),f.allowFlatten=!c.type&&!c.ease,p&&!i&&t.get()!==void 0){const m=Ig(f.keyframes,c);if(m!==void 0){yn.update(()=>{f.onUpdate(m),f.onComplete()});return}}return c.isSync?new q0(f):new _q(f)},Tq=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Aq(e){const t=Tq.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function UM(e,t,n=1){const[r,s]=Aq(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return iM(o)?parseFloat(o):o}return Bb(s)?UM(s,t,n+1):s}function q8(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function tx(e,t,n,r){if(typeof t=="function"){const[s,i]=q8(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=q8(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function mc(e,t,n){const r=e.getProps();return tx(r,t,n!==void 0?n:r.custom,e)}const ZM=new Set(["width","height","top","left","right","bottom",...Ed]),qw=e=>Array.isArray(e);function Iq(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,hd(n))}function Oq(e){return qw(e)?e[e.length-1]||0:e}function Mq(e,t){const n=mc(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const c=Oq(i[o]);Iq(e,o,c)}}const jr=e=>!!(e&&e.getVelocity);function Lq(e){return!!(jr(e)&&e.add)}function Yw(e,t){const n=e.getValue("willChange");if(Lq(n))return n.add(t);if(!n&&dl.WillChange){const r=new dl.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function nx(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const $q="framerAppearId",BM="data-"+nx($q);function WM(e){return e.props[BM]}function Nq({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function KM(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...c}=t;const u=e.getDefaultTransition();i=i?Qb(i,u):u;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],m=s&&e.animationState&&e.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(e,c,i,n,p);for(const _ in c){const w=e.getValue(_,e.latestValues[_]??null),b=c[_];if(b===void 0||m&&Nq(m,_))continue;const S={delay:n,...Jb(i||{},_)};f&&(S.skipAnimations=!0);const E=w.get();if(E!==void 0&&!w.isAnimating()&&!Array.isArray(b)&&b===E&&!S.velocity){yn.update(()=>w.set(b));continue}let C=!1;if(window.MotionHandoffAnimation){const O=WM(e);if(O){const M=window.MotionHandoffAnimation(O,_,yn);M!==null&&(S.startTime=M,C=!0)}}Yw(e,_);const R=d??e.shouldReduceMotion;w.start(ex(_,w,b,R&&ZM.has(_)?{type:!1}:S,e,C));const T=w.animation;T&&p.push(T)}if(o){const _=()=>yn.update(()=>{o&&Mq(e,o)});p.length?Promise.all(p).then(_):_()}return p}function Xw(e,t,n={}){var u;const r=mc(e,t,n.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(KM(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:m}=s;return Dq(e,t,d,f,p,m,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[d,f]=c==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function Dq(e,t,n=0,r=0,s=0,i=1,o){const c=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),c.push(Xw(u,t,{...o,delay:n+(typeof r=="function"?0:r)+HM(e.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(c)}function Fq(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Xw(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Xw(e,t,n);else{const s=typeof t=="function"?mc(e,t,n.custom):t;r=Promise.all(KM(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const jq={test:e=>e==="auto",parse:e=>e},GM=e=>t=>t.test(e),qM=[Sd,Ge,go,Ho,dG,uG,jq],Y8=e=>qM.find(GM(e));function Vq(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||aM(e):!0}const zq=new Set(["brightness","contrast","saturate","opacity"]);function Hq(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Wb)||[];if(!r)return e;const s=n.replace(r,"");let i=zq.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Uq=/\b([a-z-]*)\(.*?\)/gu,Qw={...ji,getAnimatableNone:e=>{const t=e.match(Uq);return t?t.map(Hq).join(" "):e}},Jw={...ji,getAnimatableNone:e=>{const t=ji.parse(e);return ji.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},X8={...Sd,transform:Math.round},Zq={rotate:Ho,pathRotation:Ho,rotateX:Ho,rotateY:Ho,rotateZ:Ho,scale:ym,scaleX:ym,scaleY:ym,scaleZ:ym,skew:Ho,skewX:Ho,skewY:Ho,distance:Ge,translateX:Ge,translateY:Ge,translateZ:Ge,x:Ge,y:Ge,z:Ge,perspective:Ge,transformPerspective:Ge,opacity:_h,originX:D8,originY:D8,originZ:Ge},Y0={borderWidth:Ge,borderTopWidth:Ge,borderRightWidth:Ge,borderBottomWidth:Ge,borderLeftWidth:Ge,borderRadius:Ge,borderTopLeftRadius:Ge,borderTopRightRadius:Ge,borderBottomRightRadius:Ge,borderBottomLeftRadius:Ge,width:Ge,maxWidth:Ge,height:Ge,maxHeight:Ge,top:Ge,right:Ge,bottom:Ge,left:Ge,inset:Ge,insetBlock:Ge,insetBlockStart:Ge,insetBlockEnd:Ge,insetInline:Ge,insetInlineStart:Ge,insetInlineEnd:Ge,padding:Ge,paddingTop:Ge,paddingRight:Ge,paddingBottom:Ge,paddingLeft:Ge,paddingBlock:Ge,paddingBlockStart:Ge,paddingBlockEnd:Ge,paddingInline:Ge,paddingInlineStart:Ge,paddingInlineEnd:Ge,margin:Ge,marginTop:Ge,marginRight:Ge,marginBottom:Ge,marginLeft:Ge,marginBlock:Ge,marginBlockStart:Ge,marginBlockEnd:Ge,marginInline:Ge,marginInlineStart:Ge,marginInlineEnd:Ge,fontSize:Ge,backgroundPositionX:Ge,backgroundPositionY:Ge,...Zq,zIndex:X8,fillOpacity:_h,strokeOpacity:_h,numOctaves:X8},Bq={...Y0,color:sr,backgroundColor:sr,outlineColor:sr,fill:sr,stroke:sr,borderColor:sr,borderTopColor:sr,borderRightColor:sr,borderBottomColor:sr,borderLeftColor:sr,filter:Qw,WebkitFilter:Qw,mask:Jw,WebkitMask:Jw},YM=e=>Bq[e],Wq=new Set([Qw,Jw]);function XM(e,t){let n=YM(e);return Wq.has(n)||(n=ji),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Kq=new Set(["auto","none","0"]);function Gq(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Kq.has(i)&&fd(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=XM(n,s)}class qq extends Xb{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f<t.length;f++){let p=t[f];if(typeof p=="string"&&(p=p.trim(),Bb(p))){const m=UM(p,n.current);m!==void 0&&(t[f]=m),f===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!ZM.has(r)||t.length!==2)return;const[s,i]=t,o=Y8(s),c=Y8(i),u=N8(s),d=N8(i);if(u!==d&&Ja[r]){this.needsMeasurement=!0;return}if(o!==c)if(B8(o)&&B8(c))for(let f=0;f<t.length;f++){const p=t[f];typeof p=="string"&&(t[f]=parseFloat(p))}else Ja[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Vq(t[s]))&&r.push(s);r.length&&Gq(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ja[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var c;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Ja[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(c=this.removedTransforms)!=null&&c.length&&this.removedTransforms.forEach(([u,d])=>{t.getValue(u).set(d)}),this.resolveNoneKeyframes()}}const rx=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function QM(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const e2=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Ym(e){return oM(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:sx}=wM(queueMicrotask,!1),Oi={x:!1,y:!1};function JM(){return Oi.x||Oi.y}function Yq(e){return e==="x"||e==="y"?Oi[e]?null:(Oi[e]=!0,()=>{Oi[e]=!1}):Oi.x||Oi.y?null:(Oi.x=Oi.y=!0,()=>{Oi.x=Oi.y=!1})}function eL(e,t){const n=QM(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Xq(e){return!(e.pointerType==="touch"||JM())}function Qq(e,t,n={}){const[r,s,i]=eL(e,n);return r.forEach(o=>{let c=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",_)},p=b=>{d&&(d(b),d=void 0),f()},m=b=>{c=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,p(b))},v=()=>{c=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},_=b=>{if(b.pointerType!=="touch"){if(c){u=!0;return}p(b)}},w=b=>{if(!Xq(b))return;u=!1;const S=t(o,b);typeof S=="function"&&(d=S,o.addEventListener("pointerleave",_,s))};o.addEventListener("pointerenter",w,s),o.addEventListener("pointerdown",v,s)}),i}const tL=(e,t)=>t?e===t?!0:tL(e,t.parentElement):!1,ix=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Jq=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function eY(e){return Jq.has(e.tagName)||e.isContentEditable===!0}const tY=new Set(["INPUT","SELECT","TEXTAREA"]);function nY(e){return tY.has(e.tagName)||e.isContentEditable===!0}const Xm=new WeakSet;function Q8(e){return t=>{t.key==="Enter"&&e(t)}}function F1(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const rY=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Q8(()=>{if(Xm.has(n))return;F1(n,"down");const s=Q8(()=>{F1(n,"up")}),i=()=>F1(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function J8(e){return ix(e)&&!JM()}const eP=new WeakSet;function sY(e,t,n={}){const[r,s,i]=eL(e,n),o=c=>{const u=c.currentTarget;if(!J8(c)||eP.has(c))return;Xm.add(u),n.stopPropagation&&eP.add(c);const d=t(u,c),f={...s,capture:!0},p=(_,w)=>{window.removeEventListener("pointerup",m,f),window.removeEventListener("pointercancel",v,f),Xm.has(u)&&Xm.delete(u),J8(_)&&typeof d=="function"&&d(_,{success:w})},m=_=>{p(_,u===window||u===document||n.useGlobalTarget||tL(u,_.target))},v=_=>{p(_,!1)};window.addEventListener("pointerup",m,f),window.addEventListener("pointercancel",v,f)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",o,s),Ym(c)&&(c.addEventListener("focus",d=>rY(d,s)),!eY(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),i}function ox(e){return oM(e)&&"ownerSVGElement"in e}const Qm=new WeakMap;let Na;const nL=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:ox(r)&&"getBBox"in r?r.getBBox()[t]:r[n],iY=nL("inline","width","offsetWidth"),oY=nL("block","height","offsetHeight");function aY({target:e,borderBoxSize:t}){var n;(n=Qm.get(e))==null||n.forEach(r=>{r(e,{get width(){return iY(e,t)},get height(){return oY(e,t)}})})}function lY(e){e.forEach(aY)}function cY(){typeof ResizeObserver>"u"||(Na=new ResizeObserver(lY))}function uY(e,t){Na||cY();const n=QM(e);return n.forEach(r=>{let s=Qm.get(r);s||(s=new Set,Qm.set(r,s)),s.add(t),Na==null||Na.observe(r)}),()=>{n.forEach(r=>{const s=Qm.get(r);s==null||s.delete(t),s!=null&&s.size||Na==null||Na.unobserve(r)})}}const Jm=new Set;let ku;function dY(){ku=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Jm.forEach(t=>t(e))},window.addEventListener("resize",ku)}function fY(e){return Jm.add(e),ku||dY(),()=>{Jm.delete(e),!Jm.size&&typeof ku=="function"&&(window.removeEventListener("resize",ku),ku=void 0)}}function tP(e,t){return typeof e=="function"?fY(e):uY(e,t)}function hY(e){return ox(e)&&e.tagName==="svg"}const pY=[...qM,sr,ji],mY=e=>pY.find(GM(e)),nP=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cu=()=>({x:nP(),y:nP()}),rP=()=>({min:0,max:0}),hr=()=>({x:rP(),y:rP()}),gY=new WeakMap;function Og(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function wh(e){return typeof e=="string"||Array.isArray(e)}const ax=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],lx=["initial",...ax];function Mg(e){return Og(e.animate)||lx.some(t=>wh(e[t]))}function rL(e){return!!(Mg(e)||e.variants)}function vY(e,t,n){for(const r in t){const s=t[r],i=n[r];if(jr(s))e.addValue(r,s);else if(jr(i))e.addValue(r,hd(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,hd(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const X0={current:null},cx={current:!1},yY=typeof window<"u";function sL(){if(cx.current=!0,!!yY)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>X0.current=e.matches;e.addEventListener("change",t),t()}else X0.current=!1}const sP=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Q0={};function iL(e){Q0=e}function _Y(){return Q0}class wY{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:c},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Xb,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=fs.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,yn.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=c;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Mg(n),this.isVariantNode=rL(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in m){const _=m[v];d[v]!==void 0&&jr(_)&&_.set(d[v])}}mount(t){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=t,gY.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),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:(cx.current||sL(),this.shouldReduceMotion=X0.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),fl(this.notifyUpdate),fl(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.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(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&zM.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:c,times:u,ease:d,duration:f}=n.accelerate,p=new jM({element:this.current,name:t,keyframes:c,times:u,ease:d,duration:Gs(f)}),m=o(p);this.valueSubscriptions.set(t,()=>{m(),p.cancel()});return}const r=kd.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&yn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Q0){const n=Q0[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];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):hr()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<sP.length;r++){const s=sP[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=vY(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=hd(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(iM(r)||aM(r))?r=parseFloat(r):!mY(r)&&ji.test(n)&&(r=XM(t,n)),this.setBaseTarget(t,jr(r)?r.get():r)),jr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=tx(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!jr(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Hb),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){sx.render(this.render)}}class oL extends wY{constructor(){super(...arguments),this.KeyframeResolver=qq}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;jr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class vl{constructor(t){this.isMounted=!1,this.node=t}update(){}}function aL({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function bY({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function xY(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function j1(e){return e===void 0||e===1}function t2({scale:e,scaleX:t,scaleY:n}){return!j1(e)||!j1(t)||!j1(n)}function Xl(e){return t2(e)||lL(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function lL(e){return iP(e.x)||iP(e.y)}function iP(e){return e&&e!=="0%"}function J0(e,t,n){const r=e-n,s=t*r;return n+s}function oP(e,t,n,r,s){return s!==void 0&&(e=J0(e,s,r)),J0(e,n,r)+t}function n2(e,t=0,n=1,r,s){e.min=oP(e.min,t,n,r,s),e.max=oP(e.max,t,n,r,s)}function cL(e,{x:t,y:n}){n2(e.x,t.translate,t.scale,t.originPoint),n2(e.y,n.translate,n.scale,n.originPoint)}const aP=.999999999999,lP=1.0000000000001;function SY(e,t,n,r=!1){var c;const s=n.length;if(!s)return;t.x=t.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&&(co(e.x,-i.scroll.offset.x),co(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,cL(e,o)),r&&Xl(i.latestValues)&&e0(e,i.latestValues,(c=i.layout)==null?void 0:c.layoutBox))}t.x<lP&&t.x>aP&&(t.x=1),t.y<lP&&t.y>aP&&(t.y=1)}function co(e,t){e.min+=t,e.max+=t}function cP(e,t,n,r,s=.5){const i=vn(e.min,e.max,s);n2(e,t,n,i,r)}function uP(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function e0(e,t,n){const r=n??e;cP(e.x,uP(t.x,r.x),t.scaleX,t.scale,t.originX),cP(e.y,uP(t.y,r.y),t.scaleY,t.scale,t.originY)}function uL(e,t){return aL(xY(e.getBoundingClientRect(),t))}function EY(e,t,n){const r=uL(e,n),{scroll:s}=t;return s&&(co(r.x,s.offset.x),co(r.y,s.offset.y)),r}const kY={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},CY=Ed.length;function PY(e,t,n){let r="",s=!0;for(let o=0;o<CY;o++){const c=Ed[o],u=e[c];if(u===void 0)continue;let d=!0;if(typeof u=="number")d=u===(c.startsWith("scale")?1:0);else{const f=parseFloat(u);d=c.startsWith("scale")?f===1:f===0}if(!d||n){const f=e2(u,Y0[c]);if(!d){s=!1;const p=kY[c]||c;r+=`${p}(${f}) `}n&&(t[c]=f)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${e2(i,Y0.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function ux(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,c=!1;for(const u in t){const d=t[u];if(kd.has(u)){o=!0;continue}else if(xM(u)){s[u]=d;continue}else{const f=e2(d,Y0[u]);u.startsWith("origin")?(c=!0,i[u]=f):r[u]=f}}if(t.transform||(o||n?r.transform=PY(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:u="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${u} ${d} ${f}`}}function dL(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function dP(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const wf={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ge.test(e))e=parseFloat(e);else return e;const n=dP(e,t.target.x),r=dP(e,t.target.y);return`${n}% ${r}%`}},RY={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=ji.parse(e);if(s.length>5)return r;const i=ji.createTransformer(e),o=typeof s[0]!="number"?1:0,c=n.x.scale*t.x,u=n.y.scale*t.y;s[0+o]/=c,s[1+o]/=u;const d=vn(c,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},r2={borderRadius:{...wf,applyTo:[...rx]},borderTopLeftRadius:wf,borderTopRightRadius:wf,borderBottomLeftRadius:wf,borderBottomRightRadius:wf,boxShadow:RY};function fL(e,{layout:t,layoutId:n}){return kd.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!r2[e]||e==="opacity")}function dx(e,t,n){var o;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const c in r)(jr(r[c])||s&&jr(s[c])||fL(c,e)||((o=n==null?void 0:n.getValue(c))==null?void 0:o.liveStyle)!==void 0)&&(i[c]=r[c]);return i}function TY(e){return window.getComputedStyle(e)}class AY extends oL{constructor(){super(...arguments),this.type="html",this.renderInstance=dL}mount(t){Ag(!!t.style),super.mount(t)}readValueFromInstance(t,n){var r;if(kd.has(n))return(r=this.projection)!=null&&r.isProjecting?Uw(n):XG(t,n);{const s=TY(t),i=(xM(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return uL(t,n)}build(t,n,r){ux(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return dx(t,n,r)}}const IY={offset:"stroke-dashoffset",array:"stroke-dasharray"},OY={offset:"strokeDashoffset",array:"strokeDasharray"};function MY(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?IY:OY;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const LY=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function hL(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...c},u,d,f){if(ux(e,c,d),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m}=e;p.transform&&(m.transform=p.transform,delete p.transform),(m.transform||p.transformOrigin)&&(m.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),m.transform&&(m.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete p.transformBox);for(const v of LY)p[v]!==void 0&&(m[v]=p[v],delete p[v]);t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&MY(p,s,i,o,!1)}const pL=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"]),mL=e=>typeof e=="string"&&e.toLowerCase()==="svg";function $Y(e,t,n,r){dL(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(pL.has(s)?s:nx(s),t.attrs[s])}function gL(e,t,n){const r=dx(e,t,n);for(const s in e)if(jr(e[s])||jr(t[s])){const i=Ed.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class NY extends oL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=hr}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(kd.has(n)){const r=YM(n);return r&&r.default||0}return n=pL.has(n)?n:nx(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return gL(t,n,r)}build(t,n,r){hL(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){$Y(t,n,r,s)}mount(t){this.isSVGTag=mL(t.tagName),super.mount(t)}}const DY=lx.length;function vL(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?vL(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<DY;n++){const r=lx[n],s=e.props[r];(wh(s)||s===!1)&&(t[r]=s)}return t}function yL(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const FY=[...ax].reverse(),jY=ax.length;function VY(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Fq(e,n,r)))}function zY(e){let t=VY(e),n=fP(),r=!0,s=!1;const i=d=>(f,p)=>{var v;const m=mc(e,p,d==="exit"?(v=e.presenceContext)==null?void 0:v.custom:void 0);if(m){const{transition:_,transitionEnd:w,...b}=m;f={...f,...b,...w}}return f};function o(d){t=d(e)}function c(d){const{props:f}=e,p=vL(e.parent)||{},m=[],v=new Set;let _={},w=1/0;for(let S=0;S<jY;S++){const E=FY[S],C=n[E],R=f[E]!==void 0?f[E]:p[E],T=wh(R),O=E===d?C.isActive:null;O===!1&&(w=S);let M=R===p[E]&&R!==f[E]&&T;if(M&&(r||s)&&e.manuallyAnimateOnMount&&(M=!1),C.protectedKeys={..._},!C.isActive&&O===null||!R&&!C.prevProp||Og(R)||typeof R=="boolean")continue;if(E==="exit"&&C.isActive&&O!==!0){C.prevResolvedValues&&(_={..._,...C.prevResolvedValues});continue}const A=HY(C.prevProp,R);let L=A||E===d&&C.isActive&&!M&&T||S>w&&T,V=!1;const W=Array.isArray(R)?R:[R];let z=W.reduce(i(E),{});O===!1&&(z={});const{prevResolvedValues:X={}}=C,Q={...X,...z},H=U=>{L=!0,v.has(U)&&(V=!0,v.delete(U)),C.needsAnimating[U]=!0;const J=e.getValue(U);J&&(J.liveStyle=!1)};for(const U in Q){const J=z[U],K=X[U];if(_.hasOwnProperty(U))continue;let D=!1;qw(J)&&qw(K)?D=!yL(J,K)||A:D=J!==K,D?J!=null?H(U):v.add(U):J!==void 0&&v.has(U)?H(U):C.protectedKeys[U]=!0}C.prevProp=R,C.prevResolvedValues=z,C.isActive&&(_={..._,...z}),(r||s)&&e.blockInitialAnimation&&(L=!1);const Y=M&&A;L&&(!Y||V)&&m.push(...W.map(U=>{const J={type:E};if(typeof U=="string"&&(r||s)&&!Y&&e.manuallyAnimateOnMount&&e.parent){const{parent:K}=e,D=mc(K,U);if(K.enteringChildren&&D){const{delayChildren:q}=D.transition||{};J.delay=HM(K.enteringChildren,e,q)}}return{animation:U,options:J}}))}if(v.size){const S={};if(typeof f.initial!="boolean"){const E=mc(e,Array.isArray(f.initial)?f.initial[0]:f.initial);E&&E.transition&&(S.transition=E.transition)}v.forEach(E=>{const C=e.getBaseTarget(E),R=e.getValue(E);R&&(R.liveStyle=!0),S[E]=C??null}),m.push({animation:S})}let b=!!m.length;return r&&(f.initial===!1||f.initial===f.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,s=!1,b?t(m):Promise.resolve()}function u(d,f){var m;if(n[d].isActive===f)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(v=>{var _;return(_=v.animationState)==null?void 0:_.setActive(d,f)}),n[d].isActive=f;const p=c(d);for(const v in n)n[v].protectedKeys={};return p}return{animateChanges:c,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=fP(),s=!0}}}function HY(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!yL(t,e):!1}function Ul(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fP(){return{animate:Ul(!0),whileInView:Ul(),whileHover:Ul(),whileTap:Ul(),whileDrag:Ul(),whileFocus:Ul(),exit:Ul()}}function s2(e,t){e.min=t.min,e.max=t.max}function Ii(e,t){s2(e.x,t.x),s2(e.y,t.y)}function hP(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const _L=1e-4,UY=1-_L,ZY=1+_L,wL=.01,BY=0-wL,WY=0+wL;function hs(e){return e.max-e.min}function KY(e,t,n){return Math.abs(e-t)<=n}function pP(e,t,n,r=.5){e.origin=r,e.originPoint=vn(t.min,t.max,e.origin),e.scale=hs(n)/hs(t),e.translate=vn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=UY&&e.scale<=ZY||isNaN(e.scale))&&(e.scale=1),(e.translate>=BY&&e.translate<=WY||isNaN(e.translate))&&(e.translate=0)}function Jf(e,t,n,r){pP(e.x,t.x,n.x,r?r.originX:void 0),pP(e.y,t.y,n.y,r?r.originY:void 0)}function mP(e,t,n,r=0){const s=r?vn(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+hs(t)}function GY(e,t,n,r){mP(e.x,t.x,n.x,r==null?void 0:r.x),mP(e.y,t.y,n.y,r==null?void 0:r.y)}function gP(e,t,n,r=0){const s=r?vn(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+hs(t)}function eg(e,t,n,r){gP(e.x,t.x,n.x,r==null?void 0:r.x),gP(e.y,t.y,n.y,r==null?void 0:r.y)}function vP(e,t,n,r,s){return e-=t,e=J0(e,1/n,r),s!==void 0&&(e=J0(e,1/s,r)),e}function qY(e,t=0,n=1,r=.5,s,i=e,o=e){if(go.test(t)&&(t=parseFloat(t),t=vn(o.min,o.max,t/100)-o.min),typeof t!="number")return;let c=vn(i.min,i.max,r);e===i&&(c-=t),e.min=vP(e.min,t,n,c,s),e.max=vP(e.max,t,n,c,s)}function yP(e,t,[n,r,s],i,o){qY(e,t[n],t[r],t[s],t.scale,i,o)}const YY=["x","scaleX","originX"],XY=["y","scaleY","originY"];function _P(e,t,n,r){yP(e.x,t,YY,n?n.x:void 0,r?r.x:void 0),yP(e.y,t,XY,n?n.y:void 0,r?r.y:void 0)}function wP(e){return e.translate===0&&e.scale===1}function bL(e){return wP(e.x)&&wP(e.y)}function bP(e,t){return e.min===t.min&&e.max===t.max}function QY(e,t){return bP(e.x,t.x)&&bP(e.y,t.y)}function xP(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function xL(e,t){return xP(e.x,t.x)&&xP(e.y,t.y)}function SP(e){return hs(e.x)/hs(e.y)}function EP(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function so(e){return[e("x"),e("y")]}function JY(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:p,rotateX:m,rotateY:v,skewX:_,skewY:w}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),v&&(r+=`rotateY(${v}deg) `),_&&(r+=`skewX(${_}deg) `),w&&(r+=`skewY(${w}deg) `)}const c=e.x.scale*t.x,u=e.y.scale*t.y;return(c!==1||u!==1)&&(r+=`scale(${c}, ${u})`),r||"none"}const eX=rx.length,kP=e=>typeof e=="string"?parseFloat(e):e,CP=e=>typeof e=="number"||Ge.test(e);function tX(e,t,n,r,s,i){s?(e.opacity=vn(0,n.opacity??1,nX(r)),e.opacityExit=vn(t.opacity??1,0,rX(r))):i&&(e.opacity=vn(t.opacity??1,n.opacity??1,r));for(let o=0;o<eX;o++){const c=rx[o];let u=PP(t,c),d=PP(n,c);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||CP(u)===CP(d)?(e[c]=Math.max(vn(kP(u),kP(d),r),0),(go.test(d)||go.test(u))&&(e[c]+="%")):e[c]=d}(t.rotate||n.rotate)&&(e.rotate=vn(t.rotate||0,n.rotate||0,r))}function PP(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const nX=SL(0,.5,gM),rX=SL(.5,.95,gi);function SL(e,t,n){return r=>r<e?0:r>t?1:n(yh(e,t,r))}function sX(e,t,n){const r=jr(e)?e:hd(e);return r.start(ex("",r,t,n)),r.animation}function bh(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const iX=(e,t)=>e.depth-t.depth;class oX{constructor(){this.children=[],this.isDirty=!1}add(t){zb(this.children,t),this.isDirty=!0}remove(t){B0(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(iX),this.isDirty=!1,this.children.forEach(t)}}function aX(e,t){const n=fs.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(fl(r),e(i-t))};return yn.setup(r,!0),()=>fl(r)}function t0(e){return jr(e)?e.get():e}class lX{constructor(){this.members=[]}add(t){zb(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(B0(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(B0(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-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(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=t.options;(i===void 0||i!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const n0={hasAnimatedSinceResize:!0,hasEverUpdated:!1},V1=["","X","Y","Z"],cX=1e3;let uX=0;function z1(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function EL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=WM(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",yn,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&EL(r)}function kL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},c=t==null?void 0:t()){this.id=uX++,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(hX),this.nodes.forEach(_X),this.nodes.forEach(wX),this.nodes.forEach(pX)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new oX)}addEventListener(o,c){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Hb),this.eventHandlers.get(o).add(c)}notifyListeners(o,...c){const u=this.eventHandlers.get(o);u&&u.notify(...c)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=ox(o)&&!hY(o),this.instance=o;const{layoutId:c,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||c)&&(this.isLayoutDirty=!0),e){let f,p=0;const m=()=>this.root.updateBlockedByResize=!1;yn.read(()=>{p=window.innerWidth}),e(o,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,f&&f(),f=aX(m,250),n0.hasAnimatedSinceResize&&(n0.hasAnimatedSinceResize=!1,this.nodes.forEach(AP)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||d.getDefaultTransition()||kX,{onLayoutAnimationStart:w,onLayoutAnimationComplete:b}=d.getProps(),S=!this.targetLayout||!xL(this.targetLayout,v),E=!p&&m;if(this.options.layoutRoot||this.resumeFrom||E||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Jb(_,"layout"),onPlay:w,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(f,E,C.path)}else p||AP(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(),fl(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(bX),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&&EL(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const p=this.path[f];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:c,layout:u}=this.options;if(c===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(gX),this.nodes.forEach(RP);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(TP);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(vX),this.nodes.forEach(yX),this.nodes.forEach(dX),this.nodes.forEach(fX)):this.nodes.forEach(TP),this.clearAllSnapshots();const c=fs.now();Nr.delta=wo(0,1e3/60,c-Nr.timestamp),Nr.timestamp=c,Nr.isProcessing=!0,O1.update.process(Nr),O1.preRender.process(Nr),O1.render.process(Nr),Nr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,sx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(mX),this.sharedNodes.forEach(xX)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!hs(this.snapshot.measuredBox.x)&&!hs(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=hr()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(c=!1),c&&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,c=this.projectionDelta&&!bL(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(c||Xl(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const c=this.measurePageBox();let u=this.removeElementScroll(c);return o&&(u=this.removeTransform(u)),CX(u),{animationId:this.root.animationId,measuredBox:c,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return hr();const c=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(PX))){const{scroll:f}=this.root;f&&(co(c.x,f.offset.x),co(c.y,f.offset.y))}return c}removeElementScroll(o){var u;const c=hr();if(Ii(c,o),(u=this.scroll)!=null&&u.wasRoot)return c;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:p,options:m}=f;f!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&Ii(c,o),co(c.x,p.offset.x),co(c.y,p.offset.y))}return c}applyTransform(o,c=!1,u){var f,p;const d=u||hr();Ii(d,o);for(let m=0;m<this.path.length;m++){const v=this.path[m];!c&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(co(d.x,-v.scroll.offset.x),co(d.y,-v.scroll.offset.y)),Xl(v.latestValues)&&e0(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return Xl(this.latestValues)&&e0(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(o){var u;const c=hr();Ii(c,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!Xl(f.latestValues))continue;let p;f.instance&&(t2(f.latestValues)&&f.updateSnapshot(),p=hr(),Ii(p,f.measurePageBox())),_P(c,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,p)}return Xl(this.latestValues)&&_P(c,this.latestValues),c}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!==Nr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:p}=this.options;if(!this.layout||!(f||p))return;this.resolvedRelativeTargetAt=Nr.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=hr(),this.targetWithTransforms=hr()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),GY(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ii(this.target,this.layout.layoutBox),cL(this.target,this.targetDelta)):Ii(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||t2(this.parent.latestValues)||lL(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,c,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=hr(),this.relativeTargetOrigin=hr(),eg(this.relativeTargetOrigin,c,u,this.options.layoutAnchor||void 0),Ii(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var _;const o=this.getLead(),c=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Nr.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;Ii(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;SY(this.layoutCorrected,this.treeScale,this.path,c),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=hr());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(hP(this.prevProjectionDelta.x,this.projectionDelta.x),hP(this.prevProjectionDelta.y,this.projectionDelta.y)),Jf(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!EP(this.projectionDelta.x,this.prevProjectionDelta.x)||!EP(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 c;if((c=this.options.visualElement)==null||c.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Cu(),this.projectionDelta=Cu(),this.projectionDeltaWithTransform=Cu()}setAnimationOrigin(o,c=!1,u){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},m=Cu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const v=hr(),_=d?d.source:void 0,w=this.layout?this.layout.source:void 0,b=_!==w,S=this.getStack(),E=!S||S.members.length<=1,C=!!(b&&!E&&this.options.crossfade===!0&&!this.path.some(EX));this.animationProgress=0;let R;const T=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=O=>{const M=O/1e3,A=T==null?void 0:T(M);A?(m.x.translate=A.x,m.x.scale=vn(o.x.scale,1,M),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=A.y,m.y.scale=vn(o.y.scale,1,M),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(IP(m.x,o.x,M),IP(m.y,o.y,M)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(eg(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),SX(this.relativeTarget,this.relativeTargetOrigin,v,M),R&&QY(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=hr()),Ii(R,this.relativeTarget)),b&&(this.animationValues=p,tX(p,f,this.latestValues,M,C,E)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var c,u,d;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(fl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=yn.update(()=>{n0.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=hd(0)),this.motionValue.jump(0,!1),this.currentAnimation=sX(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(cX),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:c,target:u,layout:d,latestValues:f}=o;if(!(!c||!u||!d)){if(this!==o&&this.layout&&d&&CL(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||hr();const p=hs(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+p;const m=hs(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+m}Ii(c,u),e0(c,f),Jf(this.projectionDeltaWithTransform,this.layoutCorrected,c,f)}}registerSharedNode(o,c){this.sharedNodes.has(o)||this.sharedNodes.set(o,new lX),this.sharedNodes.get(o).add(c);const d=c.options.initialPromotionConfig;c.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(c):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var c;const{layoutId:o}=this.options;return o?((c=this.getStack())==null?void 0:c.lead)||this:this}getPrevLead(){var c;const{layoutId:o}=this.options;return o?(c=this.getStack())==null?void 0:c.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:c,preserveFollowOpacity:u}={}){const d=this.getStack();d&&d.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let c=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(c=!0),!c)return;const d={};u.z&&z1("z",o,d,this.animationValues);for(let f=0;f<V1.length;f++)z1(`rotate${V1[f]}`,o,d,this.animationValues),z1(`skew${V1[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,c){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=t0(c==null?void 0:c.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=t0(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!Xl(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=JY(this.projectionDeltaWithTransform,this.treeScale,f);u&&(p=u(f,p)),o.transform=p;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 _ in r2){if(f[_]===void 0)continue;const{correct:w,applyTo:b,isCSSVariable:S}=r2[_],E=p==="none"?f[_]:w(f[_],d);if(b){const C=b.length;for(let R=0;R<C;R++)o[b[R]]=E}else S?this.options.visualElement.renderState.vars[_]=E:o[_]=E}this.options.layoutId&&(o.pointerEvents=d===this?t0(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var c;return(c=o.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(RP),this.root.sharedNodes.clear()}}}function dX(e){e.updateLayout()}function fX(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")so(p=>{const m=o?t.measuredBox[p]:t.layoutBox[p],v=hs(m);m.min=r[p].min,m.max=m.min+v});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";s2(o?t.measuredBox[p]:t.layoutBox[p],r[p])}else CL(i,t.layoutBox,r)&&so(p=>{const m=o?t.measuredBox[p]:t.layoutBox[p],v=hs(r[p]);m.max=m.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+v)});const c=Cu();Jf(c,r,t.layoutBox);const u=Cu();o?Jf(u,e.applyTransform(s,!0),t.measuredBox):Jf(u,r,t.layoutBox);const d=!bL(c);let f=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:v}=p;if(m&&v){const _=e.options.layoutAnchor||void 0,w=hr();eg(w,t.layoutBox,m.layoutBox,_);const b=hr();eg(b,r,v.layoutBox,_),xL(w,b)||(f=!0),p.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=w,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:u,layoutDelta:c,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function hX(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function pX(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function mX(e){e.clearSnapshot()}function RP(e){e.clearMeasurements()}function gX(e){e.isLayoutDirty=!0,e.updateLayout()}function TP(e){e.isLayoutDirty=!1}function vX(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function yX(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function AP(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function _X(e){e.resolveTargetDelta()}function wX(e){e.calcProjection()}function bX(e){e.resetSkewAndRotation()}function xX(e){e.removeLeadSnapshot()}function IP(e,t,n){e.translate=vn(t.translate,0,n),e.scale=vn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function OP(e,t,n,r){e.min=vn(t.min,n.min,r),e.max=vn(t.max,n.max,r)}function SX(e,t,n,r){OP(e.x,t.x,n.x,r),OP(e.y,t.y,n.y,r)}function EX(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const kX={duration:.45,ease:[.4,0,.1,1]},MP=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),LP=MP("applewebkit/")&&!MP("chrome/")?Math.round:gi;function $P(e){e.min=LP(e.min),e.max=LP(e.max)}function CX(e){$P(e.x),$P(e.y)}function CL(e,t,n){return e==="position"||e==="preserve-aspect"&&!KY(SP(t),SP(n),.2)}function PX(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const RX=kL({attachResizeListener:(e,t)=>bh(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),H1={current:void 0},PL=kL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!H1.current){const e=new RX({});e.mount(window),e.setOptions({layoutScroll:!0}),H1.current=e}return H1.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),xh=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function NP(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function TX(...e){return t=>{let n=!1;const r=e.map(s=>{const i=NP(s,t);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():NP(e[s],null)}}}}function AX(...e){return g.useCallback(TX(...e),e)}class IX extends g.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Ym(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Ym(r)&&r.offsetWidth||0,i=Ym(r)&&r.offsetHeight||0,o=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(o.height),c.width=parseFloat(o.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=s-c.width-c.left,c.bottom=i-c.height-c.top,c.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function OX({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var m;const o=g.useId(),c=g.useRef(null),u=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=g.useContext(xh),f=i!==!1?((m=e.props)==null?void 0:m.ref)??(e==null?void 0:e.ref):void 0,p=AX(c,f);return g.useInsertionEffect(()=>{const{width:v,height:_,top:w,left:b,right:S,bottom:E,direction:C}=u.current;if(t||i===!1||!c.current||!v||!_)return;const R=C==="rtl",T=n==="left"?R?`right: ${S}`:`left: ${b}`:R?`left: ${b}`:`right: ${S}`,O=r==="bottom"?`bottom: ${E}`:`top: ${w}`;c.current.dataset.motionPopId=o;const M=document.createElement("style");d&&(M.nonce=d);const A=s??document.head;return A.appendChild(M),M.sheet&&M.sheet.insertRule(`
|
|
78
|
+
[data-motion-pop-id="${o}"] {
|
|
79
|
+
position: absolute !important;
|
|
80
|
+
width: ${v}px !important;
|
|
81
|
+
height: ${_}px !important;
|
|
82
|
+
${T}px !important;
|
|
83
|
+
${O}px !important;
|
|
84
|
+
}
|
|
85
|
+
`),()=>{var L;(L=c.current)==null||L.removeAttribute("data-motion-pop-id"),A.contains(M)&&A.removeChild(M)}},[t]),P.jsx(IX,{isPresent:t,childRef:c,sizeRef:u,pop:i,children:i===!1?e:g.cloneElement(e,{ref:p})})}const MX=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:c,anchorY:u,root:d})=>{const f=Rg(LX),p=g.useId(),m=g.useRef(n),v=g.useRef(r);Vb(()=>{m.current=n,v.current=r});let _=!0,w=g.useMemo(()=>(_=!1,{id:p,initial:t,isPresent:n,custom:s,onExitComplete:b=>{f.set(b,!0);for(const S of f.values())if(!S)return;r&&r()},register:b=>(f.set(b,!1),()=>{var S;f.delete(b),!m.current&&!f.size&&((S=v.current)==null||S.call(v))})}),[n,f,r]);return i&&_&&(w={...w}),g.useMemo(()=>{f.forEach((b,S)=>f.set(S,!1))},[n]),g.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),e=P.jsx(OX,{pop:o==="popLayout",isPresent:n,anchorX:c,anchorY:u,root:d,children:e}),P.jsx(Tg.Provider,{value:w,children:e})};function LX(){return new Map}function RL(e=!0){const t=g.useContext(Tg);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=g.useId();g.useEffect(()=>{if(e)return s(i)},[e]);const o=g.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const _m=e=>e.key||"";function DP(e){const t=[];return g.Children.forEach(e,n=>{g.isValidElement(n)&&t.push(n)}),t}const Iu=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:c="left",anchorY:u="top",root:d})=>{const[f,p]=RL(o),m=g.useMemo(()=>DP(e),[e]),v=o&&!f?[]:m.map(_m),_=g.useRef(!0),w=g.useRef(m),b=Rg(()=>new Map),S=g.useRef(new Set),[E,C]=g.useState(m),[R,T]=g.useState(m);Vb(()=>{_.current=!1,w.current=m;for(let A=0;A<R.length;A++){const L=_m(R[A]);v.includes(L)?(b.delete(L),S.current.delete(L)):b.get(L)!==!0&&b.set(L,!1)}},[R,v.length,v.join("-")]);const O=[];if(m!==E){let A=[...m];for(let L=0;L<R.length;L++){const V=R[L],W=_m(V);v.includes(W)||(A.splice(L,0,V),O.push(V))}return i==="wait"&&O.length&&(A=O),T(DP(A)),C(m),null}const{forceRender:M}=g.useContext(jb);return P.jsx(P.Fragment,{children:R.map(A=>{const L=_m(A),V=o&&!f?!1:m===R||v.includes(L),W=()=>{if(S.current.has(L))return;if(b.has(L))S.current.add(L),b.set(L,!0);else return;let z=!0;b.forEach(X=>{X||(z=!1)}),z&&(M==null||M(),T(w.current),o&&(p==null||p()),r&&r())};return P.jsx(MX,{isPresent:V,initial:!_.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:V?void 0:W,anchorX:c,anchorY:u,children:A},L)})})},TL=g.createContext({strict:!1}),FP={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 jP=!1;function $X(){if(jP)return;const e={};for(const t in FP)e[t]={isEnabled:n=>FP[t].some(r=>!!n[r])};iL(e),jP=!0}function AL(){return $X(),_Y()}function NX(e){const t=AL();for(const n in e)t[n]={...t[n],...e[n]};iL(t)}const DX=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 tg(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||DX.has(e)}let IL=e=>!tg(e);function OL(e){typeof e=="function"&&(IL=t=>t.startsWith("on")?!tg(t):e(t))}try{OL(require("@emotion/is-prop-valid").default)}catch{}function FX(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||jr(e[s])||(IL(s)||n===!0&&tg(s)||!t&&!tg(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function jX({children:e,isValidProp:t,...n}){t&&OL(t);const r=g.useContext(xh);n={...r,...n},n.transition=Qb(n.transition,r.transition),n.isStatic=Rg(()=>n.isStatic);const s=g.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return P.jsx(xh.Provider,{value:s,children:e})}const Lg=g.createContext({});function VX(e,t){if(Mg(e)){const{initial:n,animate:r}=e;return{initial:n===!1||wh(n)?n:void 0,animate:wh(r)?r:void 0}}return e.inherit!==!1?t:{}}function zX(e){const{initial:t,animate:n}=VX(e,g.useContext(Lg));return g.useMemo(()=>({initial:t,animate:n}),[VP(t),VP(n)])}function VP(e){return Array.isArray(e)?e.join(" "):e}const fx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ML(e,t,n){for(const r in t)!jr(t[r])&&!fL(r,n)&&(e[r]=t[r])}function HX({transformTemplate:e},t){return g.useMemo(()=>{const n=fx();return ux(n,t,e),Object.assign({},n.vars,n.style)},[t])}function UX(e,t){const n=e.style||{},r={};return ML(r,n,e),Object.assign(r,HX(e,t)),r}function ZX(e,t){const n={},r=UX(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const LL=()=>({...fx(),attrs:{}});function BX(e,t,n,r){const s=g.useMemo(()=>{const i=LL();return hL(i,t,mL(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};ML(i,e.style,e),s.style={...i,...s.style}}return s}const WX=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function hx(e){return typeof e!="string"||e.includes("-")?!1:!!(WX.indexOf(e)>-1||/[A-Z]/u.test(e))}function KX(e,t,n,{latestValues:r},s,i=!1,o){const u=(o??hx(e)?BX:ZX)(t,r,s,e),d=FX(t,typeof e=="string",i),f=e!==g.Fragment?{...d,...u,ref:n}:{},{children:p}=t,m=g.useMemo(()=>jr(p)?p.get():p,[p]);return g.createElement(e,{...f,children:m})}function GX({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:qX(n,r,s,e),renderState:t()}}function qX(e,t,n,r){const s={},i=r(e,{});for(const m in i)s[m]=t0(i[m]);let{initial:o,animate:c}=e;const u=Mg(e),d=rL(e);t&&d&&!u&&e.inherit!==!1&&(o===void 0&&(o=t.initial),c===void 0&&(c=t.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const p=f?c:o;if(p&&typeof p!="boolean"&&!Og(p)){const m=Array.isArray(p)?p:[p];for(let v=0;v<m.length;v++){const _=tx(e,m[v]);if(_){const{transitionEnd:w,transition:b,...S}=_;for(const E in S){let C=S[E];if(Array.isArray(C)){const R=f?C.length-1:0;C=C[R]}C!==null&&(s[E]=C)}for(const E in w)s[E]=w[E]}}}return s}const $L=e=>(t,n)=>{const r=g.useContext(Lg),s=g.useContext(Tg),i=()=>GX(e,t,r,s);return n?i():Rg(i)},YX=$L({scrapeMotionValuesFromProps:dx,createRenderState:fx}),XX=$L({scrapeMotionValuesFromProps:gL,createRenderState:LL}),QX=Symbol.for("motionComponentSymbol");function JX(e,t,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var c;i&&((c=e.onMount)==null||c.call(e,i)),t&&(i?t.mount(i):t.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)},[t])}const NL=g.createContext({});function gu(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function eQ(e,t,n,r,s,i){var C,R;const{visualElement:o}=g.useContext(Lg),c=g.useContext(TL),u=g.useContext(Tg),d=g.useContext(xh),f=d.reducedMotion,p=d.skipAnimations,m=g.useRef(null),v=g.useRef(!1);r=r||c.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:p,isSVG:i}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const _=m.current,w=g.useContext(NL);_&&!_.projection&&s&&(_.type==="html"||_.type==="svg")&&tQ(m.current,n,s,w);const b=g.useRef(!1);g.useInsertionEffect(()=>{_&&b.current&&_.update(n,u)});const S=n[BM],E=g.useRef(!!S&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,S))&&((R=window.MotionHasOptimisedAnimation)==null?void 0:R.call(window,S)));return Vb(()=>{v.current=!0,_&&(b.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),E.current&&_.animationState&&_.animationState.animateChanges())}),g.useEffect(()=>{_&&(!E.current&&_.animationState&&_.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,S)}),E.current=!1),_.enteringChildren=void 0)}),_}function tQ(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:c,layoutScroll:u,layoutRoot:d,layoutAnchor:f,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:DL(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||c&&gu(c),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function DL(e){if(e)return e.options.allowProjection!==!1?e.projection:DL(e.parent)}function U1(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&NX(r);const i=n?n==="svg":hx(e),o=i?XX:YX;function c(d,f){let p;const m={...g.useContext(xh),...d,layoutId:nQ(d)},{isStatic:v}=m,_=zX(d),w=o(d,v);if(!v&&typeof window<"u"){rQ();const b=sQ(m);p=b.MeasureLayout,_.visualElement=eQ(e,w,m,s,b.ProjectionNode,i)}return P.jsxs(Lg.Provider,{value:_,children:[p&&_.visualElement?P.jsx(p,{visualElement:_.visualElement,...m}):null,KX(e,d,JX(w,_.visualElement,f),w,v,t,i)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=g.forwardRef(c);return u[QX]=e,u}function nQ({layoutId:e}){const t=g.useContext(jb).id;return t&&e!==void 0?t+"-"+e:e}function rQ(e,t){g.useContext(TL).strict}function sQ(e){const t=AL(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function iQ(e,t){if(typeof Proxy>"u")return U1;const n=new Map,r=(i,o)=>U1(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,U1(o,void 0,e,t)),n.get(o))})}const oQ=(e,t)=>t.isSVG??hx(e)?new NY(t):new AY(t,{allowProjection:e!==g.Fragment});class aQ extends vl{constructor(t){super(t),t.animationState||(t.animationState=zY(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Og(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let lQ=0;class cQ extends vl{constructor(){super(...arguments),this.id=lQ++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:c}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const u=mc(this.node,o,c);if(u){const{transition:d,transitionEnd:f,...p}=u;for(const m in p)(i=this.node.getValue(m))==null||i.jump(p[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const uQ={animation:{Feature:aQ},exit:{Feature:cQ}};function Kh(e){return{point:{x:e.pageX,y:e.pageY}}}const dQ=e=>t=>ix(t)&&e(t,Kh(t));function eh(e,t,n,r){return bh(e,t,dQ(n),r)}const FL=({current:e})=>e?e.ownerDocument.defaultView:null,zP=(e,t)=>Math.abs(e-t);function fQ(e,t){const n=zP(e.x,t.x),r=zP(e.y,t.y);return Math.sqrt(n**2+r**2)}const HP=new Set(["auto","scroll"]);class jL{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=wm(this.lastRawMoveEventInfo,this.transformPagePoint));const _=Z1(this.lastMoveEventInfo,this.history),w=this.startEvent!==null,b=fQ(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!w&&!b)return;const{point:S}=_,{timestamp:E}=Nr;this.history.push({...S,timestamp:E});const{onStart:C,onMove:R}=this.handlers;w||(C&&C(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,_)},this.handlePointerMove=(_,w)=>{this.lastMoveEvent=_,this.lastRawMoveEventInfo=w,this.lastMoveEventInfo=wm(w,this.transformPagePoint),yn.update(this.updatePoint,!0)},this.handlePointerUp=(_,w)=>{this.end();const{onEnd:b,onSessionEnd:S,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Z1(_.type==="pointercancel"?this.lastMoveEventInfo:wm(w,this.transformPagePoint),this.history);this.startEvent&&b&&b(_,C),S&&S(_,C)},!ix(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=Kh(t),d=wm(u,this.transformPagePoint),{point:f}=d,{timestamp:p}=Nr;this.history=[{...f,timestamp:p}];const{onSessionStart:m}=n;m&&m(t,Z1(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=Zh(eh(this.contextWindow,"pointermove",this.handlePointerMove,v),eh(this.contextWindow,"pointerup",this.handlePointerUp,v),eh(this.contextWindow,"pointercancel",this.handlePointerUp,v)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(HP.has(r.overflowX)||HP.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(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.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(t,s),yn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),fl(this.updatePoint)}}function wm(e,t){return t?{point:t(e.point)}:e}function UP(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Z1({point:e},t){return{point:e,delta:UP(e,VL(t)),offset:UP(e,hQ(t)),velocity:pQ(t,.1)}}function hQ(e){return e[0]}function VL(e){return e[e.length-1]}function pQ(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=VL(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Gs(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Gs(t)*2&&(r=e[1]);const i=hi(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 mQ(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?vn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?vn(n,e,r.max):Math.min(e,n)),e}function ZP(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function gQ(e,{top:t,left:n,bottom:r,right:s}){return{x:ZP(e.x,n,s),y:ZP(e.y,t,r)}}function BP(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function vQ(e,t){return{x:BP(e.x,t.x),y:BP(e.y,t.y)}}function yQ(e,t){let n=.5;const r=hs(e),s=hs(t);return s>r?n=yh(t.min,t.max-r,e.min):r>s&&(n=yh(e.min,e.max-s,t.min)),wo(0,1,n)}function _Q(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const i2=.35;function wQ(e=i2){return e===!1?e=0:e===!0&&(e=i2),{x:WP(e,"left","right"),y:WP(e,"top","bottom")}}function WP(e,t,n){return{min:KP(e,t),max:KP(e,n)}}function KP(e,t){return typeof e=="number"?e:e[t]||0}const bQ=new WeakMap;class xQ{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=hr(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=p=>{n&&this.snapToCursor(Kh(p).point),this.stopAnimation()},o=(p,m)=>{const{drag:v,dragPropagation:_,onDragStart:w}=this.getProps();if(v&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Yq(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),so(S=>{let E=this.getAxisMotionValue(S).get()||0;if(go.test(E)){const{projection:C}=this.visualElement;if(C&&C.layout){const R=C.layout.layoutBox[S];R&&(E=hs(R)*(parseFloat(E)/100))}}this.originPoint[S]=E}),w&&yn.update(()=>w(p,m),!1,!0),Yw(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:_,onDirectionLock:w,onDrag:b}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:S}=m;if(_&&this.currentDirection===null){this.currentDirection=EQ(S),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",m.point,S),this.updateAxis("y",m.point,S),this.visualElement.render(),b&&yn.update(()=>b(p,m),!1,!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new jL(t,{onSessionStart:i,onStart:o,onMove:c,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:FL(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||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:c}=this.getProps();c&&yn.postRender(()=>c(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,r){const{drag:s}=this.getProps();if(!r||!bm(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=mQ(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,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;t&&gu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=gQ(r.layoutBox,t):this.constraints=!1,this.elastic=wQ(n),s!==this.constraints&&!gu(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&so(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=_Q(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!gu(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=EY(r,s.root,this.visualElement.getTransformPagePoint());let o=vQ(s.layout.layoutBox,i);if(n){const c=n(bY(o));this.hasMutatedConstraints=!!c,c&&(o=aL(c))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:c}=this.getProps(),u=this.constraints||{},d=so(f=>{if(!bm(f,n,this.currentDirection))return;let p=u&&u[f]||{};(o===!0||o===f)&&(p={min:0,max:0});const m=s?200:1e6,v=s?40:1e7,_={type:"inertia",velocity:r?t[f]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(f,_)});return Promise.all(d).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Yw(this.visualElement,t),r.start(ex(t,r,0,n,this.visualElement,!1))}stopAnimation(){so(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){so(n=>{const{drag:r}=this.getProps();if(!bm(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:c}=s.layout.layoutBox[n],u=i.get()||0;i.set(t[n]-vn(o,c,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!gu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};so(o=>{const c=this.getAxisMotionValue(o);if(c&&this.constraints!==!1){const u=c.get();s[o]=yQ({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(),so(o=>{if(!bm(o,t,null))return;const c=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];c.set(vn(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;bQ.set(this.visualElement,this);const t=this.visualElement.current,n=eh(t,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps(),m=d.target,v=m!==t&&nY(m);f&&p&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();gu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=SQ(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),yn.read(s);const c=bh(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(so(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),o(),u&&u(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=i2,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:c}}}function GP(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function SQ(e,t,n){const r=tP(e,GP(n)),s=tP(t,GP(n));return()=>{r(),s()}}function bm(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function EQ(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class kQ extends vl{constructor(t){super(t),this.removeGroupControls=gi,this.removeListeners=gi,this.controls=new xQ(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gi}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const B1=e=>(t,n)=>{e&&yn.update(()=>e(t,n),!1,!0)};class CQ extends vl{constructor(){super(...arguments),this.removePointerDownListener=gi}onPointerDown(t){this.session=new jL(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:FL(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:B1(t),onStart:B1(n),onMove:B1(r),onEnd:(i,o)=>{delete this.session,s&&yn.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=eh(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let W1=!1;class PQ extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),W1&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),n0.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),W1=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||yn.postRender(()=>{const c=o.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),sx.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;W1=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function zL(e){const[t,n]=RL(),r=g.useContext(jb);return P.jsx(PQ,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(NL),isPresent:t,safeToRemove:n})}const RQ={pan:{Feature:CQ},drag:{Feature:kQ,ProjectionNode:PL,MeasureLayout:zL}};function qP(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&yn.postRender(()=>i(t,Kh(t)))}class TQ extends vl{mount(){const{current:t}=this.node;t&&(this.unmount=Qq(t,(n,r)=>(qP(this.node,r,"Start"),s=>qP(this.node,s,"End"))))}unmount(){}}class AQ extends vl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Zh(bh(this.node.current,"focus",()=>this.onFocus()),bh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function YP(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&yn.postRender(()=>i(t,Kh(t)))}class IQ extends vl{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=sY(t,(s,i)=>(YP(this.node,i,"Start"),(o,{success:c})=>YP(this.node,o,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const o2=new WeakMap,K1=new WeakMap,OQ=e=>{const t=o2.get(e.target);t&&t(e)},MQ=e=>{e.forEach(OQ)};function LQ({root:e,...t}){const n=e||document;K1.has(n)||K1.set(n,{});const r=K1.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(MQ,{root:e,...t})),r[s]}function $Q(e,t,n){const r=LQ(t);return o2.set(e,n),r.observe(e),()=>{o2.delete(e),r.unobserve(e)}}const NQ={some:0,all:1};class DQ extends vl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:NQ[s]},c=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),v=f?p:m;v&&v(d)};this.stopObserver=$Q(this.node.current,o,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(FQ(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function FQ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const jQ={inView:{Feature:DQ},tap:{Feature:IQ},focus:{Feature:AQ},hover:{Feature:TQ}},VQ={layout:{ProjectionNode:PL,MeasureLayout:zL}},zQ={...uQ,...jQ,...RQ,...VQ},HQ=iQ(zQ,oQ);function UQ(){!cx.current&&sL();const[e]=g.useState(X0.current);return e}const Jo=HQ;var ZQ=(function(){var e=function(t,n){return e=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])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var BQ=function(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},xm,XP="__POSTHOG_REACT_SHARED_STATE__",QP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Sh;try{Sh=QP[XP]=QP[XP]||new WeakMap}catch{Sh=new WeakMap}Sh.has(g.createContext)||Sh.set(g.createContext,{});var gc=Sh.get(g.createContext),a2;function WQ(e){(!gc.defaultPostHogInstance||gc.defaultPostHogInstance===a2)&&(gc.defaultPostHogInstance=e),a2=e}function l2(){return a2}gc.context||(gc.context=g.createContext({get client(){return l2()||gc.defaultPostHogInstance},bootstrap:void 0}));var px=gc.context;function HL(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(var i=0,o=r;i<o.length;i++){var c=o[i];if(!s.includes(c)||!HL(e[c],t[c],n))return!1}return!0}function KQ(e){var t,n,r=e.children,s=e.client,i=e.apiKey,o=e.options,c=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=l2();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=l2(),f=c.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&&!HL(o,f.options)&&d.set_config(o),c.current={apiKey:i,options:o??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,o),c.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),Ee.createElement(px.Provider,{value:{client:u,bootstrap:(t=o==null?void 0:o.bootstrap)!==null&&t!==void 0?t:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var G1=function(e){return typeof e=="function"},GQ=function(e){return e===void 0},Ys=function(){var e=g.useContext(px).client;return e},r0=function(e){var t=Object.prototype.toString.call(e);return e instanceof Error||t==="[object Error]"||t==="[object Exception]"||t==="[object DOMException]"||t==="[object DOMError]"},qQ=function(e,t){try{Object.defineProperty(e,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}},YQ=function(e,t){for(var n=new WeakSet,r=e;!n.has(r);){if(n.add(r),!r0(r.cause)){GQ(r.cause)||(t.cause=r.cause),r.cause=t;return}r=r.cause}},XQ=function(e,t){if(!t)return e;var n=new Error(r0(e)?e.message:"Primitive value captured as exception: ".concat(String(e)));return qQ(n,"React ErrorBoundary ".concat(r0(e)?e.name:"Error")),n.stack=t,r0(e)?(YQ(e,n),e):n},JP={componentStack:null,exceptionEvent:null,error:null},QQ={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},JQ=(xm=(function(e){ZQ(t,e);function t(n){var r=e.call(this,n)||this;return r._resetError=function(){r.setState(JP)},r.state=JP,r}return t.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;G1(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,c=r.componentStack,u=o.captureException(XQ(n,c),i);this.setState({error:n,componentStack:c??null,exceptionEvent:u})},t.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return G1(r)?r():r;var o=G1(s)?Ee.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return Ee.isValidElement(o)?o:(console.warn(QQ.INVALID_FALLBACK),Ee.createElement(Ee.Fragment,null))},t})(Ee.Component),BQ(xm,"PostHogErrorBoundary"),(function(){xm.contextType=px})(),xm);WQ(Xe);const eJ="rivet-preview-bridge",tJ=["ArrowUp","ArrowDown"],nJ=new Set(["INPUT","TEXTAREA","SELECT"]),UL=e=>!e||!("tagName"in e)||typeof e.tagName!="string"?!1:nJ.has(e.tagName.toUpperCase())||"isContentEditable"in e&&e.isContentEditable===!0,rJ=e=>typeof e!="object"||e===null||!("channel"in e)||e.channel!==eJ||!("direction"in e)||e.direction!=="event"||!("type"in e)||e.type!=="keydown"||!("key"in e)?null:tJ.find(t=>t===e.key)??null,sJ=e=>{try{return new URL(e.src,window.location.href).origin}catch{return null}},iJ=e=>e.source===null?null:Array.from(document.querySelectorAll("iframe")).find(t=>t.contentWindow===e.source&&sJ(t)===e.origin)??null,oJ=e=>{const t=n=>{UL(n.target)||e(n)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},aJ=()=>{const e=t=>{const n=rJ(t.data),r=n?iJ(t):null;!n||!r||r.dispatchEvent(new KeyboardEvent("keydown",{key:n,bubbles:!0,cancelable:!0}))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)};var Sm={},q1={exports:{}},xs={},Y1={exports:{}},X1={};/**
|
|
86
|
+
* @license React
|
|
87
|
+
* scheduler.production.min.js
|
|
88
|
+
*
|
|
89
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the MIT license found in the
|
|
92
|
+
* LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/var eR;function lJ(){return eR||(eR=1,(function(e){function t(U,J){var K=U.length;U.push(J);e:for(;0<K;){var D=K-1>>>1,q=U[D];if(0<s(q,J))U[D]=J,U[K]=q,K=D;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var J=U[0],K=U.pop();if(K!==J){U[0]=K;e:for(var D=0,q=U.length,fe=q>>>1;D<fe;){var ae=2*(D+1)-1,ce=U[ae],he=ae+1,ke=U[he];if(0>s(ce,K))he<q&&0>s(ke,ce)?(U[D]=ke,U[he]=K,D=he):(U[D]=ce,U[ae]=K,D=ae);else if(he<q&&0>s(ke,K))U[D]=ke,U[he]=K,D=he;else break e}}return J}function s(U,J){var K=U.sortIndex-J.sortIndex;return K!==0?K:U.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var u=[],d=[],f=1,p=null,m=3,v=!1,_=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=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(U){for(var J=n(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=U)r(d),J.sortIndex=J.expirationTime,t(u,J);else break;J=n(d)}}function R(U){if(w=!1,C(U),!_)if(n(u)!==null)_=!0,Y(T);else{var J=n(d);J!==null&&oe(R,J.startTime-U)}}function T(U,J){_=!1,w&&(w=!1,S(A),A=-1),v=!0;var K=m;try{for(C(J),p=n(u);p!==null&&(!(p.expirationTime>J)||U&&!W());){var D=p.callback;if(typeof D=="function"){p.callback=null,m=p.priorityLevel;var q=D(p.expirationTime<=J);J=e.unstable_now(),typeof q=="function"?p.callback=q:p===n(u)&&r(u),C(J)}else r(u);p=n(u)}if(p!==null)var fe=!0;else{var ae=n(d);ae!==null&&oe(R,ae.startTime-J),fe=!1}return fe}finally{p=null,m=K,v=!1}}var O=!1,M=null,A=-1,L=5,V=-1;function W(){return!(e.unstable_now()-V<L)}function z(){if(M!==null){var U=e.unstable_now();V=U;var J=!0;try{J=M(!0,U)}finally{J?X():(O=!1,M=null)}}else O=!1}var X;if(typeof E=="function")X=function(){E(z)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,H=Q.port2;Q.port1.onmessage=z,X=function(){H.postMessage(null)}}else X=function(){b(z,0)};function Y(U){M=U,O||(O=!0,X())}function oe(U,J){A=b(function(){U(e.unstable_now())},J)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_continueExecution=function(){_||v||(_=!0,Y(T))},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(U){switch(m){case 1:case 2:case 3:var J=3;break;default:J=m}var K=m;m=J;try{return U()}finally{m=K}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(U,J){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var K=m;m=U;try{return J()}finally{m=K}},e.unstable_scheduleCallback=function(U,J,K){var D=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?D+K:D):K=D,U){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=K+q,U={id:f++,callback:J,priorityLevel:U,startTime:K,expirationTime:q,sortIndex:-1},K>D?(U.sortIndex=K,t(d,U),n(u)===null&&U===n(d)&&(w?(S(A),A=-1):w=!0,oe(R,K-D))):(U.sortIndex=q,t(u,U),_||v||(_=!0,Y(T))),U},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(U){var J=m;return function(){var K=m;m=J;try{return U.apply(this,arguments)}finally{m=K}}}})(X1)),X1}var tR;function cJ(){return tR||(tR=1,Y1.exports=lJ()),Y1.exports}/**
|
|
94
|
+
* @license React
|
|
95
|
+
* react-dom.production.min.js
|
|
96
|
+
*
|
|
97
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the MIT license found in the
|
|
100
|
+
* LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/var nR;function uJ(){if(nR)return xs;nR=1;var e=B2(),t=cJ();function n(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,h=1;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(a,l){o(a,l),o(a+"Capture",l)}function o(a,l){for(s[a]=l,a=0;a<l.length;a++)r.add(l[a])}var c=!(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={},p={};function m(a){return u.call(p,a)?!0:u.call(f,a)?!1:d.test(a)?p[a]=!0:(f[a]=!0,!1)}function v(a,l,h,y){if(h!==null&&h.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:h!==null?!h.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function _(a,l,h,y){if(l===null||typeof l>"u"||v(a,l,h,y))return!0;if(y)return!1;if(h!==null)switch(h.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function w(a,l,h,y,x,k,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=x,this.mustUseProperty=h,this.propertyName=a,this.type=l,this.sanitizeURL=k,this.removeEmptyString=I}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){b[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];b[l]=new w(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){b[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){b[a]=new w(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){b[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){b[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){b[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){b[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){b[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(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 l=a.replace(S,E);b[l]=new w(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(S,E);b[l]=new w(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(S,E);b[l]=new w(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){b[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),b.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){b[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,l,h,y){var x=b.hasOwnProperty(l)?b[l]:null;(x!==null?x.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(_(l,h,x,y)&&(h=null),y||x===null?m(l)&&(h===null?a.removeAttribute(l):a.setAttribute(l,""+h)):x.mustUseProperty?a[x.propertyName]=h===null?x.type===3?!1:"":h:(l=x.attributeName,y=x.attributeNamespace,h===null?a.removeAttribute(l):(x=x.type,h=x===3||x===4&&h===!0?"":""+h,y?a.setAttributeNS(y,l,h):a.setAttribute(l,h))))}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),O=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),W=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),oe=Symbol.for("react.offscreen"),U=Symbol.iterator;function J(a){return a===null||typeof a!="object"?null:(a=U&&a[U]||a["@@iterator"],typeof a=="function"?a:null)}var K=Object.assign,D;function q(a){if(D===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);D=l&&l[1]||""}return`
|
|
102
|
+
`+D+a}var fe=!1;function ae(a,l){if(!a||fe)return"";fe=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(se){var y=se}Reflect.construct(a,[],l)}else{try{l.call()}catch(se){y=se}a.call(l.prototype)}else{try{throw Error()}catch(se){y=se}a()}}catch(se){if(se&&y&&typeof se.stack=="string"){for(var x=se.stack.split(`
|
|
103
|
+
`),k=y.stack.split(`
|
|
104
|
+
`),I=x.length-1,j=k.length-1;1<=I&&0<=j&&x[I]!==k[j];)j--;for(;1<=I&&0<=j;I--,j--)if(x[I]!==k[j]){if(I!==1||j!==1)do if(I--,j--,0>j||x[I]!==k[j]){var B=`
|
|
105
|
+
`+x[I].replace(" at new "," at ");return a.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",a.displayName)),B}while(1<=I&&0<=j);break}}}finally{fe=!1,Error.prepareStackTrace=h}return(a=a?a.displayName||a.name:"")?q(a):""}function ce(a){switch(a.tag){case 5:return q(a.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return a=ae(a.type,!1),a;case 11:return a=ae(a.type.render,!1),a;case 1:return a=ae(a.type,!0),a;default:return""}}function he(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 M:return"Fragment";case O:return"Portal";case L:return"Profiler";case A:return"StrictMode";case X:return"Suspense";case Q:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case W:return(a.displayName||"Context")+".Consumer";case V:return(a._context.displayName||"Context")+".Provider";case z:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case H:return l=a.displayName||null,l!==null?l:he(a.type)||"Memo";case Y:l=a._payload,a=a._init;try{return he(a(l))}catch{}}return null}function ke(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(l);case 8:return l===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ge(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function pe(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Le(a){var l=pe(a)?"checked":"value",h=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),y=""+a[l];if(!a.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var x=h.get,k=h.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return x.call(this)},set:function(I){y=""+I,k.call(this,I)}}),Object.defineProperty(a,l,{enumerable:h.enumerable}),{getValue:function(){return y},setValue:function(I){y=""+I},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function Ae(a){a._valueTracker||(a._valueTracker=Le(a))}function Ne(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var h=l.getValue(),y="";return a&&(y=pe(a)?a.checked?"true":"false":a.value),a=y,a!==h?(l.setValue(a),!0):!1}function Et(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 dn(a,l){var h=l.checked;return K({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??a._wrapperState.initialChecked})}function sn(a,l){var h=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;h=ge(l.value!=null?l.value:h),a._wrapperState={initialChecked:y,initialValue:h,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function kt(a,l){l=l.checked,l!=null&&C(a,"checked",l,!1)}function Gt(a,l){kt(a,l);var h=ge(l.value),y=l.type;if(h!=null)y==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+h):a.value!==""+h&&(a.value=""+h);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}l.hasOwnProperty("value")?Xt(a,l.type,h):l.hasOwnProperty("defaultValue")&&Xt(a,l.type,ge(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function mn(a,l,h){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,h||l===a.value||(a.value=l),a.defaultValue=l}h=a.name,h!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,h!==""&&(a.name=h)}function Xt(a,l,h){(l!=="number"||Et(a.ownerDocument)!==a)&&(h==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+h&&(a.defaultValue=""+h))}var Me=Array.isArray;function Qe(a,l,h,y){if(a=a.options,l){l={};for(var x=0;x<h.length;x++)l["$"+h[x]]=!0;for(h=0;h<a.length;h++)x=l.hasOwnProperty("$"+a[h].value),a[h].selected!==x&&(a[h].selected=x),x&&y&&(a[h].defaultSelected=!0)}else{for(h=""+ge(h),l=null,x=0;x<a.length;x++){if(a[x].value===h){a[x].selected=!0,y&&(a[x].defaultSelected=!0);return}l!==null||a[x].disabled||(l=a[x])}l!==null&&(l.selected=!0)}}function Te(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return K({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function xt(a,l){var h=l.value;if(h==null){if(h=l.children,l=l.defaultValue,h!=null){if(l!=null)throw Error(n(92));if(Me(h)){if(1<h.length)throw Error(n(93));h=h[0]}l=h}l==null&&(l=""),h=l}a._wrapperState={initialValue:ge(h)}}function xe(a,l){var h=ge(l.value),y=ge(l.defaultValue);h!=null&&(h=""+h,h!==a.value&&(a.value=h),l.defaultValue==null&&a.defaultValue!==h&&(a.defaultValue=h)),y!=null&&(a.defaultValue=""+y)}function Nt(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function dt(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 gt(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?dt(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Hn,Js=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,h,y,x){MSApp.execUnsafeLocalFunction(function(){return a(l,h,y,x)})}:a})(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(Hn=Hn||document.createElement("div"),Hn.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Hn.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function _n(a,l){if(l){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=l;return}}a.textContent=l}var Gn={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},_i=["Webkit","ms","Moz","O"];Object.keys(Gn).forEach(function(a){_i.forEach(function(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),Gn[l]=Gn[a]})});function ts(a,l,h){return l==null||typeof l=="boolean"||l===""?"":h||typeof l!="number"||l===0||Gn.hasOwnProperty(a)&&Gn[a]?(""+l).trim():l+"px"}function zr(a,l){a=a.style;for(var h in l)if(l.hasOwnProperty(h)){var y=h.indexOf("--")===0,x=ts(h,l[h],y);h==="float"&&(h="cssFloat"),y?a.setProperty(h,x):a[h]=x}}var Un=K({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 fn(a,l){if(l){if(Un[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Hr(a,l){if(a.indexOf("-")===-1)return typeof l.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 Qn=null;function Hi(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Tr=null,Zn=null,vr=null;function $s(a){if(a=Zd(a)){if(typeof Tr!="function")throw Error(n(280));var l=a.stateNode;l&&(l=dp(l),Tr(a.stateNode,a.type,l))}}function qn(a){Zn?vr?vr.push(a):vr=[a]:Zn=a}function ns(){if(Zn){var a=Zn,l=vr;if(vr=Zn=null,$s(a),l)for(a=0;a<l.length;a++)$s(l[a])}}function st(a,l){return a(l)}function rn(){}var Qt=!1;function hn(a,l,h){if(Qt)return a(l,h);Qt=!0;try{return st(a,l,h)}finally{Qt=!1,(Zn!==null||vr!==null)&&(rn(),ns())}}function wn(a,l){var h=a.stateNode;if(h===null)return null;var y=dp(h);if(y===null)return null;h=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(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(h&&typeof h!="function")throw Error(n(231,l,typeof h));return h}var Bt=!1;if(c)try{var Rn={};Object.defineProperty(Rn,"passive",{get:function(){Bt=!0}}),window.addEventListener("test",Rn,Rn),window.removeEventListener("test",Rn,Rn)}catch{Bt=!1}function Ur(a,l,h,y,x,k,I,j,B){var se=Array.prototype.slice.call(arguments,3);try{l.apply(h,se)}catch(_e){this.onError(_e)}}var Bn=!1,cr=null,zt=!1,ei=null,Id={onError:function(a){Bn=!0,cr=a}};function ua(a,l,h,y,x,k,I,j,B){Bn=!1,cr=null,Ur.apply(Id,arguments)}function Ui(a,l,h,y,x,k,I,j,B){if(ua.apply(this,arguments),Bn){if(Bn){var se=cr;Bn=!1,cr=null}else throw Error(n(198));zt||(zt=!0,ei=se)}}function yr(a){var l=a,h=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,(l.flags&4098)!==0&&(h=l.return),a=l.return;while(a)}return l.tag===3?h:null}function ti(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function ms(a){if(yr(a)!==a)throw Error(n(188))}function wi(a){var l=a.alternate;if(!l){if(l=yr(a),l===null)throw Error(n(188));return l!==a?null:a}for(var h=a,y=l;;){var x=h.return;if(x===null)break;var k=x.alternate;if(k===null){if(y=x.return,y!==null){h=y;continue}break}if(x.child===k.child){for(k=x.child;k;){if(k===h)return ms(x),a;if(k===y)return ms(x),l;k=k.sibling}throw Error(n(188))}if(h.return!==y.return)h=x,y=k;else{for(var I=!1,j=x.child;j;){if(j===h){I=!0,h=x,y=k;break}if(j===y){I=!0,y=x,h=k;break}j=j.sibling}if(!I){for(j=k.child;j;){if(j===h){I=!0,h=k,y=x;break}if(j===y){I=!0,y=k,h=x;break}j=j.sibling}if(!I)throw Error(n(189))}}if(h.alternate!==y)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?a:l}function gs(a){return a=wi(a),a!==null?da(a):null}function da(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var l=da(a);if(l!==null)return l;a=a.sibling}return null}var Ns=t.unstable_scheduleCallback,wl=t.unstable_cancelCallback,Rc=t.unstable_shouldYield,fa=t.unstable_requestPaint,on=t.unstable_now,Zi=t.unstable_getCurrentPriorityLevel,Ds=t.unstable_ImmediatePriority,Bi=t.unstable_UserBlockingPriority,Ar=t.unstable_NormalPriority,bl=t.unstable_LowPriority,xl=t.unstable_IdlePriority,So=null,Zr=null;function Sl(a){if(Zr&&typeof Zr.onCommitFiberRoot=="function")try{Zr.onCommitFiberRoot(So,a,void 0,(a.current.flags&128)===128)}catch{}}var rs=Math.clz32?Math.clz32:ha,Od=Math.log,Tc=Math.LN2;function ha(a){return a>>>=0,a===0?32:31-(Od(a)/Tc|0)|0}var ni=64,$=4194304;function ue(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 ve(a,l){var h=a.pendingLanes;if(h===0)return 0;var y=0,x=a.suspendedLanes,k=a.pingedLanes,I=h&268435455;if(I!==0){var j=I&~x;j!==0?y=ue(j):(k&=I,k!==0&&(y=ue(k)))}else I=h&~x,I!==0?y=ue(I):k!==0&&(y=ue(k));if(y===0)return 0;if(l!==0&&l!==y&&(l&x)===0&&(x=y&-y,k=l&-l,x>=k||x===16&&(k&4194240)!==0))return l;if((y&4)!==0&&(y|=h&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=y;0<l;)h=31-rs(l),x=1<<h,y|=a[h],l&=~x;return y}function Se(a,l){switch(a){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(a,l){for(var h=a.suspendedLanes,y=a.pingedLanes,x=a.expirationTimes,k=a.pendingLanes;0<k;){var I=31-rs(k),j=1<<I,B=x[I];B===-1?((j&h)===0||(j&y)!==0)&&(x[I]=Se(j,l)):B<=l&&(a.expiredLanes|=j),k&=~j}}function ht(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Ct(){var a=ni;return ni<<=1,(ni&4194240)===0&&(ni=64),a}function Tt(a){for(var l=[],h=0;31>h;h++)l.push(a);return l}function Jt(a,l,h){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-rs(l),a[l]=h}function pt(a,l){var h=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<h;){var x=31-rs(h),k=1<<x;l[x]=0,y[x]=-1,a[x]=-1,h&=~k}}function Tn(a,l){var h=a.entangledLanes|=l;for(a=a.entanglements;h;){var y=31-rs(h),x=1<<y;x&l|a[y]&l&&(a[y]|=l),h&=~x}}var it=0;function Ir(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Eo,ko,Or,Wi,El,Ac=!1,kl=[],bi=null,F=null,re=null,Oe=new Map,Pe=new Map,be=[],De="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 St(a,l){switch(a){case"focusin":case"focusout":bi=null;break;case"dragenter":case"dragleave":F=null;break;case"mouseover":case"mouseout":re=null;break;case"pointerover":case"pointerout":Oe.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pe.delete(l.pointerId)}}function at(a,l,h,y,x,k){return a===null||a.nativeEvent!==k?(a={blockedOn:l,domEventName:h,eventSystemFlags:y,nativeEvent:k,targetContainers:[x]},l!==null&&(l=Zd(l),l!==null&&ko(l)),a):(a.eventSystemFlags|=y,l=a.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),a)}function wt(a,l,h,y,x){switch(l){case"focusin":return bi=at(bi,a,l,h,y,x),!0;case"dragenter":return F=at(F,a,l,h,y,x),!0;case"mouseover":return re=at(re,a,l,h,y,x),!0;case"pointerover":var k=x.pointerId;return Oe.set(k,at(Oe.get(k)||null,a,l,h,y,x)),!0;case"gotpointercapture":return k=x.pointerId,Pe.set(k,at(Pe.get(k)||null,a,l,h,y,x)),!0}return!1}function Jn(a){var l=Cl(a.target);if(l!==null){var h=yr(l);if(h!==null){if(l=h.tag,l===13){if(l=ti(h),l!==null){a.blockedOn=l,El(a.priority,function(){Or(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function _r(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var h=nv(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(h===null){h=a.nativeEvent;var y=new h.constructor(h.type,h);Qn=y,h.target.dispatchEvent(y),Qn=null}else return l=Zd(h),l!==null&&ko(l),a.blockedOn=h,!1;l.shift()}return!0}function Fs(a,l,h){_r(a)&&h.delete(l)}function js(){Ac=!1,bi!==null&&_r(bi)&&(bi=null),F!==null&&_r(F)&&(F=null),re!==null&&_r(re)&&(re=null),Oe.forEach(Fs),Pe.forEach(Fs)}function Ft(a,l){a.blockedOn===l&&(a.blockedOn=null,Ac||(Ac=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,js)))}function Pt(a){function l(x){return Ft(x,a)}if(0<kl.length){Ft(kl[0],a);for(var h=1;h<kl.length;h++){var y=kl[h];y.blockedOn===a&&(y.blockedOn=null)}}for(bi!==null&&Ft(bi,a),F!==null&&Ft(F,a),re!==null&&Ft(re,a),Oe.forEach(l),Pe.forEach(l),h=0;h<be.length;h++)y=be[h],y.blockedOn===a&&(y.blockedOn=null);for(;0<be.length&&(h=be[0],h.blockedOn===null);)Jn(h),h.blockedOn===null&&be.shift()}var xi=R.ReactCurrentBatchConfig,Ki=!0;function h4(a,l,h,y){var x=it,k=xi.transition;xi.transition=null;try{it=1,tv(a,l,h,y)}finally{it=x,xi.transition=k}}function p4(a,l,h,y){var x=it,k=xi.transition;xi.transition=null;try{it=4,tv(a,l,h,y)}finally{it=x,xi.transition=k}}function tv(a,l,h,y){if(Ki){var x=nv(a,l,h,y);if(x===null)_v(a,l,y,Jh,h),St(a,y);else if(wt(x,a,l,h,y))y.stopPropagation();else if(St(a,y),l&4&&-1<De.indexOf(a)){for(;x!==null;){var k=Zd(x);if(k!==null&&Eo(k),k=nv(a,l,h,y),k===null&&_v(a,l,y,Jh,h),k===x)break;x=k}x!==null&&y.stopPropagation()}else _v(a,l,y,null,h)}}var Jh=null;function nv(a,l,h,y){if(Jh=null,a=Hi(y),a=Cl(a),a!==null)if(l=yr(a),l===null)a=null;else if(h=l.tag,h===13){if(a=ti(l),a!==null)return a;a=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return Jh=a,null}function tS(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(Zi()){case Ds:return 1;case Bi:return 4;case Ar:case bl:return 16;case xl:return 536870912;default:return 16}default:return 16}}var pa=null,rv=null,ep=null;function nS(){if(ep)return ep;var a,l=rv,h=l.length,y,x="value"in pa?pa.value:pa.textContent,k=x.length;for(a=0;a<h&&l[a]===x[a];a++);var I=h-a;for(y=1;y<=I&&l[h-y]===x[k-y];y++);return ep=x.slice(a,1<y?1-y:void 0)}function tp(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function np(){return!0}function rS(){return!1}function Vs(a){function l(h,y,x,k,I){this._reactName=h,this._targetInst=x,this.type=y,this.nativeEvent=k,this.target=I,this.currentTarget=null;for(var j in a)a.hasOwnProperty(j)&&(h=a[j],this[j]=h?h(k):k[j]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?np:rS,this.isPropagationStopped=rS,this}return K(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=np)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=np)},persist:function(){},isPersistent:np}),l}var Ic={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sv=Vs(Ic),Md=K({},Ic,{view:0,detail:0}),m4=Vs(Md),iv,ov,Ld,rp=K({},Md,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lv,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!==Ld&&(Ld&&a.type==="mousemove"?(iv=a.screenX-Ld.screenX,ov=a.screenY-Ld.screenY):ov=iv=0,Ld=a),iv)},movementY:function(a){return"movementY"in a?a.movementY:ov}}),sS=Vs(rp),g4=K({},rp,{dataTransfer:0}),v4=Vs(g4),y4=K({},Md,{relatedTarget:0}),av=Vs(y4),_4=K({},Ic,{animationName:0,elapsedTime:0,pseudoElement:0}),w4=Vs(_4),b4=K({},Ic,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),x4=Vs(b4),S4=K({},Ic,{data:0}),iS=Vs(S4),E4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},k4={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"},C4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function P4(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=C4[a])?!!l[a]:!1}function lv(){return P4}var R4=K({},Md,{key:function(a){if(a.key){var l=E4[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=tp(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?k4[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lv,charCode:function(a){return a.type==="keypress"?tp(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?tp(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),T4=Vs(R4),A4=K({},rp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),oS=Vs(A4),I4=K({},Md,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lv}),O4=Vs(I4),M4=K({},Ic,{propertyName:0,elapsedTime:0,pseudoElement:0}),L4=Vs(M4),$4=K({},rp,{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}),N4=Vs($4),D4=[9,13,27,32],cv=c&&"CompositionEvent"in window,$d=null;c&&"documentMode"in document&&($d=document.documentMode);var F4=c&&"TextEvent"in window&&!$d,aS=c&&(!cv||$d&&8<$d&&11>=$d),lS=" ",cS=!1;function uS(a,l){switch(a){case"keyup":return D4.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dS(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Oc=!1;function j4(a,l){switch(a){case"compositionend":return dS(l);case"keypress":return l.which!==32?null:(cS=!0,lS);case"textInput":return a=l.data,a===lS&&cS?null:a;default:return null}}function V4(a,l){if(Oc)return a==="compositionend"||!cv&&uS(a,l)?(a=nS(),ep=rv=pa=null,Oc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return aS&&l.locale!=="ko"?null:l.data;default:return null}}var z4={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 fS(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!z4[a.type]:l==="textarea"}function hS(a,l,h,y){qn(y),l=lp(l,"onChange"),0<l.length&&(h=new sv("onChange","change",null,h,y),a.push({event:h,listeners:l}))}var Nd=null,Dd=null;function H4(a){IS(a,0)}function sp(a){var l=Dc(a);if(Ne(l))return a}function U4(a,l){if(a==="change")return l}var pS=!1;if(c){var uv;if(c){var dv="oninput"in document;if(!dv){var mS=document.createElement("div");mS.setAttribute("oninput","return;"),dv=typeof mS.oninput=="function"}uv=dv}else uv=!1;pS=uv&&(!document.documentMode||9<document.documentMode)}function gS(){Nd&&(Nd.detachEvent("onpropertychange",vS),Dd=Nd=null)}function vS(a){if(a.propertyName==="value"&&sp(Dd)){var l=[];hS(l,Dd,a,Hi(a)),hn(H4,l)}}function Z4(a,l,h){a==="focusin"?(gS(),Nd=l,Dd=h,Nd.attachEvent("onpropertychange",vS)):a==="focusout"&&gS()}function B4(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return sp(Dd)}function W4(a,l){if(a==="click")return sp(l)}function K4(a,l){if(a==="input"||a==="change")return sp(l)}function G4(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Si=typeof Object.is=="function"?Object.is:G4;function Fd(a,l){if(Si(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var h=Object.keys(a),y=Object.keys(l);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var x=h[y];if(!u.call(l,x)||!Si(a[x],l[x]))return!1}return!0}function yS(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function _S(a,l){var h=yS(a);a=0;for(var y;h;){if(h.nodeType===3){if(y=a+h.textContent.length,a<=l&&y>=l)return{node:h,offset:l-a};a=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=yS(h)}}function wS(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?wS(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function bS(){for(var a=window,l=Et();l instanceof a.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)a=l.contentWindow;else break;l=Et(a.document)}return l}function fv(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function q4(a){var l=bS(),h=a.focusedElem,y=a.selectionRange;if(l!==h&&h&&h.ownerDocument&&wS(h.ownerDocument.documentElement,h)){if(y!==null&&fv(h)){if(l=y.start,a=y.end,a===void 0&&(a=l),"selectionStart"in h)h.selectionStart=l,h.selectionEnd=Math.min(a,h.value.length);else if(a=(l=h.ownerDocument||document)&&l.defaultView||window,a.getSelection){a=a.getSelection();var x=h.textContent.length,k=Math.min(y.start,x);y=y.end===void 0?k:Math.min(y.end,x),!a.extend&&k>y&&(x=y,y=k,k=x),x=_S(h,k);var I=_S(h,y);x&&I&&(a.rangeCount!==1||a.anchorNode!==x.node||a.anchorOffset!==x.offset||a.focusNode!==I.node||a.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(x.node,x.offset),a.removeAllRanges(),k>y?(a.addRange(l),a.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),a.addRange(l)))}}for(l=[],a=h;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<l.length;h++)a=l[h],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var Y4=c&&"documentMode"in document&&11>=document.documentMode,Mc=null,hv=null,jd=null,pv=!1;function xS(a,l,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;pv||Mc==null||Mc!==Et(y)||(y=Mc,"selectionStart"in y&&fv(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}),jd&&Fd(jd,y)||(jd=y,y=lp(hv,"onSelect"),0<y.length&&(l=new sv("onSelect","select",null,l,h),a.push({event:l,listeners:y}),l.target=Mc)))}function ip(a,l){var h={};return h[a.toLowerCase()]=l.toLowerCase(),h["Webkit"+a]="webkit"+l,h["Moz"+a]="moz"+l,h}var Lc={animationend:ip("Animation","AnimationEnd"),animationiteration:ip("Animation","AnimationIteration"),animationstart:ip("Animation","AnimationStart"),transitionend:ip("Transition","TransitionEnd")},mv={},SS={};c&&(SS=document.createElement("div").style,"AnimationEvent"in window||(delete Lc.animationend.animation,delete Lc.animationiteration.animation,delete Lc.animationstart.animation),"TransitionEvent"in window||delete Lc.transitionend.transition);function op(a){if(mv[a])return mv[a];if(!Lc[a])return a;var l=Lc[a],h;for(h in l)if(l.hasOwnProperty(h)&&h in SS)return mv[a]=l[h];return a}var ES=op("animationend"),kS=op("animationiteration"),CS=op("animationstart"),PS=op("transitionend"),RS=new Map,TS="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 ma(a,l){RS.set(a,l),i(l,[a])}for(var gv=0;gv<TS.length;gv++){var vv=TS[gv],X4=vv.toLowerCase(),Q4=vv[0].toUpperCase()+vv.slice(1);ma(X4,"on"+Q4)}ma(ES,"onAnimationEnd"),ma(kS,"onAnimationIteration"),ma(CS,"onAnimationStart"),ma("dblclick","onDoubleClick"),ma("focusin","onFocus"),ma("focusout","onBlur"),ma(PS,"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 Vd="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(" "),J4=new Set("cancel close invalid load scroll toggle".split(" ").concat(Vd));function AS(a,l,h){var y=a.type||"unknown-event";a.currentTarget=h,Ui(y,l,void 0,a),a.currentTarget=null}function IS(a,l){l=(l&4)!==0;for(var h=0;h<a.length;h++){var y=a[h],x=y.event;y=y.listeners;e:{var k=void 0;if(l)for(var I=y.length-1;0<=I;I--){var j=y[I],B=j.instance,se=j.currentTarget;if(j=j.listener,B!==k&&x.isPropagationStopped())break e;AS(x,j,se),k=B}else for(I=0;I<y.length;I++){if(j=y[I],B=j.instance,se=j.currentTarget,j=j.listener,B!==k&&x.isPropagationStopped())break e;AS(x,j,se),k=B}}}if(zt)throw a=ei,zt=!1,ei=null,a}function Sn(a,l){var h=l[kv];h===void 0&&(h=l[kv]=new Set);var y=a+"__bubble";h.has(y)||(OS(l,a,2,!1),h.add(y))}function yv(a,l,h){var y=0;l&&(y|=4),OS(h,a,y,l)}var ap="_reactListening"+Math.random().toString(36).slice(2);function zd(a){if(!a[ap]){a[ap]=!0,r.forEach(function(h){h!=="selectionchange"&&(J4.has(h)||yv(h,!1,a),yv(h,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[ap]||(l[ap]=!0,yv("selectionchange",!1,l))}}function OS(a,l,h,y){switch(tS(l)){case 1:var x=h4;break;case 4:x=p4;break;default:x=tv}h=x.bind(null,l,h,a),x=void 0,!Bt||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),y?x!==void 0?a.addEventListener(l,h,{capture:!0,passive:x}):a.addEventListener(l,h,!0):x!==void 0?a.addEventListener(l,h,{passive:x}):a.addEventListener(l,h,!1)}function _v(a,l,h,y,x){var k=y;if((l&1)===0&&(l&2)===0&&y!==null)e:for(;;){if(y===null)return;var I=y.tag;if(I===3||I===4){var j=y.stateNode.containerInfo;if(j===x||j.nodeType===8&&j.parentNode===x)break;if(I===4)for(I=y.return;I!==null;){var B=I.tag;if((B===3||B===4)&&(B=I.stateNode.containerInfo,B===x||B.nodeType===8&&B.parentNode===x))return;I=I.return}for(;j!==null;){if(I=Cl(j),I===null)return;if(B=I.tag,B===5||B===6){y=k=I;continue e}j=j.parentNode}}y=y.return}hn(function(){var se=k,_e=Hi(h),we=[];e:{var ye=RS.get(a);if(ye!==void 0){var Fe=sv,Ke=a;switch(a){case"keypress":if(tp(h)===0)break e;case"keydown":case"keyup":Fe=T4;break;case"focusin":Ke="focus",Fe=av;break;case"focusout":Ke="blur",Fe=av;break;case"beforeblur":case"afterblur":Fe=av;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Fe=sS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=v4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=O4;break;case ES:case kS:case CS:Fe=w4;break;case PS:Fe=L4;break;case"scroll":Fe=m4;break;case"wheel":Fe=N4;break;case"copy":case"cut":case"paste":Fe=x4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=oS}var qe=(l&4)!==0,Yn=!qe&&a==="scroll",ee=qe?ye!==null?ye+"Capture":null:ye;qe=[];for(var G=se,te;G!==null;){te=G;var Ce=te.stateNode;if(te.tag===5&&Ce!==null&&(te=Ce,ee!==null&&(Ce=wn(G,ee),Ce!=null&&qe.push(Hd(G,Ce,te)))),Yn)break;G=G.return}0<qe.length&&(ye=new Fe(ye,Ke,null,h,_e),we.push({event:ye,listeners:qe}))}}if((l&7)===0){e:{if(ye=a==="mouseover"||a==="pointerover",Fe=a==="mouseout"||a==="pointerout",ye&&h!==Qn&&(Ke=h.relatedTarget||h.fromElement)&&(Cl(Ke)||Ke[Co]))break e;if((Fe||ye)&&(ye=_e.window===_e?_e:(ye=_e.ownerDocument)?ye.defaultView||ye.parentWindow:window,Fe?(Ke=h.relatedTarget||h.toElement,Fe=se,Ke=Ke?Cl(Ke):null,Ke!==null&&(Yn=yr(Ke),Ke!==Yn||Ke.tag!==5&&Ke.tag!==6)&&(Ke=null)):(Fe=null,Ke=se),Fe!==Ke)){if(qe=sS,Ce="onMouseLeave",ee="onMouseEnter",G="mouse",(a==="pointerout"||a==="pointerover")&&(qe=oS,Ce="onPointerLeave",ee="onPointerEnter",G="pointer"),Yn=Fe==null?ye:Dc(Fe),te=Ke==null?ye:Dc(Ke),ye=new qe(Ce,G+"leave",Fe,h,_e),ye.target=Yn,ye.relatedTarget=te,Ce=null,Cl(_e)===se&&(qe=new qe(ee,G+"enter",Ke,h,_e),qe.target=te,qe.relatedTarget=Yn,Ce=qe),Yn=Ce,Fe&&Ke)t:{for(qe=Fe,ee=Ke,G=0,te=qe;te;te=$c(te))G++;for(te=0,Ce=ee;Ce;Ce=$c(Ce))te++;for(;0<G-te;)qe=$c(qe),G--;for(;0<te-G;)ee=$c(ee),te--;for(;G--;){if(qe===ee||ee!==null&&qe===ee.alternate)break t;qe=$c(qe),ee=$c(ee)}qe=null}else qe=null;Fe!==null&&MS(we,ye,Fe,qe,!1),Ke!==null&&Yn!==null&&MS(we,Yn,Ke,qe,!0)}}e:{if(ye=se?Dc(se):window,Fe=ye.nodeName&&ye.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&ye.type==="file")var Je=U4;else if(fS(ye))if(pS)Je=K4;else{Je=B4;var lt=Z4}else(Fe=ye.nodeName)&&Fe.toLowerCase()==="input"&&(ye.type==="checkbox"||ye.type==="radio")&&(Je=W4);if(Je&&(Je=Je(a,se))){hS(we,Je,h,_e);break e}lt&<(a,ye,se),a==="focusout"&&(lt=ye._wrapperState)&<.controlled&&ye.type==="number"&&Xt(ye,"number",ye.value)}switch(lt=se?Dc(se):window,a){case"focusin":(fS(lt)||lt.contentEditable==="true")&&(Mc=lt,hv=se,jd=null);break;case"focusout":jd=hv=Mc=null;break;case"mousedown":pv=!0;break;case"contextmenu":case"mouseup":case"dragend":pv=!1,xS(we,h,_e);break;case"selectionchange":if(Y4)break;case"keydown":case"keyup":xS(we,h,_e)}var ct;if(cv)e:{switch(a){case"compositionstart":var mt="onCompositionStart";break e;case"compositionend":mt="onCompositionEnd";break e;case"compositionupdate":mt="onCompositionUpdate";break e}mt=void 0}else Oc?uS(a,h)&&(mt="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(mt="onCompositionStart");mt&&(aS&&h.locale!=="ko"&&(Oc||mt!=="onCompositionStart"?mt==="onCompositionEnd"&&Oc&&(ct=nS()):(pa=_e,rv="value"in pa?pa.value:pa.textContent,Oc=!0)),lt=lp(se,mt),0<lt.length&&(mt=new iS(mt,a,null,h,_e),we.push({event:mt,listeners:lt}),ct?mt.data=ct:(ct=dS(h),ct!==null&&(mt.data=ct)))),(ct=F4?j4(a,h):V4(a,h))&&(se=lp(se,"onBeforeInput"),0<se.length&&(_e=new iS("onBeforeInput","beforeinput",null,h,_e),we.push({event:_e,listeners:se}),_e.data=ct))}IS(we,l)})}function Hd(a,l,h){return{instance:a,listener:l,currentTarget:h}}function lp(a,l){for(var h=l+"Capture",y=[];a!==null;){var x=a,k=x.stateNode;x.tag===5&&k!==null&&(x=k,k=wn(a,h),k!=null&&y.unshift(Hd(a,k,x)),k=wn(a,l),k!=null&&y.push(Hd(a,k,x))),a=a.return}return y}function $c(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function MS(a,l,h,y,x){for(var k=l._reactName,I=[];h!==null&&h!==y;){var j=h,B=j.alternate,se=j.stateNode;if(B!==null&&B===y)break;j.tag===5&&se!==null&&(j=se,x?(B=wn(h,k),B!=null&&I.unshift(Hd(h,B,j))):x||(B=wn(h,k),B!=null&&I.push(Hd(h,B,j)))),h=h.return}I.length!==0&&a.push({event:l,listeners:I})}var eD=/\r\n?/g,tD=/\u0000|\uFFFD/g;function LS(a){return(typeof a=="string"?a:""+a).replace(eD,`
|
|
106
|
+
`).replace(tD,"")}function cp(a,l,h){if(l=LS(l),LS(a)!==l&&h)throw Error(n(425))}function up(){}var wv=null,bv=null;function xv(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Sv=typeof setTimeout=="function"?setTimeout:void 0,nD=typeof clearTimeout=="function"?clearTimeout:void 0,$S=typeof Promise=="function"?Promise:void 0,rD=typeof queueMicrotask=="function"?queueMicrotask:typeof $S<"u"?function(a){return $S.resolve(null).then(a).catch(sD)}:Sv;function sD(a){setTimeout(function(){throw a})}function Ev(a,l){var h=l,y=0;do{var x=h.nextSibling;if(a.removeChild(h),x&&x.nodeType===8)if(h=x.data,h==="/$"){if(y===0){a.removeChild(x),Pt(l);return}y--}else h!=="$"&&h!=="$?"&&h!=="$!"||y++;h=x}while(h);Pt(l)}function ga(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return a}function NS(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"){if(l===0)return a;l--}else h==="/$"&&l++}a=a.previousSibling}return null}var Nc=Math.random().toString(36).slice(2),Gi="__reactFiber$"+Nc,Ud="__reactProps$"+Nc,Co="__reactContainer$"+Nc,kv="__reactEvents$"+Nc,iD="__reactListeners$"+Nc,oD="__reactHandles$"+Nc;function Cl(a){var l=a[Gi];if(l)return l;for(var h=a.parentNode;h;){if(l=h[Co]||h[Gi]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(a=NS(a);a!==null;){if(h=a[Gi])return h;a=NS(a)}return l}a=h,h=a.parentNode}return null}function Zd(a){return a=a[Gi]||a[Co],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Dc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function dp(a){return a[Ud]||null}var Cv=[],Fc=-1;function va(a){return{current:a}}function En(a){0>Fc||(a.current=Cv[Fc],Cv[Fc]=null,Fc--)}function bn(a,l){Fc++,Cv[Fc]=a.current,a.current=l}var ya={},Br=va(ya),vs=va(!1),Pl=ya;function jc(a,l){var h=a.type.contextTypes;if(!h)return ya;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var x={},k;for(k in h)x[k]=l[k];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=x),x}function ys(a){return a=a.childContextTypes,a!=null}function fp(){En(vs),En(Br)}function DS(a,l,h){if(Br.current!==ya)throw Error(n(168));bn(Br,l),bn(vs,h)}function FS(a,l,h){var y=a.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return h;y=y.getChildContext();for(var x in y)if(!(x in l))throw Error(n(108,ke(a)||"Unknown",x));return K({},h,y)}function hp(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||ya,Pl=Br.current,bn(Br,a),bn(vs,vs.current),!0}function jS(a,l,h){var y=a.stateNode;if(!y)throw Error(n(169));h?(a=FS(a,l,Pl),y.__reactInternalMemoizedMergedChildContext=a,En(vs),En(Br),bn(Br,a)):En(vs),bn(vs,h)}var Po=null,pp=!1,Pv=!1;function VS(a){Po===null?Po=[a]:Po.push(a)}function aD(a){pp=!0,VS(a)}function _a(){if(!Pv&&Po!==null){Pv=!0;var a=0,l=it;try{var h=Po;for(it=1;a<h.length;a++){var y=h[a];do y=y(!0);while(y!==null)}Po=null,pp=!1}catch(x){throw Po!==null&&(Po=Po.slice(a+1)),Ns(Ds,_a),x}finally{it=l,Pv=!1}}return null}var Vc=[],zc=0,mp=null,gp=0,ri=[],si=0,Rl=null,Ro=1,To="";function Tl(a,l){Vc[zc++]=gp,Vc[zc++]=mp,mp=a,gp=l}function zS(a,l,h){ri[si++]=Ro,ri[si++]=To,ri[si++]=Rl,Rl=a;var y=Ro;a=To;var x=32-rs(y)-1;y&=~(1<<x),h+=1;var k=32-rs(l)+x;if(30<k){var I=x-x%5;k=(y&(1<<I)-1).toString(32),y>>=I,x-=I,Ro=1<<32-rs(l)+x|h<<x|y,To=k+a}else Ro=1<<k|h<<x|y,To=a}function Rv(a){a.return!==null&&(Tl(a,1),zS(a,1,0))}function Tv(a){for(;a===mp;)mp=Vc[--zc],Vc[zc]=null,gp=Vc[--zc],Vc[zc]=null;for(;a===Rl;)Rl=ri[--si],ri[si]=null,To=ri[--si],ri[si]=null,Ro=ri[--si],ri[si]=null}var zs=null,Hs=null,An=!1,Ei=null;function HS(a,l){var h=li(5,null,null,0);h.elementType="DELETED",h.stateNode=l,h.return=a,l=a.deletions,l===null?(a.deletions=[h],a.flags|=16):l.push(h)}function US(a,l){switch(a.tag){case 5:var h=a.type;return l=l.nodeType!==1||h.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(a.stateNode=l,zs=a,Hs=ga(l.firstChild),!0):!1;case 6:return l=a.pendingProps===""||l.nodeType!==3?null:l,l!==null?(a.stateNode=l,zs=a,Hs=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(h=Rl!==null?{id:Ro,overflow:To}:null,a.memoizedState={dehydrated:l,treeContext:h,retryLane:1073741824},h=li(18,null,null,0),h.stateNode=l,h.return=a,a.child=h,zs=a,Hs=null,!0):!1;default:return!1}}function Av(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Iv(a){if(An){var l=Hs;if(l){var h=l;if(!US(a,l)){if(Av(a))throw Error(n(418));l=ga(h.nextSibling);var y=zs;l&&US(a,l)?HS(y,h):(a.flags=a.flags&-4097|2,An=!1,zs=a)}}else{if(Av(a))throw Error(n(418));a.flags=a.flags&-4097|2,An=!1,zs=a}}}function ZS(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;zs=a}function vp(a){if(a!==zs)return!1;if(!An)return ZS(a),An=!0,!1;var l;if((l=a.tag!==3)&&!(l=a.tag!==5)&&(l=a.type,l=l!=="head"&&l!=="body"&&!xv(a.type,a.memoizedProps)),l&&(l=Hs)){if(Av(a))throw BS(),Error(n(418));for(;l;)HS(a,l),l=ga(l.nextSibling)}if(ZS(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"){if(l===0){Hs=ga(a.nextSibling);break e}l--}else h!=="$"&&h!=="$!"&&h!=="$?"||l++}a=a.nextSibling}Hs=null}}else Hs=zs?ga(a.stateNode.nextSibling):null;return!0}function BS(){for(var a=Hs;a;)a=ga(a.nextSibling)}function Hc(){Hs=zs=null,An=!1}function Ov(a){Ei===null?Ei=[a]:Ei.push(a)}var lD=R.ReactCurrentBatchConfig;function Bd(a,l,h){if(a=h.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var y=h.stateNode}if(!y)throw Error(n(147,a));var x=y,k=""+a;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===k?l.ref:(l=function(I){var j=x.refs;I===null?delete j[k]:j[k]=I},l._stringRef=k,l)}if(typeof a!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,a))}return a}function yp(a,l){throw a=Object.prototype.toString.call(l),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a))}function WS(a){var l=a._init;return l(a._payload)}function KS(a){function l(ee,G){if(a){var te=ee.deletions;te===null?(ee.deletions=[G],ee.flags|=16):te.push(G)}}function h(ee,G){if(!a)return null;for(;G!==null;)l(ee,G),G=G.sibling;return null}function y(ee,G){for(ee=new Map;G!==null;)G.key!==null?ee.set(G.key,G):ee.set(G.index,G),G=G.sibling;return ee}function x(ee,G){return ee=Pa(ee,G),ee.index=0,ee.sibling=null,ee}function k(ee,G,te){return ee.index=te,a?(te=ee.alternate,te!==null?(te=te.index,te<G?(ee.flags|=2,G):te):(ee.flags|=2,G)):(ee.flags|=1048576,G)}function I(ee){return a&&ee.alternate===null&&(ee.flags|=2),ee}function j(ee,G,te,Ce){return G===null||G.tag!==6?(G=Sy(te,ee.mode,Ce),G.return=ee,G):(G=x(G,te),G.return=ee,G)}function B(ee,G,te,Ce){var Je=te.type;return Je===M?_e(ee,G,te.props.children,Ce,te.key):G!==null&&(G.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===Y&&WS(Je)===G.type)?(Ce=x(G,te.props),Ce.ref=Bd(ee,G,te),Ce.return=ee,Ce):(Ce=Hp(te.type,te.key,te.props,null,ee.mode,Ce),Ce.ref=Bd(ee,G,te),Ce.return=ee,Ce)}function se(ee,G,te,Ce){return G===null||G.tag!==4||G.stateNode.containerInfo!==te.containerInfo||G.stateNode.implementation!==te.implementation?(G=Ey(te,ee.mode,Ce),G.return=ee,G):(G=x(G,te.children||[]),G.return=ee,G)}function _e(ee,G,te,Ce,Je){return G===null||G.tag!==7?(G=Dl(te,ee.mode,Ce,Je),G.return=ee,G):(G=x(G,te),G.return=ee,G)}function we(ee,G,te){if(typeof G=="string"&&G!==""||typeof G=="number")return G=Sy(""+G,ee.mode,te),G.return=ee,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case T:return te=Hp(G.type,G.key,G.props,null,ee.mode,te),te.ref=Bd(ee,null,G),te.return=ee,te;case O:return G=Ey(G,ee.mode,te),G.return=ee,G;case Y:var Ce=G._init;return we(ee,Ce(G._payload),te)}if(Me(G)||J(G))return G=Dl(G,ee.mode,te,null),G.return=ee,G;yp(ee,G)}return null}function ye(ee,G,te,Ce){var Je=G!==null?G.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return Je!==null?null:j(ee,G,""+te,Ce);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case T:return te.key===Je?B(ee,G,te,Ce):null;case O:return te.key===Je?se(ee,G,te,Ce):null;case Y:return Je=te._init,ye(ee,G,Je(te._payload),Ce)}if(Me(te)||J(te))return Je!==null?null:_e(ee,G,te,Ce,null);yp(ee,te)}return null}function Fe(ee,G,te,Ce,Je){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return ee=ee.get(te)||null,j(G,ee,""+Ce,Je);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case T:return ee=ee.get(Ce.key===null?te:Ce.key)||null,B(G,ee,Ce,Je);case O:return ee=ee.get(Ce.key===null?te:Ce.key)||null,se(G,ee,Ce,Je);case Y:var lt=Ce._init;return Fe(ee,G,te,lt(Ce._payload),Je)}if(Me(Ce)||J(Ce))return ee=ee.get(te)||null,_e(G,ee,Ce,Je,null);yp(G,Ce)}return null}function Ke(ee,G,te,Ce){for(var Je=null,lt=null,ct=G,mt=G=0,xr=null;ct!==null&&mt<te.length;mt++){ct.index>mt?(xr=ct,ct=null):xr=ct.sibling;var qt=ye(ee,ct,te[mt],Ce);if(qt===null){ct===null&&(ct=xr);break}a&&ct&&qt.alternate===null&&l(ee,ct),G=k(qt,G,mt),lt===null?Je=qt:lt.sibling=qt,lt=qt,ct=xr}if(mt===te.length)return h(ee,ct),An&&Tl(ee,mt),Je;if(ct===null){for(;mt<te.length;mt++)ct=we(ee,te[mt],Ce),ct!==null&&(G=k(ct,G,mt),lt===null?Je=ct:lt.sibling=ct,lt=ct);return An&&Tl(ee,mt),Je}for(ct=y(ee,ct);mt<te.length;mt++)xr=Fe(ct,ee,mt,te[mt],Ce),xr!==null&&(a&&xr.alternate!==null&&ct.delete(xr.key===null?mt:xr.key),G=k(xr,G,mt),lt===null?Je=xr:lt.sibling=xr,lt=xr);return a&&ct.forEach(function(Ra){return l(ee,Ra)}),An&&Tl(ee,mt),Je}function qe(ee,G,te,Ce){var Je=J(te);if(typeof Je!="function")throw Error(n(150));if(te=Je.call(te),te==null)throw Error(n(151));for(var lt=Je=null,ct=G,mt=G=0,xr=null,qt=te.next();ct!==null&&!qt.done;mt++,qt=te.next()){ct.index>mt?(xr=ct,ct=null):xr=ct.sibling;var Ra=ye(ee,ct,qt.value,Ce);if(Ra===null){ct===null&&(ct=xr);break}a&&ct&&Ra.alternate===null&&l(ee,ct),G=k(Ra,G,mt),lt===null?Je=Ra:lt.sibling=Ra,lt=Ra,ct=xr}if(qt.done)return h(ee,ct),An&&Tl(ee,mt),Je;if(ct===null){for(;!qt.done;mt++,qt=te.next())qt=we(ee,qt.value,Ce),qt!==null&&(G=k(qt,G,mt),lt===null?Je=qt:lt.sibling=qt,lt=qt);return An&&Tl(ee,mt),Je}for(ct=y(ee,ct);!qt.done;mt++,qt=te.next())qt=Fe(ct,ee,mt,qt.value,Ce),qt!==null&&(a&&qt.alternate!==null&&ct.delete(qt.key===null?mt:qt.key),G=k(qt,G,mt),lt===null?Je=qt:lt.sibling=qt,lt=qt);return a&&ct.forEach(function(zD){return l(ee,zD)}),An&&Tl(ee,mt),Je}function Yn(ee,G,te,Ce){if(typeof te=="object"&&te!==null&&te.type===M&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case T:e:{for(var Je=te.key,lt=G;lt!==null;){if(lt.key===Je){if(Je=te.type,Je===M){if(lt.tag===7){h(ee,lt.sibling),G=x(lt,te.props.children),G.return=ee,ee=G;break e}}else if(lt.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===Y&&WS(Je)===lt.type){h(ee,lt.sibling),G=x(lt,te.props),G.ref=Bd(ee,lt,te),G.return=ee,ee=G;break e}h(ee,lt);break}else l(ee,lt);lt=lt.sibling}te.type===M?(G=Dl(te.props.children,ee.mode,Ce,te.key),G.return=ee,ee=G):(Ce=Hp(te.type,te.key,te.props,null,ee.mode,Ce),Ce.ref=Bd(ee,G,te),Ce.return=ee,ee=Ce)}return I(ee);case O:e:{for(lt=te.key;G!==null;){if(G.key===lt)if(G.tag===4&&G.stateNode.containerInfo===te.containerInfo&&G.stateNode.implementation===te.implementation){h(ee,G.sibling),G=x(G,te.children||[]),G.return=ee,ee=G;break e}else{h(ee,G);break}else l(ee,G);G=G.sibling}G=Ey(te,ee.mode,Ce),G.return=ee,ee=G}return I(ee);case Y:return lt=te._init,Yn(ee,G,lt(te._payload),Ce)}if(Me(te))return Ke(ee,G,te,Ce);if(J(te))return qe(ee,G,te,Ce);yp(ee,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,G!==null&&G.tag===6?(h(ee,G.sibling),G=x(G,te),G.return=ee,ee=G):(h(ee,G),G=Sy(te,ee.mode,Ce),G.return=ee,ee=G),I(ee)):h(ee,G)}return Yn}var Uc=KS(!0),GS=KS(!1),_p=va(null),wp=null,Zc=null,Mv=null;function Lv(){Mv=Zc=wp=null}function $v(a){var l=_p.current;En(_p),a._currentValue=l}function Nv(a,l,h){for(;a!==null;){var y=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),a===h)break;a=a.return}}function Bc(a,l){wp=a,Mv=Zc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&l)!==0&&(_s=!0),a.firstContext=null)}function ii(a){var l=a._currentValue;if(Mv!==a)if(a={context:a,memoizedValue:l,next:null},Zc===null){if(wp===null)throw Error(n(308));Zc=a,wp.dependencies={lanes:0,firstContext:a}}else Zc=Zc.next=a;return l}var Al=null;function Dv(a){Al===null?Al=[a]:Al.push(a)}function qS(a,l,h,y){var x=l.interleaved;return x===null?(h.next=h,Dv(l)):(h.next=x.next,x.next=h),l.interleaved=h,Ao(a,y)}function Ao(a,l){a.lanes|=l;var h=a.alternate;for(h!==null&&(h.lanes|=l),h=a,a=a.return;a!==null;)a.childLanes|=l,h=a.alternate,h!==null&&(h.childLanes|=l),h=a,a=a.return;return h.tag===3?h.stateNode:null}var wa=!1;function Fv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function YS(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Io(a,l){return{eventTime:a,lane:l,tag:0,payload:null,callback:null,next:null}}function ba(a,l,h){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Wt&2)!==0){var x=y.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),y.pending=l,Ao(a,h)}return x=y.interleaved,x===null?(l.next=l,Dv(y)):(l.next=x.next,x.next=l),y.interleaved=l,Ao(a,h)}function bp(a,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194240)!==0)){var y=l.lanes;y&=a.pendingLanes,h|=y,l.lanes=h,Tn(a,h)}}function XS(a,l){var h=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var x=null,k=null;if(h=h.firstBaseUpdate,h!==null){do{var I={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};k===null?x=k=I:k=k.next=I,h=h.next}while(h!==null);k===null?x=k=l:k=k.next=l}else x=k=l;h={baseState:y.baseState,firstBaseUpdate:x,lastBaseUpdate:k,shared:y.shared,effects:y.effects},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=l:a.next=l,h.lastBaseUpdate=l}function xp(a,l,h,y){var x=a.updateQueue;wa=!1;var k=x.firstBaseUpdate,I=x.lastBaseUpdate,j=x.shared.pending;if(j!==null){x.shared.pending=null;var B=j,se=B.next;B.next=null,I===null?k=se:I.next=se,I=B;var _e=a.alternate;_e!==null&&(_e=_e.updateQueue,j=_e.lastBaseUpdate,j!==I&&(j===null?_e.firstBaseUpdate=se:j.next=se,_e.lastBaseUpdate=B))}if(k!==null){var we=x.baseState;I=0,_e=se=B=null,j=k;do{var ye=j.lane,Fe=j.eventTime;if((y&ye)===ye){_e!==null&&(_e=_e.next={eventTime:Fe,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var Ke=a,qe=j;switch(ye=l,Fe=h,qe.tag){case 1:if(Ke=qe.payload,typeof Ke=="function"){we=Ke.call(Fe,we,ye);break e}we=Ke;break e;case 3:Ke.flags=Ke.flags&-65537|128;case 0:if(Ke=qe.payload,ye=typeof Ke=="function"?Ke.call(Fe,we,ye):Ke,ye==null)break e;we=K({},we,ye);break e;case 2:wa=!0}}j.callback!==null&&j.lane!==0&&(a.flags|=64,ye=x.effects,ye===null?x.effects=[j]:ye.push(j))}else Fe={eventTime:Fe,lane:ye,tag:j.tag,payload:j.payload,callback:j.callback,next:null},_e===null?(se=_e=Fe,B=we):_e=_e.next=Fe,I|=ye;if(j=j.next,j===null){if(j=x.shared.pending,j===null)break;ye=j,j=ye.next,ye.next=null,x.lastBaseUpdate=ye,x.shared.pending=null}}while(!0);if(_e===null&&(B=we),x.baseState=B,x.firstBaseUpdate=se,x.lastBaseUpdate=_e,l=x.shared.interleaved,l!==null){x=l;do I|=x.lane,x=x.next;while(x!==l)}else k===null&&(x.shared.lanes=0);Ml|=I,a.lanes=I,a.memoizedState=we}}function QS(a,l,h){if(a=l.effects,l.effects=null,a!==null)for(l=0;l<a.length;l++){var y=a[l],x=y.callback;if(x!==null){if(y.callback=null,y=h,typeof x!="function")throw Error(n(191,x));x.call(y)}}}var Wd={},qi=va(Wd),Kd=va(Wd),Gd=va(Wd);function Il(a){if(a===Wd)throw Error(n(174));return a}function jv(a,l){switch(bn(Gd,l),bn(Kd,a),bn(qi,Wd),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:gt(null,"");break;default:a=a===8?l.parentNode:l,l=a.namespaceURI||null,a=a.tagName,l=gt(l,a)}En(qi),bn(qi,l)}function Wc(){En(qi),En(Kd),En(Gd)}function JS(a){Il(Gd.current);var l=Il(qi.current),h=gt(l,a.type);l!==h&&(bn(Kd,a),bn(qi,h))}function Vv(a){Kd.current===a&&(En(qi),En(Kd))}var $n=va(0);function Sp(a){for(var l=a;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var zv=[];function Hv(){for(var a=0;a<zv.length;a++)zv[a]._workInProgressVersionPrimary=null;zv.length=0}var Ep=R.ReactCurrentDispatcher,Uv=R.ReactCurrentBatchConfig,Ol=0,Nn=null,ur=null,wr=null,kp=!1,qd=!1,Yd=0,cD=0;function Wr(){throw Error(n(321))}function Zv(a,l){if(l===null)return!1;for(var h=0;h<l.length&&h<a.length;h++)if(!Si(a[h],l[h]))return!1;return!0}function Bv(a,l,h,y,x,k){if(Ol=k,Nn=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Ep.current=a===null||a.memoizedState===null?hD:pD,a=h(y,x),qd){k=0;do{if(qd=!1,Yd=0,25<=k)throw Error(n(301));k+=1,wr=ur=null,l.updateQueue=null,Ep.current=mD,a=h(y,x)}while(qd)}if(Ep.current=Rp,l=ur!==null&&ur.next!==null,Ol=0,wr=ur=Nn=null,kp=!1,l)throw Error(n(300));return a}function Wv(){var a=Yd!==0;return Yd=0,a}function Yi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wr===null?Nn.memoizedState=wr=a:wr=wr.next=a,wr}function oi(){if(ur===null){var a=Nn.alternate;a=a!==null?a.memoizedState:null}else a=ur.next;var l=wr===null?Nn.memoizedState:wr.next;if(l!==null)wr=l,ur=a;else{if(a===null)throw Error(n(310));ur=a,a={memoizedState:ur.memoizedState,baseState:ur.baseState,baseQueue:ur.baseQueue,queue:ur.queue,next:null},wr===null?Nn.memoizedState=wr=a:wr=wr.next=a}return wr}function Xd(a,l){return typeof l=="function"?l(a):l}function Kv(a){var l=oi(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=ur,x=y.baseQueue,k=h.pending;if(k!==null){if(x!==null){var I=x.next;x.next=k.next,k.next=I}y.baseQueue=x=k,h.pending=null}if(x!==null){k=x.next,y=y.baseState;var j=I=null,B=null,se=k;do{var _e=se.lane;if((Ol&_e)===_e)B!==null&&(B=B.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 we={lane:_e,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};B===null?(j=B=we,I=y):B=B.next=we,Nn.lanes|=_e,Ml|=_e}se=se.next}while(se!==null&&se!==k);B===null?I=y:B.next=j,Si(y,l.memoizedState)||(_s=!0),l.memoizedState=y,l.baseState=I,l.baseQueue=B,h.lastRenderedState=y}if(a=h.interleaved,a!==null){x=a;do k=x.lane,Nn.lanes|=k,Ml|=k,x=x.next;while(x!==a)}else x===null&&(h.lanes=0);return[l.memoizedState,h.dispatch]}function Gv(a){var l=oi(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=h.dispatch,x=h.pending,k=l.memoizedState;if(x!==null){h.pending=null;var I=x=x.next;do k=a(k,I.action),I=I.next;while(I!==x);Si(k,l.memoizedState)||(_s=!0),l.memoizedState=k,l.baseQueue===null&&(l.baseState=k),h.lastRenderedState=k}return[k,y]}function eE(){}function tE(a,l){var h=Nn,y=oi(),x=l(),k=!Si(y.memoizedState,x);if(k&&(y.memoizedState=x,_s=!0),y=y.queue,qv(sE.bind(null,h,y,a),[a]),y.getSnapshot!==l||k||wr!==null&&wr.memoizedState.tag&1){if(h.flags|=2048,Qd(9,rE.bind(null,h,y,x,l),void 0,null),br===null)throw Error(n(349));(Ol&30)!==0||nE(h,l,x)}return x}function nE(a,l,h){a.flags|=16384,a={getSnapshot:l,value:h},l=Nn.updateQueue,l===null?(l={lastEffect:null,stores:null},Nn.updateQueue=l,l.stores=[a]):(h=l.stores,h===null?l.stores=[a]:h.push(a))}function rE(a,l,h,y){l.value=h,l.getSnapshot=y,iE(l)&&oE(a)}function sE(a,l,h){return h(function(){iE(l)&&oE(a)})}function iE(a){var l=a.getSnapshot;a=a.value;try{var h=l();return!Si(a,h)}catch{return!0}}function oE(a){var l=Ao(a,1);l!==null&&Ri(l,a,1,-1)}function aE(a){var l=Yi();return typeof a=="function"&&(a=a()),l.memoizedState=l.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xd,lastRenderedState:a},l.queue=a,a=a.dispatch=fD.bind(null,Nn,a),[l.memoizedState,a]}function Qd(a,l,h,y){return a={tag:a,create:l,destroy:h,deps:y,next:null},l=Nn.updateQueue,l===null?(l={lastEffect:null,stores:null},Nn.updateQueue=l,l.lastEffect=a.next=a):(h=l.lastEffect,h===null?l.lastEffect=a.next=a:(y=h.next,h.next=a,a.next=y,l.lastEffect=a)),a}function lE(){return oi().memoizedState}function Cp(a,l,h,y){var x=Yi();Nn.flags|=a,x.memoizedState=Qd(1|l,h,void 0,y===void 0?null:y)}function Pp(a,l,h,y){var x=oi();y=y===void 0?null:y;var k=void 0;if(ur!==null){var I=ur.memoizedState;if(k=I.destroy,y!==null&&Zv(y,I.deps)){x.memoizedState=Qd(l,h,k,y);return}}Nn.flags|=a,x.memoizedState=Qd(1|l,h,k,y)}function cE(a,l){return Cp(8390656,8,a,l)}function qv(a,l){return Pp(2048,8,a,l)}function uE(a,l){return Pp(4,2,a,l)}function dE(a,l){return Pp(4,4,a,l)}function fE(a,l){if(typeof l=="function")return a=a(),l(a),function(){l(null)};if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function hE(a,l,h){return h=h!=null?h.concat([a]):null,Pp(4,4,fE.bind(null,l,a),h)}function Yv(){}function pE(a,l){var h=oi();l=l===void 0?null:l;var y=h.memoizedState;return y!==null&&l!==null&&Zv(l,y[1])?y[0]:(h.memoizedState=[a,l],a)}function mE(a,l){var h=oi();l=l===void 0?null:l;var y=h.memoizedState;return y!==null&&l!==null&&Zv(l,y[1])?y[0]:(a=a(),h.memoizedState=[a,l],a)}function gE(a,l,h){return(Ol&21)===0?(a.baseState&&(a.baseState=!1,_s=!0),a.memoizedState=h):(Si(h,l)||(h=Ct(),Nn.lanes|=h,Ml|=h,a.baseState=!0),l)}function uD(a,l){var h=it;it=h!==0&&4>h?h:4,a(!0);var y=Uv.transition;Uv.transition={};try{a(!1),l()}finally{it=h,Uv.transition=y}}function vE(){return oi().memoizedState}function dD(a,l,h){var y=ka(a);if(h={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null},yE(a))_E(l,h);else if(h=qS(a,l,h,y),h!==null){var x=is();Ri(h,a,y,x),wE(h,l,y)}}function fD(a,l,h){var y=ka(a),x={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null};if(yE(a))_E(l,x);else{var k=a.alternate;if(a.lanes===0&&(k===null||k.lanes===0)&&(k=l.lastRenderedReducer,k!==null))try{var I=l.lastRenderedState,j=k(I,h);if(x.hasEagerState=!0,x.eagerState=j,Si(j,I)){var B=l.interleaved;B===null?(x.next=x,Dv(l)):(x.next=B.next,B.next=x),l.interleaved=x;return}}catch{}finally{}h=qS(a,l,x,y),h!==null&&(x=is(),Ri(h,a,y,x),wE(h,l,y))}}function yE(a){var l=a.alternate;return a===Nn||l!==null&&l===Nn}function _E(a,l){qd=kp=!0;var h=a.pending;h===null?l.next=l:(l.next=h.next,h.next=l),a.pending=l}function wE(a,l,h){if((h&4194240)!==0){var y=l.lanes;y&=a.pendingLanes,h|=y,l.lanes=h,Tn(a,h)}}var Rp={readContext:ii,useCallback:Wr,useContext:Wr,useEffect:Wr,useImperativeHandle:Wr,useInsertionEffect:Wr,useLayoutEffect:Wr,useMemo:Wr,useReducer:Wr,useRef:Wr,useState:Wr,useDebugValue:Wr,useDeferredValue:Wr,useTransition:Wr,useMutableSource:Wr,useSyncExternalStore:Wr,useId:Wr,unstable_isNewReconciler:!1},hD={readContext:ii,useCallback:function(a,l){return Yi().memoizedState=[a,l===void 0?null:l],a},useContext:ii,useEffect:cE,useImperativeHandle:function(a,l,h){return h=h!=null?h.concat([a]):null,Cp(4194308,4,fE.bind(null,l,a),h)},useLayoutEffect:function(a,l){return Cp(4194308,4,a,l)},useInsertionEffect:function(a,l){return Cp(4,2,a,l)},useMemo:function(a,l){var h=Yi();return l=l===void 0?null:l,a=a(),h.memoizedState=[a,l],a},useReducer:function(a,l,h){var y=Yi();return l=h!==void 0?h(l):l,y.memoizedState=y.baseState=l,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},y.queue=a,a=a.dispatch=dD.bind(null,Nn,a),[y.memoizedState,a]},useRef:function(a){var l=Yi();return a={current:a},l.memoizedState=a},useState:aE,useDebugValue:Yv,useDeferredValue:function(a){return Yi().memoizedState=a},useTransition:function(){var a=aE(!1),l=a[0];return a=uD.bind(null,a[1]),Yi().memoizedState=a,[l,a]},useMutableSource:function(){},useSyncExternalStore:function(a,l,h){var y=Nn,x=Yi();if(An){if(h===void 0)throw Error(n(407));h=h()}else{if(h=l(),br===null)throw Error(n(349));(Ol&30)!==0||nE(y,l,h)}x.memoizedState=h;var k={value:h,getSnapshot:l};return x.queue=k,cE(sE.bind(null,y,k,a),[a]),y.flags|=2048,Qd(9,rE.bind(null,y,k,h,l),void 0,null),h},useId:function(){var a=Yi(),l=br.identifierPrefix;if(An){var h=To,y=Ro;h=(y&~(1<<32-rs(y)-1)).toString(32)+h,l=":"+l+"R"+h,h=Yd++,0<h&&(l+="H"+h.toString(32)),l+=":"}else h=cD++,l=":"+l+"r"+h.toString(32)+":";return a.memoizedState=l},unstable_isNewReconciler:!1},pD={readContext:ii,useCallback:pE,useContext:ii,useEffect:qv,useImperativeHandle:hE,useInsertionEffect:uE,useLayoutEffect:dE,useMemo:mE,useReducer:Kv,useRef:lE,useState:function(){return Kv(Xd)},useDebugValue:Yv,useDeferredValue:function(a){var l=oi();return gE(l,ur.memoizedState,a)},useTransition:function(){var a=Kv(Xd)[0],l=oi().memoizedState;return[a,l]},useMutableSource:eE,useSyncExternalStore:tE,useId:vE,unstable_isNewReconciler:!1},mD={readContext:ii,useCallback:pE,useContext:ii,useEffect:qv,useImperativeHandle:hE,useInsertionEffect:uE,useLayoutEffect:dE,useMemo:mE,useReducer:Gv,useRef:lE,useState:function(){return Gv(Xd)},useDebugValue:Yv,useDeferredValue:function(a){var l=oi();return ur===null?l.memoizedState=a:gE(l,ur.memoizedState,a)},useTransition:function(){var a=Gv(Xd)[0],l=oi().memoizedState;return[a,l]},useMutableSource:eE,useSyncExternalStore:tE,useId:vE,unstable_isNewReconciler:!1};function ki(a,l){if(a&&a.defaultProps){l=K({},l),a=a.defaultProps;for(var h in a)l[h]===void 0&&(l[h]=a[h]);return l}return l}function Xv(a,l,h,y){l=a.memoizedState,h=h(y,l),h=h==null?l:K({},l,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Tp={isMounted:function(a){return(a=a._reactInternals)?yr(a)===a:!1},enqueueSetState:function(a,l,h){a=a._reactInternals;var y=is(),x=ka(a),k=Io(y,x);k.payload=l,h!=null&&(k.callback=h),l=ba(a,k,x),l!==null&&(Ri(l,a,x,y),bp(l,a,x))},enqueueReplaceState:function(a,l,h){a=a._reactInternals;var y=is(),x=ka(a),k=Io(y,x);k.tag=1,k.payload=l,h!=null&&(k.callback=h),l=ba(a,k,x),l!==null&&(Ri(l,a,x,y),bp(l,a,x))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var h=is(),y=ka(a),x=Io(h,y);x.tag=2,l!=null&&(x.callback=l),l=ba(a,x,y),l!==null&&(Ri(l,a,y,h),bp(l,a,y))}};function bE(a,l,h,y,x,k,I){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,k,I):l.prototype&&l.prototype.isPureReactComponent?!Fd(h,y)||!Fd(x,k):!0}function xE(a,l,h){var y=!1,x=ya,k=l.contextType;return typeof k=="object"&&k!==null?k=ii(k):(x=ys(l)?Pl:Br.current,y=l.contextTypes,k=(y=y!=null)?jc(a,x):ya),l=new l(h,k),a.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Tp,a.stateNode=l,l._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=x,a.__reactInternalMemoizedMaskedChildContext=k),l}function SE(a,l,h,y){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,y),l.state!==a&&Tp.enqueueReplaceState(l,l.state,null)}function Qv(a,l,h,y){var x=a.stateNode;x.props=h,x.state=a.memoizedState,x.refs={},Fv(a);var k=l.contextType;typeof k=="object"&&k!==null?x.context=ii(k):(k=ys(l)?Pl:Br.current,x.context=jc(a,k)),x.state=a.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(Xv(a,l,k,h),x.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(l=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),l!==x.state&&Tp.enqueueReplaceState(x,x.state,null),xp(a,h,x,y),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308)}function Kc(a,l){try{var h="",y=l;do h+=ce(y),y=y.return;while(y);var x=h}catch(k){x=`
|
|
107
|
+
Error generating stack: `+k.message+`
|
|
108
|
+
`+k.stack}return{value:a,source:l,stack:x,digest:null}}function Jv(a,l,h){return{value:a,source:null,stack:h??null,digest:l??null}}function ey(a,l){try{console.error(l.value)}catch(h){setTimeout(function(){throw h})}}var gD=typeof WeakMap=="function"?WeakMap:Map;function EE(a,l,h){h=Io(-1,h),h.tag=3,h.payload={element:null};var y=l.value;return h.callback=function(){Np||(Np=!0,my=y),ey(a,l)},h}function kE(a,l,h){h=Io(-1,h),h.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var x=l.value;h.payload=function(){return y(x)},h.callback=function(){ey(a,l)}}var k=a.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(h.callback=function(){ey(a,l),typeof y!="function"&&(Sa===null?Sa=new Set([this]):Sa.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),h}function CE(a,l,h){var y=a.pingCache;if(y===null){y=a.pingCache=new gD;var x=new Set;y.set(l,x)}else x=y.get(l),x===void 0&&(x=new Set,y.set(l,x));x.has(h)||(x.add(h),a=AD.bind(null,a,l,h),l.then(a,a))}function PE(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function RE(a,l,h,y,x){return(a.mode&1)===0?(a===l?a.flags|=65536:(a.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(l=Io(-1,1),l.tag=2,ba(h,l,1))),h.lanes|=1),a):(a.flags|=65536,a.lanes=x,a)}var vD=R.ReactCurrentOwner,_s=!1;function ss(a,l,h,y){l.child=a===null?GS(l,null,h,y):Uc(l,a.child,h,y)}function TE(a,l,h,y,x){h=h.render;var k=l.ref;return Bc(l,x),y=Bv(a,l,h,y,k,x),h=Wv(),a!==null&&!_s?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~x,Oo(a,l,x)):(An&&h&&Rv(l),l.flags|=1,ss(a,l,y,x),l.child)}function AE(a,l,h,y,x){if(a===null){var k=h.type;return typeof k=="function"&&!xy(k)&&k.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(l.tag=15,l.type=k,IE(a,l,k,y,x)):(a=Hp(h.type,null,y,l,l.mode,x),a.ref=l.ref,a.return=l,l.child=a)}if(k=a.child,(a.lanes&x)===0){var I=k.memoizedProps;if(h=h.compare,h=h!==null?h:Fd,h(I,y)&&a.ref===l.ref)return Oo(a,l,x)}return l.flags|=1,a=Pa(k,y),a.ref=l.ref,a.return=l,l.child=a}function IE(a,l,h,y,x){if(a!==null){var k=a.memoizedProps;if(Fd(k,y)&&a.ref===l.ref)if(_s=!1,l.pendingProps=y=k,(a.lanes&x)!==0)(a.flags&131072)!==0&&(_s=!0);else return l.lanes=a.lanes,Oo(a,l,x)}return ty(a,l,h,y,x)}function OE(a,l,h){var y=l.pendingProps,x=y.children,k=a!==null?a.memoizedState:null;if(y.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},bn(qc,Us),Us|=h;else{if((h&1073741824)===0)return a=k!==null?k.baseLanes|h:h,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,bn(qc,Us),Us|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=k!==null?k.baseLanes:h,bn(qc,Us),Us|=y}else k!==null?(y=k.baseLanes|h,l.memoizedState=null):y=h,bn(qc,Us),Us|=y;return ss(a,l,x,h),l.child}function ME(a,l){var h=l.ref;(a===null&&h!==null||a!==null&&a.ref!==h)&&(l.flags|=512,l.flags|=2097152)}function ty(a,l,h,y,x){var k=ys(h)?Pl:Br.current;return k=jc(l,k),Bc(l,x),h=Bv(a,l,h,y,k,x),y=Wv(),a!==null&&!_s?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~x,Oo(a,l,x)):(An&&y&&Rv(l),l.flags|=1,ss(a,l,h,x),l.child)}function LE(a,l,h,y,x){if(ys(h)){var k=!0;hp(l)}else k=!1;if(Bc(l,x),l.stateNode===null)Ip(a,l),xE(l,h,y),Qv(l,h,y,x),y=!0;else if(a===null){var I=l.stateNode,j=l.memoizedProps;I.props=j;var B=I.context,se=h.contextType;typeof se=="object"&&se!==null?se=ii(se):(se=ys(h)?Pl:Br.current,se=jc(l,se));var _e=h.getDerivedStateFromProps,we=typeof _e=="function"||typeof I.getSnapshotBeforeUpdate=="function";we||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(j!==y||B!==se)&&SE(l,I,y,se),wa=!1;var ye=l.memoizedState;I.state=ye,xp(l,y,I,x),B=l.memoizedState,j!==y||ye!==B||vs.current||wa?(typeof _e=="function"&&(Xv(l,h,_e,y),B=l.memoizedState),(j=wa||bE(l,h,j,y,ye,B,se))?(we||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=B),I.props=y,I.state=B,I.context=se,y=j):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{I=l.stateNode,YS(a,l),j=l.memoizedProps,se=l.type===l.elementType?j:ki(l.type,j),I.props=se,we=l.pendingProps,ye=I.context,B=h.contextType,typeof B=="object"&&B!==null?B=ii(B):(B=ys(h)?Pl:Br.current,B=jc(l,B));var Fe=h.getDerivedStateFromProps;(_e=typeof Fe=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(j!==we||ye!==B)&&SE(l,I,y,B),wa=!1,ye=l.memoizedState,I.state=ye,xp(l,y,I,x);var Ke=l.memoizedState;j!==we||ye!==Ke||vs.current||wa?(typeof Fe=="function"&&(Xv(l,h,Fe,y),Ke=l.memoizedState),(se=wa||bE(l,h,se,y,ye,Ke,B)||!1)?(_e||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(y,Ke,B),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(y,Ke,B)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||j===a.memoizedProps&&ye===a.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&ye===a.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=Ke),I.props=y,I.state=Ke,I.context=B,y=se):(typeof I.componentDidUpdate!="function"||j===a.memoizedProps&&ye===a.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&ye===a.memoizedState||(l.flags|=1024),y=!1)}return ny(a,l,h,y,k,x)}function ny(a,l,h,y,x,k){ME(a,l);var I=(l.flags&128)!==0;if(!y&&!I)return x&&jS(l,h,!1),Oo(a,l,k);y=l.stateNode,vD.current=l;var j=I&&typeof h.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,a!==null&&I?(l.child=Uc(l,a.child,null,k),l.child=Uc(l,null,j,k)):ss(a,l,j,k),l.memoizedState=y.state,x&&jS(l,h,!0),l.child}function $E(a){var l=a.stateNode;l.pendingContext?DS(a,l.pendingContext,l.pendingContext!==l.context):l.context&&DS(a,l.context,!1),jv(a,l.containerInfo)}function NE(a,l,h,y,x){return Hc(),Ov(x),l.flags|=256,ss(a,l,h,y),l.child}var ry={dehydrated:null,treeContext:null,retryLane:0};function sy(a){return{baseLanes:a,cachePool:null,transitions:null}}function DE(a,l,h){var y=l.pendingProps,x=$n.current,k=!1,I=(l.flags&128)!==0,j;if((j=I)||(j=a!==null&&a.memoizedState===null?!1:(x&2)!==0),j?(k=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(x|=1),bn($n,x&1),a===null)return Iv(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((l.mode&1)===0?l.lanes=1:a.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(I=y.children,a=y.fallback,k?(y=l.mode,k=l.child,I={mode:"hidden",children:I},(y&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=I):k=Up(I,y,0,null),a=Dl(a,y,h,null),k.return=l,a.return=l,k.sibling=a,l.child=k,l.child.memoizedState=sy(h),l.memoizedState=ry,a):iy(l,I));if(x=a.memoizedState,x!==null&&(j=x.dehydrated,j!==null))return yD(a,l,I,y,j,x,h);if(k){k=y.fallback,I=l.mode,x=a.child,j=x.sibling;var B={mode:"hidden",children:y.children};return(I&1)===0&&l.child!==x?(y=l.child,y.childLanes=0,y.pendingProps=B,l.deletions=null):(y=Pa(x,B),y.subtreeFlags=x.subtreeFlags&14680064),j!==null?k=Pa(j,k):(k=Dl(k,I,h,null),k.flags|=2),k.return=l,y.return=l,y.sibling=k,l.child=y,y=k,k=l.child,I=a.child.memoizedState,I=I===null?sy(h):{baseLanes:I.baseLanes|h,cachePool:null,transitions:I.transitions},k.memoizedState=I,k.childLanes=a.childLanes&~h,l.memoizedState=ry,y}return k=a.child,a=k.sibling,y=Pa(k,{mode:"visible",children:y.children}),(l.mode&1)===0&&(y.lanes=h),y.return=l,y.sibling=null,a!==null&&(h=l.deletions,h===null?(l.deletions=[a],l.flags|=16):h.push(a)),l.child=y,l.memoizedState=null,y}function iy(a,l){return l=Up({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function Ap(a,l,h,y){return y!==null&&Ov(y),Uc(l,a.child,null,h),a=iy(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function yD(a,l,h,y,x,k,I){if(h)return l.flags&256?(l.flags&=-257,y=Jv(Error(n(422))),Ap(a,l,I,y)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(k=y.fallback,x=l.mode,y=Up({mode:"visible",children:y.children},x,0,null),k=Dl(k,x,I,null),k.flags|=2,y.return=l,k.return=l,y.sibling=k,l.child=y,(l.mode&1)!==0&&Uc(l,a.child,null,I),l.child.memoizedState=sy(I),l.memoizedState=ry,k);if((l.mode&1)===0)return Ap(a,l,I,null);if(x.data==="$!"){if(y=x.nextSibling&&x.nextSibling.dataset,y)var j=y.dgst;return y=j,k=Error(n(419)),y=Jv(k,y,void 0),Ap(a,l,I,y)}if(j=(I&a.childLanes)!==0,_s||j){if(y=br,y!==null){switch(I&-I){case 4:x=2;break;case 16:x=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:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(y.suspendedLanes|I))!==0?0:x,x!==0&&x!==k.retryLane&&(k.retryLane=x,Ao(a,x),Ri(y,a,x,-1))}return by(),y=Jv(Error(n(421))),Ap(a,l,I,y)}return x.data==="$?"?(l.flags|=128,l.child=a.child,l=ID.bind(null,a),x._reactRetry=l,null):(a=k.treeContext,Hs=ga(x.nextSibling),zs=l,An=!0,Ei=null,a!==null&&(ri[si++]=Ro,ri[si++]=To,ri[si++]=Rl,Ro=a.id,To=a.overflow,Rl=l),l=iy(l,y.children),l.flags|=4096,l)}function FE(a,l,h){a.lanes|=l;var y=a.alternate;y!==null&&(y.lanes|=l),Nv(a.return,l,h)}function oy(a,l,h,y,x){var k=a.memoizedState;k===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:x}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=y,k.tail=h,k.tailMode=x)}function jE(a,l,h){var y=l.pendingProps,x=y.revealOrder,k=y.tail;if(ss(a,l,y.children,h),y=$n.current,(y&2)!==0)y=y&1|2,l.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&FE(a,h,l);else if(a.tag===19)FE(a,h,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(bn($n,y),(l.mode&1)===0)l.memoizedState=null;else switch(x){case"forwards":for(h=l.child,x=null;h!==null;)a=h.alternate,a!==null&&Sp(a)===null&&(x=h),h=h.sibling;h=x,h===null?(x=l.child,l.child=null):(x=h.sibling,h.sibling=null),oy(l,!1,x,h,k);break;case"backwards":for(h=null,x=l.child,l.child=null;x!==null;){if(a=x.alternate,a!==null&&Sp(a)===null){l.child=x;break}a=x.sibling,x.sibling=h,h=x,x=a}oy(l,!0,h,null,k);break;case"together":oy(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Ip(a,l){(l.mode&1)===0&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function Oo(a,l,h){if(a!==null&&(l.dependencies=a.dependencies),Ml|=l.lanes,(h&l.childLanes)===0)return null;if(a!==null&&l.child!==a.child)throw Error(n(153));if(l.child!==null){for(a=l.child,h=Pa(a,a.pendingProps),l.child=h,h.return=l;a.sibling!==null;)a=a.sibling,h=h.sibling=Pa(a,a.pendingProps),h.return=l;h.sibling=null}return l.child}function _D(a,l,h){switch(l.tag){case 3:$E(l),Hc();break;case 5:JS(l);break;case 1:ys(l.type)&&hp(l);break;case 4:jv(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,x=l.memoizedProps.value;bn(_p,y._currentValue),y._currentValue=x;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(bn($n,$n.current&1),l.flags|=128,null):(h&l.child.childLanes)!==0?DE(a,l,h):(bn($n,$n.current&1),a=Oo(a,l,h),a!==null?a.sibling:null);bn($n,$n.current&1);break;case 19:if(y=(h&l.childLanes)!==0,(a.flags&128)!==0){if(y)return jE(a,l,h);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),bn($n,$n.current),y)break;return null;case 22:case 23:return l.lanes=0,OE(a,l,h)}return Oo(a,l,h)}var VE,ay,zE,HE;VE=function(a,l){for(var h=l.child;h!==null;){if(h.tag===5||h.tag===6)a.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},ay=function(){},zE=function(a,l,h,y){var x=a.memoizedProps;if(x!==y){a=l.stateNode,Il(qi.current);var k=null;switch(h){case"input":x=dn(a,x),y=dn(a,y),k=[];break;case"select":x=K({},x,{value:void 0}),y=K({},y,{value:void 0}),k=[];break;case"textarea":x=Te(a,x),y=Te(a,y),k=[];break;default:typeof x.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=up)}fn(h,y);var I;h=null;for(se in x)if(!y.hasOwnProperty(se)&&x.hasOwnProperty(se)&&x[se]!=null)if(se==="style"){var j=x[se];for(I in j)j.hasOwnProperty(I)&&(h||(h={}),h[I]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(s.hasOwnProperty(se)?k||(k=[]):(k=k||[]).push(se,null));for(se in y){var B=y[se];if(j=x!=null?x[se]:void 0,y.hasOwnProperty(se)&&B!==j&&(B!=null||j!=null))if(se==="style")if(j){for(I in j)!j.hasOwnProperty(I)||B&&B.hasOwnProperty(I)||(h||(h={}),h[I]="");for(I in B)B.hasOwnProperty(I)&&j[I]!==B[I]&&(h||(h={}),h[I]=B[I])}else h||(k||(k=[]),k.push(se,h)),h=B;else se==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,j=j?j.__html:void 0,B!=null&&j!==B&&(k=k||[]).push(se,B)):se==="children"?typeof B!="string"&&typeof B!="number"||(k=k||[]).push(se,""+B):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(s.hasOwnProperty(se)?(B!=null&&se==="onScroll"&&Sn("scroll",a),k||j===B||(k=[])):(k=k||[]).push(se,B))}h&&(k=k||[]).push("style",h);var se=k;(l.updateQueue=se)&&(l.flags|=4)}},HE=function(a,l,h,y){h!==y&&(l.flags|=4)};function Jd(a,l){if(!An)switch(a.tailMode){case"hidden":l=a.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function Kr(a){var l=a.alternate!==null&&a.alternate.child===a.child,h=0,y=0;if(l)for(var x=a.child;x!==null;)h|=x.lanes|x.childLanes,y|=x.subtreeFlags&14680064,y|=x.flags&14680064,x.return=a,x=x.sibling;else for(x=a.child;x!==null;)h|=x.lanes|x.childLanes,y|=x.subtreeFlags,y|=x.flags,x.return=a,x=x.sibling;return a.subtreeFlags|=y,a.childLanes=h,l}function wD(a,l,h){var y=l.pendingProps;switch(Tv(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kr(l),null;case 1:return ys(l.type)&&fp(),Kr(l),null;case 3:return y=l.stateNode,Wc(),En(vs),En(Br),Hv(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(vp(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ei!==null&&(yy(Ei),Ei=null))),ay(a,l),Kr(l),null;case 5:Vv(l);var x=Il(Gd.current);if(h=l.type,a!==null&&l.stateNode!=null)zE(a,l,h,y,x),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(n(166));return Kr(l),null}if(a=Il(qi.current),vp(l)){y=l.stateNode,h=l.type;var k=l.memoizedProps;switch(y[Gi]=l,y[Ud]=k,a=(l.mode&1)!==0,h){case"dialog":Sn("cancel",y),Sn("close",y);break;case"iframe":case"object":case"embed":Sn("load",y);break;case"video":case"audio":for(x=0;x<Vd.length;x++)Sn(Vd[x],y);break;case"source":Sn("error",y);break;case"img":case"image":case"link":Sn("error",y),Sn("load",y);break;case"details":Sn("toggle",y);break;case"input":sn(y,k),Sn("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!k.multiple},Sn("invalid",y);break;case"textarea":xt(y,k),Sn("invalid",y)}fn(h,k),x=null;for(var I in k)if(k.hasOwnProperty(I)){var j=k[I];I==="children"?typeof j=="string"?y.textContent!==j&&(k.suppressHydrationWarning!==!0&&cp(y.textContent,j,a),x=["children",j]):typeof j=="number"&&y.textContent!==""+j&&(k.suppressHydrationWarning!==!0&&cp(y.textContent,j,a),x=["children",""+j]):s.hasOwnProperty(I)&&j!=null&&I==="onScroll"&&Sn("scroll",y)}switch(h){case"input":Ae(y),mn(y,k,!0);break;case"textarea":Ae(y),Nt(y);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(y.onclick=up)}y=x,l.updateQueue=y,y!==null&&(l.flags|=4)}else{I=x.nodeType===9?x:x.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=dt(h)),a==="http://www.w3.org/1999/xhtml"?h==="script"?(a=I.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=I.createElement(h,{is:y.is}):(a=I.createElement(h),h==="select"&&(I=a,y.multiple?I.multiple=!0:y.size&&(I.size=y.size))):a=I.createElementNS(a,h),a[Gi]=l,a[Ud]=y,VE(a,l,!1,!1),l.stateNode=a;e:{switch(I=Hr(h,y),h){case"dialog":Sn("cancel",a),Sn("close",a),x=y;break;case"iframe":case"object":case"embed":Sn("load",a),x=y;break;case"video":case"audio":for(x=0;x<Vd.length;x++)Sn(Vd[x],a);x=y;break;case"source":Sn("error",a),x=y;break;case"img":case"image":case"link":Sn("error",a),Sn("load",a),x=y;break;case"details":Sn("toggle",a),x=y;break;case"input":sn(a,y),x=dn(a,y),Sn("invalid",a);break;case"option":x=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},x=K({},y,{value:void 0}),Sn("invalid",a);break;case"textarea":xt(a,y),x=Te(a,y),Sn("invalid",a);break;default:x=y}fn(h,x),j=x;for(k in j)if(j.hasOwnProperty(k)){var B=j[k];k==="style"?zr(a,B):k==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,B!=null&&Js(a,B)):k==="children"?typeof B=="string"?(h!=="textarea"||B!=="")&&_n(a,B):typeof B=="number"&&_n(a,""+B):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(s.hasOwnProperty(k)?B!=null&&k==="onScroll"&&Sn("scroll",a):B!=null&&C(a,k,B,I))}switch(h){case"input":Ae(a),mn(a,y,!1);break;case"textarea":Ae(a),Nt(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ge(y.value));break;case"select":a.multiple=!!y.multiple,k=y.value,k!=null?Qe(a,!!y.multiple,k,!1):y.defaultValue!=null&&Qe(a,!!y.multiple,y.defaultValue,!0);break;default:typeof x.onClick=="function"&&(a.onclick=up)}switch(h){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Kr(l),null;case 6:if(a&&l.stateNode!=null)HE(a,l,a.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(n(166));if(h=Il(Gd.current),Il(qi.current),vp(l)){if(y=l.stateNode,h=l.memoizedProps,y[Gi]=l,(k=y.nodeValue!==h)&&(a=zs,a!==null))switch(a.tag){case 3:cp(y.nodeValue,h,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&cp(y.nodeValue,h,(a.mode&1)!==0)}k&&(l.flags|=4)}else y=(h.nodeType===9?h:h.ownerDocument).createTextNode(y),y[Gi]=l,l.stateNode=y}return Kr(l),null;case 13:if(En($n),y=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(An&&Hs!==null&&(l.mode&1)!==0&&(l.flags&128)===0)BS(),Hc(),l.flags|=98560,k=!1;else if(k=vp(l),y!==null&&y.dehydrated!==null){if(a===null){if(!k)throw Error(n(318));if(k=l.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[Gi]=l}else Hc(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Kr(l),k=!1}else Ei!==null&&(yy(Ei),Ei=null),k=!0;if(!k)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=h,l):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(l.child.flags|=8192,(l.mode&1)!==0&&(a===null||($n.current&1)!==0?dr===0&&(dr=3):by())),l.updateQueue!==null&&(l.flags|=4),Kr(l),null);case 4:return Wc(),ay(a,l),a===null&&zd(l.stateNode.containerInfo),Kr(l),null;case 10:return $v(l.type._context),Kr(l),null;case 17:return ys(l.type)&&fp(),Kr(l),null;case 19:if(En($n),k=l.memoizedState,k===null)return Kr(l),null;if(y=(l.flags&128)!==0,I=k.rendering,I===null)if(y)Jd(k,!1);else{if(dr!==0||a!==null&&(a.flags&128)!==0)for(a=l.child;a!==null;){if(I=Sp(a),I!==null){for(l.flags|=128,Jd(k,!1),y=I.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=h,h=l.child;h!==null;)k=h,a=y,k.flags&=14680066,I=k.alternate,I===null?(k.childLanes=0,k.lanes=a,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=I.childLanes,k.lanes=I.lanes,k.child=I.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=I.memoizedProps,k.memoizedState=I.memoizedState,k.updateQueue=I.updateQueue,k.type=I.type,a=I.dependencies,k.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),h=h.sibling;return bn($n,$n.current&1|2),l.child}a=a.sibling}k.tail!==null&&on()>Yc&&(l.flags|=128,y=!0,Jd(k,!1),l.lanes=4194304)}else{if(!y)if(a=Sp(I),a!==null){if(l.flags|=128,y=!0,h=a.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),Jd(k,!0),k.tail===null&&k.tailMode==="hidden"&&!I.alternate&&!An)return Kr(l),null}else 2*on()-k.renderingStartTime>Yc&&h!==1073741824&&(l.flags|=128,y=!0,Jd(k,!1),l.lanes=4194304);k.isBackwards?(I.sibling=l.child,l.child=I):(h=k.last,h!==null?h.sibling=I:l.child=I,k.last=I)}return k.tail!==null?(l=k.tail,k.rendering=l,k.tail=l.sibling,k.renderingStartTime=on(),l.sibling=null,h=$n.current,bn($n,y?h&1|2:h&1),l):(Kr(l),null);case 22:case 23:return wy(),y=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(l.flags|=8192),y&&(l.mode&1)!==0?(Us&1073741824)!==0&&(Kr(l),l.subtreeFlags&6&&(l.flags|=8192)):Kr(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function bD(a,l){switch(Tv(l),l.tag){case 1:return ys(l.type)&&fp(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return Wc(),En(vs),En(Br),Hv(),a=l.flags,(a&65536)!==0&&(a&128)===0?(l.flags=a&-65537|128,l):null;case 5:return Vv(l),null;case 13:if(En($n),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Hc()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return En($n),null;case 4:return Wc(),null;case 10:return $v(l.type._context),null;case 22:case 23:return wy(),null;case 24:return null;default:return null}}var Op=!1,Gr=!1,xD=typeof WeakSet=="function"?WeakSet:Set,Ze=null;function Gc(a,l){var h=a.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(y){Wn(a,l,y)}else h.current=null}function ly(a,l,h){try{h()}catch(y){Wn(a,l,y)}}var UE=!1;function SD(a,l){if(wv=Ki,a=bS(),fv(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var x=y.anchorOffset,k=y.focusNode;y=y.focusOffset;try{h.nodeType,k.nodeType}catch{h=null;break e}var I=0,j=-1,B=-1,se=0,_e=0,we=a,ye=null;t:for(;;){for(var Fe;we!==h||x!==0&&we.nodeType!==3||(j=I+x),we!==k||y!==0&&we.nodeType!==3||(B=I+y),we.nodeType===3&&(I+=we.nodeValue.length),(Fe=we.firstChild)!==null;)ye=we,we=Fe;for(;;){if(we===a)break t;if(ye===h&&++se===x&&(j=I),ye===k&&++_e===y&&(B=I),(Fe=we.nextSibling)!==null)break;we=ye,ye=we.parentNode}we=Fe}h=j===-1||B===-1?null:{start:j,end:B}}else h=null}h=h||{start:0,end:0}}else h=null;for(bv={focusedElem:a,selectionRange:h},Ki=!1,Ze=l;Ze!==null;)if(l=Ze,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,Ze=a;else for(;Ze!==null;){l=Ze;try{var Ke=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Ke!==null){var qe=Ke.memoizedProps,Yn=Ke.memoizedState,ee=l.stateNode,G=ee.getSnapshotBeforeUpdate(l.elementType===l.type?qe:ki(l.type,qe),Yn);ee.__reactInternalSnapshotBeforeUpdate=G}break;case 3:var te=l.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){Wn(l,l.return,Ce)}if(a=l.sibling,a!==null){a.return=l.return,Ze=a;break}Ze=l.return}return Ke=UE,UE=!1,Ke}function ef(a,l,h){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var x=y=y.next;do{if((x.tag&a)===a){var k=x.destroy;x.destroy=void 0,k!==void 0&&ly(l,h,k)}x=x.next}while(x!==y)}}function Mp(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&a)===a){var y=h.create;h.destroy=y()}h=h.next}while(h!==l)}}function cy(a){var l=a.ref;if(l!==null){var h=a.stateNode;switch(a.tag){case 5:a=h;break;default:a=h}typeof l=="function"?l(a):l.current=a}}function ZE(a){var l=a.alternate;l!==null&&(a.alternate=null,ZE(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[Gi],delete l[Ud],delete l[kv],delete l[iD],delete l[oD])),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 BE(a){return a.tag===5||a.tag===3||a.tag===4}function WE(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||BE(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 uy(a,l,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?h.nodeType===8?h.parentNode.insertBefore(a,l):h.insertBefore(a,l):(h.nodeType===8?(l=h.parentNode,l.insertBefore(a,h)):(l=h,l.appendChild(a)),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=up));else if(y!==4&&(a=a.child,a!==null))for(uy(a,l,h),a=a.sibling;a!==null;)uy(a,l,h),a=a.sibling}function dy(a,l,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?h.insertBefore(a,l):h.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(dy(a,l,h),a=a.sibling;a!==null;)dy(a,l,h),a=a.sibling}var Mr=null,Ci=!1;function xa(a,l,h){for(h=h.child;h!==null;)KE(a,l,h),h=h.sibling}function KE(a,l,h){if(Zr&&typeof Zr.onCommitFiberUnmount=="function")try{Zr.onCommitFiberUnmount(So,h)}catch{}switch(h.tag){case 5:Gr||Gc(h,l);case 6:var y=Mr,x=Ci;Mr=null,xa(a,l,h),Mr=y,Ci=x,Mr!==null&&(Ci?(a=Mr,h=h.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)):Mr.removeChild(h.stateNode));break;case 18:Mr!==null&&(Ci?(a=Mr,h=h.stateNode,a.nodeType===8?Ev(a.parentNode,h):a.nodeType===1&&Ev(a,h),Pt(a)):Ev(Mr,h.stateNode));break;case 4:y=Mr,x=Ci,Mr=h.stateNode.containerInfo,Ci=!0,xa(a,l,h),Mr=y,Ci=x;break;case 0:case 11:case 14:case 15:if(!Gr&&(y=h.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){x=y=y.next;do{var k=x,I=k.destroy;k=k.tag,I!==void 0&&((k&2)!==0||(k&4)!==0)&&ly(h,l,I),x=x.next}while(x!==y)}xa(a,l,h);break;case 1:if(!Gr&&(Gc(h,l),y=h.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=h.memoizedProps,y.state=h.memoizedState,y.componentWillUnmount()}catch(j){Wn(h,l,j)}xa(a,l,h);break;case 21:xa(a,l,h);break;case 22:h.mode&1?(Gr=(y=Gr)||h.memoizedState!==null,xa(a,l,h),Gr=y):xa(a,l,h);break;default:xa(a,l,h)}}function GE(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var h=a.stateNode;h===null&&(h=a.stateNode=new xD),l.forEach(function(y){var x=OD.bind(null,a,y);h.has(y)||(h.add(y),y.then(x,x))})}}function Pi(a,l){var h=l.deletions;if(h!==null)for(var y=0;y<h.length;y++){var x=h[y];try{var k=a,I=l,j=I;e:for(;j!==null;){switch(j.tag){case 5:Mr=j.stateNode,Ci=!1;break e;case 3:Mr=j.stateNode.containerInfo,Ci=!0;break e;case 4:Mr=j.stateNode.containerInfo,Ci=!0;break e}j=j.return}if(Mr===null)throw Error(n(160));KE(k,I,x),Mr=null,Ci=!1;var B=x.alternate;B!==null&&(B.return=null),x.return=null}catch(se){Wn(x,l,se)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)qE(l,a),l=l.sibling}function qE(a,l){var h=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Pi(l,a),Xi(a),y&4){try{ef(3,a,a.return),Mp(3,a)}catch(qe){Wn(a,a.return,qe)}try{ef(5,a,a.return)}catch(qe){Wn(a,a.return,qe)}}break;case 1:Pi(l,a),Xi(a),y&512&&h!==null&&Gc(h,h.return);break;case 5:if(Pi(l,a),Xi(a),y&512&&h!==null&&Gc(h,h.return),a.flags&32){var x=a.stateNode;try{_n(x,"")}catch(qe){Wn(a,a.return,qe)}}if(y&4&&(x=a.stateNode,x!=null)){var k=a.memoizedProps,I=h!==null?h.memoizedProps:k,j=a.type,B=a.updateQueue;if(a.updateQueue=null,B!==null)try{j==="input"&&k.type==="radio"&&k.name!=null&&kt(x,k),Hr(j,I);var se=Hr(j,k);for(I=0;I<B.length;I+=2){var _e=B[I],we=B[I+1];_e==="style"?zr(x,we):_e==="dangerouslySetInnerHTML"?Js(x,we):_e==="children"?_n(x,we):C(x,_e,we,se)}switch(j){case"input":Gt(x,k);break;case"textarea":xe(x,k);break;case"select":var ye=x._wrapperState.wasMultiple;x._wrapperState.wasMultiple=!!k.multiple;var Fe=k.value;Fe!=null?Qe(x,!!k.multiple,Fe,!1):ye!==!!k.multiple&&(k.defaultValue!=null?Qe(x,!!k.multiple,k.defaultValue,!0):Qe(x,!!k.multiple,k.multiple?[]:"",!1))}x[Ud]=k}catch(qe){Wn(a,a.return,qe)}}break;case 6:if(Pi(l,a),Xi(a),y&4){if(a.stateNode===null)throw Error(n(162));x=a.stateNode,k=a.memoizedProps;try{x.nodeValue=k}catch(qe){Wn(a,a.return,qe)}}break;case 3:if(Pi(l,a),Xi(a),y&4&&h!==null&&h.memoizedState.isDehydrated)try{Pt(l.containerInfo)}catch(qe){Wn(a,a.return,qe)}break;case 4:Pi(l,a),Xi(a);break;case 13:Pi(l,a),Xi(a),x=a.child,x.flags&8192&&(k=x.memoizedState!==null,x.stateNode.isHidden=k,!k||x.alternate!==null&&x.alternate.memoizedState!==null||(py=on())),y&4&&GE(a);break;case 22:if(_e=h!==null&&h.memoizedState!==null,a.mode&1?(Gr=(se=Gr)||_e,Pi(l,a),Gr=se):Pi(l,a),Xi(a),y&8192){if(se=a.memoizedState!==null,(a.stateNode.isHidden=se)&&!_e&&(a.mode&1)!==0)for(Ze=a,_e=a.child;_e!==null;){for(we=Ze=_e;Ze!==null;){switch(ye=Ze,Fe=ye.child,ye.tag){case 0:case 11:case 14:case 15:ef(4,ye,ye.return);break;case 1:Gc(ye,ye.return);var Ke=ye.stateNode;if(typeof Ke.componentWillUnmount=="function"){y=ye,h=ye.return;try{l=y,Ke.props=l.memoizedProps,Ke.state=l.memoizedState,Ke.componentWillUnmount()}catch(qe){Wn(y,h,qe)}}break;case 5:Gc(ye,ye.return);break;case 22:if(ye.memoizedState!==null){QE(we);continue}}Fe!==null?(Fe.return=ye,Ze=Fe):QE(we)}_e=_e.sibling}e:for(_e=null,we=a;;){if(we.tag===5){if(_e===null){_e=we;try{x=we.stateNode,se?(k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(j=we.stateNode,B=we.memoizedProps.style,I=B!=null&&B.hasOwnProperty("display")?B.display:null,j.style.display=ts("display",I))}catch(qe){Wn(a,a.return,qe)}}}else if(we.tag===6){if(_e===null)try{we.stateNode.nodeValue=se?"":we.memoizedProps}catch(qe){Wn(a,a.return,qe)}}else if((we.tag!==22&&we.tag!==23||we.memoizedState===null||we===a)&&we.child!==null){we.child.return=we,we=we.child;continue}if(we===a)break e;for(;we.sibling===null;){if(we.return===null||we.return===a)break e;_e===we&&(_e=null),we=we.return}_e===we&&(_e=null),we.sibling.return=we.return,we=we.sibling}}break;case 19:Pi(l,a),Xi(a),y&4&&GE(a);break;case 21:break;default:Pi(l,a),Xi(a)}}function Xi(a){var l=a.flags;if(l&2){try{e:{for(var h=a.return;h!==null;){if(BE(h)){var y=h;break e}h=h.return}throw Error(n(160))}switch(y.tag){case 5:var x=y.stateNode;y.flags&32&&(_n(x,""),y.flags&=-33);var k=WE(a);dy(a,k,x);break;case 3:case 4:var I=y.stateNode.containerInfo,j=WE(a);uy(a,j,I);break;default:throw Error(n(161))}}catch(B){Wn(a,a.return,B)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function ED(a,l,h){Ze=a,YE(a)}function YE(a,l,h){for(var y=(a.mode&1)!==0;Ze!==null;){var x=Ze,k=x.child;if(x.tag===22&&y){var I=x.memoizedState!==null||Op;if(!I){var j=x.alternate,B=j!==null&&j.memoizedState!==null||Gr;j=Op;var se=Gr;if(Op=I,(Gr=B)&&!se)for(Ze=x;Ze!==null;)I=Ze,B=I.child,I.tag===22&&I.memoizedState!==null?JE(x):B!==null?(B.return=I,Ze=B):JE(x);for(;k!==null;)Ze=k,YE(k),k=k.sibling;Ze=x,Op=j,Gr=se}XE(a)}else(x.subtreeFlags&8772)!==0&&k!==null?(k.return=x,Ze=k):XE(a)}}function XE(a){for(;Ze!==null;){var l=Ze;if((l.flags&8772)!==0){var h=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Gr||Mp(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!Gr)if(h===null)y.componentDidMount();else{var x=l.elementType===l.type?h.memoizedProps:ki(l.type,h.memoizedProps);y.componentDidUpdate(x,h.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var k=l.updateQueue;k!==null&&QS(l,k,y);break;case 3:var I=l.updateQueue;if(I!==null){if(h=null,l.child!==null)switch(l.child.tag){case 5:h=l.child.stateNode;break;case 1:h=l.child.stateNode}QS(l,I,h)}break;case 5:var j=l.stateNode;if(h===null&&l.flags&4){h=j;var B=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":B.autoFocus&&h.focus();break;case"img":B.src&&(h.src=B.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var se=l.alternate;if(se!==null){var _e=se.memoizedState;if(_e!==null){var we=_e.dehydrated;we!==null&&Pt(we)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Gr||l.flags&512&&cy(l)}catch(ye){Wn(l,l.return,ye)}}if(l===a){Ze=null;break}if(h=l.sibling,h!==null){h.return=l.return,Ze=h;break}Ze=l.return}}function QE(a){for(;Ze!==null;){var l=Ze;if(l===a){Ze=null;break}var h=l.sibling;if(h!==null){h.return=l.return,Ze=h;break}Ze=l.return}}function JE(a){for(;Ze!==null;){var l=Ze;try{switch(l.tag){case 0:case 11:case 15:var h=l.return;try{Mp(4,l)}catch(B){Wn(l,h,B)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var x=l.return;try{y.componentDidMount()}catch(B){Wn(l,x,B)}}var k=l.return;try{cy(l)}catch(B){Wn(l,k,B)}break;case 5:var I=l.return;try{cy(l)}catch(B){Wn(l,I,B)}}}catch(B){Wn(l,l.return,B)}if(l===a){Ze=null;break}var j=l.sibling;if(j!==null){j.return=l.return,Ze=j;break}Ze=l.return}}var kD=Math.ceil,Lp=R.ReactCurrentDispatcher,fy=R.ReactCurrentOwner,ai=R.ReactCurrentBatchConfig,Wt=0,br=null,er=null,Lr=0,Us=0,qc=va(0),dr=0,tf=null,Ml=0,$p=0,hy=0,nf=null,ws=null,py=0,Yc=1/0,Mo=null,Np=!1,my=null,Sa=null,Dp=!1,Ea=null,Fp=0,rf=0,gy=null,jp=-1,Vp=0;function is(){return(Wt&6)!==0?on():jp!==-1?jp:jp=on()}function ka(a){return(a.mode&1)===0?1:(Wt&2)!==0&&Lr!==0?Lr&-Lr:lD.transition!==null?(Vp===0&&(Vp=Ct()),Vp):(a=it,a!==0||(a=window.event,a=a===void 0?16:tS(a.type)),a)}function Ri(a,l,h,y){if(50<rf)throw rf=0,gy=null,Error(n(185));Jt(a,h,y),((Wt&2)===0||a!==br)&&(a===br&&((Wt&2)===0&&($p|=h),dr===4&&Ca(a,Lr)),bs(a,y),h===1&&Wt===0&&(l.mode&1)===0&&(Yc=on()+500,pp&&_a()))}function bs(a,l){var h=a.callbackNode;Ue(a,l);var y=ve(a,a===br?Lr:0);if(y===0)h!==null&&wl(h),a.callbackNode=null,a.callbackPriority=0;else if(l=y&-y,a.callbackPriority!==l){if(h!=null&&wl(h),l===1)a.tag===0?aD(tk.bind(null,a)):VS(tk.bind(null,a)),rD(function(){(Wt&6)===0&&_a()}),h=null;else{switch(Ir(y)){case 1:h=Ds;break;case 4:h=Bi;break;case 16:h=Ar;break;case 536870912:h=xl;break;default:h=Ar}h=ck(h,ek.bind(null,a))}a.callbackPriority=l,a.callbackNode=h}}function ek(a,l){if(jp=-1,Vp=0,(Wt&6)!==0)throw Error(n(327));var h=a.callbackNode;if(Xc()&&a.callbackNode!==h)return null;var y=ve(a,a===br?Lr:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||l)l=zp(a,y);else{l=y;var x=Wt;Wt|=2;var k=rk();(br!==a||Lr!==l)&&(Mo=null,Yc=on()+500,$l(a,l));do try{RD();break}catch(j){nk(a,j)}while(!0);Lv(),Lp.current=k,Wt=x,er!==null?l=0:(br=null,Lr=0,l=dr)}if(l!==0){if(l===2&&(x=ht(a),x!==0&&(y=x,l=vy(a,x))),l===1)throw h=tf,$l(a,0),Ca(a,y),bs(a,on()),h;if(l===6)Ca(a,y);else{if(x=a.current.alternate,(y&30)===0&&!CD(x)&&(l=zp(a,y),l===2&&(k=ht(a),k!==0&&(y=k,l=vy(a,k))),l===1))throw h=tf,$l(a,0),Ca(a,y),bs(a,on()),h;switch(a.finishedWork=x,a.finishedLanes=y,l){case 0:case 1:throw Error(n(345));case 2:Nl(a,ws,Mo);break;case 3:if(Ca(a,y),(y&130023424)===y&&(l=py+500-on(),10<l)){if(ve(a,0)!==0)break;if(x=a.suspendedLanes,(x&y)!==y){is(),a.pingedLanes|=a.suspendedLanes&x;break}a.timeoutHandle=Sv(Nl.bind(null,a,ws,Mo),l);break}Nl(a,ws,Mo);break;case 4:if(Ca(a,y),(y&4194240)===y)break;for(l=a.eventTimes,x=-1;0<y;){var I=31-rs(y);k=1<<I,I=l[I],I>x&&(x=I),y&=~k}if(y=x,y=on()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*kD(y/1960))-y,10<y){a.timeoutHandle=Sv(Nl.bind(null,a,ws,Mo),y);break}Nl(a,ws,Mo);break;case 5:Nl(a,ws,Mo);break;default:throw Error(n(329))}}}return bs(a,on()),a.callbackNode===h?ek.bind(null,a):null}function vy(a,l){var h=nf;return a.current.memoizedState.isDehydrated&&($l(a,l).flags|=256),a=zp(a,l),a!==2&&(l=ws,ws=h,l!==null&&yy(l)),a}function yy(a){ws===null?ws=a:ws.push.apply(ws,a)}function CD(a){for(var l=a;;){if(l.flags&16384){var h=l.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var y=0;y<h.length;y++){var x=h[y],k=x.getSnapshot;x=x.value;try{if(!Si(k(),x))return!1}catch{return!1}}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ca(a,l){for(l&=~hy,l&=~$p,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var h=31-rs(l),y=1<<h;a[h]=-1,l&=~y}}function tk(a){if((Wt&6)!==0)throw Error(n(327));Xc();var l=ve(a,0);if((l&1)===0)return bs(a,on()),null;var h=zp(a,l);if(a.tag!==0&&h===2){var y=ht(a);y!==0&&(l=y,h=vy(a,y))}if(h===1)throw h=tf,$l(a,0),Ca(a,l),bs(a,on()),h;if(h===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,Nl(a,ws,Mo),bs(a,on()),null}function _y(a,l){var h=Wt;Wt|=1;try{return a(l)}finally{Wt=h,Wt===0&&(Yc=on()+500,pp&&_a())}}function Ll(a){Ea!==null&&Ea.tag===0&&(Wt&6)===0&&Xc();var l=Wt;Wt|=1;var h=ai.transition,y=it;try{if(ai.transition=null,it=1,a)return a()}finally{it=y,ai.transition=h,Wt=l,(Wt&6)===0&&_a()}}function wy(){Us=qc.current,En(qc)}function $l(a,l){a.finishedWork=null,a.finishedLanes=0;var h=a.timeoutHandle;if(h!==-1&&(a.timeoutHandle=-1,nD(h)),er!==null)for(h=er.return;h!==null;){var y=h;switch(Tv(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&fp();break;case 3:Wc(),En(vs),En(Br),Hv();break;case 5:Vv(y);break;case 4:Wc();break;case 13:En($n);break;case 19:En($n);break;case 10:$v(y.type._context);break;case 22:case 23:wy()}h=h.return}if(br=a,er=a=Pa(a.current,null),Lr=Us=l,dr=0,tf=null,hy=$p=Ml=0,ws=nf=null,Al!==null){for(l=0;l<Al.length;l++)if(h=Al[l],y=h.interleaved,y!==null){h.interleaved=null;var x=y.next,k=h.pending;if(k!==null){var I=k.next;k.next=x,y.next=I}h.pending=y}Al=null}return a}function nk(a,l){do{var h=er;try{if(Lv(),Ep.current=Rp,kp){for(var y=Nn.memoizedState;y!==null;){var x=y.queue;x!==null&&(x.pending=null),y=y.next}kp=!1}if(Ol=0,wr=ur=Nn=null,qd=!1,Yd=0,fy.current=null,h===null||h.return===null){dr=1,tf=l,er=null;break}e:{var k=a,I=h.return,j=h,B=l;if(l=Lr,j.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var se=B,_e=j,we=_e.tag;if((_e.mode&1)===0&&(we===0||we===11||we===15)){var ye=_e.alternate;ye?(_e.updateQueue=ye.updateQueue,_e.memoizedState=ye.memoizedState,_e.lanes=ye.lanes):(_e.updateQueue=null,_e.memoizedState=null)}var Fe=PE(I);if(Fe!==null){Fe.flags&=-257,RE(Fe,I,j,k,l),Fe.mode&1&&CE(k,se,l),l=Fe,B=se;var Ke=l.updateQueue;if(Ke===null){var qe=new Set;qe.add(B),l.updateQueue=qe}else Ke.add(B);break e}else{if((l&1)===0){CE(k,se,l),by();break e}B=Error(n(426))}}else if(An&&j.mode&1){var Yn=PE(I);if(Yn!==null){(Yn.flags&65536)===0&&(Yn.flags|=256),RE(Yn,I,j,k,l),Ov(Kc(B,j));break e}}k=B=Kc(B,j),dr!==4&&(dr=2),nf===null?nf=[k]:nf.push(k),k=I;do{switch(k.tag){case 3:k.flags|=65536,l&=-l,k.lanes|=l;var ee=EE(k,B,l);XS(k,ee);break e;case 1:j=B;var G=k.type,te=k.stateNode;if((k.flags&128)===0&&(typeof G.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(Sa===null||!Sa.has(te)))){k.flags|=65536,l&=-l,k.lanes|=l;var Ce=kE(k,j,l);XS(k,Ce);break e}}k=k.return}while(k!==null)}ik(h)}catch(Je){l=Je,er===h&&h!==null&&(er=h=h.return);continue}break}while(!0)}function rk(){var a=Lp.current;return Lp.current=Rp,a===null?Rp:a}function by(){(dr===0||dr===3||dr===2)&&(dr=4),br===null||(Ml&268435455)===0&&($p&268435455)===0||Ca(br,Lr)}function zp(a,l){var h=Wt;Wt|=2;var y=rk();(br!==a||Lr!==l)&&(Mo=null,$l(a,l));do try{PD();break}catch(x){nk(a,x)}while(!0);if(Lv(),Wt=h,Lp.current=y,er!==null)throw Error(n(261));return br=null,Lr=0,dr}function PD(){for(;er!==null;)sk(er)}function RD(){for(;er!==null&&!Rc();)sk(er)}function sk(a){var l=lk(a.alternate,a,Us);a.memoizedProps=a.pendingProps,l===null?ik(a):er=l,fy.current=null}function ik(a){var l=a;do{var h=l.alternate;if(a=l.return,(l.flags&32768)===0){if(h=wD(h,l,Us),h!==null){er=h;return}}else{if(h=bD(h,l),h!==null){h.flags&=32767,er=h;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{dr=6,er=null;return}}if(l=l.sibling,l!==null){er=l;return}er=l=a}while(l!==null);dr===0&&(dr=5)}function Nl(a,l,h){var y=it,x=ai.transition;try{ai.transition=null,it=1,TD(a,l,h,y)}finally{ai.transition=x,it=y}return null}function TD(a,l,h,y){do Xc();while(Ea!==null);if((Wt&6)!==0)throw Error(n(327));h=a.finishedWork;var x=a.finishedLanes;if(h===null)return null;if(a.finishedWork=null,a.finishedLanes=0,h===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var k=h.lanes|h.childLanes;if(pt(a,k),a===br&&(er=br=null,Lr=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Dp||(Dp=!0,ck(Ar,function(){return Xc(),null})),k=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||k){k=ai.transition,ai.transition=null;var I=it;it=1;var j=Wt;Wt|=4,fy.current=null,SD(a,h),qE(h,a),q4(bv),Ki=!!wv,bv=wv=null,a.current=h,ED(h),fa(),Wt=j,it=I,ai.transition=k}else a.current=h;if(Dp&&(Dp=!1,Ea=a,Fp=x),k=a.pendingLanes,k===0&&(Sa=null),Sl(h.stateNode),bs(a,on()),l!==null)for(y=a.onRecoverableError,h=0;h<l.length;h++)x=l[h],y(x.value,{componentStack:x.stack,digest:x.digest});if(Np)throw Np=!1,a=my,my=null,a;return(Fp&1)!==0&&a.tag!==0&&Xc(),k=a.pendingLanes,(k&1)!==0?a===gy?rf++:(rf=0,gy=a):rf=0,_a(),null}function Xc(){if(Ea!==null){var a=Ir(Fp),l=ai.transition,h=it;try{if(ai.transition=null,it=16>a?16:a,Ea===null)var y=!1;else{if(a=Ea,Ea=null,Fp=0,(Wt&6)!==0)throw Error(n(331));var x=Wt;for(Wt|=4,Ze=a.current;Ze!==null;){var k=Ze,I=k.child;if((Ze.flags&16)!==0){var j=k.deletions;if(j!==null){for(var B=0;B<j.length;B++){var se=j[B];for(Ze=se;Ze!==null;){var _e=Ze;switch(_e.tag){case 0:case 11:case 15:ef(8,_e,k)}var we=_e.child;if(we!==null)we.return=_e,Ze=we;else for(;Ze!==null;){_e=Ze;var ye=_e.sibling,Fe=_e.return;if(ZE(_e),_e===se){Ze=null;break}if(ye!==null){ye.return=Fe,Ze=ye;break}Ze=Fe}}}var Ke=k.alternate;if(Ke!==null){var qe=Ke.child;if(qe!==null){Ke.child=null;do{var Yn=qe.sibling;qe.sibling=null,qe=Yn}while(qe!==null)}}Ze=k}}if((k.subtreeFlags&2064)!==0&&I!==null)I.return=k,Ze=I;else e:for(;Ze!==null;){if(k=Ze,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:ef(9,k,k.return)}var ee=k.sibling;if(ee!==null){ee.return=k.return,Ze=ee;break e}Ze=k.return}}var G=a.current;for(Ze=G;Ze!==null;){I=Ze;var te=I.child;if((I.subtreeFlags&2064)!==0&&te!==null)te.return=I,Ze=te;else e:for(I=G;Ze!==null;){if(j=Ze,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:Mp(9,j)}}catch(Je){Wn(j,j.return,Je)}if(j===I){Ze=null;break e}var Ce=j.sibling;if(Ce!==null){Ce.return=j.return,Ze=Ce;break e}Ze=j.return}}if(Wt=x,_a(),Zr&&typeof Zr.onPostCommitFiberRoot=="function")try{Zr.onPostCommitFiberRoot(So,a)}catch{}y=!0}return y}finally{it=h,ai.transition=l}}return!1}function ok(a,l,h){l=Kc(h,l),l=EE(a,l,1),a=ba(a,l,1),l=is(),a!==null&&(Jt(a,1,l),bs(a,l))}function Wn(a,l,h){if(a.tag===3)ok(a,a,h);else for(;l!==null;){if(l.tag===3){ok(l,a,h);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Sa===null||!Sa.has(y))){a=Kc(h,a),a=kE(l,a,1),l=ba(l,a,1),a=is(),l!==null&&(Jt(l,1,a),bs(l,a));break}}l=l.return}}function AD(a,l,h){var y=a.pingCache;y!==null&&y.delete(l),l=is(),a.pingedLanes|=a.suspendedLanes&h,br===a&&(Lr&h)===h&&(dr===4||dr===3&&(Lr&130023424)===Lr&&500>on()-py?$l(a,0):hy|=h),bs(a,l)}function ak(a,l){l===0&&((a.mode&1)===0?l=1:(l=$,$<<=1,($&130023424)===0&&($=4194304)));var h=is();a=Ao(a,l),a!==null&&(Jt(a,l,h),bs(a,h))}function ID(a){var l=a.memoizedState,h=0;l!==null&&(h=l.retryLane),ak(a,h)}function OD(a,l){var h=0;switch(a.tag){case 13:var y=a.stateNode,x=a.memoizedState;x!==null&&(h=x.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(l),ak(a,h)}var lk;lk=function(a,l,h){if(a!==null)if(a.memoizedProps!==l.pendingProps||vs.current)_s=!0;else{if((a.lanes&h)===0&&(l.flags&128)===0)return _s=!1,_D(a,l,h);_s=(a.flags&131072)!==0}else _s=!1,An&&(l.flags&1048576)!==0&&zS(l,gp,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;Ip(a,l),a=l.pendingProps;var x=jc(l,Br.current);Bc(l,h),x=Bv(null,l,y,a,x,h);var k=Wv();return l.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,ys(y)?(k=!0,hp(l)):k=!1,l.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,Fv(l),x.updater=Tp,l.stateNode=x,x._reactInternals=l,Qv(l,y,a,h),l=ny(null,l,y,!0,k,h)):(l.tag=0,An&&k&&Rv(l),ss(null,l,x,h),l=l.child),l;case 16:y=l.elementType;e:{switch(Ip(a,l),a=l.pendingProps,x=y._init,y=x(y._payload),l.type=y,x=l.tag=LD(y),a=ki(y,a),x){case 0:l=ty(null,l,y,a,h);break e;case 1:l=LE(null,l,y,a,h);break e;case 11:l=TE(null,l,y,a,h);break e;case 14:l=AE(null,l,y,ki(y.type,a),h);break e}throw Error(n(306,y,""))}return l;case 0:return y=l.type,x=l.pendingProps,x=l.elementType===y?x:ki(y,x),ty(a,l,y,x,h);case 1:return y=l.type,x=l.pendingProps,x=l.elementType===y?x:ki(y,x),LE(a,l,y,x,h);case 3:e:{if($E(l),a===null)throw Error(n(387));y=l.pendingProps,k=l.memoizedState,x=k.element,YS(a,l),xp(l,y,null,h);var I=l.memoizedState;if(y=I.element,k.isDehydrated)if(k={element:y,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=k,l.memoizedState=k,l.flags&256){x=Kc(Error(n(423)),l),l=NE(a,l,y,h,x);break e}else if(y!==x){x=Kc(Error(n(424)),l),l=NE(a,l,y,h,x);break e}else for(Hs=ga(l.stateNode.containerInfo.firstChild),zs=l,An=!0,Ei=null,h=GS(l,null,y,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Hc(),y===x){l=Oo(a,l,h);break e}ss(a,l,y,h)}l=l.child}return l;case 5:return JS(l),a===null&&Iv(l),y=l.type,x=l.pendingProps,k=a!==null?a.memoizedProps:null,I=x.children,xv(y,x)?I=null:k!==null&&xv(y,k)&&(l.flags|=32),ME(a,l),ss(a,l,I,h),l.child;case 6:return a===null&&Iv(l),null;case 13:return DE(a,l,h);case 4:return jv(l,l.stateNode.containerInfo),y=l.pendingProps,a===null?l.child=Uc(l,null,y,h):ss(a,l,y,h),l.child;case 11:return y=l.type,x=l.pendingProps,x=l.elementType===y?x:ki(y,x),TE(a,l,y,x,h);case 7:return ss(a,l,l.pendingProps,h),l.child;case 8:return ss(a,l,l.pendingProps.children,h),l.child;case 12:return ss(a,l,l.pendingProps.children,h),l.child;case 10:e:{if(y=l.type._context,x=l.pendingProps,k=l.memoizedProps,I=x.value,bn(_p,y._currentValue),y._currentValue=I,k!==null)if(Si(k.value,I)){if(k.children===x.children&&!vs.current){l=Oo(a,l,h);break e}}else for(k=l.child,k!==null&&(k.return=l);k!==null;){var j=k.dependencies;if(j!==null){I=k.child;for(var B=j.firstContext;B!==null;){if(B.context===y){if(k.tag===1){B=Io(-1,h&-h),B.tag=2;var se=k.updateQueue;if(se!==null){se=se.shared;var _e=se.pending;_e===null?B.next=B:(B.next=_e.next,_e.next=B),se.pending=B}}k.lanes|=h,B=k.alternate,B!==null&&(B.lanes|=h),Nv(k.return,h,l),j.lanes|=h;break}B=B.next}}else if(k.tag===10)I=k.type===l.type?null:k.child;else if(k.tag===18){if(I=k.return,I===null)throw Error(n(341));I.lanes|=h,j=I.alternate,j!==null&&(j.lanes|=h),Nv(I,h,l),I=k.sibling}else I=k.child;if(I!==null)I.return=k;else for(I=k;I!==null;){if(I===l){I=null;break}if(k=I.sibling,k!==null){k.return=I.return,I=k;break}I=I.return}k=I}ss(a,l,x.children,h),l=l.child}return l;case 9:return x=l.type,y=l.pendingProps.children,Bc(l,h),x=ii(x),y=y(x),l.flags|=1,ss(a,l,y,h),l.child;case 14:return y=l.type,x=ki(y,l.pendingProps),x=ki(y.type,x),AE(a,l,y,x,h);case 15:return IE(a,l,l.type,l.pendingProps,h);case 17:return y=l.type,x=l.pendingProps,x=l.elementType===y?x:ki(y,x),Ip(a,l),l.tag=1,ys(y)?(a=!0,hp(l)):a=!1,Bc(l,h),xE(l,y,x),Qv(l,y,x,h),ny(null,l,y,!0,a,h);case 19:return jE(a,l,h);case 22:return OE(a,l,h)}throw Error(n(156,l.tag))};function ck(a,l){return Ns(a,l)}function MD(a,l,h,y){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(a,l,h,y){return new MD(a,l,h,y)}function xy(a){return a=a.prototype,!(!a||!a.isReactComponent)}function LD(a){if(typeof a=="function")return xy(a)?1:0;if(a!=null){if(a=a.$$typeof,a===z)return 11;if(a===H)return 14}return 2}function Pa(a,l){var h=a.alternate;return h===null?(h=li(a.tag,l,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=l,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&14680064,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,l=a.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h}function Hp(a,l,h,y,x,k){var I=2;if(y=a,typeof a=="function")xy(a)&&(I=1);else if(typeof a=="string")I=5;else e:switch(a){case M:return Dl(h.children,x,k,l);case A:I=8,x|=8;break;case L:return a=li(12,h,l,x|2),a.elementType=L,a.lanes=k,a;case X:return a=li(13,h,l,x),a.elementType=X,a.lanes=k,a;case Q:return a=li(19,h,l,x),a.elementType=Q,a.lanes=k,a;case oe:return Up(h,x,k,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case V:I=10;break e;case W:I=9;break e;case z:I=11;break e;case H:I=14;break e;case Y:I=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return l=li(I,h,l,x),l.elementType=a,l.type=y,l.lanes=k,l}function Dl(a,l,h,y){return a=li(7,a,y,l),a.lanes=h,a}function Up(a,l,h,y){return a=li(22,a,y,l),a.elementType=oe,a.lanes=h,a.stateNode={isHidden:!1},a}function Sy(a,l,h){return a=li(6,a,null,l),a.lanes=h,a}function Ey(a,l,h){return l=li(4,a.children!==null?a.children:[],a.key,l),l.lanes=h,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function $D(a,l,h,y,x){this.tag=l,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=Tt(0),this.expirationTimes=Tt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tt(0),this.identifierPrefix=y,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function ky(a,l,h,y,x,k,I,j,B){return a=new $D(a,l,h,j,B),l===1?(l=1,k===!0&&(l|=8)):l=0,k=li(3,null,null,l),a.current=k,k.stateNode=a,k.memoizedState={element:y,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fv(k),a}function ND(a,l,h){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:y==null?null:""+y,children:a,containerInfo:l,implementation:h}}function uk(a){if(!a)return ya;a=a._reactInternals;e:{if(yr(a)!==a||a.tag!==1)throw Error(n(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(ys(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(a.tag===1){var h=a.type;if(ys(h))return FS(a,h,l)}return l}function dk(a,l,h,y,x,k,I,j,B){return a=ky(h,y,!0,a,x,k,I,j,B),a.context=uk(null),h=a.current,y=is(),x=ka(h),k=Io(y,x),k.callback=l??null,ba(h,k,x),a.current.lanes=x,Jt(a,x,y),bs(a,y),a}function Zp(a,l,h,y){var x=l.current,k=is(),I=ka(x);return h=uk(h),l.context===null?l.context=h:l.pendingContext=h,l=Io(k,I),l.payload={element:a},y=y===void 0?null:y,y!==null&&(l.callback=y),a=ba(x,l,I),a!==null&&(Ri(a,x,I,k),bp(a,x,I)),I}function Bp(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 fk(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<l?h:l}}function Cy(a,l){fk(a,l),(a=a.alternate)&&fk(a,l)}function DD(){return null}var hk=typeof reportError=="function"?reportError:function(a){console.error(a)};function Py(a){this._internalRoot=a}Wp.prototype.render=Py.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(n(409));Zp(a,l,null,null)},Wp.prototype.unmount=Py.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Ll(function(){Zp(null,a,null,null)}),l[Co]=null}};function Wp(a){this._internalRoot=a}Wp.prototype.unstable_scheduleHydration=function(a){if(a){var l=Wi();a={blockedOn:null,target:a,priority:l};for(var h=0;h<be.length&&l!==0&&l<be[h].priority;h++);be.splice(h,0,a),h===0&&Jn(a)}};function Ry(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Kp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function pk(){}function FD(a,l,h,y,x){if(x){if(typeof y=="function"){var k=y;y=function(){var se=Bp(I);k.call(se)}}var I=dk(l,y,a,0,null,!1,!1,"",pk);return a._reactRootContainer=I,a[Co]=I.current,zd(a.nodeType===8?a.parentNode:a),Ll(),I}for(;x=a.lastChild;)a.removeChild(x);if(typeof y=="function"){var j=y;y=function(){var se=Bp(B);j.call(se)}}var B=ky(a,0,!1,null,null,!1,!1,"",pk);return a._reactRootContainer=B,a[Co]=B.current,zd(a.nodeType===8?a.parentNode:a),Ll(function(){Zp(l,B,h,y)}),B}function Gp(a,l,h,y,x){var k=h._reactRootContainer;if(k){var I=k;if(typeof x=="function"){var j=x;x=function(){var B=Bp(I);j.call(B)}}Zp(l,I,a,x)}else I=FD(h,l,a,x,y);return Bp(I)}Eo=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var h=ue(l.pendingLanes);h!==0&&(Tn(l,h|1),bs(l,on()),(Wt&6)===0&&(Yc=on()+500,_a()))}break;case 13:Ll(function(){var y=Ao(a,1);if(y!==null){var x=is();Ri(y,a,1,x)}}),Cy(a,1)}},ko=function(a){if(a.tag===13){var l=Ao(a,134217728);if(l!==null){var h=is();Ri(l,a,134217728,h)}Cy(a,134217728)}},Or=function(a){if(a.tag===13){var l=ka(a),h=Ao(a,l);if(h!==null){var y=is();Ri(h,a,l,y)}Cy(a,l)}},Wi=function(){return it},El=function(a,l){var h=it;try{return it=a,l()}finally{it=h}},Tr=function(a,l,h){switch(l){case"input":if(Gt(a,h),l=h.name,h.type==="radio"&&l!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<h.length;l++){var y=h[l];if(y!==a&&y.form===a.form){var x=dp(y);if(!x)throw Error(n(90));Ne(y),Gt(y,x)}}}break;case"textarea":xe(a,h);break;case"select":l=h.value,l!=null&&Qe(a,!!h.multiple,l,!1)}},st=_y,rn=Ll;var jD={usingClientEntryPoint:!1,Events:[Zd,Dc,dp,qn,ns,_y]},sf={findFiberByHostInstance:Cl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},VD={bundleType:sf.bundleType,version:sf.version,rendererPackageName:sf.rendererPackageName,rendererConfig:sf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=gs(a),a===null?null:a.stateNode},findFiberByHostInstance:sf.findFiberByHostInstance||DD,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 qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{So=qp.inject(VD),Zr=qp}catch{}}return xs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jD,xs.createPortal=function(a,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ry(l))throw Error(n(200));return ND(a,l,null,h)},xs.createRoot=function(a,l){if(!Ry(a))throw Error(n(299));var h=!1,y="",x=hk;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(x=l.onRecoverableError)),l=ky(a,1,!1,null,null,h,!1,y,x),a[Co]=l.current,zd(a.nodeType===8?a.parentNode:a),new Py(l)},xs.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=gs(l),a=a===null?null:a.stateNode,a},xs.flushSync=function(a){return Ll(a)},xs.hydrate=function(a,l,h){if(!Kp(l))throw Error(n(200));return Gp(null,a,l,!0,h)},xs.hydrateRoot=function(a,l,h){if(!Ry(a))throw Error(n(405));var y=h!=null&&h.hydratedSources||null,x=!1,k="",I=hk;if(h!=null&&(h.unstable_strictMode===!0&&(x=!0),h.identifierPrefix!==void 0&&(k=h.identifierPrefix),h.onRecoverableError!==void 0&&(I=h.onRecoverableError)),l=dk(l,null,a,1,h??null,x,!1,k,I),a[Co]=l.current,zd(a),y)for(a=0;a<y.length;a++)h=y[a],x=h._getVersion,x=x(h._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[h,x]:l.mutableSourceEagerHydrationData.push(h,x);return new Wp(l)},xs.render=function(a,l,h){if(!Kp(l))throw Error(n(200));return Gp(null,a,l,!1,h)},xs.unmountComponentAtNode=function(a){if(!Kp(a))throw Error(n(40));return a._reactRootContainer?(Ll(function(){Gp(null,null,a,!1,function(){a._reactRootContainer=null,a[Co]=null})}),!0):!1},xs.unstable_batchedUpdates=_y,xs.unstable_renderSubtreeIntoContainer=function(a,l,h,y){if(!Kp(h))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Gp(a,l,h,!1,y)},xs.version="18.3.1-next-f1338f8080-20240426",xs}var rR;function ZL(){if(rR)return q1.exports;rR=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),q1.exports=uJ(),q1.exports}var sR;function dJ(){if(sR)return Sm;sR=1;var e=ZL();return Sm.createRoot=e.createRoot,Sm.hydrateRoot=e.hydrateRoot,Sm}var fJ=dJ();const hJ=vg(fJ),pJ=e=>{const t=e==null?void 0:e.userId,n=e==null?void 0:e.email;g.useEffect(()=>{BO({userId:t,email:n})},[t,n])},qo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_SENTRY_DSN:""};function BL(e){return"init"in e}function c2(e){return typeof e.write=="function"}function mJ(e){return!!e.onMount}function iR(e){return"v"in e||"e"in e}function ng(e){if("e"in e)throw e.e;if((qo?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function rg(e){return typeof(e==null?void 0:e.then)=="function"}function gJ(e){if(!(e instanceof Error))return!1;const t=e.name,n=e.message.toLowerCase();return(t==="RangeError"||t==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function WL(e,t,n){if(!n.p.has(e)){n.p.add(e);const r=()=>n.p.delete(e);t.then(r,r)}}function KL(e,t,n){const r=n.get(e),s=r==null?void 0:r.t,i=t.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const o=new Set(s);for(const c of i)o.add(c);return o}function vJ(e){return!!e.INTERNAL_onInit}const yJ=(e,t,n,...r)=>n.read(...r),_J=(e,t,n,...r)=>n.write(...r),wJ=(e,t,n)=>n.INTERNAL_onInit(t),bJ=(e,t,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},xJ=(e,t,n)=>{var r;const s=e[0];let i=s.get(n);if(!i){const o=e[6],c=e[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=o.i)==null||r.call(o,n),vJ(n)&&c(e,t,n)}return i},SJ=(e,t)=>{var n;const r=e[1],s=e[3],i=e[4],o=e[5],c=e[6],u=e[13];if(!c.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=p=>{try{p()}catch(m){d.push(m)}};do{c.f&&f(c.f);const p=new Set;for(const m of s){const v=(n=r.get(m))==null?void 0:n.l;if(v)for(const _ of v)p.add(_)}s.clear();for(const m of o)p.add(m);o.clear();for(const m of i)p.add(m);i.clear();for(const m of p)f(m);s.size&&u(e,t)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},EJ=(e,t)=>{const n=e[1],r=e[2],s=e[3],i=e[11],o=e[14],c=e[17];if(!s.size)return;const u=[],d=[],f=new WeakSet,p=new WeakSet,m=[],v=[];for(const _ of s)m.push(_),v.push(i(e,t,_));for(;m.length;){const _=m.length-1,w=m[_],b=v[_];if(p.has(w)){m.pop(),v.pop();continue}if(f.has(w)){if(r.get(w)===b.n)u.push(w),d.push(b);else if((qo?"production":void 0)!=="production"&&r.has(w))throw new Error("[Bug] invalidated atom exists");p.add(w),m.pop(),v.pop();continue}f.add(w);for(const S of KL(w,b,n))f.has(S)||(m.push(S),v.push(i(e,t,S)))}for(let _=u.length-1;_>=0;--_){const w=u[_],b=d[_];let S=!1;for(const E of b.d.keys())if(E!==w&&s.has(E)){S=!0;break}S&&(r.set(w,b.n),o(e,t,w),c(e,t,w)),r.delete(w)}},u2=new WeakSet,kJ=(e,t,n)=>{var r,s;const i=e[1],o=e[2],c=e[3],u=e[6],d=e[7],f=e[11],p=e[12],m=e[13],v=e[14],_=e[16],w=e[17],b=e[20],S=e[26],E=e[28],C=f(e,t,n),R=E[0];if(iR(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===R)return C.m=R,C;let H=!1;for(const[Y,oe]of C.d)if(v(e,t,Y).n!==oe){H=!0;break}if(!H)return C.m=R,C}let T=!0;const O=new Set(C.d.keys()),M=()=>{for(const H of O)C.d.delete(H)},A=()=>{if(i.has(n)){const H=!c.size;w(e,t,n),H&&(m(e,t),p(e,t))}},L=H=>{var Y;if(H===n){const U=f(e,t,H);if(!iR(U))if(BL(H))b(e,t,H,H.init);else throw new Error("no atom init");return ng(U)}const oe=v(e,t,H);try{return ng(oe)}finally{O.delete(H),C.d.set(H,oe.n),rg(C.v)&&WL(n,C.v,oe),i.has(n)&&((Y=i.get(H))==null||Y.t.add(n)),T||A()}};let V,W;const z={get signal(){return V||(V=new AbortController),V.signal},get setSelf(){return(qo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(qo?"production":void 0)!=="production"&&!c2(n)&&console.warn("setSelf function cannot be used with read-only atom"),!W&&c2(n)&&(W=(...H)=>{if((qo?"production":void 0)!=="production"&&T&&console.warn("setSelf function cannot be called in sync"),!T)try{return _(e,t,n,H)}finally{m(e,t),p(e,t)}}),W}},X=C.n,Q=o.get(n)===X;try{(qo?"production":void 0)!=="production"&&u2.delete(t);const H=d(e,t,n,L,z);if((qo?"production":void 0)!=="production"&&u2.has(t)&&console.warn("Detected store mutation during atom read. This is not supported."),b(e,t,n,H),rg(H)){S(e,t,H,()=>V==null?void 0:V.abort());const Y=()=>{M(),A()};H.then(Y,Y)}else M();return(r=u.r)==null||r.call(u,n),C.m=R,C}catch(H){if(gJ(H))throw H;return delete C.v,C.e=H,++C.n,C.m=R,C}finally{T=!1,C.n!==X&&Q&&(o.set(n,C.n),c.add(n),(s=u.c)==null||s.call(u,n))}},CJ=(e,t,n)=>{const r=e[1],s=e[2],i=e[11],o=[n];for(;o.length;){const c=o.pop(),u=i(e,t,c);for(const d of KL(c,u,r)){const f=i(e,t,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},PJ=(e,t,n,r)=>{const s=e[3],i=e[6],o=e[8],c=e[11],u=e[12],d=e[13],f=e[14],p=e[15],m=e[16],v=e[17],_=e[20],w=e[28];let b=!0;const S=C=>ng(f(e,t,C)),E=(C,...R)=>{var T;const O=c(e,t,C);try{if(C===n){if(!BL(C))throw new Error("atom not writable");(qo?"production":void 0)!=="production"&&u2.add(t);const M=O.n,A=R[0];_(e,t,C,A),v(e,t,C),M!==O.n&&(++w[0],s.add(C),p(e,t,C),(T=i.c)==null||T.call(i,C));return}else return m(e,t,C,R)}finally{b||(d(e,t),u(e,t))}};try{return o(e,t,n,S,E,...r)}finally{b=!1}},RJ=(e,t,n)=>{var r;const s=e[1],i=e[3],o=e[6],c=e[11],u=e[15],d=e[18],f=e[19],p=c(e,t,n),m=s.get(n);if(m&&p.d.size>0){for(const[v,_]of p.d)if(!m.d.has(v)){const w=c(e,t,v);d(e,t,v).t.add(n),m.d.add(v),_!==w.n&&(i.add(v),u(e,t,v),(r=o.c)==null||r.call(o,v))}for(const v of m.d)if(!p.d.has(v)){m.d.delete(v);const _=f(e,t,v);_==null||_.t.delete(n)}}},TJ=(e,t,n)=>{var r;const s=e[1],i=e[4],o=e[6],c=e[10],u=e[11],d=e[12],f=e[13],p=e[14],m=e[16],v=e[18],_=u(e,t,n);let w=s.get(n);if(!w){p(e,t,n);for(const b of _.d.keys())v(e,t,b).t.add(n);if(w={l:new Set,d:new Set(_.d.keys()),t:new Set},s.set(n,w),c2(n)&&mJ(n)){const b=()=>{let S=!0;const E=(...C)=>{try{return m(e,t,n,C)}finally{S||(f(e,t),d(e,t))}};try{const C=c(e,t,n,E);C&&(w.u=()=>{S=!0;try{C()}finally{S=!1}})}finally{S=!1}};i.add(b)}(r=o.m)==null||r.call(o,n)}return w},AJ=(e,t,n)=>{var r,s;const i=e[1],o=e[5],c=e[6],u=e[11],d=e[19],f=u(e,t,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const v of p.t)if((r=i.get(v))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&o.add(p.u),p=void 0,i.delete(n);for(const v of f.d.keys()){const _=d(e,t,v);_==null||_.t.delete(n)}(s=c.u)==null||s.call(c,n);return}return p},IJ=(e,t,n,r)=>{const s=e[11],i=e[27],o=s(e,t,n),c="v"in o,u=o.v;if(rg(r))for(const d of o.d.keys())WL(n,r,s(e,t,d));o.v=r,delete o.e,(!c||!Object.is(u,o.v))&&(++o.n,rg(u)&&i(e,t,u))},OJ=(e,t,n)=>{const r=e[14];return ng(r(e,t,n))},MJ=(e,t,n,...r)=>{const s=e[3],i=e[12],o=e[13],c=e[16],u=s.size;try{return c(e,t,n,r)}finally{s.size!==u&&(o(e,t),i(e,t))}},LJ=(e,t,n,r)=>{const s=e[12],i=e[13],o=e[18],c=e[19],d=o(e,t,n).l;return d.add(r),i(e,t),s(e,t),()=>{d.delete(r),c(e,t,n),i(e,t),s(e,t)}},$J=(e,t,n,r)=>{const s=e[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)},NJ=(e,t,n)=>{const s=e[25].get(n);s==null||s.forEach(i=>i())},GL=new WeakMap;function DJ(e){const t=GL.get(e);if((qo?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");const n=t[24];return n?n(t,e):t}function FJ(...e){const t={get(o){return r(n,t,o)},set(o,...c){return s(n,t,o,...c)},sub(o,c){return i(n,t,o,c)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},yJ,_J,wJ,bJ,xJ,SJ,EJ,kJ,CJ,PJ,RJ,TJ,AJ,IJ,OJ,MJ,LJ,void 0,new WeakMap,$J,NJ,[0]].map((o,c)=>e[c]||o);GL.set(t,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return t}const qL={};let jJ=0;function un(e,t){const n=`atom${++jJ}`,r={toString(){return(qL?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=VJ,r.write=zJ),r}function VJ(e){return e(this)}function zJ(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}function HJ(){return FJ()}let bf;function UJ(){return bf||(bf=HJ(),(qL?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=bf),globalThis.__JOTAI_DEFAULT_STORE__!==bf&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),bf}const ZJ={},BJ=g.createContext(void 0);function mx(e){return g.useContext(BJ)||UJ()}const d2=e=>typeof(e==null?void 0:e.then)=="function",f2=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},WJ=Ee.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(f2(e),e)}),Q1=new WeakMap,oR=(e,t,n)=>{const r=DJ(e),s=r[26];let i=Q1.get(t);return i||(i=new Promise((o,c)=>{let u=t;const d=m=>v=>{u===m&&o(v)},f=m=>v=>{u===m&&c(v)},p=()=>{try{const m=n();d2(m)?(Q1.set(m,i),u=m,m.then(d(m),f(m)),s(r,e,m,p)):o(m)}catch(m){c(m)}};t.then(d(t),f(t)),s(r,e,t,p)}),Q1.set(t,i)),i};function _t(e,t){const{delay:n,unstable_promiseStatus:r=!Ee.use}={},s=mx(),[[i,o,c],u]=g.useReducer(f=>{const p=s.get(e);return Object.is(f[0],p)&&f[1]===s&&f[2]===e?f:[p,s,e]},void 0,()=>[s.get(e),s,e]);let d=i;if((o!==s||c!==e)&&(u(),d=s.get(e)),g.useEffect(()=>{const f=s.sub(e,()=>{if(r)try{const p=s.get(e);d2(p)&&f2(oR(s,p,()=>s.get(e)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
|
|
109
|
+
|
|
110
|
+
Migration guide:
|
|
111
|
+
|
|
112
|
+
Create a custom hook like the following.
|
|
113
|
+
|
|
114
|
+
function useAtomValueWithDelay<Value>(
|
|
115
|
+
atom: Atom<Value>,
|
|
116
|
+
options: { delay: number },
|
|
117
|
+
): Value {
|
|
118
|
+
const { delay } = options
|
|
119
|
+
const store = useStore(options)
|
|
120
|
+
const [value, setValue] = useState(() => store.get(atom))
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
const unsub = store.sub(atom, () => {
|
|
123
|
+
setTimeout(() => setValue(store.get(atom)), delay)
|
|
124
|
+
})
|
|
125
|
+
return unsub
|
|
126
|
+
}, [store, atom, delay])
|
|
127
|
+
return value
|
|
128
|
+
}
|
|
129
|
+
`),setTimeout(u,n);return}u()});return u(),f},[s,e,n,r]),g.useDebugValue(d),d2(d)){const f=oR(s,d,()=>s.get(e));return r&&f2(f),WJ(f)}return d}function Lt(e,t){const n=mx();return g.useCallback((...s)=>{if((ZJ?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...s)},[n,e])}function YL(e,t){return[_t(e),Lt(e)]}var Cd=ZL();const KJ=vg(Cd);function GJ(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const qJ=e=>{switch(e){case"success":return QJ;case"info":return eee;case"warning":return JJ;case"error":return tee;default:return null}},YJ=Array(12).fill(0),XJ=({visible:e,className:t})=>Ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ee.createElement("div",{className:"sonner-spinner"},YJ.map((n,r)=>Ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),QJ=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.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"})),JJ=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.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"})),eee=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.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"})),tee=Ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ee.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"})),nee=Ee.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"},Ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ree=()=>{const[e,t]=Ee.useState(document.hidden);return Ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e};let see=1;const iee=100,aR=e=>{var t;return typeof(e==null?void 0:e.id)=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:see++};class oee{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(n=>t(n)),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-iee;t<=0||(this.toasts=this.toasts.filter(n=>t>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),t--,!1):!0))},this.create=t=>{const{message:n,...r}=t,s=aR(t),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const o=this.dismissedToasts.has(s),c=t.dismissible===void 0?!0:t.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,...t,id:s,title:n}),{...d,...t,id:s,dismissible:c,title:n}):d):this.addToast({title:n,...r,dismissible:c,id:s}),s},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const n=this.pendingDismissals.get(t);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(r=>r({id:t,dismiss:!0}))})),t},this.message=(t,n)=>this.create({...n,message:t,type:void 0}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,o;const c=s.then(async d=>{if(o=["resolve",d],Ee.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(lee(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,_=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,..._})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,_=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,..._})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,_=typeof p=="object"&&!Ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,..._})}}).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,p=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!Ee.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,f)=>c.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=(t,n)=>{const r=aR(n);return this.create({...n,jsx:t(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Ss=new oee,aee=(e,t)=>Ss.message(e,t),lee=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",cee=aee,uee=()=>Ss.toasts,dee=()=>Ss.getActiveToasts(),en=Object.assign(cee,{success:Ss.success,info:Ss.info,warning:Ss.warning,error:Ss.error,custom:Ss.custom,message:Ss.message,promise:Ss.promise,dismiss:Ss.dismiss,loading:Ss.loading},{getHistory:uee,getToasts:dee});GJ("[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 Em(e){return e.label!==void 0}const fee=3,hee="24px",pee="16px",lR=4e3,mee=356,gee=14,vee=45,yee=200;function Ji(...e){return e.filter(Boolean).join(" ")}function _ee(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const wee=e=>{var t,n,r,s,i,o,c,u,d;const{invert:f,toast:p,unstyled:m,interacting:v,setHeights:_,visibleToasts:w,heights:b,index:S,toasts:E,expanded:C,removeToast:R,defaultRichColors:T,closeButton:O,style:M,cancelButtonStyle:A,actionButtonStyle:L,className:V="",descriptionClassName:W="",duration:z,position:X,gap:Q,expandByDefault:H,classNames:Y,icons:oe,closeButtonAriaLabel:U="Close toast"}=e,[J,K]=Ee.useState(null),[D,q]=Ee.useState(null),[fe,ae]=Ee.useState(!1),[ce,he]=Ee.useState(!1),[ke,ge]=Ee.useState(!1),[pe,Le]=Ee.useState(!1),[Ae,Ne]=Ee.useState(!1),[Et,dn]=Ee.useState(0),[sn,kt]=Ee.useState(0),Gt=Ee.useRef(p.duration||z||lR),mn=Ee.useRef(null),Xt=Ee.useRef(null),Me=S===0,Qe=S+1<=w,Te=p.type,xt=Te??"default",xe=p.dismissible!==!1,Nt=p.className||"",dt=p.descriptionClassName||"",gt=Ee.useMemo(()=>b.findIndex(st=>st.toastId===p.id)||0,[b,p.id]),Hn=Ee.useMemo(()=>{var st;return(st=p.closeButton)!=null?st:O},[p.closeButton,O]),Js=Ee.useMemo(()=>p.duration||z||lR,[p.duration,z]),_n=Ee.useRef(0),Gn=Ee.useRef(0),_i=Ee.useRef(0),ts=Ee.useRef(null),[zr,Un]=X.split("-"),fn=Ee.useMemo(()=>b.reduce((st,rn,Qt)=>Qt>=gt?st:st+rn.height,0),[b,gt]),Hr=ree(),Qn=Ee.useMemo(()=>{var st;return(st=e.swipeDirections)!=null?st:_ee(X)},[e.swipeDirections,X]),Hi=p.invert||f,Tr=Te==="loading";Gn.current=Ee.useMemo(()=>gt*Q+fn,[gt,fn]),Ee.useEffect(()=>{Gt.current=Js},[Js]),Ee.useEffect(()=>{ae(!0)},[]),Ee.useEffect(()=>{const st=Xt.current;if(st){const rn=st.getBoundingClientRect().height;return kt(rn),_(Qt=>[{toastId:p.id,height:rn,position:p.position},...Qt]),()=>_(Qt=>Qt.filter(hn=>hn.toastId!==p.id))}},[_,p.id]),Ee.useLayoutEffect(()=>{if(!fe)return;const st=Xt.current,rn=st.style.height;st.style.height="auto";const Qt=st.getBoundingClientRect().height;st.style.height=rn,kt(Qt),_(hn=>hn.find(Bt=>Bt.toastId===p.id)?hn.map(Bt=>Bt.toastId===p.id?{...Bt,height:Qt}:Bt):[{toastId:p.id,height:Qt,position:p.position},...hn])},[fe,p.title,p.description,_,p.id,p.jsx,p.action,p.cancel]);const Zn=Ee.useCallback(()=>{he(!0),dn(Gn.current),_(st=>st.filter(rn=>rn.toastId!==p.id)),setTimeout(()=>{R(p)},yee)},[p,R,_,Gn]);Ee.useEffect(()=>{if(p.promise&&Te==="loading"||p.duration===1/0||p.type==="loading")return;let st;return C||v||Hr?(()=>{if(_i.current<_n.current){const hn=new Date().getTime()-_n.current;Gt.current=Gt.current-hn}_i.current=new Date().getTime()})():(()=>{Gt.current!==1/0&&(_n.current=new Date().getTime(),st=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Zn()},Gt.current))})(),()=>clearTimeout(st)},[C,v,p,Te,Hr,Zn]),Ee.useEffect(()=>{p.delete&&(Zn(),p.onDismiss==null||p.onDismiss.call(p,p))},[Zn,p.delete]);function vr(){var st;if(oe!=null&&oe.loading){var rn;return Ee.createElement("div",{className:Ji(Y==null?void 0:Y.loader,p==null||(rn=p.classNames)==null?void 0:rn.loader,"sonner-loader"),"data-visible":Te==="loading"},oe.loading)}return Ee.createElement(XJ,{className:Ji(Y==null?void 0:Y.loader,p==null||(st=p.classNames)==null?void 0:st.loader),visible:Te==="loading"})}const $s=p.icon||(oe==null?void 0:oe[Te])||qJ(Te);var qn,ns;return Ee.createElement("li",{tabIndex:0,ref:Xt,className:Ji(V,Nt,Y==null?void 0:Y.toast,p==null||(t=p.classNames)==null?void 0:t.toast,Y==null?void 0:Y[xt],p==null||(n=p.classNames)==null?void 0:n[xt]),"data-sonner-toast":"","data-rich-colors":(qn=p.richColors)!=null?qn:T,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":fe,"data-promise":!!p.promise,"data-swiped":Ae,"data-removed":ce,"data-visible":Qe,"data-y-position":zr,"data-x-position":Un,"data-index":S,"data-front":Me,"data-swiping":ke,"data-dismissible":xe,"data-type":Te,"data-invert":Hi,"data-swipe-out":pe,"data-swipe-direction":D,"data-expanded":!!(C||H&&fe),"data-testid":p.testId,style:{"--index":S,"--toasts-before":S,"--z-index":E.length-S,"--offset":`${ce?Et:Gn.current}px`,"--initial-height":H?"auto":`${sn}px`,...M,...p.style},onDragEnd:()=>{ge(!1),K(null),ts.current=null},onPointerDown:st=>{st.button!==2&&(Tr||!xe||(mn.current=new Date,dn(Gn.current),st.target.setPointerCapture(st.pointerId),st.target.tagName!=="BUTTON"&&(ge(!0),ts.current={x:st.clientX,y:st.clientY})))},onPointerUp:()=>{var st,rn,Qt;if(pe||!xe)return;ts.current=null;const hn=Number(((st=Xt.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wn=Number(((rn=Xt.current)==null?void 0:rn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Bt=new Date().getTime()-((Qt=mn.current)==null?void 0:Qt.getTime()),Rn=J==="x"?hn:wn,Ur=Math.abs(Rn)/Bt;if((J==="x"?Qn.includes(hn>0?"right":"left"):Qn.includes(wn>0?"bottom":"top"))&&(Math.abs(Rn)>=vee||Ur>.11)){dn(Gn.current),p.onDismiss==null||p.onDismiss.call(p,p),q(J==="x"?hn>0?"right":"left":wn>0?"down":"up"),Zn(),Le(!0);return}else{var cr,zt;(cr=Xt.current)==null||cr.style.setProperty("--swipe-amount-x","0px"),(zt=Xt.current)==null||zt.style.setProperty("--swipe-amount-y","0px")}Ne(!1),ge(!1),K(null)},onPointerMove:st=>{var rn,Qt,hn;if(!ts.current||!xe||((rn=window.getSelection())==null?void 0:rn.toString().length)>0)return;const Bt=st.clientY-ts.current.y,Rn=st.clientX-ts.current.x;!J&&(Math.abs(Rn)>1||Math.abs(Bt)>1)&&K(Math.abs(Rn)>Math.abs(Bt)?"x":"y");let Ur={x:0,y:0};const Bn=cr=>1/(1.5+Math.abs(cr)/20);if(J==="y"){if(Qn.includes("top")||Qn.includes("bottom"))if(Qn.includes("top")&&Bt<0||Qn.includes("bottom")&&Bt>0)Ur.y=Bt;else{const cr=Bt*Bn(Bt);Ur.y=Math.abs(cr)<Math.abs(Bt)?cr:Bt}}else if(J==="x"&&(Qn.includes("left")||Qn.includes("right")))if(Qn.includes("left")&&Rn<0||Qn.includes("right")&&Rn>0)Ur.x=Rn;else{const cr=Rn*Bn(Rn);Ur.x=Math.abs(cr)<Math.abs(Rn)?cr:Rn}(Math.abs(Ur.x)>0||Math.abs(Ur.y)>0)&&Ne(!0),(Qt=Xt.current)==null||Qt.style.setProperty("--swipe-amount-x",`${Ur.x}px`),(hn=Xt.current)==null||hn.style.setProperty("--swipe-amount-y",`${Ur.y}px`)}},Hn&&!p.jsx&&Te!=="loading"?Ee.createElement("button",{"aria-label":U,"data-disabled":Tr,"data-close-button":!0,onClick:Tr||!xe?()=>{}:()=>{Zn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Ji(Y==null?void 0:Y.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(ns=oe==null?void 0:oe.close)!=null?ns:nee):null,(Te||p.icon||p.promise)&&p.icon!==null&&((oe==null?void 0:oe[Te])!==null||p.icon)?Ee.createElement("div",{"data-icon":"",className:Ji(Y==null?void 0:Y.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},Te==="loading"?p.icon||vr():p.promise?vr():null,Te!=="loading"?$s:null):null,Ee.createElement("div",{"data-content":"",className:Ji(Y==null?void 0:Y.content,p==null||(i=p.classNames)==null?void 0:i.content)},Ee.createElement("div",{"data-title":"",className:Ji(Y==null?void 0:Y.title,p==null||(o=p.classNames)==null?void 0:o.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?Ee.createElement("div",{"data-description":"",className:Ji(W,dt,Y==null?void 0:Y.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),Ee.isValidElement(p.cancel)?p.cancel:p.cancel&&Em(p.cancel)?Ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:st=>{Em(p.cancel)&&xe&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,st),Zn())},className:Ji(Y==null?void 0:Y.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,Ee.isValidElement(p.action)?p.action:p.action&&Em(p.action)?Ee.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:st=>{Em(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,st),!st.defaultPrevented&&Zn())},className:Ji(Y==null?void 0:Y.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function cR(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function bee(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",c=i?pee:hee;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}`]=c:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(c)}),n}const xee=Ee.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:c,closeButton:u,className:d,offset:f,mobileOffset:p,theme:m="light",richColors:v,duration:_,style:w,visibleToasts:b=fee,toastOptions:S,dir:E=cR(),gap:C=gee,icons:R,customAriaLabel:T,containerAriaLabel:O="Notifications"}=t,[M,A]=Ee.useState([]),L=Ee.useMemo(()=>r?M.filter(ae=>ae.toasterId===r):M.filter(ae=>!ae.toasterId),[M,r]),V=Ee.useMemo(()=>Array.from(new Set([i].concat(L.filter(ae=>ae.position).map(ae=>ae.position)))),[L,i]),[W,z]=Ee.useState([]),[X,Q]=Ee.useState(!1),[H,Y]=Ee.useState(!1),[oe,U]=Ee.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=Ee.useRef(null),K=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Ee.useRef(null),q=Ee.useRef(!1),fe=Ee.useCallback(ae=>{A(ce=>{var he;return(he=ce.find(ke=>ke.id===ae.id))!=null&&he.delete||Ss.dismiss(ae.id),ce.filter(({id:ke})=>ke!==ae.id)})},[]);return Ee.useEffect(()=>Ss.subscribe(ae=>{if(ae.dismiss){requestAnimationFrame(()=>{A(ce=>ce.map(he=>he.id===ae.id?{...he,delete:!0}:he))});return}setTimeout(()=>{KJ.flushSync(()=>{A(ce=>{const he=ce.findIndex(ke=>ke.id===ae.id);return he!==-1?[...ce.slice(0,he),{...ce[he],...ae},...ce.slice(he+1)]:[ae,...ce]})})})}),[]),Ee.useEffect(()=>{if(m!=="system"){U(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const ae=window.matchMedia("(prefers-color-scheme: dark)");try{ae.addEventListener("change",({matches:ce})=>{U(ce?"dark":"light")})}catch{ae.addListener(({matches:he})=>{try{U(he?"dark":"light")}catch(ke){console.error(ke)}})}},[m]),Ee.useEffect(()=>{M.length<=1&&Q(!1)},[M]),Ee.useEffect(()=>{const ae=ce=>{var he;if(o.length>0&&o.every(pe=>ce[pe]||ce.code===pe)){var ge;Q(!0),(ge=J.current)==null||ge.focus()}ce.code==="Escape"&&(document.activeElement===J.current||(he=J.current)!=null&&he.contains(document.activeElement))&&Q(!1)};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[o]),Ee.useEffect(()=>{if(J.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,q.current=!1)}},[J.current]),Ee.createElement("section",{ref:n,"aria-label":T??`${O} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},V.map((ae,ce)=>{var he;const[ke,ge]=ae.split("-");return L.length?Ee.createElement("ol",{key:ae,dir:E==="auto"?cR():E,tabIndex:-1,ref:J,className:d,"data-sonner-toaster":!0,"data-sonner-theme":oe,"data-y-position":ke,"data-x-position":ge,style:{"--front-toast-height":`${((he=W[0])==null?void 0:he.height)||0}px`,"--width":`${mee}px`,"--gap":`${C}px`,...w,...bee(f,p)},onBlur:pe=>{q.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(q.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||q.current||(q.current=!0,D.current=pe.relatedTarget)},onMouseEnter:()=>Q(!0),onMouseMove:()=>Q(!0),onMouseLeave:()=>{H||Q(!1)},onDragEnd:()=>Q(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},L.filter(pe=>!pe.position&&ce===0||pe.position===ae).map((pe,Le)=>{var Ae,Ne;return Ee.createElement(wee,{key:pe.id,icons:R,index:Le,toast:pe,defaultRichColors:v,duration:(Ae=S==null?void 0:S.duration)!=null?Ae:_,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:s,visibleToasts:b,closeButton:(Ne=S==null?void 0:S.closeButton)!=null?Ne:u,interacting:H,position:ae,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:fe,toasts:L.filter(Et=>Et.position==pe.position),heights:W.filter(Et=>Et.position==pe.position),setHeights:z,expandByDefault:c,gap:C,expanded:X,swipeDirections:t.swipeDirections})})):null}))}),See=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"}))]]),Eee=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"}))]]),kee=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"}))]]),Cee=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"}))]]),Pee=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"}))]]),Ree=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"}))]]),Tee=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"}))]]),Aee=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"}))]]),Iee=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"}))]]),Oee=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"}))]]),Mee=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,84H180.2l7.61-41.85a12,12,0,0,0-23.62-4.3L155.8,84H116.2l7.61-41.85a12,12,0,1,0-23.62-4.3L91.8,84H48a12,12,0,0,0,0,24H87.44l-7.27,40H32a12,12,0,0,0,0,24H75.8l-7.61,41.85a12,12,0,0,0,9.66,14A11.43,11.43,0,0,0,80,228a12,12,0,0,0,11.8-9.86L100.2,172h39.6l-7.61,41.85a12,12,0,0,0,9.66,14,11.43,11.43,0,0,0,2.16.2,12,12,0,0,0,11.8-9.86L164.2,172H208a12,12,0,0,0,0-24H168.56l7.27-40H224a12,12,0,0,0,0-24Zm-79.83,64H104.56l7.27-40h39.61Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M165.82,96l-11.64,64h-64l11.64-64Z",opacity:"0.2"}),g.createElement("path",{d:"M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M116.25,112h31.5l-8,32h-31.5ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Zm-16,56a8,8,0,0,0-8-8H168.25l7.51-30.06a8,8,0,0,0-15.52-3.88L151.75,96h-31.5l7.51-30.06a8,8,0,0,0-15.52-3.88L103.75,96H64a8,8,0,0,0,0,16H99.75l-8,32H56a8,8,0,0,0,0,16H87.75l-7.51,30.06a8,8,0,0,0,5.82,9.7,8.13,8.13,0,0,0,2,.24,8,8,0,0,0,7.75-6.06L104.25,160h31.5l-7.51,30.06a8,8,0,0,0,5.82,9.7A8.13,8.13,0,0,0,136,200a8,8,0,0,0,7.75-6.06L152.25,160H192a8,8,0,0,0,0-16H156.25l8-32H200A8,8,0,0,0,208,104Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,90H173l8.89-48.93a6,6,0,1,0-11.8-2.14L160.81,90H109l8.89-48.93a6,6,0,0,0-11.8-2.14L96.81,90H48a6,6,0,0,0,0,12H94.63l-9.46,52H32a6,6,0,0,0,0,12H83L74.1,214.93a6,6,0,0,0,4.83,7A5.64,5.64,0,0,0,80,222a6,6,0,0,0,5.89-4.93L95.19,166H147l-8.89,48.93a6,6,0,0,0,4.83,7,5.64,5.64,0,0,0,1.08.1,6,6,0,0,0,5.89-4.93L159.19,166H208a6,6,0,0,0,0-12H161.37l9.46-52H224a6,6,0,0,0,0-12Zm-74.83,64H97.37l9.46-52h51.8Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,92H170.61l9.33-51.28a4,4,0,1,0-7.88-1.44L162.48,92H106.61l9.33-51.28a4,4,0,1,0-7.88-1.44L98.48,92H48a4,4,0,0,0,0,8H97L86.84,156H32a4,4,0,0,0,0,8H85.39l-9.33,51.28a4,4,0,0,0,3.22,4.65A3.65,3.65,0,0,0,80,220a4,4,0,0,0,3.94-3.29L93.52,164h55.87l-9.33,51.28a4,4,0,0,0,3.22,4.65,3.65,3.65,0,0,0,.72.07,4,4,0,0,0,3.94-3.29L157.52,164H208a4,4,0,0,0,0-8H159l10.19-56H224a4,4,0,0,0,0-8Zm-73.16,64H95l10.19-56H161Z"}))]]),Lee=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"}))]]),$ee=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"}))]]),Nee=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"}))]]),Dee=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"}))]]),Fee=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"}))]]),jee=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"}))]]),Vee=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"}))]]),zee=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"}))]]),Hee=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"}))]]),Uee=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"}))]]),Zee=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"}))]]),Bee=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"}))]]),Wee=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Ln=g.forwardRef((e,t)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:c,weights:u,...d}=e,{color:f="currentColor",size:p,weight:m="regular",mirrored:v=!1,..._}=g.useContext(Wee);return g.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??f,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,..._,...d},!!n&&g.createElement("title",null,n),c,u.get(i??m))});Ln.displayName="IconBase";const XL=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:See}));XL.displayName="ArrowUpIcon";const Kee=XL,QL=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Eee}));QL.displayName="CaretDownIcon";const Gee=QL,JL=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:kee}));JL.displayName="CaretRightIcon";const qee=JL,e$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Cee}));e$.displayName="ChatCircleIcon";const Yee=e$,t$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Pee}));t$.displayName="CheckIcon";const Xee=t$,n$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Ree}));n$.displayName="CircleNotchIcon";const gx=n$,r$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Tee}));r$.displayName="CopyIcon";const Eh=r$,s$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Aee}));s$.displayName="DotsThreeIcon";const Qee=s$,i$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Iee}));i$.displayName="FolderOpenIcon";const Jee=i$,o$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Oee}));o$.displayName="FolderSimpleIcon";const ete=o$,a$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Mee}));a$.displayName="HashIcon";const tte=a$,l$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Lee}));l$.displayName="MagnifyingGlassIcon";const nte=l$,c$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:$ee}));c$.displayName="PencilSimpleIcon";const u$=c$,d$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Nee}));d$.displayName="PushPinIcon";const h2=d$,f$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Dee}));f$.displayName="SidebarSimpleIcon";const rte=f$,h$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Fee}));h$.displayName="SignInIcon";const ste=h$,p$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:jee}));p$.displayName="SignOutIcon";const ite=p$,m$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Vee}));m$.displayName="SquaresFourIcon";const ote=m$,g$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:zee}));g$.displayName="SwatchesIcon";const ate=g$,v$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Hee}));v$.displayName="TrashIcon";const y$=v$,_$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Uee}));_$.displayName="UserIcon";const lte=_$,w$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Zee}));w$.displayName="XIcon";const b$=w$,x$=g.forwardRef((e,t)=>g.createElement(Ln,{ref:t,...e,weights:Bee}));x$.displayName="XLogoIcon";const cte=x$,ute="/assets/arena-Db0j1set.png",dte="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",fte="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20500%20500'%3e%3cpath%20fill='%23fff'%20d='M250%20500%20C388.071%20500%20500%20388.071%20500%20250%20C500%20111.929%20388.071%200%20250%200%20C111.929%200%200%20111.929%200%20250%20C0%20388.071%20111.929%20500%20250%20500%20Z'/%3e%3cpath%20fill='%23000'%20d='M249.995%200%20C111.928%200%200%20111.932%200%20250.005%20C0%20355.287%2065.0787%20445.359%20157.197%20482.21%20C154.077%20453.779%20156.247%20426.449%20162.497%20400.208%20L187.496%20292.396%20C183.436%20279.266%20180.306%20264.265%20180.306%20249.265%20C180.306%20214.264%20197.186%20189.264%20223.746%20189.264%20C242.185%20189.264%20255.625%20202.074%20255.625%20226.765%20C255.625%20234.575%20254.065%20243.325%20250.935%20253.325%20L239.995%20289.266%20C237.805%20296.146%20236.875%20302.706%20236.875%20308.326%20C236.875%20333.327%20255.935%20347.387%20280.314%20347.387%20C323.754%20347.387%20354.693%20302.386%20354.693%20243.945%20C354.693%20178.944%20312.194%20137.383%20249.385%20137.383%20C179.386%20137.383%20135.017%20183.014%20135.017%20246.445%20C135.017%20272.065%20142.827%20295.816%20158.137%20312.066%20C153.137%20320.506%20147.827%20322.066%20139.697%20322.066%20C114.698%20322.066%2090.9482%20286.756%2090.9482%20238.625%20C90.9482%20155.493%20157.507%2089.2518%20250.945%2089.2518%20C349.063%2089.2518%20410.632%20157.693%20410.632%20242.065%20C410.632%20326.437%20350.633%20390.818%20285.944%20390.818%20C260.315%20390.818%20237.815%20379.878%20222.196%20360.187%20L209.386%20412.068%20C202.516%20438.939%20192.126%20464.359%20175.566%20488.73%20C199.076%20496.05%20224.086%20500%20250.005%20500%20C388.072%20500%20500%20388.068%20500%20249.995%20C500%20111.922%20388.062%200%20249.995%200%20Z'/%3e%3c/svg%3e";function S$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=S$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function E$(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=S$(e))&&(r&&(r+=" "),r+=t);return r}const hte=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},pte=(e,t)=>({classGroupId:e,validator:t}),k$=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),sg="-",uR=[],mte="arbitrary..",gte=e=>{const t=yte(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return vte(o);const c=o.split(sg),u=c[0]===""&&c.length>1?1:0;return C$(c,u,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const u=r[o],d=n[o];return u?d?hte(d,u):u:d||uR}return n[o]||uR}}},C$=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const d=C$(e,t+1,i);if(d)return d}const o=n.validators;if(o===null)return;const c=t===0?e.join(sg):e.slice(t).join(sg),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(c))return f.classGroupId}},vte=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?mte+r:void 0})(),yte=e=>{const{theme:t,classGroups:n}=e;return _te(n,t)},_te=(e,t)=>{const n=k$();for(const r in e){const s=e[r];vx(s,n,r,t)}return n},vx=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const o=e[i];wte(o,t,n,r)}},wte=(e,t,n,r)=>{if(typeof e=="string"){bte(e,t,n);return}if(typeof e=="function"){xte(e,t,n,r);return}Ste(e,t,n,r)},bte=(e,t,n)=>{const r=e===""?t:P$(t,e);r.classGroupId=n},xte=(e,t,n,r)=>{if(Ete(e)){vx(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(pte(n,e))},Ste=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let o=0;o<i;o++){const[c,u]=s[o];vx(u,P$(t,c),n,r)}},P$=(e,t)=>{let n=e;const r=t.split(sg),s=r.length;for(let i=0;i<s;i++){const o=r[i];let c=n.nextPart.get(o);c||(c=k$(),n.nextPart.set(o,c)),n=c}return n},Ete=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,kte=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,t++,t>e&&(t=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)}}},p2="!",dR=":",Cte=[],fR=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Pte=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let o=0,c=0,u=0,d;const f=s.length;for(let w=0;w<f;w++){const b=s[w];if(o===0&&c===0){if(b===dR){i.push(s.slice(u,w)),u=w+1;continue}if(b==="/"){d=w;continue}}b==="["?o++:b==="]"?o--:b==="("?c++:b===")"&&c--}const p=i.length===0?s:s.slice(u);let m=p,v=!1;p.endsWith(p2)?(m=p.slice(0,-1),v=!0):p.startsWith(p2)&&(m=p.slice(1),v=!0);const _=d&&d>u?d-u:void 0;return fR(i,v,m,_)};if(t){const s=t+dR,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):fR(Cte,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},Rte=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const o=n[i],c=o[0]==="[",u=t.has(o);c||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}},Tte=e=>({cache:kte(e.cacheSize),parseClassName:Pte(e),sortModifiers:Rte(e),postfixLookupClassGroupIds:Ate(e),...gte(e)}),Ate=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Ite=/\s+/,Ote=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=t,c=[],u=e.trim().split(Ite);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:v,hasImportantModifier:_,baseClassName:w,maybePostfixModifierPosition:b}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let S=!!b,E;if(S){const M=w.substring(0,b);E=r(M);const A=E&&o[E]?r(w):void 0;A&&A!==E&&(E=A,S=!1)}else E=r(w);if(!E){if(!S){d=p+(d.length>0?" "+d:d);continue}if(E=r(w),!E){d=p+(d.length>0?" "+d:d);continue}S=!1}const C=v.length===0?"":v.length===1?v[0]:i(v).join(":"),R=_?C+p2:C,T=R+E;if(c.indexOf(T)>-1)continue;c.push(T);const O=s(E,S);for(let M=0;M<O.length;++M){const A=O[M];c.push(R+A)}d=p+(d.length>0?" "+d:d)}return d},Mte=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=R$(n))&&(s&&(s+=" "),s+=r);return s},R$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=R$(e[r]))&&(n&&(n+=" "),n+=t);return n},Lte=(e,...t)=>{let n,r,s,i;const o=u=>{const d=t.reduce((f,p)=>p(f),e());return n=Tte(d),r=n.cache.get,s=n.cache.set,i=c,c(u)},c=u=>{const d=r(u);if(d)return d;const f=Ote(u,n);return s(u,f),f};return i=o,(...u)=>i(Mte(...u))},$te=[],fr=e=>{const t=n=>n[e]||$te;return t.isThemeGetter=!0,t.themeKey=e,t},T$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,A$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Nte=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Dte=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fte=/\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$/,jte=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Vte=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zte=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oa=e=>Nte.test(e),At=e=>!!e&&!Number.isNaN(Number(e)),eo=e=>!!e&&Number.isInteger(Number(e)),J1=e=>e.endsWith("%")&&At(e.slice(0,-1)),No=e=>Dte.test(e),I$=()=>!0,Hte=e=>Fte.test(e)&&!jte.test(e),yx=()=>!1,Ute=e=>Vte.test(e),Zte=e=>zte.test(e),Bte=e=>!ze(e)&&!Be(e),Wte=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Kte=e=>yl(e,L$,yx),ze=e=>T$.test(e),Zl=e=>yl(e,$$,Hte),hR=e=>yl(e,tne,At),Gte=e=>yl(e,D$,I$),qte=e=>yl(e,N$,yx),pR=e=>yl(e,O$,yx),Yte=e=>yl(e,M$,Zte),km=e=>yl(e,F$,Ute),Be=e=>A$.test(e),xf=e=>Cc(e,$$),Xte=e=>Cc(e,N$),mR=e=>Cc(e,O$),Qte=e=>Cc(e,L$),Jte=e=>Cc(e,M$),Cm=e=>Cc(e,F$,!0),ene=e=>Cc(e,D$,!0),yl=(e,t,n)=>{const r=T$.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Cc=(e,t,n=!1)=>{const r=A$.exec(e);return r?r[1]?t(r[1]):n:!1},O$=e=>e==="position"||e==="percentage",M$=e=>e==="image"||e==="url",L$=e=>e==="length"||e==="size"||e==="bg-size",$$=e=>e==="length",tne=e=>e==="number",N$=e=>e==="family-name",D$=e=>e==="number"||e==="weight",F$=e=>e==="shadow",nne=()=>{const e=fr("color"),t=fr("font"),n=fr("text"),r=fr("font-weight"),s=fr("tracking"),i=fr("leading"),o=fr("breakpoint"),c=fr("container"),u=fr("spacing"),d=fr("radius"),f=fr("shadow"),p=fr("inset-shadow"),m=fr("text-shadow"),v=fr("drop-shadow"),_=fr("blur"),w=fr("perspective"),b=fr("aspect"),S=fr("ease"),E=fr("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...R(),Be,ze],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],A=()=>[Be,ze,u],L=()=>[Oa,"full","auto",...A()],V=()=>[eo,"none","subgrid",Be,ze],W=()=>["auto",{span:["full",eo,Be,ze]},eo,Be,ze],z=()=>[eo,"auto",Be,ze],X=()=>["auto","min","max","fr",Be,ze],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...A()],oe=()=>[Oa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],U=()=>[c,Oa,"screen","full","dvw","lvw","svw","min","max","fit",...A()],J=()=>[Oa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],K=()=>[e,Be,ze],D=()=>[...R(),mR,pR,{position:[Be,ze]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],fe=()=>["auto","cover","contain",Qte,Kte,{size:[Be,ze]}],ae=()=>[J1,xf,Zl],ce=()=>["","none","full",d,Be,ze],he=()=>["",At,xf,Zl],ke=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[At,J1,mR,pR],Le=()=>["","none",_,Be,ze],Ae=()=>["none",At,Be,ze],Ne=()=>["none",At,Be,ze],Et=()=>[At,Be,ze],dn=()=>[Oa,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[No],breakpoint:[No],color:[I$],container:[No],"drop-shadow":[No],ease:["in","out","in-out"],font:[Bte],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[No],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[No],shadow:[No],spacing:["px",At],text:[No],"text-shadow":[No],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Oa,ze,Be,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Be,ze]}],"container-named":[Wte],columns:[{columns:[At,"auto",ze,Be,c]}],"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:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset: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:[eo,"auto",Be,ze]}],basis:[{basis:[Oa,"full","auto",c,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[At,Oa,"auto","initial","none",ze]}],grow:[{grow:["",At,Be,ze]}],shrink:[{shrink:["",At,Be,ze]}],order:[{order:[eo,"first","last","none",Be,ze]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mbs:[{mbs:Y()}],mbe:[{mbe:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[c,"screen",...oe()]}],"min-w":[{"min-w":[c,"screen","none",...oe()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh","none",...oe()]}],"font-size":[{text:["base",n,xf,Zl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ene,Gte]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",J1,ze]}],"font-family":[{font:[Xte,qte,t]}],"font-features":[{"font-features":[ze]}],"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,Be,ze]}],"line-clamp":[{"line-clamp":[At,"none",Be,hR]}],leading:[{leading:["none",i,...A()]}],"list-image":[{"list-image":["none",Be,ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:[At,"from-font","auto",Be,Zl]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[At,"auto",Be,ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[eo,Be,ze]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,ze]}],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",Be,ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:fe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eo,Be,ze],radial:["",Be,ze],conic:["",eo,Be,ze]},Jte,Yte]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ke(),"hidden","none"]}],"divide-style":[{divide:[...ke(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-bs":[{"border-bs":K()}],"border-color-be":[{"border-be":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...ke(),"none","hidden"]}],"outline-offset":[{"outline-offset":[At,Be,ze]}],"outline-w":[{outline:["",At,xf,Zl]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","inner","none",f,Cm,km]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",p,Cm,km]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[At,Zl]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",m,Cm,km]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[At,Be,ze]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[At]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[Be,ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[At]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:fe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,ze]}],filter:[{filter:["","none",Be,ze]}],blur:[{blur:Le()}],brightness:[{brightness:[At,Be,ze]}],contrast:[{contrast:[At,Be,ze]}],"drop-shadow":[{"drop-shadow":["","none",v,Cm,km]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",At,Be,ze]}],"hue-rotate":[{"hue-rotate":[At,Be,ze]}],invert:[{invert:["",At,Be,ze]}],saturate:[{saturate:[At,Be,ze]}],sepia:[{sepia:["",At,Be,ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,ze]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[At,Be,ze]}],"backdrop-contrast":[{"backdrop-contrast":[At,Be,ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",At,Be,ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[At,Be,ze]}],"backdrop-invert":[{"backdrop-invert":["",At,Be,ze]}],"backdrop-opacity":[{"backdrop-opacity":[At,Be,ze]}],"backdrop-saturate":[{"backdrop-saturate":[At,Be,ze]}],"backdrop-sepia":[{"backdrop-sepia":["",At,Be,ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[At,"initial",Be,ze]}],ease:[{ease:["linear","initial",S,Be,ze]}],delay:[{delay:[At,Be,ze]}],animate:[{animate:["none",E,Be,ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Be,ze]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:Et()}],"skew-x":[{"skew-x":Et()}],"skew-y":[{"skew-y":Et()}],transform:[{transform:[Be,ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:dn()}],"translate-x":[{"translate-x":dn()}],"translate-y":[{"translate-y":dn()}],"translate-z":[{"translate-z":dn()}],"translate-none":["translate-none"],zoom:[{zoom:[eo,Be,ze]}],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"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",Be,ze]}],"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":K()}],"scrollbar-track-color":[{"scrollbar-track":K()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Be,ze]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[At,xf,Zl,hR]}],stroke:[{stroke:["none",...K()]}],"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"]}},rne=Lte(nne);function ir(...e){return rne(E$(e))}const sne="h-6 w-6",gR=e=>({className:n,color:r})=>P.jsx("span",{"aria-hidden":"true",className:ir("bg-current forced-colors:bg-[CanvasText] forced-colors:forced-color-adjust-none",n),style:{color:r,WebkitMaskImage:`url("${e}")`,maskImage:`url("${e}")`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),ine={x:{draw:({className:e,color:t})=>P.jsx(cte,{className:e,style:{color:t},"aria-hidden":"true"})},pinterest:{draw:({className:e})=>P.jsx("img",{src:fte,className:e,alt:"","aria-hidden":"true"})},arena:{brandColor:"#B1B1B1",draw:gR(ute)},cosmos:{draw:gR(dte)}},th=({provider:e,className:t})=>{const n=ine[e];return n.draw({className:ir(sne,n.brandColor&&"forced-colors:text-[CanvasText]!",t),color:n.brandColor})},one=e=>{const t=new URL(e).hostname.replace(/^www\./,"");return t==="are.na"?"arena":t==="pinterest.com"||t==="pin.it"?"pinterest":t==="x.com"?"x":t==="cosmos.so"?"cosmos":null},ane=({reference:e,imageUrl:t,onOpen:n})=>{const[r,s]=g.useState(!1),i=!!t&&!r,o=e.url?one(e.url):null,c=e.url??(i?t:void 0),u=c?"a":"span",d=i&&e.url?new URL(e.url).hostname:e.title;return P.jsxs(u,{href:c,target:c?"_blank":void 0,rel:c?"noopener noreferrer":void 0,"aria-label":e.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(),c&&n()},className:ir("border-surface-2 bg-muted text-foreground hover:border-soft-foreground/50 focus-visible:border-soft-foreground flex max-w-full min-w-0 shrink-0 items-center gap-1.5 overflow-hidden rounded-md border pr-1.5 text-xs outline-hidden",!i&&"py-1.5 pl-2"),children:[i?P.jsx("img",{src:t,alt:"",className:"h-8 w-12 shrink-0 object-contain",width:48,height:32,onError:()=>s(!0)}):null,o&&(i||o==="cosmos")?P.jsx(th,{provider:o,className:"h-3.5 w-3.5 shrink-0"}):null,!i||!o?P.jsx("span",{className:"max-w-40 truncate",children:d}):null]})},lne=({references:e,source:t,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=Ys(),c=$W(e);return c?P.jsx("div",{className:ir("ph-no-capture flex min-w-0 flex-nowrap gap-1.5 overflow-x-auto pr-3 pb-2",i),"aria-label":"References",children:c.map(u=>{var p;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 P.jsx(ane,{reference:u,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:t,reference_count:c.length})},`${u.id}:${((p=u.image)==null?void 0:p.hash)??""}:${f??""}`)})}):null},wue=e=>{const t=e.pathname.split("/").filter(Boolean).map(decodeURIComponent),n=t[3];if(t[2]==="references")return{kind:"references"};if(t[2]!=="projects"||!n)return{kind:"library"};const r=t[4]==="variants"?t[5]:void 0,s=t[4]==="variants"?t[6]:void 0,i=new URLSearchParams(e.search);return r&&s&&i.get("edit")!=="1"?{kind:"preview",projectId:n,sessionId:r,variantId:s}:{kind:"workspace",projectId:n,sessionId:r,variantId:s}},bue=e=>{if(e.kind==="references")return"/rivet/library/references";if(e.kind==="library"||!e.projectId)return"/rivet/library";const t=`/rivet/library/projects/${encodeURIComponent(e.projectId)}`;return e.sessionId&&e.variantId?`${t}/variants/${encodeURIComponent(e.sessionId)}/${encodeURIComponent(e.variantId)}${e.kind==="workspace"?"?edit=1":""}`:t},cne=e=>{const t=new URLSearchParams(e),n=t.get("historySession"),r=t.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},vR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yR=E$,une=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],p=i==null?void 0:i[d];if(f===null)return null;const m=vR(f)||vR(p);return s[d][m]}),c=n&&Object.entries(n).reduce((d,f)=>{let[p,m]=f;return m===void 0||(d[p]=m),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:p,className:m,...v}=f;return Object.entries(v).every(_=>{let[w,b]=_;return Array.isArray(b)?b.includes({...i,...c}[w]):{...i,...c}[w]===b})?[...d,p,m]:d},[]);return yR(e,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},dne=une(["group/button relative isolate inline-flex cursor-pointer items-center justify-center outline-hidden","transition-colors duration-80 motion-reduce:transition-none","disabled:pointer-events-none disabled:opacity-50"],{variants:{variant:{primary:"text-background",secondary:"text-foreground",tertiary:"text-foreground",ghost:"text-muted-foreground hover:text-foreground focus-visible: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"}}),_R={default:16,compact:14},fne={primary:"[--btn-bg:var(--foreground)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-focus-visible/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,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-focus-visible/button:[--btn-bg:var(--selected)] 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-focus-visible/button:bg-active 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-focus-visible/button:bg-active group-focus-visible/button:shadow-[0_0_0_1px_var(--active)] 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)] group-aria-expanded/button:group-focus-visible/button:bg-selected group-aria-pressed/button:group-focus-visible/button:bg-selected"},j$=g.forwardRef(({className:e,variant:t,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:c,type:u="button",...d},f)=>{const p=t??"secondary",m=n??"default",v=m==="icon"||m==="icon-compact",_=m==="compact"||m==="icon-compact",w=_?_R.compact:_R.default;return P.jsxs("button",{...d,ref:f,type:u,disabled:o||r,"aria-busy":r||d["aria-busy"],className:ir(dne({variant:p,size:m,iconLeft:!v&&!!s,iconRight:!v&&!!i}),"rounded-lg",e),children:[P.jsx("span",{"aria-hidden":!0,className:ir("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",fne[p])}),P.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[P.jsxs("span",{className:ir("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!v?P.jsx(s,{size:w,weight:"regular","aria-hidden":!0}):null,P.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:c}),i&&!v?P.jsx(i,{size:w,weight:"regular","aria-hidden":!0}):null]}),r?P.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:P.jsx("svg",{className:_?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:P.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]})]})});j$.displayName="Button";var hne=Object.defineProperty,Pd=(e,t)=>hne(e,"name",{value:t,configurable:!0}),V$=!!(typeof window<"u"&&window.document&&window.document.createElement);function mr(e,t,{checkForDefaultPrevented:n=!0}={}){return Pd(function(s){if(e==null||e(s),n===!1||!s||!s.defaultPrevented)return t==null?void 0:t(s)},"handleEvent")}Pd(mr,"composeEventHandlers");function pne(e){var t;if(!V$)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Pd(pne,"getOwnerWindow");function m2(e){if(!V$)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Pd(m2,"getOwnerDocument");function z$(e,t=!1){const{activeElement:n}=m2(e);if(!(n!=null&&n.nodeName))return null;if(H$(n)&&n.contentDocument)return z$(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const s=m2(n).getElementById(r);if(s)return s}}return n}Pd(z$,"getActiveElement");function H$(e){return e.tagName==="IFRAME"}Pd(H$,"isFrame");var mne=Object.defineProperty,_x=(e,t)=>mne(e,"name",{value:t,configurable:!0});function g2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}_x(g2,"setRef");function U$(...e){return t=>{let n=!1;const r=e.map(s=>{const i=g2(s,t);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():g2(e[s],null)}}}}_x(U$,"composeRefs");function ps(...e){return g.useCallback(U$(...e),e)}_x(ps,"useComposedRefs");var gne=Object.defineProperty,fi=(e,t)=>gne(e,"name",{value:t,configurable:!0});function vne(e,t){const n=g.createContext(t);n.displayName=e+"Context";const r=fi(i=>{const{children:o,...c}=i,u=g.useMemo(()=>c,Object.values(c));return P.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=e+"Provider";function s(i,o={}){const{optional:c=!1}=o,u=g.useContext(n);if(u)return u;if(t!==void 0)return t;if(!c)throw new Error(`\`${i}\` must be used within \`${e}\``)}return fi(s,"useContext"),[r,s]}fi(vne,"createContext");function Gh(e,t=[]){let n=[];function r(i,o){const c=g.createContext(o);c.displayName=i+"Context";const u=n.length;n=[...n,o];const d=fi(p=>{var S;const{scope:m,children:v,..._}=p,w=((S=m==null?void 0:m[e])==null?void 0:S[u])||c,b=g.useMemo(()=>_,Object.values(_));return P.jsx(w.Provider,{value:b,children:v})},"Provider");d.displayName=i+"Provider";function f(p,m,v={}){var S;const{optional:_=!1}=v,w=((S=m==null?void 0:m[e])==null?void 0:S[u])||c,b=g.useContext(w);if(b)return b;if(o!==void 0)return o;if(!_)throw new Error(`\`${p}\` must be used within \`${i}\``)}return fi(f,"useContext"),[d,f]}fi(r,"createContext");const s=fi(()=>{const i=n.map(o=>g.createContext(o));return fi(function(c){const u=(c==null?void 0:c[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])},"useScope")},"createScope");return s.scopeName=e,[r,Z$(s,...t)]}fi(Gh,"createContextScope");function Z$(...e){const t=e[0];if(e.length===1)return t;const n=fi(()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return fi(function(i){const o=r.reduce((c,{useScope:u,scopeName:d})=>{const p=u(i)[`__scope${d}`];return{...c,...p}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}fi(Z$,"composeContextScopes");var yne=Object.defineProperty,Xs=(e,t)=>yne(e,"name",{value:t,configurable:!0});function $g(e){const t=g.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,c=!1;const u=[];s=X$(s),g.Children.forEach(s,m=>{var v;if(q$(m)){c=!0;const _=m;let w="child"in _.props?_.props.child:_.props.children;for(;wx(w)&&typeof ig=="function";)w=ig(w._payload);o=_ne(_,w),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):!c&&g.Children.count(s)===1&&g.isValidElement(s)&&(o=s);const d=o?G$(o):void 0,f=ps(r,d);if(!o){if(s||s===0)throw new Error(c?xne(e):bne(e));return s}const p=K$(i,o.props??{});return o.type!==g.Fragment&&(p.ref=r?f:d),g.cloneElement(o,p)});return t.displayName=`${e}.Slot`,t}Xs($g,"createSlot");var B$=Symbol.for("radix.slottable");function W$(e){const t=Xs(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=B$,t}Xs(W$,"createSlottable");var _ne=Xs((e,t)=>"child"in e.props?g.isValidElement(t)?g.cloneElement(t,void 0,e.props.children(t.props.children)):null:g.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function K$(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const u=i(...c);return s(...c),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"?n[r]=[s,i].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=Q$(i,s))}return{...e,...n}}Xs(K$,"mergeProps");function G$(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Xs(G$,"getElementRef");function q$(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B$}Xs(q$,"isSlottable");var wne=Symbol.for("react.lazy");function wx(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===wne&&"_payload"in e&&Y$(e._payload)}Xs(wx,"isLazyComponent");function Y$(e){return typeof e=="object"&&e!==null&&"then"in e}Xs(Y$,"isPromiseLike");function X$(e){let t=e;for(;wx(t)&&typeof ig=="function";)t=ig(t._payload);return t}Xs(X$,"useUnwrappedLazy");function Q$(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Xs(Q$,"concatAriaDescribedby");var bne=Xs(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),xne=Xs(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ig=_d[" use ".trim().toString()],Sne=Object.defineProperty,Ene=(e,t)=>Sne(e,"name",{value:t,configurable:!0}),kne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qs=kne.reduce((e,t)=>{const n=$g(`Primitive.${t}`),r=g.forwardRef((s,i)=>{const{asChild:o,...c}=s,u=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function J$(e,t){e&&Cd.flushSync(()=>e.dispatchEvent(t))}Ene(J$,"dispatchDiscreteCustomEvent");var Ts=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Cne=Object.defineProperty,Pne=(e,t)=>Cne(e,"name",{value:t,configurable:!0}),wR=_d[" useInsertionEffect ".trim().toString()];function Sc(e){const t=g.useRef(e);return typeof wR=="function"?wR(()=>{t.current=e}):Ts(()=>{t.current=e}),g.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Pne(Sc,"useCallbackRef");var Rne=Object.defineProperty,Pr=(e,t)=>Rne(e,"name",{value:t,configurable:!0}),v2="dismissableLayer.update",Tne="dismissableLayer.pointerDownOutside",Ane="dismissableLayer.focusOutside",bR,e5=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),bx=g.forwardRef(Pr(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:u,onDismiss:d,...f}=t,p=g.useContext(e5),[m,v]=g.useState(null),_=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=g.useState({}),b=ps(n,v),S=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=E?S.indexOf(E):-1,R=m?S.indexOf(m):-1,T=p.layersWithOutsidePointerEventsDisabled.size>0,O=R>=C,M=g.useRef(!1),A=n5(z=>{o==null||o(z),u==null||u(z),z.defaultPrevented||d==null||d()},{ownerDocument:_,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(z=>{if(!(z instanceof Node))return!1;const X=[...p.branches].some(Q=>Q.contains(z));return O&&!X},[p.branches,O])}),L=r5(z=>{if(s&&M.current)return;const X=z.target;[...p.branches].some(H=>H.contains(X))||(c==null||c(z),u==null||u(z),z.defaultPrevented||d==null||d())},_),V=m?R===S.length-1:!1,W=Sc(z=>{z.key==="Escape"&&(i==null||i(z),!z.defaultPrevented&&d&&(z.preventDefault(),d()))});return g.useEffect(()=>{if(V)return _.addEventListener("keydown",W,{capture:!0}),()=>_.removeEventListener("keydown",W,{capture:!0})},[_,V,W]),g.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(bR=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),y2(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=bR))}},[m,_,r,p]),g.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),y2())},[m,p]),g.useEffect(()=>{const z=Pr(()=>w({}),"handleUpdate");return document.addEventListener(v2,z),()=>document.removeEventListener(v2,z)},[]),P.jsx(Qs.div,{...f,ref:b,style:{pointerEvents:T?O?"auto":"none":void 0,...t.style},onFocusCapture:mr(t.onFocusCapture,L.onFocusCapture),onBlurCapture:mr(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:mr(t.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function t5(){const e=g.useContext(e5),[t,n]=g.useState(null);return g.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Pr(t5,"useDismissableLayerSurface");var Ine=Pr(()=>!0,"IS_TRUE");function n5(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=Ine}=t,c=Sc(e),u=g.useRef(!1),d=g.useRef(!1),f=g.useRef(new Map),p=g.useRef(()=>{});return g.useEffect(()=>{function m(){d.current=!1,s.current=!1,f.current.clear()}Pr(m,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}Pr(v,"isOutsideInteractionIntercepted");function _(C){if(!d.current)return;const R=C.target;R instanceof Node&&[...i].some(O=>O.contains(R))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}Pr(_,"handleInteractionCapture");function w(C){d.current&&f.current.set(C.type,!1)}Pr(w,"handleInteractionBubble");const b=Pr(C=>{if(C.target&&!u.current){let R=function(){n.removeEventListener("click",p.current);const O=v();m(),O||xx(Tne,c,T,{discrete:!0})};if(Pr(R,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",p.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?R():(n.removeEventListener("click",p.current),p.current=R,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();u.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of S)n.addEventListener(C,_,!0),n.addEventListener(C,w);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",b),n.removeEventListener("click",p.current);for(const C of S)n.removeEventListener(C,_,!0),n.removeEventListener(C,w)}},[n,c,r,s,i,o]),{onPointerDownCapture:Pr(()=>u.current=!0,"onPointerDownCapture")}}Pr(n5,"usePointerDownOutside");function r5(e,t=globalThis==null?void 0:globalThis.document){const n=Sc(e),r=g.useRef(!1);return g.useEffect(()=>{const s=Pr(i=>{i.target&&!r.current&&xx(Ane,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:Pr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Pr(()=>r.current=!1,"onBlurCapture")}}Pr(r5,"useFocusOutside");function y2(){const e=new CustomEvent(v2);document.dispatchEvent(e)}Pr(y2,"dispatchUpdate");function xx(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?J$(s,i):s.dispatchEvent(i)}Pr(xx,"handleAndDispatchCustomEvent");var One=Object.defineProperty,or=(e,t)=>One(e,"name",{value:t,configurable:!0}),e_="focusScope.autoFocusOnMount",t_="focusScope.autoFocusOnUnmount",xR={bubbles:!1,cancelable:!0},s5=g.forwardRef(or(function(t,n){const{loop:r=!1,trapped:s=!1,branches:i,onMountAutoFocus:o,onUnmountAutoFocus:c,...u}=t,[d,f]=g.useState(null),p=Sc(o),m=Sc(c),v=g.useRef(null),_=ps(n,f),w=g.useRef(i);g.useEffect(()=>{w.current=i});const b=g.useCallback(C=>{var R;return C?d!=null&&d.contains(C)?!0:!!((R=w.current)!=null&&R.some(T=>T.contains(C))):!1},[d]),S=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let C=function(M){if(S.paused||!d)return;const A=M.target;b(A)?v.current=A:Uo(v.current,{select:!0})},R=function(M){if(S.paused||!d)return;const A=M.relatedTarget;A!==null&&(b(A)||Uo(v.current,{select:!0}))},T=function(M){if(document.activeElement===document.body)for(const L of M)L.removedNodes.length>0&&Uo(d)};or(C,"handleFocusIn"),or(R,"handleFocusOut"),or(T,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",R);const O=new MutationObserver(T);return d&&O.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",R),O.disconnect()}}},[s,d,S.paused,b]),g.useEffect(()=>{if(d){SR.add(S);const C=document.activeElement;if(!d.contains(C)){const T=new CustomEvent(e_,xR);d.addEventListener(e_,p),d.dispatchEvent(T),T.defaultPrevented||(o5(d5(Cx(d)),{select:!0}),document.activeElement===C&&Uo(d))}return()=>{d.removeEventListener(e_,p);const T=d.ownerDocument,O=CustomEvent;setTimeout(()=>{const M=new O(t_,xR);d.addEventListener(t_,m),d.dispatchEvent(M),M.defaultPrevented||Uo(C??T.body,{select:!0}),d.removeEventListener(t_,m),SR.remove(S)},0)}}},[d,p,m,S]);const E=g.useCallback(C=>{if(!r&&!s||S.paused)return;const R=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,T=document.activeElement;if(R&&T){const O=C.currentTarget,[M,A]=a5(O);M&&A?!C.shiftKey&&T===A?(C.preventDefault(),r&&Uo(M,{select:!0})):C.shiftKey&&T===M&&(C.preventDefault(),r&&Uo(A,{select:!0})):T===O&&C.preventDefault()}},[r,s,S.paused]);return P.jsx(Qs.div,{tabIndex:-1,...u,ref:_,onKeyDown:E})},"FocusScope")),i5=g.createContext(null);function Sx({registry:e,children:t}){return e?P.jsx(i5.Provider,{value:e,children:t}):t}or(Sx,"FocusScopeBranchProvider");function Ex(){const[e,t]=g.useState([]),n=g.useMemo(()=>({add:or(r=>t(s=>s.includes(r)?s:[...s,r]),"add"),remove:or(r=>t(s=>s.filter(i=>i!==r)),"remove")}),[]);return{nodes:e,registry:n}}or(Ex,"useFocusScopeBranchRegistry");function kx(e){const t=g.useContext(i5);g.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}or(kx,"useFocusScopeBranch");function o5(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Uo(r,{select:t}),document.activeElement!==n)return}or(o5,"focusFirst");function a5(e){const t=Cx(e),n=_2(t,e),r=_2(t.reverse(),e);return[n,r]}or(a5,"getTabbableEdges");function Cx(e){const t=[],r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:or(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();)t.push(r.currentNode);return t}or(Cx,"getTabbableCandidates");function _2(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):l5(r,{upTo:t})))return r}or(_2,"findVisible");function l5(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}or(l5,"isHidden");function c5(e){return e.tagName==="INPUT"&&typeof e.select=="function"}or(c5,"isSelectableInput");function Uo(e,{select:t=!1}={}){if(e&&e.focus){const r=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==r&&c5(e)&&t&&e.select()}}or(Uo,"focus");var SR=u5();function u5(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=w2(e,t),e.unshift(t)},remove(t){var n;e=w2(e,t),(n=e[0])==null||n.resume()}}}or(u5,"createFocusScopesStack");function w2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}or(w2,"arrayRemove");function d5(e){return e.filter(t=>t.tagName!=="A")}or(d5,"removeLinks");var Mne=Object.defineProperty,Lne=(e,t)=>Mne(e,"name",{value:t,configurable:!0}),$ne=_d[" useId ".trim().toString()]||(()=>{}),Nne=0;function sl(e){const[t,n]=g.useState($ne());return Ts(()=>{e||n(r=>r??String(Nne++))},[e]),e||(t?`radix-${t}`:"")}Lne(sl,"useId");const Dne=["top","right","bottom","left"],hl=Math.min,ea=Math.max,og=Math.round,Pm=Math.floor,ta=e=>({x:e,y:e}),Fne={left:"right",right:"left",bottom:"top",top:"bottom"};function f5(e,t,n){return ea(e,hl(t,n))}function ia(e,t){return typeof e=="function"?e(t):e}function pl(e){return e.split("-")[0]}function Rd(e){return e.split("-")[1]}function Px(e){return e==="x"?"y":"x"}function Rx(e){return e==="y"?"height":"width"}function ho(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Tx(e){return Px(ho(e))}function jne(e,t,n){n===void 0&&(n=!1);const r=Rd(e),s=Tx(e),i=Rx(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=ag(o)),[o,ag(o)]}function Vne(e){const t=ag(e);return[b2(e),t,b2(t)]}function b2(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ER=["left","right"],kR=["right","left"],zne=["top","bottom"],Hne=["bottom","top"];function Une(e,t,n){switch(e){case"top":case"bottom":return n?t?kR:ER:t?ER:kR;case"left":case"right":return t?zne:Hne;default:return[]}}function Zne(e,t,n,r){const s=Rd(e);let i=Une(pl(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(b2)))),i}function ag(e){const t=pl(e);return Fne[t]+e.slice(t.length)}function Bne(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function h5(e){return typeof e!="number"?Bne(e):{top:e,right:e,bottom:e,left:e}}function lg(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function CR(e,t,n){let{reference:r,floating:s}=e;const i=ho(t),o=Tx(t),c=Rx(o),u=pl(t),d=i==="y",f=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[c]/2-s[c]/2;let 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:p};break;case"left":v={x:r.x-s.width,y:p};break;default:v={x:r.x,y:r.y}}const _=Rd(t);return _&&(v[o]+=m*(_==="end"?1:-1)*(n&&d?-1:1)),v}async function Wne(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=ia(t,e),_=h5(v),b=c[m?p==="floating"?"reference":"floating":p],S=lg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:d,rootBoundary:f,strategy:u})),E=p==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},T=lg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:C,strategy:u}):E);return{top:(S.top-T.top+_.top)/R.y,bottom:(T.bottom-S.bottom+_.bottom)/R.y,left:(S.left-T.left+_.left)/R.x,right:(T.right-S.right+_.right)/R.x}}const Kne=50,Gne=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,c=o.detectOverflow?o:{...o,detectOverflow:Wne},u=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:f,y:p}=CR(d,r,u),m=r,v=0;const _={};for(let w=0;w<i.length;w++){const b=i[w];if(!b)continue;const{name:S,fn:E}=b,{x:C,y:R,data:T,reset:O}=await E({x:f,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:_,rects:d,platform:c,elements:{reference:e,floating:t}});f=C??f,p=R??p,_[S]={..._[S],...T},O&&v<Kne&&(v++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(d=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):O.rects),{x:f,y:p}=CR(d,m,u)),w=-1)}return{x:f,y:p,placement:m,strategy:s,middlewareData:_}},qne=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:c,middlewareData:u}=t,{element:d,padding:f=0}=ia(e,t)||{};if(d==null)return{};const p=h5(f),m={x:n,y:r},v=Tx(s),_=Rx(v),w=await o.getDimensions(d),b=v==="y",S=b?"top":"left",E=b?"bottom":"right",C=b?"clientHeight":"clientWidth",R=i.reference[_]+i.reference[v]-m[v]-i.floating[_],T=m[v]-i.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let M=O?O[C]:0;(!M||!await(o.isElement==null?void 0:o.isElement(O)))&&(M=c.floating[C]||i.floating[_]);const A=R/2-T/2,L=M/2-w[_]/2-1,V=hl(p[S],L),W=hl(p[E],L),z=M-w[_]-W,X=M/2-w[_]/2+A,Q=f5(V,X,z),H=!u.arrow&&Rd(s)!=null&&X!==Q&&i.reference[_]/2-(X<V?V:W)-w[_]/2<0,Y=H?X<V?X-V:X-z:0;return{[v]:m[v]+Y,data:{[v]:Q,centerOffset:X-Q-Y,...H&&{alignmentOffset:Y}},reset:H}}}),Yne=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:w=!0,...b}=ia(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=pl(s),E=ho(c),C=pl(c)===c,R=await(u.isRTL==null?void 0:u.isRTL(d.floating)),T=m||(C||!w?[ag(c)]:Vne(c)),O=_!=="none";!m&&O&&T.push(...Zne(c,w,_,R));const M=[c,...T],A=await u.detectOverflow(t,b),L=[];let V=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&L.push(A[S]),p){const Q=jne(s,o,R);L.push(A[Q[0]],A[Q[1]])}if(V=[...V,{placement:s,overflows:L}],!L.every(Q=>Q<=0)){var W,z;const Q=(((W=i.flip)==null?void 0:W.index)||0)+1,H=M[Q];if(H&&(!(p==="alignment"?E!==ho(H):!1)||V.every(U=>ho(U.placement)===E?U.overflows[0]>0:!0)))return{data:{index:Q,overflows:V},reset:{placement:H}};let Y=(z=V.filter(oe=>oe.overflows[0]<=0).sort((oe,U)=>oe.overflows[1]-U.overflows[1])[0])==null?void 0:z.placement;if(!Y)switch(v){case"bestFit":{var X;const oe=(X=V.filter(U=>{if(O){const J=ho(U.placement);return J===E||J==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(J=>J>0).reduce((J,K)=>J+K,0)]).sort((U,J)=>U[1]-J[1])[0])==null?void 0:X[0];oe&&(Y=oe);break}case"initialPlacement":Y=c;break}if(s!==Y)return{reset:{placement:Y}}}return{}}}};function PR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function RR(e){return Dne.some(t=>e[t]>=0)}const Xne=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...i}=ia(e,t);switch(s){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=PR(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:RR(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=PR(o,n.floating);return{data:{escapedOffsets:c,escaped:RR(c)}}}default:return{}}}}},p5=new Set(["left","top"]);async function Qne(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=pl(n),c=Rd(n),u=ho(n)==="y",d=p5.has(o)?-1:1,f=i&&u?-1:1,p=ia(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:_}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof _=="number"&&(v=c==="end"?_*-1:_),u?{x:v*f,y:m*d}:{x:m*d,y:v*f}}const Jne=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:c}=t,u=await Qne(t,e);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:o}}}}},ere=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:u={fn:E=>{let{x:C,y:R}=E;return{x:C,y:R}}},...d}=ia(e,t),f={x:n,y:r},p=await i.detectOverflow(t,d),m=ho(s),v=Px(m);let _=f[v],w=f[m];const b=(E,C)=>f5(C+p[E==="y"?"top":"left"],C,C-p[E==="y"?"bottom":"right"]);o&&(_=b(v,_)),c&&(w=b(m,w));const S=u.fn({...t,[v]:_,[m]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[m]:c}}}}}},tre=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:i,placement:o,rects:c,middlewareData:u}=t,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=ia(e,t),m={x:s,y:i},v=ho(o),_=Px(v);let w=m[_],b=m[v];const S=ia(d,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(f){const T=_==="y"?"height":"width",O=c.reference[_]-c.floating[T]+E.mainAxis,M=c.reference[_]+c.reference[T]-E.mainAxis;w<O?w=O:w>M&&(w=M)}if(p){var C,R;const T=_==="y"?"width":"height",O=p5.has(pl(o)),M=c.reference[v]-c.floating[T]+(O&&((C=u.offset)==null?void 0:C[v])||0)+(O?0:E.crossAxis),A=c.reference[v]+c.reference[T]+(O?0:((R=u.offset)==null?void 0:R[v])||0)-(O?E.crossAxis:0);b<M?b=M:b>A&&(b=A)}return{[_]:w,[v]:b}}}},nre=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:i}=t,{apply:o=()=>{},...c}=ia(e,t),u=await s.detectOverflow(t,c),d=pl(n),f=Rd(n),p=ho(n)==="y",{width:m,height:v}=r.floating;let _,w;d==="top"||d==="bottom"?(_=d,w=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(w=d,_=f==="end"?"top":"bottom");const b=v-u.top-u.bottom,S=m-u.left-u.right,E=hl(v-u[_],b),C=hl(m-u[w],S),R=t.middlewareData.shift,T=!R;let O=E,M=C;R!=null&&R.enabled.x&&(M=S),R!=null&&R.enabled.y&&(O=b),T&&!f&&(p?M=m-2*ea(u.left,u.right):O=v-2*ea(u.top,u.bottom)),await o({...t,availableWidth:M,availableHeight:O});const A=await s.getDimensions(i.floating);return m!==A.width||v!==A.height?{reset:{rects:!0}}:{}}}};function Ng(){return typeof window<"u"}function Td(e){return m5(e)?(e.nodeName||"").toLowerCase():"#document"}function As(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function la(e){var t;return(t=(m5(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function m5(e){return Ng()?e instanceof Node||e instanceof As(e).Node:!1}function bo(e){return Ng()?e instanceof Element||e instanceof As(e).Element:!1}function _l(e){return Ng()?e instanceof HTMLElement||e instanceof As(e).HTMLElement:!1}function TR(e){return!Ng()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof As(e).ShadowRoot}function Dg(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=xo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function rre(e){return/^(table|td|th)$/.test(Td(e))}function Fg(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const sre=/transform|translate|scale|rotate|perspective|filter/,ire=/paint|layout|strict|content/,Bl=e=>!!e&&e!=="none";let n_;function Ax(e){const t=bo(e)?xo(e):e;return Bl(t.transform)||Bl(t.translate)||Bl(t.scale)||Bl(t.rotate)||Bl(t.perspective)||!Ix()&&(Bl(t.backdropFilter)||Bl(t.filter))||sre.test(t.willChange||"")||ire.test(t.contain||"")}function ore(e){let t=Ec(e);for(;_l(t)&&!kh(t);){if(Ax(t))return t;if(Fg(t))return null;t=Ec(t)}return null}function Ix(){return n_==null&&(n_=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),n_}function kh(e){return/^(html|body|#document)$/.test(Td(e))}function xo(e){return As(e).getComputedStyle(e)}function jg(e){return bo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ec(e){if(Td(e)==="html")return e;const t=e.assignedSlot||e.parentNode||TR(e)&&e.host||la(e);return TR(t)?t.host:t}function g5(e){const t=Ec(e);return kh(t)?(e.ownerDocument||e).body:_l(t)&&Dg(t)?t:g5(t)}function Ch(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=g5(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=As(s);if(i){const c=x2(o);return t.concat(o,o.visualViewport||[],Dg(s)?s:[],c&&n?Ch(c):[])}else return t.concat(s,Ch(s,[],n))}function x2(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function v5(e){const t=xo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=_l(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,c=og(n)!==i||og(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function Ox(e){return bo(e)?e:e.contextElement}function Ou(e){const t=Ox(e);if(!_l(t))return ta(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=v5(t);let o=(i?og(n.width):n.width)/r,c=(i?og(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const are=ta(0);function y5(e){const t=As(e);return!Ix()||!t.visualViewport?are:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lre(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===As(e)}function kc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=Ox(e);let o=ta(1);t&&(r?bo(r)&&(o=Ou(r)):o=Ou(e));const c=lre(i,n,r)?y5(i):ta(0);let u=(s.left+c.x)/o.x,d=(s.top+c.y)/o.y,f=s.width/o.x,p=s.height/o.y;if(i&&r){const m=As(i),v=bo(r)?As(r):r;let _=m,w=x2(_);for(;w&&v!==_;){const b=Ou(w),S=w.getBoundingClientRect(),E=xo(w),C=S.left+(w.clientLeft+parseFloat(E.paddingLeft))*b.x,R=S.top+(w.clientTop+parseFloat(E.paddingTop))*b.y;u*=b.x,d*=b.y,f*=b.x,p*=b.y,u+=C,d+=R,_=As(w),w=x2(_)}}return lg({width:f,height:p,x:u,y:d})}function Vg(e,t){const n=jg(e).scrollLeft;return t?t.left+n:kc(la(e)).left+n}function _5(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Vg(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function cre(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=la(r),c=t?Fg(t.floating):!1;if(r===o||c&&i)return n;let u={scrollLeft:0,scrollTop:0},d=ta(1);const f=ta(0),p=_l(r);if((p||!i)&&((Td(r)!=="body"||Dg(o))&&(u=jg(r)),p)){const v=kc(r);d=Ou(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const m=o&&!p&&!i?_5(o,u):ta(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 ure(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function dre(e){const t=jg(e),n=e.ownerDocument.body,r=ea(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=ea(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+Vg(e);const o=-t.scrollTop;return xo(n).direction==="rtl"&&(i+=ea(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const fre=25;function hre(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=As(e),i=la(e),o=s.visualViewport;let c=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const m=!Ix()||t==="fixed";r?m||(d=-o.offsetLeft,f=-o.offsetTop):(c=o.width,u=o.height,m&&(d=o.offsetLeft,f=o.offsetTop))}if(Vg(i)<=0){const m=i.ownerDocument,v=m.body,_=getComputedStyle(v),w=m.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,b=Math.abs(i.clientWidth-v.clientWidth-w),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;S<=fre&&(c-=S)}return{width:c,height:u,x:d,y:f}}function pre(e,t){const n=kc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Ou(e),o=e.clientWidth*i.x,c=e.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:o,height:c,x:u,y:d}}function AR(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=hre(e,n,t);else if(t==="document")r=dre(la(e));else if(bo(t))r=pre(t,n);else{const s=y5(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return lg(r)}function mre(e,t){const n=t.get(e);if(n)return n;let r=Ch(e,[],!1).filter(c=>bo(c)&&Td(c)!=="body"),s=null;const i=xo(e).position==="fixed";let o=i?Ec(e):e;for(;bo(o)&&!kh(o);){const c=xo(o),u=Ax(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&c.position==="static")?r=r.filter(p=>p!==o):s=c,o=Ec(o)}return t.set(e,r),r}function gre(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?Fg(t)?[]:mre(t,this._c):[].concat(n),r],c=AR(t,o[0],s);let u=c.top,d=c.right,f=c.bottom,p=c.left;for(let m=1;m<o.length;m++){const v=AR(t,o[m],s);u=ea(v.top,u),d=hl(v.right,d),f=hl(v.bottom,f),p=ea(v.left,p)}return{width:d-p,height:f-u,x:p,y:u}}function vre(e){const{width:t,height:n}=v5(e);return{width:t,height:n}}function yre(e,t,n){const r=_l(t),s=la(t),i=n==="fixed",o=kc(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=ta(0);if((r||!i)&&((Td(t)!=="body"||Dg(s))&&(c=jg(t)),r)){const m=kc(t,!0,i,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}!r&&s&&(u.x=Vg(s));const d=s&&!r&&!i?_5(s,c):ta(0),f=o.left+c.scrollLeft-u.x-d.x,p=o.top+c.scrollTop-u.y-d.y;return{x:f,y:p,width:o.width,height:o.height}}function r_(e){return xo(e).position==="static"}function IR(e,t){if(!_l(e)||xo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return la(e)===n&&(n=n.ownerDocument.body),n}function w5(e,t){const n=As(e);if(Fg(e))return n;if(!_l(e)){let s=Ec(e);for(;s&&!kh(s);){if(bo(s)&&!r_(s))return s;s=Ec(s)}return n}let r=IR(e,t);for(;r&&rre(r)&&r_(r);)r=IR(r,t);return r&&kh(r)&&r_(r)&&!Ax(r)?n:r||ore(e)||n}const _re=async function(e){const t=this.getOffsetParent||w5,n=this.getDimensions,r=await n(e.floating);return{reference:yre(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wre(e){return xo(e).direction==="rtl"}const bre={convertOffsetParentRelativeRectToViewportRelativeRect:cre,getDocumentElement:la,getClippingRect:gre,getOffsetParent:w5,getElementRects:_re,getClientRects:ure,getDimensions:vre,getScale:Ou,isElement:bo,isRTL:wre};function b5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xre(e,t,n){let r=null,s;const i=la(e);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function c(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),o();const m=e.getBoundingClientRect(),{left:v,top:_,width:w,height:b}=m;if(f||t(),!w||!b)return;const S=Pm(_),E=Pm(i.clientWidth-(v+w)),C=Pm(i.clientHeight-(_+b)),R=Pm(v),O={rootMargin:-S+"px "+-E+"px "+-C+"px "+-R+"px",threshold:ea(0,hl(1,p))||1};let M=!0;function A(L){const V=L[0].intersectionRatio;if(!b5(m,e.getBoundingClientRect()))return c();if(V!==p){if(!M)return c();V?c(!1,V):s=setTimeout(()=>{c(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(A,{...O,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,O)}r.observe(e)}const u=As(e),d=()=>c(n);return u.addEventListener("resize",d),c(!0),()=>{u.removeEventListener("resize",d),o()}}function Sre(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Ox(e),f=s||i?[...d?Ch(d):[],...t?Ch(t):[]]:[];f.forEach(S=>{s&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const p=d&&c?xre(d,n,i):null;let m=-1,v=null;o&&(v=new ResizeObserver(S=>{let[E]=S;E&&E.target===d&&v&&t&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(t)})),n()}),d&&!u&&v.observe(d),t&&v.observe(t));let _,w=u?kc(e):null;u&&b();function b(){const S=kc(e);w&&!b5(w,S)&&n(),w=S,_=requestAnimationFrame(b)}return n(),()=>{var S;f.forEach(E=>{s&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),p==null||p(),(S=v)==null||S.disconnect(),v=null,u&&cancelAnimationFrame(_)}}const Ere=Jne,kre=ere,Cre=Yne,Pre=nre,Rre=Xne,OR=qne,Tre=tre,Are=(e,t,n)=>{const r=new Map,s=n??{},i={...bre,...s.platform,_c:r};return Gne(e,t,{...s,platform:i})};var Ire=typeof document<"u",Ore=function(){},s0=Ire?g.useLayoutEffect:Ore;function cg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cg(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!cg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function x5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function MR(e,t){const n=x5(e);return Math.round(t*n)/n}function s_(e){const t=g.useRef(e);return s0(()=>{t.current=e}),t}function Mre(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,p]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=g.useState(r);cg(m,r)||v(r);const[_,w]=g.useState(null),[b,S]=g.useState(null),E=g.useCallback(U=>{U!==O.current&&(O.current=U,w(U))},[]),C=g.useCallback(U=>{U!==M.current&&(M.current=U,S(U))},[]),R=i||_,T=o||b,O=g.useRef(null),M=g.useRef(null),A=g.useRef(f),L=u!=null,V=s_(u),W=s_(s),z=s_(d),X=g.useCallback(()=>{if(!O.current||!M.current)return;const U={placement:t,strategy:n,middleware:m};W.current&&(U.platform=W.current),Are(O.current,M.current,U).then(J=>{const K={...J,isPositioned:z.current!==!1};Q.current&&!cg(A.current,K)&&(A.current=K,Cd.flushSync(()=>{p(K)}))})},[m,t,n,W,z]);s0(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[d]);const Q=g.useRef(!1);s0(()=>(Q.current=!0,()=>{Q.current=!1}),[]),s0(()=>{if(R&&(O.current=R),T&&(M.current=T),R&&T){if(V.current)return V.current(R,T,X);X()}},[R,T,X,V,L]);const H=g.useMemo(()=>({reference:O,floating:M,setReference:E,setFloating:C}),[E,C]),Y=g.useMemo(()=>({reference:R,floating:T}),[R,T]),oe=g.useMemo(()=>{const U={position:n,left:0,top:0};if(!Y.floating)return U;const J=MR(Y.floating,f.x),K=MR(Y.floating,f.y);return c?{...U,transform:"translate("+J+"px, "+K+"px)",...x5(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:K}},[n,c,Y.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:X,refs:H,elements:Y,floatingStyles:oe}),[f,X,H,Y,oe])}const Lre=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?OR({element:r.current,padding:s}).fn(n):{}:r?OR({element:r,padding:s}).fn(n):{}}}},$re=(e,t)=>{const n=Ere(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nre=(e,t)=>{const n=kre(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dre=(e,t)=>({fn:Tre(e).fn,options:[e,t]}),Fre=(e,t)=>{const n=Cre(e);return{name:n.name,fn:n.fn,options:[e,t]}},jre=(e,t)=>{const n=Pre(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vre=(e,t)=>{const n=Rre(e);return{name:n.name,fn:n.fn,options:[e,t]}},zre=(e,t)=>{const n=Lre(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Hre=Object.defineProperty,Ure=(e,t)=>Hre(e,"name",{value:t,configurable:!0});function S5(e){const[t,n]=g.useState(void 0);return Ts(()=>{if(e){n({width:e.offsetWidth,height:e.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 c,u;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;c=f.inlineSize,u=f.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})})});return s.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}else n(void 0)},[e]),t}Ure(S5,"useSize");var Zre=Object.defineProperty,il=(e,t)=>Zre(e,"name",{value:t,configurable:!0}),LR={Partial:"partial"},$R={Optimized:"optimized",Always:"always"},E5="Popper",[k5,zg]=Gh(E5),[Bre,C5]=k5(E5),P5=il(e=>{const{__scopePopper:t,children:n}=e,[r,s]=g.useState(null),[i,o]=g.useState(void 0);return P.jsx(Bre,{scope:t,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),Wre="PopperAnchor",R5=g.forwardRef(il(function(t,n){const{__scopePopper:r,virtualRef:s,...i}=t,o=C5(Wre,r),c=g.useRef(null),u=o.onAnchorChange,d=g.useCallback(w=>{c.current=w,w&&u(w)},[u]),f=ps(n,d),p=g.useRef(null);g.useEffect(()=>{if(!s)return;const w=p.current;p.current=s.current,w!==p.current&&u(p.current)});const m=o.placementState&&Hg(o.placementState),v=m==null?void 0:m[0],_=m==null?void 0:m[1];return s?null:P.jsx(Qs.div,{"data-radix-popper-side":v,"data-radix-popper-align":_,...i,ref:f})},"PopperAnchor")),T5="PopperContent",[Kre,xue]=k5(T5),A5=g.forwardRef(il(function(t,n){var pe,Le,Ae,Ne,Et,dn,sn;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m=LR.Partial,hideWhenDetached:v=!1,updatePositionStrategy:_=$R.Optimized,onPlaced:w,...b}=t,S=C5(T5,r),[E,C]=g.useState(null),R=ps(n,C),[T,O]=g.useState(null),M=S5(T),A=(M==null?void 0:M.width)??0,L=(M==null?void 0:M.height)??0,V=s+(o!=="center"?"-"+o:""),W=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},z=Array.isArray(f)?f:[f],X=z.length>0,Q={padding:W,boundary:z.filter(I5),altBoundary:X},{refs:H,floatingStyles:Y,placement:oe,isPositioned:U,middlewareData:J}=Mre({strategy:"fixed",placement:V,whileElementsMounted:il((...kt)=>Sre(...kt,{animationFrame:_===$R.Always}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[$re({mainAxis:i+L,alignmentAxis:c}),d&&Nre({mainAxis:!0,crossAxis:!1,...m===LR.Partial?{limiter:Dre()}:{},...Q}),d&&Fre({...Q}),jre({...Q,apply:il(({elements:kt,rects:Gt,availableWidth:mn,availableHeight:Xt})=>{const{width:Me,height:Qe}=Gt.reference,Te=kt.floating.style;Te.setProperty("--radix-popper-available-width",`${mn}px`),Te.setProperty("--radix-popper-available-height",`${Xt}px`),Te.setProperty("--radix-popper-anchor-width",`${Me}px`),Te.setProperty("--radix-popper-anchor-height",`${Qe}px`)},"apply")}),T&&zre({element:T,padding:u}),Gre({arrowWidth:A,arrowHeight:L}),v&&Vre(X?{strategy:"referenceHidden",...Q}:{strategy:"referenceHidden",padding:Q.padding,altBoundary:Q.altBoundary})]}),K=S.setPlacementState;Ts(()=>(K(oe),()=>{K(void 0)}),[oe,K]);const[D,q]=Hg(oe),fe=Sc(w);Ts(()=>{U&&(fe==null||fe())},[U,fe]);const ae=(pe=J.arrow)==null?void 0:pe.x,ce=(Le=J.arrow)==null?void 0:Le.y,he=((Ae=J.arrow)==null?void 0:Ae.centerOffset)!==0,[ke,ge]=g.useState();return Ts(()=>{E&&ge(window.getComputedStyle(E).zIndex)},[E]),P.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:U?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[(Ne=J.transformOrigin)==null?void 0:Ne.x,(Et=J.transformOrigin)==null?void 0:Et.y].join(" "),...((dn=J.hide)==null?void 0:dn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:P.jsx(Kre,{scope:r,placedSide:D,placedAlign:q,onArrowChange:O,arrowX:ae,arrowY:ce,shouldHideArrow:he,children:P.jsx(Qs.div,{"data-side":D,"data-align":q,...b,ref:R,style:{...b.style,animation:U?(sn=b.style)==null?void 0:sn.animation:"none"}})})})},"PopperContent"));function I5(e){return e!==null}il(I5,"isNotNull");var Gre=il(e=>({name:"transformOrigin",options:e,fn(t){var b,S,E;const{placement:n,rects:r,middlewareData:s}=t,o=((b=s.arrow)==null?void 0:b.centerOffset)!==0,c=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[d,f]=Hg(n),p={start:"0%",center:"50%",end:"100%"}[f],m=(((S=s.arrow)==null?void 0:S.x)??0)+c/2,v=(((E=s.arrow)==null?void 0:E.y)??0)+u/2;let _="",w="";return d==="bottom"?(_=o?p:`${m}px`,w=`${-u}px`):d==="top"?(_=o?p:`${m}px`,w=`${r.floating.height+u}px`):d==="right"?(_=`${-u}px`,w=o?p:`${v}px`):d==="left"&&(_=`${r.floating.width+u}px`,w=o?p:`${v}px`),{data:{x:_,y:w}}}}),"transformOrigin");function Hg(e){const[t,n="center"]=e.split("-");return[t,n]}il(Hg,"getSideAndAlignFromPlacement");var qre=Object.defineProperty,Yre=(e,t)=>qre(e,"name",{value:t,configurable:!0}),Mx=g.forwardRef(Yre(function(t,n){var u;const{container:r,...s}=t,[i,o]=g.useState(!1);Ts(()=>o(!0),[]);const c=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?Cd.createPortal(P.jsx(Qs.div,{...s,ref:n}),c):null},"Portal")),Xre=Object.defineProperty,oa=(e,t)=>Xre(e,"name",{value:t,configurable:!0});function O5(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}oa(O5,"useStateMachine");var Pc=oa(e=>{const{present:t,children:n}=e,r=M5(t),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=L5(r.ref,$5(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null},"Presence");function M5(e){const[t,n]=g.useState(),r=g.useRef(null),s=g.useRef(e),i=g.useRef("none"),o=g.useRef(void 0),c=e?"mounted":"unmounted",[u,d]=O5(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{u==="mounted"?(i.current=o.current??vu(r.current),o.current=void 0):i.current="none"},[u]),Ts(()=>{const f=r.current,p=s.current;if(p!==e){const v=i.current,_=vu(f);e?(o.current=_,d("MOUNT")):_==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&v!==_?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),Ts(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=oa(_=>{const b=vu(r.current).includes(CSS.escape(_.animationName));if(_.target===t&&b&&(d("ANIMATION_END"),!s.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},"handleAnimationEnd"),v=oa(_=>{_.target===t&&(i.current=vu(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:g.useCallback(f=>{if(f){const p=getComputedStyle(f);r.current=p,o.current=vu(p)}else r.current=null;n(f)},[])}}oa(M5,"usePresence");function S2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}oa(S2,"setRef");function L5(...e){const t=g.useRef(e);return t.current=e,g.useCallback(n=>{const r=t.current;let s=!1;const i=r.map(o=>{const c=S2(o,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let o=0;o<i.length;o++){const c=i[o];typeof c=="function"?c():S2(r[o],null)}}},[])}oa(L5,"useStableComposedRefs");function vu(e){return(e==null?void 0:e.animationName)||"none"}oa(vu,"getAnimationName");function $5(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}oa($5,"getElementRef");var Qre=Object.defineProperty,Jre=(e,t)=>Qre(e,"name",{value:t,configurable:!0}),NR=_d[" useEffectEvent ".trim().toString()],DR=_d[" useInsertionEffect ".trim().toString()];function N5(e){if(typeof NR=="function")return NR(e);const t=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof DR=="function"?DR(()=>{t.current=e}):Ts(()=>{t.current=e}),g.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Jre(N5,"useEffectEvent");var ese=Object.defineProperty,qh=(e,t)=>ese(e,"name",{value:t,configurable:!0}),tse=_d[" useInsertionEffect ".trim().toString()]||Ts;function Ug({prop:e,defaultProp:t,onChange:n=qh(()=>{},"onChange"),caller:r}){const[s,i,o]=D5({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:s,d=g.useCallback(f=>{var p;if(c){const m=F5(f)?f(e):f;m!==e&&((p=o.current)==null||p.call(o,m))}else i(f)},[c,e,i,o]);return[u,d]}qh(Ug,"useControllableState");function D5({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),s=g.useRef(n),i=g.useRef(t);return tse(()=>{i.current=t},[t]),g.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}qh(D5,"useUncontrolledState");function F5(e){return typeof e=="function"}qh(F5,"isFunction");var FR=Symbol("RADIX:SYNC_STATE");function nse(e,t,n,r){const{prop:s,defaultProp:i,onChange:o,caller:c}=t,u=s!==void 0,d=N5(o),f=[{...n,state:i}];r&&f.push(r);const[p,m]=g.useReducer((b,S)=>{if(S.type===FR)return{...b,state:S.state};const E=e(b,S);return u&&!Object.is(E.state,b.state)&&d(E.state),E},...f),v=p.state,_=g.useRef(v);g.useEffect(()=>{_.current!==v&&(_.current=v,u||d(v))},[v,_,u]);const w=g.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return g.useEffect(()=>{u&&!Object.is(s,p.state)&&m({type:FR,state:s})},[s,p.state,u]),[w,m]}qh(nse,"useControllableStateReducer");var rse=Object.defineProperty,sse=(e,t)=>rse(e,"name",{value:t,configurable:!0}),ise=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"}),ose=g.forwardRef(sse(function(t,n){return P.jsx(Qs.span,{...t,ref:n,style:{...ise,...t.style}})},"VisuallyHidden")),ase=Object.defineProperty,gr=(e,t)=>ase(e,"name",{value:t,configurable:!0}),[Lx,Sue]=Gh("Tooltip",[zg]),$x=zg(),lse="TooltipProvider",cse=700,E2="tooltip.open",[use,Nx]=Lx(lse),dse=gr(e=>{const{__scopeTooltip:t,delayDuration:n=cse,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,o=g.useRef(!0),c=g.useRef(!1),u=g.useRef(0);return g.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),P.jsx(use,{scope:t,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:c,onPointerInTransitChange:g.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),k2="Tooltip",[fse,Yh]=Lx(k2),hse=gr(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,u=Nx(k2,e.__scopeTooltip),d=$x(t),[f,p]=g.useState(null),[m,v]=g.useState(void 0),_=sl(),w=g.useRef(0),b=o??u.disableHoverableContent,S=c??u.delayDuration,E=g.useRef(!1),[C,R]=Ug({prop:r,defaultProp:s??!1,onChange:gr(V=>{V?(u.onOpen(),document.dispatchEvent(new CustomEvent(E2))):u.onClose(),i==null||i(V)},"onChange"),caller:k2}),T=g.useMemo(()=>C?E.current?"delayed-open":"instant-open":"closed",[C]),O=g.useCallback(()=>{window.clearTimeout(w.current),w.current=0,E.current=!1,R(!0)},[R]),M=g.useCallback(()=>{window.clearTimeout(w.current),w.current=0,R(!1)},[R]),A=g.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{E.current=!0,R(!0),w.current=0},S)},[S,R]);g.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]);const L=m??_;return P.jsx(P5,{...d,children:P.jsx(fse,{scope:t,contentId:L,setContentId:v,open:C,stateAttribute:T,trigger:f,onTriggerChange:p,onTriggerEnter:g.useCallback(()=>{u.isOpenDelayedRef.current?A():O()},[u.isOpenDelayedRef,A,O]),onTriggerLeave:g.useCallback(()=>{b?M():(window.clearTimeout(w.current),w.current=0)},[M,b]),onOpen:O,onClose:M,disableHoverableContent:b,children:n})})},"Tooltip"),jR="TooltipTrigger",pse=g.forwardRef(gr(function(t,n){const{__scopeTooltip:r,"aria-describedby":s,...i}=t,o=Yh(jR,r),c=Nx(jR,r),u=$x(r),d=g.useRef(null),f=ps(n,d,o.onTriggerChange),p=g.useRef(!1),m=g.useRef(!1),v=g.useCallback(()=>p.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),P.jsx(R5,{asChild:!0,...u,children:P.jsx(Qs.button,{"aria-describedby":o.open?K5(s,o.contentId):s,"data-state":o.stateAttribute,...i,ref:f,onPointerMove:mr(t.onPointerMove,_=>{_.pointerType!=="touch"&&!m.current&&!c.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:mr(t.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:mr(t.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:mr(t.onFocus,()=>{p.current||o.onOpen()}),onBlur:mr(t.onBlur,o.onClose),onClick:mr(t.onClick,o.onClose)})})},"TooltipTrigger")),j5="TooltipPortal",[mse,gse]=Lx(j5,{forceMount:void 0}),vse=gr(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=Yh(j5,t);return P.jsx(mse,{scope:t,forceMount:n,children:P.jsx(Pc,{present:n||i.open,children:P.jsx(Mx,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),Ph="TooltipContent",yse=g.forwardRef(gr(function(t,n){const r=gse(Ph,t.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=t,c=Yh(Ph,t.__scopeTooltip);return P.jsx(Pc,{present:s||c.open,children:c.disableHoverableContent?P.jsx(V5,{side:i,...o,ref:n}):P.jsx(_se,{side:i,...o,ref:n})})},"TooltipContent")),_se=g.forwardRef(gr(function(t,n){const r=Yh(Ph,t.__scopeTooltip),s=Nx(Ph,t.__scopeTooltip),i=g.useRef(null),o=ps(n,i),[c,u]=g.useState(null),{trigger:d,onClose:f}=r,p=i.current,{onPointerInTransitChange:m}=s,v=g.useCallback(()=>{u(null),m(!1)},[m]),_=g.useCallback((w,b)=>{const S=w.currentTarget,E={x:w.clientX,y:w.clientY},C=z5(E,S.getBoundingClientRect()),R=H5(E,C),T=U5(b.getBoundingClientRect()),O=B5([...R,...T]);u(O),m(!0)},[m]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(d&&p){const w=gr(S=>_(S,p),"handleTriggerLeave"),b=gr(S=>_(S,d),"handleContentLeave");return d.addEventListener("pointerleave",w),p.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",w),p.removeEventListener("pointerleave",b)}}},[d,p,_,v]),g.useEffect(()=>{if(c){const w=gr(b=>{const S=b.target,E={x:b.clientX,y:b.clientY},C=(d==null?void 0:d.contains(S))||(p==null?void 0:p.contains(S)),R=!Z5(E,c);C?v():R&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,p,c,f,v]),P.jsx(V5,{...t,ref:o})},"TooltipContentHoverable")),wse=W$("TooltipContent"),V5=g.forwardRef(gr(function(t,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:c,onPointerDownOutside:u,...d}=t,f=Yh(Ph,r),p=$x(r),{onClose:m}=f,[v,_]=g.useState(null),w=ps(n,_);kx(v),g.useEffect(()=>(document.addEventListener(E2,m),()=>document.removeEventListener(E2,m)),[m]),g.useEffect(()=>{if(f.trigger){const S=gr(E=>{E.target instanceof Node&&E.target.contains(f.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[f.trigger,m]);const{setContentId:b}=f;return Ts(()=>(b(o),()=>{b(void 0)}),[o,b]),P.jsx(bx,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:S=>S.preventDefault(),onDismiss:m,children:P.jsxs(A5,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...p,...d,ref:w,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:[P.jsx(wse,{children:s}),i?P.jsx(ose,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function z5(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.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")}}gr(z5,"getExitSideFromRect");function H5(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}gr(H5,"getPaddedExitPoints");function U5(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}gr(U5,"getPointsFromRect");function Z5(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],u=t[o],d=c.x,f=c.y,p=u.x,m=u.y;f>r!=m>r&&n<(p-d)*(r-f)/(m-f)+d&&(s=!s)}return s}gr(Z5,"isPointInPolygon");function B5(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),W5(t)}gr(B5,"getHull");function W5(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[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(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}gr(W5,"getHullPresorted");function K5(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}gr(K5,"concatAriaDescribedby");const bse={medium:"'wght' 450"},ug={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:0},slow:{type:"spring",duration:.24,bounce:.12}},G5=g.createContext(null);function xse({value:e,children:t}){return P.jsx(G5.Provider,{value:e,children:t})}function Sse(e){switch(e){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function q5({content:e,children:t,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:c}){const[u,d]=g.useState(!1),f=o!==void 0?o:u,[p,m]=g.useState(!1),v=g.useContext(G5);g.useEffect(()=>{f&&m(!0)},[f]);const _=()=>{f||m(!1)},w=Sse(n);return P.jsx(dse,{delayDuration:s,children:P.jsxs(hse,{open:f,onOpenChange:b=>{d(b),c==null||c(b)},children:[P.jsx(pse,{asChild:!0,children:t}),p&&P.jsx(vse,{forceMount:!0,container:v??void 0,children:P.jsx(yse,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:P.jsx(Jo.div,{className:ir("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg","rounded-lg",i),style:{fontVariationSettings:bse.medium},initial:{opacity:0,scale:.8,...w},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?ug.slow:{duration:.1},onAnimationComplete:_,children:e})})})]})})}const Rr=g.forwardRef(({title:e,shortcut:t,...n},r)=>{const s=P.jsx(j$,{ref:r,...n});return e?P.jsx(q5,{content:P.jsxs("div",{className:"flex flex-row items-center gap-2",children:[P.jsx("span",{children:e}),t?P.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:t}):null]}),children:s}):s});Rr.displayName="Button";var Ese=Object.defineProperty,Dx=(e,t)=>Ese(e,"name",{value:t,configurable:!0}),Rm=0,to=null;function kse(e){return Zg(),e.children}Dx(kse,"FocusGuards");function Zg(){g.useEffect(()=>{to||(to={start:C2(),end:C2()});const{start:e,end:t}=to;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Rm++,()=>{Rm===1&&(to==null||to.start.remove(),to==null||to.end.remove(),to=null),Rm=Math.max(0,Rm-1)}},[])}Dx(Zg,"useFocusGuards");function C2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Dx(C2,"createFocusGuard");var uo=function(){return uo=Object.assign||function(t){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)&&(t[i]=n[i])}return t},uo.apply(this,arguments)};function Y5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Cse(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var i0="right-scroll-bar-position",o0="width-before-scroll-bar",Pse="with-scroll-bars-hidden",Rse="--removed-body-scroll-bar-size";function i_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Tse(e,t){var n=g.useState(function(){return{value:e,callback:t,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=t,n.facade}var Ase=typeof window<"u"?g.useLayoutEffect:g.useEffect,VR=new WeakMap;function Ise(e,t){var n=Tse(null,function(r){return e.forEach(function(s){return i_(s,r)})});return Ase(function(){var r=VR.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;s.forEach(function(c){i.has(c)||i_(c,null)}),i.forEach(function(c){s.has(c)||i_(c,o)})}VR.set(n,e)},[e]),n}function Ose(e){return e}function Mse(e,t){t===void 0&&(t=Ose);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]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var c=n;n=[],c.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 Lse(e){e===void 0&&(e={});var t=Mse(null);return t.options=uo({async:!0,ssr:!1},e),t}var X5=function(e){var t=e.sideCar,n=Y5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,uo({},n))};X5.isSideCarExport=!0;function $se(e,t){return e.useMedium(t),X5}var Q5=Lse(),o_=function(){},Bg=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:o_,onWheelCapture:o_,onTouchMoveCapture:o_}),s=r[0],i=r[1],o=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,m=e.sideCar,v=e.noRelative,_=e.noIsolation,w=e.inert,b=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,C=e.gapMode,R=Y5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=m,O=Ise([n,t]),M=uo(uo({},R),s);return g.createElement(g.Fragment,null,f&&g.createElement(T,{sideCar:Q5,removeScrollBar:d,shards:p,noRelative:v,noIsolation:_,inert:w,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:C}),o?g.cloneElement(g.Children.only(c),uo(uo({},M),{ref:O})):g.createElement(E,uo({},M,{className:u,ref:O}),c))});Bg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bg.classNames={fullWidth:o0,zeroRight:i0};var Nse=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Dse(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nse();return t&&e.setAttribute("nonce",t),e}function Fse(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jse(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Vse=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Dse())&&(Fse(t,n),jse(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zse=function(){var e=Vse();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},J5=function(){var e=zse(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Hse={left:0,top:0,right:0,gap:0},a_=function(e){return parseInt(e||"",10)||0},Use=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[a_(n),a_(r),a_(s)]},Zse=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Hse;var t=Use(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Bse=J5(),Mu="data-scroll-locked",Wse=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
130
|
+
.`.concat(Pse,` {
|
|
131
|
+
overflow: hidden `).concat(r,`;
|
|
132
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
133
|
+
}
|
|
134
|
+
body[`).concat(Mu,`] {
|
|
135
|
+
overflow: hidden `).concat(r,`;
|
|
136
|
+
overscroll-behavior: contain;
|
|
137
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
138
|
+
padding-left: `.concat(s,`px;
|
|
139
|
+
padding-top: `).concat(i,`px;
|
|
140
|
+
padding-right: `).concat(o,`px;
|
|
141
|
+
margin-left:0;
|
|
142
|
+
margin-top:0;
|
|
143
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
144
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.`).concat(i0,` {
|
|
148
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.`).concat(o0,` {
|
|
152
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.`).concat(i0," .").concat(i0,` {
|
|
156
|
+
right: 0 `).concat(r,`;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.`).concat(o0," .").concat(o0,` {
|
|
160
|
+
margin-right: 0 `).concat(r,`;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
body[`).concat(Mu,`] {
|
|
164
|
+
`).concat(Rse,": ").concat(c,`px;
|
|
165
|
+
}
|
|
166
|
+
`)},zR=function(){var e=parseInt(document.body.getAttribute(Mu)||"0",10);return isFinite(e)?e:0},Kse=function(){g.useEffect(function(){return document.body.setAttribute(Mu,(zR()+1).toString()),function(){var e=zR()-1;e<=0?document.body.removeAttribute(Mu):document.body.setAttribute(Mu,e.toString())}},[])},Gse=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Kse();var i=g.useMemo(function(){return Zse(s)},[s]);return g.createElement(Bse,{styles:Wse(i,!t,s,n?"":"!important")})},P2=!1;if(typeof window<"u")try{var Tm=Object.defineProperty({},"passive",{get:function(){return P2=!0,!0}});window.addEventListener("test",Tm,Tm),window.removeEventListener("test",Tm,Tm)}catch{P2=!1}var uu=P2?{passive:!1}:!1,qse=function(e){return e.tagName==="TEXTAREA"},eN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!qse(e)&&n[t]==="visible")},Yse=function(e){return eN(e,"overflowY")},Xse=function(e){return eN(e,"overflowX")},HR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=tN(e,r);if(s){var i=nN(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qse=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Jse=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},tN=function(e,t){return e==="v"?Yse(t):Xse(t)},nN=function(e,t){return e==="v"?Qse(t):Jse(t)},eie=function(e,t){return e==="h"&&t==="rtl"?-1:1},tie=function(e,t,n,r,s){var i=eie(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,u=t.contains(c),d=!1,f=o>0,p=0,m=0;do{if(!c)break;var v=nN(e,c),_=v[0],w=v[1],b=v[2],S=w-b-i*_;(_||S)&&tN(e,c)&&(p+=S,m+=_);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(p)<1||!f&&Math.abs(m)<1)&&(d=!0),d},Am=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},UR=function(e){return[e.deltaX,e.deltaY]},ZR=function(e){return e&&"current"in e?e.current:e},nie=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rie=function(e){return`
|
|
167
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
168
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
169
|
+
`)},sie=0,du=[];function iie(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(sie++)[0],i=g.useState(J5)[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=Cse([e.lockRef.current],(e.shards||[]).map(ZR),!0).filter(Boolean);return w.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=g.useCallback(function(w,b){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var S=Am(w),E=n.current,C="deltaX"in w?w.deltaX:E[0]-S[0],R="deltaY"in w?w.deltaY:E[1]-S[1],T,O=w.target,M=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in w&&M==="h"&&O.type==="range")return!1;var A=window.getSelection(),L=A&&A.anchorNode,V=L?L===O||L.contains(O):!1;if(V)return!1;var W=HR(M,O);if(!W)return!0;if(W?T=M:(T=M==="v"?"h":"v",W=HR(M,O)),!W)return!1;if(!r.current&&"changedTouches"in w&&(C||R)&&(r.current=T),!T)return!0;var z=r.current||T;return tie(z,b,w,z==="h"?C:R)},[]),u=g.useCallback(function(w){var b=w;if(!(!du.length||du[du.length-1]!==i)){var S="deltaY"in b?UR(b):Am(b),E=t.current.filter(function(T){return T.name===b.type&&(T.target===b.target||b.target===T.shadowParent)&&nie(T.delta,S)})[0];if(E&&E.should){b.cancelable&&b.preventDefault();return}if(!E){var C=(o.current.shards||[]).map(ZR).filter(Boolean).filter(function(T){return T.contains(b.target)}),R=C.length>0?c(b,C[0]):!o.current.noIsolation;R&&b.cancelable&&b.preventDefault()}}},[]),d=g.useCallback(function(w,b,S,E){var C={name:w,delta:b,target:S,should:E,shadowParent:oie(S)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),f=g.useCallback(function(w){n.current=Am(w),r.current=void 0},[]),p=g.useCallback(function(w){d(w.type,UR(w),w.target,c(w,e.lockRef.current))},[]),m=g.useCallback(function(w){d(w.type,Am(w),w.target,c(w,e.lockRef.current))},[]);g.useEffect(function(){return du.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,uu),document.addEventListener("touchmove",u,uu),document.addEventListener("touchstart",f,uu),function(){du=du.filter(function(w){return w!==i}),document.removeEventListener("wheel",u,uu),document.removeEventListener("touchmove",u,uu),document.removeEventListener("touchstart",f,uu)}},[]);var v=e.removeScrollBar,_=e.inert;return g.createElement(g.Fragment,null,_?g.createElement(i,{styles:rie(s)}):null,v?g.createElement(Gse,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function oie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const aie=$se(Q5,iie);var Fx=g.forwardRef(function(e,t){return g.createElement(Bg,uo({},e,{ref:t,sideCar:aie}))});Fx.classNames=Bg.classNames;var lie=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fu=new WeakMap,Im=new WeakMap,Om={},l_=0,rN=function(e){return e&&(e.host||rN(e.parentNode))},cie=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=rN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},uie=function(e,t,n,r){var s=cie(t,Array.isArray(e)?e:[e]);Om[n]||(Om[n]=new WeakMap);var i=Om[n],o=[],c=new Set,u=new Set(s),d=function(p){!p||c.has(p)||(c.add(p),d(p.parentNode))};s.forEach(d);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(m){if(c.has(m))f(m);else try{var v=m.getAttribute(r),_=v!==null&&v!=="false",w=(fu.get(m)||0)+1,b=(i.get(m)||0)+1;fu.set(m,w),i.set(m,b),o.push(m),w===1&&_&&Im.set(m,!0),b===1&&m.setAttribute(n,"true"),_||m.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return f(t),c.clear(),l_++,function(){o.forEach(function(p){var m=fu.get(p)-1,v=i.get(p)-1;fu.set(p,m),i.set(p,v),m||(Im.has(p)||p.removeAttribute(r),Im.delete(p)),v||p.removeAttribute(n)}),l_--,l_||(fu=new WeakMap,fu=new WeakMap,Im=new WeakMap,Om={})}},sN=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=lie(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),uie(r,s,n,"aria-hidden")):function(){return null}},die=Object.defineProperty,Ms=(e,t)=>die(e,"name",{value:t,configurable:!0}),jx="Dialog",[iN,Eue]=Gh(jx),[fie,zi]=iN(jx),hie=Ms(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,c=g.useRef(null),u=g.useRef(null),{nodes:d,registry:f}=Ex(),[p,m]=Ug({prop:r,defaultProp:s??!1,onChange:i,caller:jx}),[v,_]=g.useState(0),[w,b]=g.useState(0);return P.jsx(fie,{scope:t,triggerRef:c,contentRef:u,contentId:sl(),titleId:sl(),descriptionId:sl(),titlePresent:v>0,descriptionPresent:w>0,setTitleCount:_,setDescriptionCount:b,open:p,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(S=>!S),[m]),modal:o,branchNodes:d,branchRegistry:f,children:n})},"Dialog"),pie="DialogTrigger",mie=g.forwardRef(Ms(function(t,n){const{__scopeDialog:r,...s}=t,i=zi(pie,r),o=ps(n,i.triggerRef);return P.jsx(Qs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Wg(i.open),...s,ref:o,onClick:mr(t.onClick,i.onOpenToggle)})},"DialogTrigger")),oN="DialogPortal",[gie,aN]=iN(oN,{forceMount:void 0}),vie=Ms(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=zi(oN,t);return P.jsx(gie,{scope:t,forceMount:n,children:g.Children.map(r,o=>P.jsx(Pc,{present:n||i.open,children:P.jsx(Mx,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),R2="DialogOverlay",yie=g.forwardRef(Ms(function(t,n){const r=aN(R2,t.__scopeDialog),{forceMount:s=r.forceMount,...i}=t,o=zi(R2,t.__scopeDialog);return o.modal?P.jsx(Pc,{present:s||o.open,children:P.jsx(wie,{...i,ref:n})}):null},"DialogOverlay")),_ie=$g("DialogOverlay.RemoveScroll"),wie=g.forwardRef(Ms(function(t,n){const{__scopeDialog:r,...s}=t,i=zi(R2,r),o=t5(),c=ps(n,o);return P.jsx(Fx,{as:_ie,allowPinchZoom:!0,shards:g.useMemo(()=>[i.contentRef,...i.branchNodes.map(u=>({current:u}))],[i.contentRef,i.branchNodes]),children:P.jsx(Qs.div,{"data-state":Wg(i.open),...s,ref:c,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Rh="DialogContent",bie=g.forwardRef(Ms(function(t,n){const r=aN(Rh,t.__scopeDialog),{forceMount:s=r.forceMount,...i}=t,o=zi(Rh,t.__scopeDialog);return P.jsx(Pc,{present:s||o.open,children:o.modal?P.jsx(xie,{...i,ref:n}):P.jsx(Sie,{...i,ref:n})})},"DialogContent")),xie=g.forwardRef(Ms(function(t,n){const r=zi(Rh,t.__scopeDialog),s=g.useRef(null),i=ps(n,r.contentRef,s);return g.useEffect(()=>{const o=s.current;if(o)return sN(o)},[]),P.jsx(lN,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:mr(t.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:mr(t.onPointerDownOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&o.preventDefault()}),onFocusOutside:mr(t.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),Sie=g.forwardRef(Ms(function(t,n){const r=zi(Rh,t.__scopeDialog),s=g.useRef(!1),i=g.useRef(!1);return P.jsx(lN,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,u;(c=t.onCloseAutoFocus)==null||c.call(t,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=t.onInteractOutside)==null||d.call(t,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),lN=g.forwardRef(Ms(function(t,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,"aria-describedby":c,children:u,...d}=t,f=zi(Rh,r);return Zg(),P.jsx(Sx,{registry:f.branchRegistry,children:P.jsx(s5,{asChild:!0,loop:!0,trapped:s,branches:f.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:o,children:P.jsx(bx,{role:"dialog",id:f.contentId,"aria-labelledby":f.titlePresent?f.titleId:void 0,"aria-describedby":f.descriptionPresent?uN(c,f.descriptionId):c,"data-state":Wg(f.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1),children:u})})})},"DialogContentImpl")),cN=g.forwardRef(Ms(function(t,n){const{__scopeDialog:r,...s}=t,i=zi("DialogTitle",r),{setTitleCount:o}=i;return Ts(()=>(o(c=>c+1),()=>o(c=>c-1)),[o]),P.jsx(Qs.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),Eie=g.forwardRef(Ms(function(t,n){const{__scopeDialog:r,...s}=t,i=zi("DialogDescription",r),{setDescriptionCount:o}=i;return Ts(()=>(o(c=>c+1),()=>o(c=>c-1)),[o]),P.jsx(Qs.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),kie="DialogClose",Cie=g.forwardRef(Ms(function(t,n){const{__scopeDialog:r,...s}=t,i=zi(kie,r);return P.jsx(Qs.button,{type:"button",...s,ref:n,onClick:mr(t.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function uN(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Ms(uN,"concatAriaDescribedby");function Wg(e){return e?"open":"closed"}Ms(Wg,"getState");const BR="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",Pie={editor:{overlay:"z-max fixed inset-0 bg-black/40",content:`z-max border-surface-2 bg-background font-main ${BR} rounded-lg border shadow-2xl outline-none`},library:{overlay:"z-modal fixed inset-0 bg-black/60",content:`bg-surface-2 text-foreground z-ui-secondary ${BR} rounded-xl p-6 shadow-lg forced-colors:border`},librarySheet:{overlay:"fixed inset-0 z-50 bg-black/55",content:"bg-background text-foreground fixed inset-y-0 right-0 z-50 flex flex-col border-l border-white/10 shadow-2xl outline-none"}},Rie="bg-black/60",dN=g.createContext(null),WR=()=>document.activeElement===document.body?null:document.activeElement,Kg=e=>{const t=e.open===!0,[n,r]=g.useState(()=>({isOpen:t,opener:t?WR():null}));return n.isOpen!==t&&r({isOpen:t,opener:t?WR():n.opener}),P.jsx(dN.Provider,{value:n.opener,children:P.jsx(hie,{...e})})},kue=mie,Cue=Cie,Tie=cN,Gg=Eie,qg=({surface:e="editor",isStacked:t=!1,className:n,children:r,onCloseAutoFocus:s,...i})=>{const[o,c]=g.useState(null),u=g.useContext(dN),d=Pie[e],f=p=>{s==null||s(p),!p.defaultPrevented&&(!(u instanceof HTMLElement)||!u.isConnected||(p.preventDefault(),u.focus()))};return P.jsxs(vie,{children:[P.jsx(yie,{className:ir(d.overlay,t&&Rie)}),P.jsx(bie,{...i,onCloseAutoFocus:f,ref:c,className:ir(d.content,n),children:P.jsx(xse,{value:o,children:r})})]})},Vx=({children:e,onClose:t,isCloseDisabled:n=!1})=>P.jsxs("div",{className:"border-surface-2 bg-card flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[P.jsx(cN,{className:"text-foreground text-base font-medium",children:e}),P.jsx(Rr,{onClick:t,disabled:n,"aria-label":"Close",variant:"ghost",size:"icon-compact",children:P.jsx(b$,{className:"h-4 w-4",weight:"bold"})})]}),Aie="bg-destructive/15 text-destructive hover:bg-destructive/25 hover:text-destructive focus-visible:bg-destructive/25 focus-visible:text-destructive",Iie=e=>e.kind==="active"?e.variant.label.trim()||"this direction":e.kind==="run"?e.label.trim()||"this run":e.entry.label.trim()||"this direction",Oie=({target:e,fallbackFocus:t,isConfirming:n,onCancel:r,onConfirm:s})=>{if(!e)return null;const i=Iie(e),o=e.kind==="run",c=o?e.variants.length+e.entries.length:0,u=o?"Remove run":"Remove direction";return P.jsx(Kg,{open:!0,onOpenChange:d=>{!d&&!n&&r()},children:P.jsx(qg,{className:"w-[360px]",onCloseAutoFocus:d=>{const f=[e.returnFocusTo,t==null?void 0:t.current].find(p=>p==null?void 0:p.isConnected);f&&(d.preventDefault(),f.focus())},children:P.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[P.jsx(Tie,{className:"text-foreground text-base font-medium",children:o?"Remove run?":"Remove direction?"}),P.jsx(Gg,{className:"text-muted-foreground text-sm leading-5",children:o?`This removes all ${c} directions in “${i}”.`:`This removes “${i}” from the directions list.`}),P.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[P.jsx(Rr,{variant:"ghost",onClick:r,disabled:n,children:"Cancel"}),P.jsx(Rr,{variant:"ghost","aria-label":"Confirm remove direction",onClick:s,disabled:n,className:Aie,children:n?"Removing...":u})]})]})})})};var Mie=Object.defineProperty,ca=(e,t)=>Mie(e,"name",{value:t,configurable:!0}),zx="Popover",[fN,Pue]=Gh(zx,[zg]),Hx=zg(),[Lie,Ad]=fN(zx),$ie=ca(e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=e,c=Hx(t),u=g.useRef(null),[d,f]=g.useState(!1),[p,m]=g.useState(0),[v,_]=g.useState(0),[w,b]=Ug({prop:r,defaultProp:s??!1,onChange:i,caller:zx});return P.jsx(P5,{...c,children:P.jsx(Lie,{scope:t,contentId:sl(),titleId:sl(),descriptionId:sl(),titlePresent:p>0,descriptionPresent:v>0,setTitleCount:m,setDescriptionCount:_,triggerRef:u,open:w,onOpenChange:b,onOpenToggle:g.useCallback(()=>b(S=>!S),[b]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>f(!0),[]),onCustomAnchorRemove:g.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),Nie="PopoverTrigger",Die=g.forwardRef(ca(function(t,n){const{__scopePopover:r,...s}=t,i=Ad(Nie,r),o=Hx(r),c=ps(n,i.triggerRef),u=P.jsx(Qs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Ux(i.open),...s,ref:c,onClick:mr(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:P.jsx(R5,{asChild:!0,...o,children:u})},"PopoverTrigger")),hN="PopoverPortal",[Fie,jie]=fN(hN,{forceMount:void 0}),Vie=ca(e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Ad(hN,t);return P.jsx(Fie,{scope:t,forceMount:n,children:P.jsx(Pc,{present:n||i.open,children:P.jsx(Mx,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),Th="PopoverContent",zie=g.forwardRef(ca(function(t,n){const r=jie(Th,t.__scopePopover),{forceMount:s=r.forceMount,...i}=t,o=Ad(Th,t.__scopePopover);return P.jsx(Pc,{present:s||o.open,children:o.modal?P.jsx(Uie,{...i,ref:n}):P.jsx(Zie,{...i,ref:n})})},"PopoverContent")),Hie=$g("PopoverContent.RemoveScroll"),Uie=g.forwardRef(ca(function(t,n){const r=Ad(Th,t.__scopePopover),s=g.useRef(null),i=ps(n,s),o=g.useRef(!1),{nodes:c,registry:u}=Ex();return g.useEffect(()=>{const d=s.current;if(d)return sN(d)},[]),P.jsx(Fx,{as:Hie,allowPinchZoom:!0,shards:g.useMemo(()=>[s,...c.map(d=>({current:d}))],[s,c]),children:P.jsx(pN,{...t,ref:i,branchNodes:c,branchRegistry:u,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:mr(t.onCloseAutoFocus,d=>{var f;d.preventDefault(),o.current||(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:mr(t.onPointerDownOutside,d=>{const f=d.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0,m=f.button===2||p;o.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:mr(t.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Zie=g.forwardRef(ca(function(t,n){const r=Ad(Th,t.__scopePopover),s=g.useRef(!1),i=g.useRef(!1);return P.jsx(pN,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,u;(c=t.onCloseAutoFocus)==null||c.call(t,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=t.onInteractOutside)==null||d.call(t,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"PopoverContentNonModal")),pN=g.forwardRef(ca(function(t,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,"aria-describedby":m,branchNodes:v,branchRegistry:_,...w}=t,b=Ad(Th,r),S=Hx(r),[E,C]=g.useState(null),R=ps(n,C);return kx(E),Zg(),P.jsx(Sx,{registry:_,children:P.jsx(s5,{asChild:!0,loop:!0,trapped:s,branches:v,onMountAutoFocus:i,onUnmountAutoFocus:o,children:P.jsx(bx,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),deferPointerDownOutside:!0,children:P.jsx(A5,{"data-state":Ux(b.open),role:"dialog",id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?mN(m,b.descriptionId):m,...S,...w,ref:R,style:{...w.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 Ux(e){return e?"open":"closed"}ca(Ux,"getState");function mN(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}ca(mN,"concatAriaDescribedby");const Ah=e=>{const t=g.useRef(e);return g.useLayoutEffect(()=>{t.current=e}),t};let a0=0;const Bie=()=>{a0+=1;let e=!1;return()=>{e||(e=!0,a0=Math.max(0,a0-1))}},Wie=()=>a0>0,Kie='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',Gie=({itemSelector:e=Kie,loop:t=!1,onDismiss:n}={})=>{const r=g.useRef(null),s=g.useRef(null),i=Ah(n),o=g.useRef(!1),c=g.useCallback(f=>{var p;if(r.current=f,f){o.current=!1;const m=Bie(),v=f.ownerDocument.defaultView;let _;const w=()=>{v==null||v.clearTimeout(_),_=v==null?void 0:v.setTimeout(()=>{const b=f.ownerDocument.activeElement;(b==null?void 0:b.tagName)==="IFRAME"&&!f.contains(b)&&i.current&&(o.current=!0,i.current())})};v==null||v.addEventListener("blur",w),s.current=()=>{v==null||v.removeEventListener("blur",w),v==null||v.clearTimeout(_),m()}}else(p=s.current)==null||p.call(s),s.current=null},[i]),u=f=>{o.current&&f.preventDefault()},d=g.useCallback(f=>{var E;const{key:p}=f;if(p!=="ArrowDown"&&p!=="ArrowUp"&&p!=="Home"&&p!=="End")return;const m=r.current;if(!m)return;const v=Array.from(m.querySelectorAll(e));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const _=v.indexOf(document.activeElement),w=v.length-1,b=C=>{if(_===-1)return C===1?0:w;const R=_+C;return t?(R+v.length)%v.length:Math.min(Math.max(R,0),w)};let S;p==="Home"?S=0:p==="End"?S=w:p==="ArrowDown"?S=b(1):S=b(-1),(E=v[S])==null||E.focus()},[e,t]);return{containerRef:c,onKeyDown:d,onCloseAutoFocus:u}},qie="bg-popover text-popover-foreground shadow-surface-4 z-max min-w-40 rounded-lg p-1",Yie="text-soft-foreground hover:bg-hover hover:text-foreground focus-visible:bg-active focus-visible:text-foreground flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-left text-xs outline-hidden transition-colors duration-80 disabled:cursor-not-allowed disabled:opacity-50",Xie=4,Zx=g.createContext(()=>{}),Bx=({isOpen:e,onOpenChange:t,children:n})=>P.jsx(Zx.Provider,{value:t,children:P.jsx($ie,{open:e,onOpenChange:t,children:n})}),Yg=g.forwardRef((e,t)=>P.jsx(Die,{ref:t,...e,"aria-haspopup":"menu"}));Yg.displayName="MenuTrigger";const Wx=({className:e,sideOffset:t=Xie,onCloseAutoFocus:n,...r})=>{const s=g.useContext(Zx),{containerRef:i,onKeyDown:o,onCloseAutoFocus:c}=Gie({onDismiss:()=>s(!1)});return P.jsx(Vie,{children:P.jsx(zie,{...r,sideOffset:t,className:ir(qie,e),ref:i,role:"menu",onKeyDown:o,onCloseAutoFocus:u=>{n==null||n(u),c(u)}})})},ja=g.forwardRef(({className:e,onClick:t,onSelect:n,...r},s)=>{const i=g.useContext(Zx);return P.jsx("button",{ref:s,type:"button",...r,onClick:o=>{t==null||t(o),n&&(i(!1),n())},className:ir(Yie,e),role:"menuitem","data-menu-item":!0})});ja.displayName="MenuItem";const Qie="data-hover-dead-zone";function Jie(e,t={}){const{axis:n="y",snapTolerancePx:r=1/0}=t,s=g.useRef(new Map),[i,o]=g.useState(null),[c,u]=g.useState([]),d=g.useRef([]),f=g.useRef(0),p=g.useRef(null),m=g.useRef(null),v=g.useCallback(()=>{const C=[];return s.current.forEach((R,T)=>{C[T]={top:R.offsetTop,height:R.offsetHeight,left:R.offsetLeft,width:R.offsetWidth}}),C},[]),_=g.useCallback(()=>{if(!e.current)return;const R=v();d.current=R,u(R)},[e,v]),w=g.useCallback((C,R)=>{R?s.current.set(C,R):s.current.delete(C),m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{m.current=null,_()})},[_]),b=g.useCallback(C=>{const R=C.clientX,T=C.clientY,O=C.target instanceof Element&&C.target.closest(`[${Qie}]`)!==null;p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null;const M=e.current;if(!M)return;if(O){o(null);return}const A=v(),L=d.current;(A.length!==L.length||A.some((fe,ae)=>{const ce=L[ae];return!ce||!fe||fe.top!==ce.top||fe.height!==ce.height||fe.left!==ce.left||fe.width!==ce.width}))&&(d.current=A,u(A));const W=M.getBoundingClientRect(),z=n==="x"?R:T;let X=null,Q=1/0,H=null;const Y=d.current,oe=n==="x"?M.scrollLeft:M.scrollTop,U=n==="x"?M.clientLeft:M.clientTop,J=n==="x"?W.left:W.top,K=n==="x"?M.offsetWidth:M.offsetHeight,D=n==="x"?W.width:W.height,q=K>0?D/K:1;for(let fe=0;fe<Y.length;fe++){const ae=Y[fe];if(!ae)continue;const ce=n==="x"?ae.left:ae.top,he=J+(U+ce-oe)*q,ke=(n==="x"?ae.width:ae.height)*q,ge=he+ke;z>=he&&z<=ge&&(H=fe);let pe=0;z<he?pe=he-z:z>ge&&(pe=z-ge),pe<Q&&(Q=pe,X=fe)}o(H??(Q<=r?X:null))})},[n,e,r,v]),S=g.useCallback(()=>{f.current+=1,_()},[_]),E=g.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),o(null)},[]);return g.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current),m.current!==null&&cancelAnimationFrame(m.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:c,sessionRef:f,handlers:{onMouseMove:b,onMouseEnter:S,onMouseLeave:E},registerItem:w,measureItems:_}}function eoe(e,t,n){g.useEffect(()=>(e(t,n.current),()=>e(t,null)),[t,e,n])}const gN=({queryKey:e,data:t})=>{const n=Uh(),[r,s]=g.useState(null),i=r!==null&&r.base===t?r.value:t,o=Ah({queryKey:e,data:t,visible:i}),c=g.useCallback(u=>{const d=o.current,f=u(n.getQueryData(d.queryKey)??d.visible);return n.setQueryData(d.queryKey,f),o.current={...d,visible:f},s({base:d.data,value:f}),f},[n,o]);return{data:i,updateData:c}},T2=["project-library"],KR=[...T2,"history"],GR=["library-project-preview"],qR=["variants-history"],Is={rivetConfig:["rivet-config"],featureFlags:["rivet-feature-flags"],account:["rivet-account"],serverConfig:["server-config"],integrations:["integrations"],cosmosProfile:["cosmos-profile"],previewUpstreamHealth:e=>["preview-upstream-health",e],variantsUiState:e=>["variants-ui-state",e],variantsHistory:{all:qR,list:e=>[...qR,e]},designLibrary:(e,t)=>["design-library",e,t],designReferenceSearch:({profileId:e,revision:t,references:n,search:r,sourceId:s})=>["design-reference-search",e,t,n,r,s],designLibraryImage:({profileId:e,referenceId:t,hash:n})=>["design-library-image",e,t,n],projectLibrary:{all:T2,projects:[...T2,"projects"],histories:KR,history:e=>[...KR,e]},libraryProjectPreview:{project:e=>[...GR,e],thumbnail:(e,t)=>[...GR,e,t]},libraryWorkspace:e=>["library-workspace",e],libraryPreview:({projectId:e,sessionId:t,variantId:n})=>["library-preview",e,t,n]};var l0={exports:{}},toe=l0.exports,YR;function noe(){return YR||(YR=1,(function(e){(function(t,n){e.exports?e.exports=n():t.log=n()})(toe,function(){var t=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 c(w,b){var S=w[b];if(typeof S.bind=="function")return S.bind(w);try{return Function.prototype.bind.call(S,w)}catch{return function(){return Function.prototype.apply.apply(S,[w,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(w){return w==="debug"&&(w="log"),typeof console===n?!1:w==="trace"&&r?u:console[w]!==void 0?c(console,w):console.log!==void 0?c(console,"log"):t}function f(){for(var w=this.getLevel(),b=0;b<s.length;b++){var S=s[b];this[S]=b<w?t:this.methodFactory(S,w,this.name)}if(this.log=this.debug,typeof console===n&&w<this.levels.SILENT)return"No console available for logging"}function p(w){return function(){typeof console!==n&&(f.call(this),this[w].apply(this,arguments))}}function m(w,b,S){return d(w)||p.apply(this,arguments)}function v(w,b){var S=this,E,C,R,T="loglevel";typeof w=="string"?T+=":"+w:typeof w=="symbol"&&(T=void 0);function O(W){var z=(s[W]||"silent").toUpperCase();if(!(typeof window===n||!T)){try{window.localStorage[T]=z;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+z+";"}catch{}}}function M(){var W;if(!(typeof window===n||!T)){try{W=window.localStorage[T]}catch{}if(typeof W===n)try{var z=window.document.cookie,X=encodeURIComponent(T),Q=z.indexOf(X+"=");Q!==-1&&(W=/^([^;]+)/.exec(z.slice(Q+X.length+1))[1])}catch{}return S.levels[W]===void 0&&(W=void 0),W}}function A(){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(W){var z=W;if(typeof z=="string"&&S.levels[z.toUpperCase()]!==void 0&&(z=S.levels[z.toUpperCase()]),typeof z=="number"&&z>=0&&z<=S.levels.SILENT)return z;throw new TypeError("log.setLevel() called with invalid level: "+W)}S.name=w,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=b||m,S.getLevel=function(){return R??C??E},S.setLevel=function(W,z){return R=L(W),z!==!1&&O(R),f.call(S)},S.setDefaultLevel=function(W){C=L(W),M()||S.setLevel(W,!1)},S.resetLevel=function(){R=null,A(),f.call(S)},S.enableAll=function(W){S.setLevel(S.levels.TRACE,W)},S.disableAll=function(W){S.setLevel(S.levels.SILENT,W)},S.rebuild=function(){if(o!==S&&(E=L(o.getLevel())),f.call(S),o===S)for(var W in i)i[W].rebuild()},E=L(o?o.getLevel():"WARN");var V=M();V!=null&&(R=L(V)),f.call(S)}o=new v,o.getLogger=function(b){if(typeof b!="symbol"&&typeof b!="string"||b==="")throw new TypeError("You must supply a name when creating a logger.");var S=i[b];return S||(S=i[b]=new v(b,o.methodFactory)),S};var _=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=_),o},o.getLoggers=function(){return i},o.default=o,o})})(l0)),l0.exports}var roe=noe();const Mi=vg(roe),soe="INFO",ioe=soe.toUpperCase();Mi.setLevel(Mi.levels[ioe]||Mi.levels.INFO);const Ls=e=>{const t=e?`[${e}] `:"";return{trace:(n,...r)=>Mi.trace(`${t}${n}`,...r),debug:(n,...r)=>Mi.debug(`${t}${n}`,...r),info:(n,...r)=>Mi.info(`${t}${n}`,...r),warn:(n,...r)=>Mi.warn(`${t}${n}`,...r),error:(n,...r)=>{Mi.error(`${t}${n}`,...r);try{const i=r.map(c=>Ps(c)).join(" ").slice(0,512),o={source:"ui",error_message:n,service:e??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Xe.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>Mi.info(`${t}API: ${n}`,...r),hook:(n,...r)=>Mi.debug(`${t}Hook: ${n}`,...r),mount:(n,...r)=>Mi.debug(`${t}Mount: ${n}`,...r)}},ooe=Ls("useVariantsHistory"),XR=[],aoe=(e,t)=>e.length===t.length&&e.every((n,r)=>{var i,o;const s=t[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}),loe=({historyQuery:e,snapshotKey:t,isEnabled:n,isListed:r,onLoaded:s})=>{const i=Is.variantsHistory.list({historyQuery:e,snapshotKey:t}),o=Ah(s),c=_o({queryKey:i,queryFn:async({signal:v})=>{let _;try{const b=await Dt(`/api/variants/history${e}`,{credentials:"same-origin",signal:v});if(!b.ok)return p.current;_=((await b.json()).variants??[]).filter(r)}catch(b){return v.aborted||ooe.warn("Failed to load past variants",b),p.current}if(v.aborted)return p.current;o.current(_);const w=p.current;return aoe(w,_)?w:_},enabled:n,placeholderData:mK,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:u,updateData:d}=gN({queryKey:i,data:c.data}),f=u??XR,p=Ah(f),m=g.useCallback(v=>{d(_=>v(_??XR))},[d]);return{pastVariants:f,setPastVariants:m}},QR=Ls("useVariantsUiState"),coe={groups:[],rows:{}},c0={pinned:[],order:coe},Nf="pinned",uoe="top",c_=e=>`rows:${e}`,u_=e=>({projectPath:e,mutations:[],preview:c0}),doe=(e,t)=>t.reduce((n,r)=>r(n),e),vN=e=>e?`/api/variants/ui-state?projectPath=${encodeURIComponent(e)}`:"/api/variants/ui-state",foe=async e=>{const t=await Dt(vN(e));if(!t.ok)throw new Error(`Failed to load variants UI state (${t.status})`);return YW.parse(await t.json()).uiState},hoe=async({projectPath:e,uiState:t})=>{await Dt(vN(e),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:t})})},JR=e=>t=>t.pinned.includes(e)?t:{...t,pinned:[...t.pinned,e]},poe=e=>t=>({...t,pinned:t.pinned.filter(n=>n!==e)}),moe=(e,t)=>n=>{if(e===Nf){const r=new Set(t);return{...n,pinned:[...t,...n.pinned.filter(s=>!r.has(s))]}}return e===uoe?{...n,order:{...n.order,groups:t}}:{...n,order:{...n.order,rows:{...n.order.rows,[e.slice(5)]:t}}}},goe=e=>{const t=Uh(),n=Is.variantsUiState(e),[r,s]=g.useState(()=>u_(e)),i=g.useRef(r),o=g.useCallback(R=>{i.current=R,s(R)},[]),c=g.useCallback(R=>i.current.projectPath===R?i.current:u_(R),[]),{mutate:u}=sM({mutationFn:hoe,onError:R=>{QR.warn("persist failed — arrangement kept for this session only",R)}}),d=_o({queryKey:n,queryFn:async()=>{let R;try{R=await foe(e)}catch(M){throw QR.warn("load failed — arrangement is session-local until reload",M),M}const{mutations:T}=c(e);if(T.length===0)return R;o(u_(e));const O=doe(R,T);return e&&u({projectPath:e,uiState:O}),O},enabled:e!==null,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),{data:f,updateData:p}=gN({queryKey:n,data:d.isSuccess?d.data:void 0}),m=g.useCallback(()=>{var R;return e!==null&&((R=t.getQueryState(Is.variantsUiState(e)))==null?void 0:R.status)==="success"},[e,t]),v=g.useCallback(()=>m()?t.getQueryData(Is.variantsUiState(e))??c0:c(e).preview,[m,e,t,c]),_=g.useCallback(R=>{if(e!==null&&m()){const O=p(M=>R(M??c0));u({projectPath:e,uiState:O});return}const T=c(e);o({projectPath:e,mutations:[...T.mutations,R],preview:R(T.preview)})},[m,u,e,c,o,p]),w=g.useCallback(R=>{const T=!v().pinned.includes(R);_(T?JR(R):poe(R))},[_,v]),b=g.useCallback(R=>{v().pinned.includes(R)||_(JR(R))},[_,v]),S=g.useCallback((R,T)=>{_(moe(R,T))},[_]);let E=c0;f?E=f:r.projectPath===e&&(E=r.preview);const C=g.useMemo(()=>new Set(E.pinned),[E.pinned]);return{pinnedKeys:E.pinned,pinnedKeySet:C,listOrder:E.order,togglePin:w,pinItem:b,reorder:S}},voe=e=>{const{containerRef:t,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=e,[o,c]=g.useState(null),u=g.useCallback(p=>{const m=t.current;return m?Array.from(m.querySelectorAll(`[data-reorder-container="${CSS.escape(p)}"]`)):[]},[t]),d=g.useCallback(p=>{if(!n){o&&c(null);return}const m=t.current;if(!m)return;if(r){const S=m.querySelector(r);if(S){const E=S.getBoundingClientRect();if(p.clientY>=E.top&&p.clientY<=E.bottom){o&&c(null);return}}}if(s){const S=m.querySelector(s),E=S==null?void 0:S.getBoundingClientRect();if(!E||p.clientY<E.top||p.clientY>E.bottom){o&&c(null);return}}const v=u(n.container);if(v.length===0){o&&c(null);return}const _=m.getBoundingClientRect().top;let w=v.length;for(let S=0;S<v.length;S++){const E=v[S].getBoundingClientRect();if(p.clientY<E.top+E.height/2){w=S;break}}let b;w===0?b=v[0].getBoundingClientRect().top-_-1:w===v.length?b=v[v.length-1].getBoundingClientRect().bottom-_:b=(v[w-1].getBoundingClientRect().bottom+v[w].getBoundingClientRect().top)/2-_,(!o||o.index!==w||o.container!==n.container)&&c({container:n.container,index:w,top:b})},[t,n,o,u,r,s]),f=g.useCallback(()=>{if(!n||!o)return;c(null);const p=u(o.container).map(_=>_.dataset.reorderKey).filter(_=>!!_),m=p.indexOf(n.key);if(m===-1)return;p.splice(m,1);const v=o.index>m?o.index-1:o.index;p.splice(v,0,n.key),i(o.container,p)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},yoe={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},generativeControls:{default:!1},refineMode:{default:!1},inspectorUndoRedo:{default:!1}},yN=Object.fromEntries(Object.entries(yoe).map(([e,t])=>[e,{isEnabled:t.default}])),_N=un(!0),wN=un(null),bN=un(0),_oe=un({name:null,email:null}),A2=un(0),dg=un(null),I2=un(!1),O2=un(null),xN=un(!1),SN=un(!1),u0=un(null),d0=un(null),pd=un(null),Kx=un(null),ml=un(null),EN=un(!1),Xh=un({active:!1}),kN=un([]),M2=un(yN),woe=un(!1),Xg=un(null),boe=un(null),Qg=un(!0),xoe=un(!1),CN=un(!1),PN=un(null),Soe=()=>{var e;return typeof window>"u"?null:((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.agentApplyMode)??null},Jg=un(Soe()),Eoe=un(null);function koe(e){return e==="cursor"?"Cursor":e==="codex"?"Codex":e==="claude-desktop"?"Claude":"Claude Code"}const Coe=e=>{var t;return[e.label.trim(),(t=e.description)==null?void 0:t.trim()].filter(n=>!!n).join(`
|
|
170
|
+
`)},RN=async({text:e,copyKind:t})=>{const n=e.trim();if(n)try{await navigator.clipboard.writeText(n),Xe.capture("variants_panel.copy_completed",{outcome:"success",copyKind:t}),en.success("Copied")}catch(r){Xe.capture("variants_panel.copy_failed",{outcome:"failure",copyKind:t,errorName:r instanceof Error?r.name:"UnknownError"}),en.error("Couldn't copy")}},Poe=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],TN=({className:e,"data-testid":t}={})=>P.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${e??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":t,children:P.jsx("div",{className:"rivet-sparkle-strip",children:Poe.map((n,r)=>P.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),fg=({className:e=""})=>P.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${e}`.trim()}),Roe=({entry:e,deploying:t,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=t?"Deploying…":n?"Copy link":"Share";return P.jsxs("div",{className:"border-surface-2 bg-card flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[P.jsxs("div",{className:"min-w-0",children:[P.jsx("div",{className:"text-foreground truncate text-sm font-medium",children:e.label.trim()||"Untitled direction"}),n?P.jsx("div",{className:"text-soft-foreground text-[11px]",children:"Deployed — share link ready"}):null]}),P.jsxs("button",{type:"button",onClick:()=>r(e),disabled:t||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-surface-2 text-foreground hover:bg-muted 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&&!t?P.jsx(Eh,{size:12,weight:"bold"}):null,o]})]})},Toe=({primaryLabel:e,primaryIcon:t,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:c="More actions",dropdownItems:u})=>{const[d,f]=g.useState(!1),p=i?o??e:e,m=u.length>0;return P.jsxs("div",{className:"flex items-stretch",children:[P.jsxs("button",{onClick:n,disabled:r||i,className:`bg-selected hover:bg-muted focus-visible:bg-muted flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white outline-hidden transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[t?P.jsx(t,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?P.jsxs(Bx,{isOpen:d,onOpenChange:f,children:[P.jsx(Yg,{asChild:!0,children:P.jsx("button",{"aria-label":c,disabled:s||i,title:c,className:"bg-selected hover:bg-muted focus-visible:bg-muted h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white outline-hidden transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:P.jsx(Gee,{className:"h-3.5 w-3.5",weight:"bold"})})}),P.jsx(Wx,{align:"end",children:u.map(v=>{const _=v.icon;return P.jsxs(ja,{onSelect:v.onClick,disabled:v.isDisabled,children:[_?P.jsx(_,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})]}):null]})},md=({label:e,children:t,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?P.jsx(P.Fragment,{children:t}):P.jsx(q5,{content:e,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:t}),Aoe=32,Ioe=2048,AN=Su().max(Ioe).refine(e=>{let t;try{t=decodeURIComponent(e.split(/[?#]/)[0])}catch{return!1}return e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\")&&!/^\/%(?:2f|5c)/i.test(e)&&!t.includes("\\")&&!t.split("/").some(n=>n==="."||n==="..")&&![...e].some(n=>n<=" "||n==="")},"Expected an app-relative preview route");OW(AN).min(1).max(Aoe).transform(e=>[...new Set(e)]);const ev="/__rivet/preview",eT=`${ev}/variant/`,tT=`${ev}/history/`,IN=e=>e?e.startsWith("/")?e:`/${e}`:"/",ON=(e,t)=>{if(!t)return e;const n=AN.parse(t);if(e.includes("?")||e.includes("#"))throw new Error("Preview target must not contain an application query or hash");return e.replace(/\/$/,"")+n},nT=(e,t)=>{const n=new URLSearchParams(t);return n.set("targetAddressed","1"),`/api/variants/history/${encodeURIComponent(e.sessionId)}/${encodeURIComponent(e.variantId)}/run?${n}`},Ooe=e=>{const t="/api/variants/history/"+encodeURIComponent(e.sessionId)+"/"+encodeURIComponent(e.variantId);return e.routePath?ON(t+"/site/"+encodeURIComponent(e.projectPath??"current"),e.routePath):t+"/preview"+(e.projectPath?"?projectPath="+encodeURIComponent(e.projectPath):"")},Moe=e=>`${ev}/variant/${encodeURIComponent(e.sessionId)}/${encodeURIComponent(e.variantId)}${IN(e.routePath)}`,rT=e=>`${ev}/history/${encodeURIComponent(e.sessionId)}/${encodeURIComponent(e.variantId)}${IN(e.routePath)}`,sT=e=>{try{const t=new URL(e,"http://localhost");return t.pathname.startsWith(eT)||t.pathname.startsWith(tT)}catch{return e.startsWith(eT)||e.startsWith(tT)}},vc=e=>{var s,i,o,c,u,d;const{sessionId:t,variant:n,projectContext:r}=e;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?ON(n.preview.url,(i=n.previewRoutes)==null?void 0:i[0]):t&&(((o=n.preview)==null?void 0:o.kind)==="dev_server"||typeof n.port=="number")?Moe({sessionId:t,variantId:n.workItemId,routePath:((c=n.previewRoutes)==null?void 0:c[0])??((r==null?void 0:r.kind)==="fresh"?"/":e.routePath)}):t&&(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/${t}/static/${n.workItemId}`:null},iT="/rivet/",MN=e=>{if(!e.startsWith(iT))return null;const t=e.slice(iT.length);return!t||t==="/"?null:`/${t}`},Lu=e=>{var t;return!!e.hasTree&&((t=e.serve)==null?void 0:t.kind)==="dev-server"},Loe=e=>{var t,n;return((t=e.preview)==null?void 0:t.kind)==="static"||((n=e.serve)==null?void 0:n.kind)==="static"||Lu(e)},$oe=e=>[...e].sort((t,n)=>new Date(n.createdAt).getTime()-new Date(t.createdAt).getTime()).find(t=>!Lu(t)),Ih=e=>{var t,n;return e.status!=="succeeded"?!1:((n=(t=e.actions)==null?void 0:t.view)==null?void 0:n.enabled)??(!!e.preview||typeof e.port=="number")},oT=e=>{var t,n;return Ih(e)&&(((t=e.preview)==null?void 0:t.kind)==="static_artifact"||((n=e.preview)==null?void 0:n.kind)==="dev_server")},LN=({entry:e,projectPath:t})=>{var n;return Ooe({sessionId:e.sessionId,variantId:e.variantId,projectPath:t,routePath:(n=e.previewRoutes)==null?void 0:n[0]})},Noe=({entry:e,projectPath:t})=>({selectedPastVariant:{sessionId:e.sessionId,variantId:e.variantId,previewKind:"static",references:e.references,projectPath:t??void 0},previewUrl:LN({entry:e,projectPath:t})}),Doe=({incomingSessionId:e,previousSessionId:t,isIncomingSessionPreviewable:n,selectedPastVariant:r,displayedLiveVariantId:s,pastVariants:i})=>{if(n)return{kind:"clear"};if(r)return r.sessionId===e?{kind:"clear"}:{kind:"keep_selected"};const o=i.find(c=>c.sessionId===t&&c.variantId===s&&!Lu(c));return o?{kind:"show_saved",entry:o}:{kind:"clear"}},gd=(e,t=Dt)=>{if((e==null?void 0:e.source)!=="history-dev-server")return;const n=new URLSearchParams({sessionId:e.sessionId,variantId:e.variantId});t(`/api/variants/history/replay/stop?${n.toString()}`,{method:"POST"}).catch(()=>{})},Foe=(e,t=Dt)=>{const n=new Set;for(const r of[e==null?void 0:e.left,e==null?void 0:e.right]){if((r==null?void 0:r.source)!=="history-dev-server")continue;const s=`${r.sessionId}:${r.variantId}`;n.has(s)||(n.add(s),gd(r,t))}},hg=(e,t)=>{const n=t==null?void 0:t.left,r=t==null?void 0:t.right;return{event:`visual_editor_variant_compare_${e}`,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}}},aT=6,$N="original",Gx="Original",NN="The original state of your app before any variants were generated.",lT=200,DN="h-6 w-6 rounded",cT={size:13,weight:"fill",className:"text-soft-foreground shrink-0"},L2=[.33,1,.68,1],$2=.22,$r=Ls("AgentVariantsPanel"),d_=()=>{var e;(e=window.getSelection())==null||e.removeAllRanges()},joe=e=>{var t;return e?e.kind==="existing"?!0:((t=e.executionPlan)==null?void 0:t.mode)==="vite_app":!1};function f_(e,...t){return e?t.some(n=>(n??"").toLowerCase().includes(e)):!0}const Voe=(e,t)=>{if(e.kind==="original")return null;const n=e.kind==="active"?e.variant.runLabel:e.entry.runLabel,r=n==null?void 0:n.trim();return r?e.kind==="active"?t?{label:r,run:e.variant.requestId?{sessionId:t,requestId:e.variant.requestId}:{sessionId:t,runLabel:r}}:null:{label:r,run:e.entry.requestId?{sessionId:e.entry.sessionId,requestId:e.entry.requestId}:{sessionId:e.entry.sessionId,runLabel:r}}:null},FN=e=>{const t="requestId"in e?["request",e.requestId]:["label",e.runLabel];return`run:${JSON.stringify([e.sessionId,...t])}`},zoe="original",N2="pinned-section";function jN(e){return`rivet:collapsedRuns:${e}`}function Mm(e){try{const t=window.localStorage.getItem(jN(e)),n=t?JSON.parse(t):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function h_(e,t){try{window.localStorage.setItem(jN(e),JSON.stringify([...t]))}catch{}}const uT=(e,t)=>{const n=[],r=new Map;for(const s of e){const i=Voe(s,t);let o="";s.kind==="original"?o=zoe:i&&(o=FN(i.run));let c=r.get(o);c||(c={key:o,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(o,c),n.push(c)),c.rows.push(s)}return n};async function Do(e){try{const t=await e.json();return{message:typeof t.message=="string"?t.message:null,errorCode:typeof t.errorCode=="string"?t.errorCode:null}}catch{return{message:null,errorCode:null}}}const VN=e=>e.status==="succeeded",zN=e=>{var t;return((t=e.previewUnavailable)==null?void 0:t.reason)==="idle_timeout"},Hoe=e=>e.status==="succeeded"&&!Ih(e)&&(!e.previewUnavailable||zN(e)),p_=e=>{var t,n;return((t=e.preview)==null?void 0:t.kind)==="static_artifact"?"static_artifact":((n=e.preview)==null?void 0:n.kind)==="dev_server"||typeof e.port=="number"?"dev_server":"none"},dT=(e,t,n)=>{const r=new URL(e,window.location.origin);return r.searchParams.set(t,n),`${r.pathname}${r.search}${r.hash}`},Uoe=e=>{var t;return VN(e)&&((t=e.preview)==null?void 0:t.kind)==="static_artifact"},fT=(e,t)=>e.map(n=>`${n.workItemId}:${t[n.workItemId]??""}`).join("|"),Zoe=()=>{var Ac,kl,bi;const e=mx(),t=_t(Xh),n=_t(EN),r=g.useRef(!1),s=_t(kN),i=_t(Xg),o=_t(Qg),c=_t(M2),u=((Ac=c.share)==null?void 0:Ac.isEnabled)??!1,d=((kl=c.deployPrototype)==null?void 0:kl.isEnabled)??!1,f=((bi=c.canvasShare)==null?void 0:bi.isEnabled)??!1,p=_t(CN),m=_t(PN),v=Lt(A2),_=Lt(dg),w=Lt(I2),b=Lt(O2),S=Lt(xN),E=Lt(SN),C=Lt(pd),R=_t(pd),T=Lt(Kx),O=Lt(wN);g.useEffect(()=>(O("Directions"),()=>O(null)),[O]);const M=_t(ml),A=Lt(ml),L=g.useCallback((F=!1)=>{if(Foe(M),A(null),F&&M){const re=hg("ended",M);Xe.capture(re.event,re.properties)}},[A,M]),V=_t(u0),W=Lt(u0),z=_t(d0),X=Lt(d0),Q=z?`${z.sessionId}:${z.variantId}`:null,[H,Y]=g.useState(""),[oe,U]=g.useReducer(F=>F+1,0),J=g.useMemo(()=>i!==null?Mm(i):new Set,[i,oe]),K=g.useCallback(F=>{if(i===null)return;const re=new Set(Mm(i));re.delete(F)||re.add(F),h_(i,re),U()},[i]),[D,q]=g.useState(null),[fe,ae]=g.useState(null),[ce,he]=g.useState(!1),[ke,ge]=g.useState({}),[pe,Le]=g.useState(null),[Ae,Ne]=g.useState({}),[Et,dn]=g.useState(null),[sn,kt]=g.useState(!1),[Gt]=g.useState(()=>cne(window.location.search)),mn=g.useRef(!1),Xt=Gt!==null||z!==null||V!==null||sn,Me=g.useMemo(()=>t.active?t.variants:[],[t]),Qe=g.useMemo(()=>Me.filter(Uoe),[Me]),Te=g.useMemo(()=>fT(Qe,ke),[Qe,ke]),xt=(pe==null?void 0:pe.key)===Te?pe.shareUrl:null,xe=t.active?t.sessionId:null,Nt=g.useMemo(()=>{const F=new Set;for(const re of Me)re.adoptedSource&&F.add(`${re.adoptedSource.sessionId}:${re.adoptedSource.variantId}`);return F},[Me]),dt=t.active?t.projectContext:null,gt=(dt==null?void 0:dt.kind)==="fresh"?dt.workspacePath:i,Hn=g.useMemo(()=>gt?`?projectPath=${encodeURIComponent(gt)}`:"",[gt]),Js=t.active?`${t.sessionId}:${t.stage}`:"inactive",_n=g.useMemo(()=>{var re;if(sn||Q)return null;const F=V?Me.find(Oe=>Oe.workItemId===V):null;return V&&!F?null:F?Ih(F)?F.workItemId:null:t.active?((re=Me.find(oT))==null?void 0:re.workItemId)??null:null},[V,Q,sn,t,Me]),Gn=g.useCallback(F=>{const re=Noe({entry:F,projectPath:gt});X(re.selectedPastVariant),kt(!1),_(re.previewUrl)},[gt,_,X]),_i=g.useRef(!1),ts=F=>{if(!_i.current&&!Xt&&_n===null&&F.length>0&&F.every(re=>re.projectKind==="fresh")){const re=$oe(F);re&&(_i.current=!0,Gn(re))}X(re=>{if(!re)return re;const Oe=F.find(Pe=>Pe.sessionId===re.sessionId&&Pe.variantId===re.variantId);return!Oe||JSON.stringify(re.references)===JSON.stringify(Oe.references)?re:{...re,references:Oe.references}})},{pastVariants:zr,setPastVariants:Un}=loe({historyQuery:Hn,snapshotKey:Js,isEnabled:!o,isListed:Loe,onLoaded:ts}),fn=g.useMemo(()=>[...zr.filter(re=>re.sessionId!==xe&&!Nt.has(`${re.sessionId}:${re.variantId}`))].sort((re,Oe)=>{const Pe=new Date(re.createdAt).getTime(),be=new Date(Oe.createdAt).getTime();return(Number.isNaN(be)?0:be)-(Number.isNaN(Pe)?0:Pe)}),[Nt,zr,xe]),Hr=g.useMemo(()=>z?Me.find(F=>{var re,Oe;return((re=F.adoptedSource)==null?void 0:re.sessionId)===z.sessionId&&((Oe=F.adoptedSource)==null?void 0:Oe.variantId)===z.variantId})??null:null,[z,Me]),Qn=g.useMemo(()=>z?fn.find(F=>F.sessionId===z.sessionId&&F.variantId===z.variantId)??null:null,[z,fn]),Hi=!t.active&&fn.length>0&&fn.every(F=>F.projectKind==="fresh"),Tr=t.active?joe(dt):!!i&&!Hi,{pinnedKeys:Zn,pinnedKeySet:vr,listOrder:$s,togglePin:qn,pinItem:ns,reorder:st}=goe(gt),rn=g.useRef(null),Qt=g.useRef(null),hn=typeof window>"u"?"/":MN(window.location.pathname)??"/",wn=g.useRef(null),Bt=g.useRef(!1),Rn=g.useCallback((F,re)=>{re.button!==0&&re.pointerType==="mouse"||(re.preventDefault(),d_(),wn.current={kind:"live",variantId:F,startX:re.clientX,startY:re.clientY,committed:!1})},[]),Ur=g.useCallback((F,re)=>{re.button!==0&&re.pointerType==="mouse"||(re.preventDefault(),d_(),wn.current={kind:"past",entry:F,startX:re.clientX,startY:re.clientY,committed:!1})},[]);g.useEffect(()=>{const F=Pe=>{var at;const be=wn.current;if(!be)return;const De=Pe.clientX-be.startX,St=Pe.clientY-be.startY;if(!be.committed){if(De*De+St*St<aT*aT)return;if(d_(),be.kind==="live"){const wt=Me.find(_r=>_r.workItemId===be.variantId);if(!wt||wt.status!=="succeeded"){wn.current=null;return}const Jn=vc({sessionId:xe,variant:wt,projectContext:dt,routePath:hn});C({sessionId:xe??"",variantId:wt.workItemId,label:wt.label||"Direction",url:Jn,source:"live",runLabel:wt.runLabel,description:wt.description})}else{const{entry:wt}=be,Jn=Lu(wt),_r=Jn?rT({sessionId:wt.sessionId,variantId:wt.variantId,routePath:((at=wt.previewRoutes)==null?void 0:at[0])??hn}):LN({entry:wt,projectPath:gt});if(C({sessionId:wt.sessionId,variantId:wt.variantId,label:wt.label||"Direction",url:_r,source:Jn?"history-dev-server":"history-static",runLabel:wt.runLabel,description:wt.brief}),Jn){const Fs=nT(wt,Hn);(async()=>{try{if(!(await Dt(Fs,{method:"POST"})).ok)return;const Ft=dT(_r,"replay",String(Date.now()));C(Pt=>!Pt||Pt.sessionId!==wt.sessionId||Pt.variantId!==wt.variantId||Pt.source!=="history-dev-server"?Pt:{...Pt,url:Ft}),A(Pt=>{if(!Pt)return Pt;const xi=Ki=>!Ki||Ki.sessionId!==wt.sessionId||Ki.variantId!==wt.variantId?Ki:{...Ki,url:Ft};return{...Pt,left:xi(Pt.left),right:xi(Pt.right)}})}catch(js){$r.warn("history replay drag boot failed",js)}})()}}be.committed=!0}T({x:Pe.clientX,y:Pe.clientY})},re=()=>{const Pe=wn.current;Pe!=null&&Pe.committed&&(Bt.current=!0,window.setTimeout(()=>{Bt.current=!1},0)),wn.current=null,T(null)},Oe=Pe=>{if(Pe.key!=="Escape")return;const be=wn.current;be!=null&&be.committed&&(be.kind==="past"&&Lu(be.entry)&&gd({sessionId:be.entry.sessionId,variantId:be.entry.variantId,source:"history-dev-server"}),wn.current=null,C(null),T(null))};return window.addEventListener("pointermove",F),window.addEventListener("pointerup",re),window.addEventListener("pointercancel",re),window.addEventListener("keydown",Oe),()=>{window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",re),window.removeEventListener("pointercancel",re),window.removeEventListener("keydown",Oe)}},[Me,xe,dt,hn,Hn,gt,C,T,A]);const Bn=g.useCallback(()=>{var F;(F=wn.current)!=null&&F.committed&&(Bt.current=!0,window.setTimeout(()=>{Bt.current=!1},0)),wn.current=null,T(null),R&&(R.source==="history-dev-server"&&gd({sessionId:R.sessionId,variantId:R.variantId,source:"history-dev-server"}),C(null))},[R,C,T]),cr=g.useCallback((F,re)=>{const Oe=!vr.has(F);Xe.capture(Oe?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:re}),qn(F)},[vr,qn]),zt=g.useCallback(()=>{R&&(Xe.capture("variants_panel.direction_pinned",{method:"drag"}),ns(`row:past:${R.sessionId}:${R.variantId}`),Bn())},[R,Bn,ns]),ei=g.useCallback(F=>{Xe.capture("variants_panel.direction_unpinned",{method:"drag"}),qn(F),Bn()},[qn,Bn]),Id=g.useCallback((F,re)=>{st(F,re),Bn()},[st,Bn]),ua=sn||Tr&&V===null&&Q===null&&_n===null,Ui=g.useCallback(async F=>{var Oe,Pe,be,De,St;if(!xe)return;const re=(F==null?void 0:F.workItemId)??null;q({kind:"switch",variantId:re??void 0});try{if(((Oe=F==null?void 0:F.preview)==null?void 0:Oe.kind)==="static_artifact"){const wt=vc({sessionId:xe,variant:F,projectContext:t.active?t.projectContext:null})??F.preview.url;w(!1),b(null),((Pe=F.refinement)==null?void 0:Pe.status)==="succeeded"&&!((be=F.previewRoutes)!=null&&be.length)?_(dT(wt,"refinement",F.refinement.workItemId)):_(wt);return}if(re&&xe&&t.active&&t.projectContext.kind==="fresh"&&((De=t.projectContext.executionPlan)==null?void 0:De.mode)!=="vite_app"&&((St=F==null?void 0:F.preview)==null?void 0:St.kind)!=="dev_server"){w(!1),b(null),_(`/api/variants/${xe}/static/${re}`);return}const at=F&&re?vc({sessionId:xe,variant:F,projectContext:t.active?t.projectContext:null,routePath:hn}):null;if(at){w(!1),b(null),_(at);return}Xe.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:re,previewKind:F?p_(F):"none",hasPreview:!!(F!=null&&F.preview),hasPort:typeof(F==null?void 0:F.port)=="number",errorMessage:"No addressable dev-server preview URL"}),w(!1),b(null)}catch(at){$r.warn("preview display failed",at),Xe.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:re,previewKind:F?p_(F):"none",hasPreview:!!(F!=null&&F.preview),hasPort:typeof(F==null?void 0:F.port)=="number",errorMessage:at instanceof Error?at.message:String(at)}),w(!1),b(null)}finally{q(null)}},[xe,t,hn,_,w,b]),yr=g.useRef(0),ti=g.useCallback(()=>{yr.current++,q(F=>(F==null?void 0:F.kind)==="switch"?null:F),S(!1),E(!1)},[S,E]),ms=g.useCallback(async F=>{if(xe){q({kind:"switch",variantId:F.workItemId});try{const re=await Dt(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:F.workItemId})});if(!re.ok){const Oe=await Do(re);throw new Error(Oe.message??`Preview restoration failed (${re.status})`)}}catch(re){$r.warn("preview restoration failed",re),Xe.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:F.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:re instanceof Error?re.message:String(re)})}finally{q(null)}}},[xe]),wi=g.useCallback(F=>{var De,St,at,wt,Jn;if(Bt.current){Bt.current=!1;return}const re=Ih(F),Oe=F.status==="pending"||F.status==="running"||Hoe(F);ti();const Pe=p_(F),be=Me.find(_r=>_r.workItemId===V);Xe.capture("variants_panel.preview_requested",{sessionId:xe,fromVariantId:be==null?void 0:be.workItemId,toVariantId:F.workItemId,variantStatus:F.status,isPreviewReady:re,isArmed:Oe,previewKind:Pe,hasPreview:!!F.preview,hasPort:typeof F.port=="number",viewEnabled:((St=(De=F.actions)==null?void 0:De.view)==null?void 0:St.enabled)??null,previewUnavailableReason:((at=F.previewUnavailable)==null?void 0:at.reason)??null}),W(F.workItemId),X(null),re?(Qt.current=F.workItemId,kt(!1),L(!0),Ui(F)):(Qt.current=null,kt(!1),_(null),w(!1),Oe&&Xe.capture("variants_panel.preview_armed",{sessionId:xe,fromVariantId:be==null?void 0:be.workItemId,toVariantId:F.workItemId,variantStatus:F.status,previewKind:Pe,hasPreview:!!F.preview,hasPort:typeof F.port=="number",viewEnabled:((Jn=(wt=F.actions)==null?void 0:wt.view)==null?void 0:Jn.enabled)??null}),zN(F)&&ms(F)),Xe.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:be==null?void 0:be.workItemId,toVariantId:F.workItemId,armed:Oe})},[V,xe,L,W,X,ti,ms,Ui,Me,_,w]),gs=g.useCallback(F=>{if(Bt.current){Bt.current=!1;return}if(L(!0),W(null),Lu(F)){X({sessionId:F.sessionId,variantId:F.variantId,previewKind:"dev_server",references:F.references,projectPath:gt??void 0}),kt(!1);const re=++yr.current;S(!0),E(!0),(async()=>{var Pe;q({kind:"switch"}),Xe.capture("variants_panel.history_replay_started",{sessionId:F.sessionId,variantId:F.variantId});const Oe=(be,De)=>{Xe.capture("variants_panel.history_replay_failed",{sessionId:F.sessionId,variantId:F.variantId,...De}),S(!1),E(!1),X(St=>St?{...St,previewError:be}:null),_(null)};try{const be=await Dt(nT(F,Hn),{method:"POST"});if(re!==yr.current)return;if(!be.ok){const{message:St,errorCode:at}=await Do(be);if(re!==yr.current)return;$r.warn(`history replay failed: HTTP ${be.status} ${at??""}`),Oe(St??`Preview startup failed (${be.status})`,{httpStatus:be.status,errorCode:at});return}const De=await be.json();if(re!==yr.current)return;E(!1),w(!1),b(null),_(rT({sessionId:F.sessionId,variantId:F.variantId,routePath:((Pe=F.previewRoutes)==null?void 0:Pe[0])??hn})),De.alreadyRunning||v(St=>St+1),Xe.capture("variants_panel.history_replay_ready",{sessionId:F.sessionId,variantId:F.variantId})}catch(be){if(re!==yr.current)return;$r.warn("history replay failed",be);const De=Ps(be,"Preview startup failed");Oe(De,{errorMessage:De})}finally{re===yr.current&&q(null)}})();return}ti(),w(!1),b(null),Gn(F)},[gt,hn,Gn,q,S,E,v,X,W,_,b,L,w,ti,Hn]);g.useEffect(()=>{if(!Gt||mn.current)return;const F=zr.find(re=>re.sessionId===Gt.sessionId&&re.variantId===Gt.variantId);F&&(mn.current=!0,gs(F))},[Gt,zr,gs]);const da=g.useCallback(async()=>{ti();const F=()=>{L(!0),W(null),X(null),kt(!0),Qt.current=null,w(!1),b(null),_(null)};if(!xe){F();return}q({kind:"switch"});try{const re=await Dt(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!re.ok){$r.warn(`switch to original failed: HTTP ${re.status}`);return}F(),w(!0),Xe.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:V,toVariantId:null,target:"original",armed:!1})}catch(re){$r.warn("preview-port original switch failed",re)}finally{q(null)}},[V,xe,W,X,_,b,L,w,ti]),Ns=g.useCallback(async(F,re,Oe)=>{Xe.capture("variants_panel.deploy_clicked",{sessionId:F,variantId:re,variantLabel:Oe});try{const Pe=await Dt(`/api/variants/${F}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:re,...i?{projectPath:i}:{}})});if(!Pe.ok){const{message:St,errorCode:at}=await Do(Pe);return $r.warn(`deploy failed: HTTP ${Pe.status} ${at??""} ${St??""}`),Xe.capture("variants_panel.deploy_failed",{sessionId:F,variantId:re,httpStatus:Pe.status,errorCode:at??null,errorMessage:St??null}),en.error("Couldn't deploy this direction",{description:St??`The server rejected the request (HTTP ${Pe.status}). Try again.`}),null}const be=await Pe.json().catch(()=>null),De=be==null?void 0:be.shareUrl;return De?(await navigator.clipboard.writeText(De).catch(()=>{}),Xe.capture("variants_panel.deploy_succeeded",{sessionId:F,variantId:re}),en.success(`"${Oe}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(De,"_blank","noopener")}}),De):(en.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(Pe){return $r.warn("deploy failed",Pe),Xe.capture("variants_panel.deploy_failed",{sessionId:F,variantId:re,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:Pe instanceof Error?Pe.message:String(Pe)}),en.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),wl=g.useCallback(async F=>{if(!xe)return;const re=ke[F.workItemId];if(re){await navigator.clipboard.writeText(re).catch(()=>{}),en.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(re,"_blank","noopener")}});return}q({kind:"deploy",variantId:F.workItemId});try{const Oe=await Ns(xe,F.workItemId,F.label);Oe&&ge(Pe=>({...Pe,[F.workItemId]:Oe}))}finally{q(null)}},[xe,ke,Ns]),Rc=g.useCallback(async()=>{if(!(!xe||Qe.length===0)){if(xt){await navigator.clipboard.writeText(xt).catch(()=>{}),en.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(xt,"_blank","noopener")}});return}Xe.capture("variants_panel.deploy_clicked",{sessionId:xe,variantId:"canvas",variantLabel:"Canvas",variantCount:Qe.length}),q({kind:"deploy-canvas"});try{const F=await Dt(`/api/variants/${xe}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Qe.map(De=>De.workItemId),...i?{projectPath:i}:{}})});if(!F.ok){const{message:De,errorCode:St}=await Do(F);$r.warn(`canvas deploy failed: HTTP ${F.status} ${St??""} ${De??""}`),Xe.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:F.status,errorCode:St??null,errorMessage:De??null,variantCount:Qe.length}),en.error("Couldn't share this canvas",{description:De??`The server rejected the request (HTTP ${F.status}). Try again.`});return}const re=await F.json().catch(()=>null),Oe=re==null?void 0:re.shareUrl;if(!Oe){en.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const Pe=Object.fromEntries(((re==null?void 0:re.variants)??[]).filter(De=>typeof De.variantId=="string"&&typeof De.shareUrl=="string").map(De=>[De.variantId,De.shareUrl])),be=Object.keys(Pe).length>0?{...ke,...Pe}:ke;be!==ke&&ge(be),await navigator.clipboard.writeText(Oe).catch(()=>{}),Le({key:fT(Qe,be),shareUrl:Oe}),Xe.capture("variants_panel.deploy_succeeded",{sessionId:xe,variantId:"canvas",variantCount:Qe.length}),en.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Oe,"_blank","noopener")}})}catch(F){$r.warn("canvas deploy failed",F),Xe.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:F instanceof Error?F.message:String(F),variantCount:Qe.length}),en.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{q(null)}}},[xt,Qe,ke,i,xe]),fa=g.useCallback(async F=>{const re=`${F.sessionId}:${F.variantId}`,Oe=Ae[re];if(Oe){await navigator.clipboard.writeText(Oe).catch(()=>{}),en.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Oe,"_blank","noopener")}});return}dn(re);try{const Pe=await Ns(F.sessionId,F.variantId,F.label);Pe&&Ne(be=>({...be,[re]:Pe}))}finally{dn(null)}},[Ae,Ns]),on=g.useCallback(async F=>{if(xe){Xe.capture("variants_panel.remove_clicked",{sessionId:xe,variantId:F.workItemId,variantLabelLength:F.label.length}),q({kind:"remove",variantId:F.workItemId});try{const re=await Dt(`/api/variants/${xe}/${F.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!re.ok){const{message:Oe}=await Do(re);$r.warn(`remove failed: HTTP ${re.status} ${Oe??""}`),en.error("Couldn't remove direction",{description:Oe??`The server rejected the request (HTTP ${re.status}). Try again.`});return}(F.workItemId===_n||F.workItemId===V)&&(W(null),_(null),w(!1),v(Oe=>Oe+1))}catch(re){$r.warn("remove failed",re),en.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{q(null)}}},[xe,V,_n,W,_,w,v]),Zi=g.useCallback(async F=>{if(!gt){en.error("Couldn't remove direction",{description:"No project path available."});return}Xe.capture("variants_panel.remove_past_clicked",{sessionId:F.sessionId,variantId:F.variantId});const re=`${F.sessionId}:${F.variantId}`,Oe=Pe=>Pe.sessionId===F.sessionId&&Pe.variantId===F.variantId;q({kind:"remove",variantId:re}),Un(Pe=>Pe.filter(be=>!Oe(be))),Q===re&&(X(null),_(null),w(!1),v(Pe=>Pe+1));try{const Pe=await Dt(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:gt})});if(!Pe.ok){const{message:be}=await Do(Pe);Un(De=>De.some(Oe)?De:[...De,F]),en.error("Couldn't remove direction",{description:be??`The server rejected the request (HTTP ${Pe.status}). Try again.`})}}catch(Pe){$r.warn("remove past failed",Pe),Un(be=>be.some(Oe)?be:[...be,F]),en.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{q(null)}},[gt,Q,X,_,w,v,Un]),Ds=g.useCallback(F=>{ae(F)},[]),Bi=g.useCallback((F,re)=>{if(!F.label||!F.run)return;const Oe=F.rows.flatMap(be=>be.kind==="active"?[be.variant]:[]),Pe=F.rows.flatMap(be=>be.kind==="past"?[be.entry]:[]);Oe.length===0&&Pe.length===0||ae({kind:"run",label:F.label,variants:Oe,entries:Pe,returnFocusTo:re})},[]),Ar=g.useCallback(async()=>{if(!(!fe||ce)){he(!0);try{if(fe.kind==="active")await on(fe.variant);else if(fe.kind==="past")await Zi(fe.entry);else{for(const F of fe.variants)await on(F);for(const F of fe.entries)await Zi(F)}}finally{he(!1),ae(null)}}},[fe,ce,on,Zi]),[bl,xl]=g.useState(null),[So,Zr]=g.useState(null),Sl=g.useRef(null),rs=g.useCallback(F=>{Zr(F)},[]),Od=g.useCallback(()=>{Zr(null)},[]),Tc=g.useCallback(async(F,re)=>{Zr(null);const Oe=re.trim();if(!Oe||F.kind==="original")return;if(F.kind==="active"){if(!xe||Oe===F.variant.label)return;Xe.capture("variants_panel.rename",{sessionId:xe,variantId:F.variant.workItemId,labelLength:Oe.length,past:!1});try{const De=await Dt(`/api/variants/${xe}/${F.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Oe})});if(!De.ok){const{message:St}=await Do(De);en.error("Couldn't rename direction",{description:St??`The server rejected the request (HTTP ${De.status}). Try again.`})}}catch(De){$r.warn("rename failed",De),en.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:Pe}=F;if(Oe===Pe.label.trim())return;if(!gt){en.error("Couldn't rename direction",{description:"No project path available."});return}Xe.capture("variants_panel.rename",{sessionId:Pe.sessionId,variantId:Pe.variantId,labelLength:Oe.length,past:!0});const be=De=>De.sessionId===Pe.sessionId&&De.variantId===Pe.variantId;Un(De=>De.map(St=>be(St)?{...St,label:Oe}:St));try{const De=await Dt(`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Oe,projectPath:gt})});if(!De.ok){const{message:St}=await Do(De);Un(at=>at.map(wt=>be(wt)?{...wt,label:Pe.label}:wt)),en.error("Couldn't rename direction",{description:St??`The server rejected the request (HTTP ${De.status}). Try again.`})}}catch(De){$r.warn("rename failed",De),Un(St=>St.map(at=>be(at)?{...at,label:Pe.label}:at)),en.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[xe,gt,Un]),[ha,ni]=g.useState(null),$=g.useCallback(F=>{ni(F)},[]),ue=g.useCallback(()=>{ni(null)},[]),ve=g.useCallback(async(F,re)=>{if(ni(null),!F.label||!F.run)return;const Oe=F.label,Pe=re.trim();if(!Pe||Pe===Oe)return;Xe.capture("variants_panel.rename_run",{runLabelLength:Pe.length});const be="requestId"in F.run?F.run.requestId:void 0,De=be?F.key:FN({sessionId:F.run.sessionId,runLabel:Pe}),St=De!==F.key;let at=!1,wt=!1;if(i!==null&&St){const Ft=Mm(i);at=Ft.has(F.key),wt=Ft.has(De),at&&(Ft.add(De),h_(i,Ft),U())}const Jn=Ft=>{if(i===null||!St)return;const Pt=Mm(i);Ft?Pt.delete(F.key):(at?Pt.add(F.key):Pt.delete(F.key),wt?Pt.add(De):Pt.delete(De)),h_(i,Pt),U()},_r=new Set(F.rows.flatMap(Ft=>Ft.kind==="past"?[`${Ft.entry.sessionId}:${Ft.entry.variantId}`]:[])),Fs=Ft=>_r.has(`${Ft.sessionId}:${Ft.variantId}`);Un(Ft=>Ft.map(Pt=>Fs(Pt)?{...Pt,runLabel:Pe}:Pt));const js=()=>Un(Ft=>Ft.map(Pt=>Fs(Pt)?{...Pt,runLabel:Oe}:Pt));try{const Ft=await Dt("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:F.run.sessionId,...be?{requestId:be}:{},runLabel:Oe,label:Pe,...gt?{projectPath:gt}:{}})});if(Ft.ok)Jn(!0);else{const{message:Pt}=await Do(Ft);js(),Jn(!1),en.error("Couldn't rename run",{description:Pt??`The server rejected the request (HTTP ${Ft.status}). Try again.`})}}catch(Ft){$r.warn("run rename failed",Ft),js(),Jn(!1),en.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[gt,i,Un]);g.useEffect(()=>{const F=n&&!r.current;if(r.current=n,rn.current!==xe){const Oe=rn.current===null,Pe=rn.current;rn.current=xe;const be=e.get(d0);if(F&&Gt&&(be==null?void 0:be.sessionId)===Gt.sessionId&&(be==null?void 0:be.variantId)===Gt.variantId)return;const De=Doe({incomingSessionId:xe,previousSessionId:Pe,isIncomingSessionPreviewable:t.active&&Me.some(oT),selectedPastVariant:be,displayedLiveVariantId:e.get(u0)??Qt.current,pastVariants:zr});switch(Qt.current=null,Le(null),w(!1),b(null),L(),W(null),kt(!1),_i.current=!1,De.kind){case"keep_selected":break;case"show_saved":Gn(De.entry);break;case"clear":_(null),X(null);break;default:{const St=De;throw new Error(`Unhandled session preview: ${String(St)}`)}}if(!Oe)return}if(Q||sn||!_n||t.active!==!0||Qt.current===_n)return;const re=Me.find(Oe=>Oe.workItemId===_n);re&&(Qt.current=_n,L(),Ui(re))},[xe,n,Gt,e,Q,sn,_n,t,Me,Ui,L,zr,W,X,_,Gn,b,w]),g.useEffect(()=>{!z||!Hr||(Qt.current=null,X(null),W(Hr.workItemId))},[Hr,z,xe,W,X]),g.useEffect(()=>{!z||Hr||Qn||X(null)},[Hr,z,Qn,xe,X,fn]),g.useEffect(()=>{const F=H.trim().toLowerCase(),re=[...Me.map(at=>({kind:"active",variant:at})),...fn.map(at=>({kind:"past",entry:at})),...Tr?[{kind:"original"}]:[]],Oe=F?re.filter(at=>hT(at,F)):re,{pinned:Pe,unpinned:be}=pT(gT(uT(Oe,xe),$s),Zn,xe),De=[...J.has(N2)?[]:Pe,...be.flatMap(at=>at.key!==""&&J.has(at.key)?[]:at.rows)];return De.length===0?void 0:oJ(at=>{if(Wie())return;if(at.key==="Enter"){const Pt=Me.find(xi=>xi.workItemId===bl);Pt&&(at.preventDefault(),wi(Pt));return}if(at.key!=="ArrowUp"&&at.key!=="ArrowDown")return;at.preventDefault();const wt=V??_n;let Jn=wt?`live:${wt}`:null;Q?Jn=`past:${Q}`:ua&&(Jn=$N);const _r=Jn?De.findIndex(Pt=>vd(Pt)===Jn):-1;let Fs;if(_r===-1?Fs=at.key==="ArrowDown"?0:De.length-1:at.key==="ArrowDown"?Fs=Math.min(_r+1,De.length-1):Fs=Math.max(_r-1,0),Fs===_r)return;const js=De[Fs];js.kind==="active"?wi(js.variant):js.kind==="past"?gs(js.entry):da();const Ft=document.querySelector(`[data-variant-key="${vd(js)}"]`);Ft instanceof HTMLElement&&Ft.focus({preventScroll:!0})})},[Me,fn,H,Tr,J,Zn,$s,xe,V,Q,ua,_n,bl,wi,gs,da]);const Se=Me.find(F=>F.workItemId===_n)??null,Ue=Q?fn.find(F=>`${F.sessionId}:${F.variantId}`===Q)??null:null,ht=!!Ue,Tt=[...(t.active?Me:[]).map(F=>({kind:"active",variant:F})),...fn.map(F=>({kind:"past",entry:F})),...Tr?[{kind:"original"}]:[]],Jt=H.trim().toLowerCase(),pt=Jt?Tt.filter(F=>hT(F,Jt)):Tt,Tn=gT(uT(pt,xe),$s),{pinned:it,unpinned:Ir}=pT(Tn,Zn,xe);let Eo=null;R&&(Eo=R.source==="live"?`live:${R.variantId}`:`past:${R.sessionId}:${R.variantId}`);const ko=new Set(Me.map(F=>F.requestId).filter(Boolean)),Or=s.filter(F=>!ko.has(F.requestId)),Wi=Or.length>0,El=o&&!Wi&&Tt.length===0;return P.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[Tt.length>0?P.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:P.jsxs("div",{className:"relative",children:[P.jsx(nte,{size:13,className:"text-soft-foreground pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),P.jsx("input",{type:"text",value:H,onChange:F=>Y(F.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-surface-2 bg-muted/40 text-foreground placeholder:text-soft-foreground focus:ring-soft-foreground/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,P.jsxs("div",{ref:Sl,role:"region","aria-label":"Directions",tabIndex:-1,className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2 outline-none forced-colors:focus-visible:outline-2 forced-colors:focus-visible:-outline-offset-2 forced-colors:focus-visible:outline-solid",children:[Wi?P.jsx(Qoe,{groups:Or}):null,El?P.jsx(Joe,{}):null,t.active&&Tt.length===0&&!Wi&&!El?P.jsx(eae,{}):null,!t.active&&!Wi&&!El&&fn.length===0&&!Tr?P.jsx(tae,{isMCPSession:p,mcpEditor:m}):null,Tt.length>0&&pt.length===0?P.jsxs("p",{className:"text-soft-foreground px-1 py-6 text-center text-xs",children:["No directions match “",H.trim(),"”."]}):null,pt.length>0?P.jsx(Goe,{groups:Ir,pinned:it,pinnedKeys:vr,draggedRowKey:Eo,onDropPin:zt,onDropUnpin:ei,onTogglePin:cr,onReorder:Id,collapsedRuns:J,onToggleRun:K,activeVariantId:V??_n,activePastKey:Q,isOriginalSelected:ua,busy:D,editingKey:So,onSelectActive:wi,onSelectPast:gs,onSelectOriginal:da,onActivePointerDown:Rn,onPastPointerDown:Ur,onHover:xl,onRemove:(F,re)=>Ds({kind:"active",variant:F,returnFocusTo:re}),onRemovePast:(F,re)=>Ds({kind:"past",entry:F,returnFocusTo:re}),onStartRename:rs,onCommitRename:Tc,onCancelRename:Od,editingRunKey:ha,onStartRunRename:$,onCommitRunRename:ve,onCancelRunRename:ue,onRemoveRun:Bi,onCopyVariantContext:RN,activeSessionId:t.active?t.sessionId:null,projectPath:gt}):null]}),u&&ht&&Ue?P.jsx(Roe,{entry:Ue,deploying:Et===Q,deployedUrl:Q?Ae[Q]??null:null,onDeploy:fa,isDeployDisabled:!d}):null,!ht&&t.active?P.jsx(Xoe,{selectedVariant:Se,busy:D,onDeploy:wl,onDeployCanvas:Rc,canShare:u,canDeploy:d&&(dt==null?void 0:dt.kind)==="fresh",canDeployCanvas:d&&f&&(dt==null?void 0:dt.kind)==="fresh",canvasVariantCount:Qe.length,canvasDeployedUrl:xt,deployedUrl:Se?ke[Se.workItemId]??null:null}):null,P.jsx(Oie,{target:fe,fallbackFocus:Sl,isConfirming:ce,onCancel:()=>ae(null),onConfirm:Ar})]})},vd=e=>e.kind==="active"?`live:${e.variant.workItemId}`:e.kind==="past"?`past:${e.entry.sessionId}:${e.entry.variantId}`:$N,hT=(e,t)=>e.kind==="active"?f_(t,e.variant.label,e.variant.runLabel):e.kind==="past"?f_(t,e.entry.label,e.entry.runLabel,e.entry.brief):f_(t,Gx,NN),HN=(e,t)=>e.startsWith("live:")?`row:past:${t??""}:${e.slice(5)}`:`row:${e}`,UN=(e,t)=>HN(vd(e),t),pT=(e,t,n)=>{if(t.length===0)return{pinned:[],unpinned:e};const r=new Set(t),s=new Map,i=[];for(const c of e){const u=[];for(const d of c.rows){const f=UN(d,n);r.has(f)?s.set(f,d):u.push(d)}u.length>0&&i.push(u.length===c.rows.length?c:{...c,rows:u})}return{pinned:t.flatMap(c=>{const u=s.get(c);return u?[u]:[]}),unpinned:i}},mT=(e,t,n)=>{if(!t||t.length===0)return e;const r=new Map(t.map((o,c)=>[o,c])),s=e.filter(o=>!r.has(n(o)));if(s.length===e.length)return e;const i=e.flatMap(o=>{const c=r.get(n(o));return c===void 0?[]:[{item:o,index:c}]}).sort((o,c)=>o.index-c.index).map(({item:o})=>o);return[...s,...i]},gT=(e,t)=>{const n=e.map(r=>{const s=t.rows[r.key];return!s||s.length===0?r:{...r,rows:mT(r.rows,s,vd)}});return mT(n,t.groups,r=>r.key)},Boe=e=>e.length<=lT?e:`${e.slice(0,lT-1)}…`,Woe=(e,t)=>e.kind==="active"?t?`${t}:${e.variant.workItemId}`:null:e.kind==="past"?`${e.entry.sessionId}:${e.entry.variantId}`:null,Koe=e=>e.kind==="active"?e.variant.directionRef??null:e.kind==="past"?e.entry.directionRef??null:null,Goe=({groups:e,pinned:t,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:c,collapsedRuns:u,onToggleRun:d,activeVariantId:f,activePastKey:p,isOriginalSelected:m,busy:v,editingKey:_,onSelectActive:w,onSelectPast:b,onSelectOriginal:S,onActivePointerDown:E,onPastPointerDown:C,onHover:R,onRemove:T,onRemovePast:O,onStartRename:M,onCommitRename:A,onCancelRename:L,editingRunKey:V,onStartRunRename:W,onCommitRunRename:z,onCancelRunRename:X,onRemoveRun:Q,onCopyVariantContext:H,activeSessionId:Y,projectPath:oe})=>{const U=g.useRef(null),{activeIndex:J,itemRects:K,handlers:D,registerItem:q}=Jie(U,{snapTolerancePx:5}),[fe,ae]=g.useState(0),[ce,he]=g.useState(!1),[ke,ge]=g.useState(!1),pe=u.has(N2),Le=r!==null,Ae=g.useMemo(()=>{if(!r)return null;const Te=HN(r,Y);if(n.has(Te))return{container:Nf,key:Te};const xt=e.find(xe=>xe.rows.some(Nt=>vd(Nt)===r));return xt?{container:c_(xt.key),key:r}:null},[r,n,e,Y]),Ne=(Ae==null?void 0:Ae.container)===Nf,{dropTarget:Et,onPointerMove:dn,onPointerUp:sn}=voe({containerRef:U,dragged:Ae,yieldToSelector:Ne?void 0:"[data-pinned-drop-zone]",restrictToSelector:Ne?"[data-pinned-drop-zone]":void 0,onReorder:c}),kt=J!==null?K[J]:null,Gt=Te=>Te.kind==="active"?Te.variant.workItemId===f:Te.kind==="past"?`${Te.entry.sessionId}:${Te.entry.variantId}`===p:m,mn=(Te,xt,xe,Nt)=>{const dt=vd(Te),gt=UN(Te,Y);return P.jsx(Yoe,{rowKey:dt,row:Te,index:xt,isSelected:Gt(Te),isEditing:_===dt,isPinned:n.has(gt),onTogglePin:Hn=>o(gt,Hn),reorderContainer:xe,reorderKey:xe===Nf?gt:dt,isNested:Nt,busy:v,registerItem:q,onSelectActive:w,onSelectPast:b,onSelectOriginal:S,onActivePointerDown:E,onPastPointerDown:C,onHover:R,onRemove:T,onRemovePast:O,onStartRename:M,onCommitRename:A,onCancelRename:L,onCopyVariantContext:H,activeSessionId:Y,projectPath:oe},dt)};let Xt=0;const Me=Te=>{if(Te.key==="")return Te.rows.map(dt=>mn(dt,Xt++,c_(Te.key),!1));const xt=u.has(Te.key),xe=xt?null:Te.rows.map(dt=>mn(dt,Xt++,c_(Te.key),!0)),Nt=Te.label;return P.jsx(qoe,{label:Nt??Gx,collapsed:xt,onToggle:()=>d(Te.key),directionCount:Te.rows.length,isEditing:Nt!==null&&V===Te.key,onStartRename:Nt!==null?()=>W(Te.key):void 0,onCommitRename:Nt!==null?dt=>z(Te,dt):void 0,onCancelRename:X,onRemove:Nt!==null?dt=>Q(Te,dt):void 0,children:xe},Te.key)},Qe=t.length>0||Le;return P.jsxs("div",{ref:U,className:"relative",onMouseEnter:()=>{ae(Te=>Te+1),D.onMouseEnter()},onMouseMove:D.onMouseMove,onMouseLeave:D.onMouseLeave,onPointerMove:dn,onPointerUp:Te=>{var xt;if(Ne&&Ae){const xe=(xt=U.current)==null?void 0:xt.querySelector("[data-pinned-drop-zone]"),Nt=xe==null?void 0:xe.getBoundingClientRect();if(!(Nt!==void 0&&Te.clientY>=Nt.top&&Te.clientY<=Nt.bottom)){i(Ae.key);return}}sn()},children:[Ae&&Et?P.jsx("div",{className:"bg-soft-foreground pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:Et.top}}):null,P.jsx(Iu,{children:kt&&P.jsx(Jo.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:kt.top,left:kt.left,width:kt.width,height:kt.height},animate:{opacity:1,top:kt.top,left:kt.left,width:kt.width,height:kt.height},exit:{opacity:0,transition:{duration:.06}},transition:{...ug.fast,opacity:{duration:.08}}},fe)}),P.jsxs("ul",{className:"relative flex flex-col gap-2",children:[P.jsx(Iu,{initial:!1,children:Qe?P.jsxs(Jo.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:$2,ease:L2},"data-pinned-drop-zone":"",className:ir("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",Le&&"ring-soft-foreground/30 ring-1",Le&&ce&&"ring-soft-foreground/70 bg-white/[0.03]"),onPointerEnter:Le?()=>he(!0):void 0,onPointerLeave:Le?()=>he(!1):void 0,onPointerUp:Le?()=>{he(!1),s()}:void 0,children:[P.jsx("div",{"data-hover-dead-zone":"",children:P.jsxs("button",{type:"button",onClick:()=>d(N2),"aria-expanded":!pe,"aria-label":`${pe?"Expand":"Collapse"} pinned items`,className:"focus-visible:ring-soft-foreground/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors duration-80 hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[P.jsx(h2,{...cT}),P.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),P.jsx(Iu,{initial:!1,children:!pe&&P.jsx(Jo.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:$2,ease:L2},className:"overflow-hidden",children:t.length>0?P.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Te=>mn(Te,Xt++,Nf,!1))}):null},"body")})]},"pinned-section"):null}),Qe&&e.length>0?P.jsxs("li",{className:ir("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",Ne&&"ring-soft-foreground/30 ring-1",Ne&&ke&&"ring-soft-foreground/70 bg-white/[0.03]"),onPointerEnter:Ne?()=>ge(!0):void 0,onPointerLeave:Ne?()=>ge(!1):void 0,onPointerUp:Ne?()=>ge(!1):void 0,children:[P.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[P.jsx(ote,{...cT}),P.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),P.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Te=>Me(Te))})]}):e.map(Te=>Me(Te))]})]})},ZN=({open:e,onOpenChange:t,triggerLabel:n,actions:r})=>{const s=g.useRef(null);return P.jsxs(Bx,{isOpen:e,onOpenChange:t,children:[P.jsx(md,{label:n,children:P.jsx(Yg,{asChild:!0,children:P.jsx(Rr,{ref:s,type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:i=>i.stopPropagation(),onPointerDown:i=>i.stopPropagation(),className:DN,children:P.jsx(Qee,{size:15,weight:"bold"})})})}),P.jsx(Wx,{side:"bottom",align:"end",onCloseAutoFocus:i=>i.preventDefault(),children:r.map(i=>P.jsxs(ja,{disabled:i.disabled,onClick:o=>o.stopPropagation(),onSelect:()=>i.onSelect(s.current),onPointerDown:o=>o.stopPropagation(),children:[i.icon,i.label,i.detail?P.jsx("span",{className:"text-soft-foreground ml-auto pl-3 font-mono",children:i.detail}):null]},i.key))})]})},qoe=({label:e,collapsed:t,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:c,onRemove:u,children:d})=>{const f=Ys(),[p,m]=g.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:P.jsx(u$,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:P.jsx(y$,{size:13,weight:"bold"}),onSelect:u}]:[]],_=t?P.jsx(ete,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):P.jsx(Jee,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&c?P.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[P.jsxs("div",{"data-hover-dead-zone":"",className:"bg-muted flex w-full items-center gap-2 px-3 py-2",children:[_,P.jsx("span",{className:"min-w-0 flex-1",children:P.jsx(BN,{initial:e,onCommit:o,onCancel:c})})]}),P.jsx(Iu,{initial:!1,children:!t&&P.jsx(Jo.ul,{className:"overflow-hidden",children:d},"body")})]}):P.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[P.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[P.jsxs("button",{type:"button",onClick:w=>{if((w.metaKey||w.ctrlKey)&&v.length>0){m(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!t,directionCount:n}),r()},"aria-expanded":!t,"aria-label":`${t?"Expand":"Collapse"} ${e} directions`,className:"focus-visible:ring-soft-foreground/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors duration-80 hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[_,P.jsx("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm font-medium",children:e})]}),v.length>0&&P.jsx("div",{className:ir("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-80","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",p&&"pointer-events-auto opacity-100"),children:P.jsx(ZN,{open:p,onOpenChange:m,triggerLabel:`${e} run actions`,actions:v})})]}),P.jsx(Iu,{initial:!1,children:!t&&P.jsx(Jo.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:$2,ease:L2},className:"overflow-hidden",children:d},"body")})]})},Yoe=({rowKey:e,row:t,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:c,reorderKey:u,isNested:d,busy:f,registerItem:p,onSelectActive:m,onSelectPast:v,onSelectOriginal:_,onActivePointerDown:w,onPastPointerDown:b,onHover:S,onRemove:E,onRemovePast:C,onStartRename:R,onCommitRename:T,onCancelRename:O,onCopyVariantContext:M,activeSessionId:A,projectPath:L})=>{var pe,Le;const V=g.useRef(null);eoe(p,n,V);const[W,z]=g.useState(!1),X=t.kind==="active",Q=t.kind==="original",H=t.kind==="active"?t.variant:null,Y=t.kind==="past"?t.entry:null,oe=H?H.status==="succeeded":!0,U=H?Ih(H):!0,J=H!==null&&(H.status==="pending"||H.status==="running"),K=(H==null?void 0:H.status)==="failed",D=(H==null?void 0:H.status)==="cancelled",q=H!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===H.workItemId,fe=H!==null&&(((pe=H.refinement)==null?void 0:pe.status)==="pending"||((Le=H.refinement)==null?void 0:Le.status)==="running");let ae=Gx;H?ae=H.label||`Direction ${n+1}`:Y&&(ae=Y.label.trim()||"Untitled direction");let ce=NN;H?ce=H.description:Y&&(ce=Y.brief);const he=ce?Boe(ce):null,ke=Koe(t),ge=ke??Woe(t,A);return s?P.jsx("li",{ref:V,"data-proximity-index":n,"data-reorder-container":c,"data-reorder-key":u,className:"group relative z-10",children:P.jsx("div",{className:ir("bg-muted flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:P.jsxs("span",{className:"min-w-0 flex-1",children:[P.jsx(BN,{initial:ae,onCommit:Ae=>T(t,Ae),onCancel:O}),he&&P.jsx("span",{className:"text-soft-foreground mt-1 line-clamp-2 block text-xs leading-snug",children:he})]})})}):P.jsxs("li",{ref:V,"data-proximity-index":n,"data-reorder-container":c,"data-reorder-key":u,className:ir("group relative z-10 rounded-md",r&&"bg-muted"),onMouseEnter:H?()=>S(H.workItemId):void 0,onMouseLeave:X?()=>S(null):void 0,children:[P.jsx("div",{role:"button",tabIndex:0,"data-variant-id":H==null?void 0:H.workItemId,"data-variant-key":e,onClick:Ae=>{if(Ae.metaKey||Ae.ctrlKey){z(!0);return}const Ne=window.getSelection();Ne&&!Ne.isCollapsed||(t.kind==="active"?m(t.variant):t.kind==="past"?v(t.entry):_())},onKeyDown:Ae=>{(Ae.key==="Enter"||Ae.key===" ")&&(Ae.preventDefault(),Ae.stopPropagation(),t.kind==="active"?m(t.variant):t.kind==="past"?v(t.entry):_())},onPointerDown:Ae=>{Ae.metaKey||Ae.ctrlKey||(t.kind==="active"?U&&w(t.variant.workItemId,Ae):t.kind==="past"&&b(t.entry,Ae))},"aria-pressed":r,"aria-disabled":X?!1:void 0,"aria-busy":J||fe,className:ir("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",U&&"cursor-grab active:cursor-grabbing",!U&&"cursor-pointer"),style:U?{touchAction:"none"}:void 0,children:P.jsxs("span",{className:"min-w-0 flex-1",children:[P.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(J||fe)&&P.jsx(TN,{className:"text-soft-foreground shrink-0 text-sm","data-testid":fe&&!J?"variant-refining":void 0}),P.jsx(md,{label:"Double-click to rename",disabled:Q,children:P.jsx("span",{onDoubleClick:Ae=>{Ae.stopPropagation(),Q||R(e)},className:ir("min-w-0 flex-1 truncate text-sm font-medium select-text",Q?"cursor-default":"cursor-text",oe||r?"text-foreground":"text-soft-foreground"),children:ae})}),K&&P.jsx(md,{label:(H==null?void 0:H.errorMessage)??(H==null?void 0:H.errorCode)??"Failed",disabled:!(H!=null&&H.errorMessage)&&!(H!=null&&H.errorCode),children:P.jsx("span",{className:"shrink-0",children:P.jsx(vT,{label:"Failed"})})}),D&&P.jsx(vT,{label:"Cancelled"})]}),he&&P.jsx("span",{className:"text-soft-foreground mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:he})]})}),Q?null:P.jsx(lne,{references:(H==null?void 0:H.references)??(Y==null?void 0:Y.references),source:X?"active":"history",sessionId:(Y==null?void 0:Y.sessionId)??A,variantId:(Y==null?void 0:Y.variantId)??(H==null?void 0:H.workItemId),projectPath:L,className:d?"pl-[33px]":"pl-3"}),P.jsxs("div",{className:ir("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-80 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",W&&"pointer-events-auto opacity-100"),children:[P.jsx(Rr,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:Ae=>Ae.stopPropagation(),onKeyDown:Ae=>{(Ae.key!=="ArrowUp"&&Ae.key!=="ArrowDown"||Ae.altKey||Ae.ctrlKey||Ae.metaKey||Ae.shiftKey)&&Ae.stopPropagation()},onClick:Ae=>{Ae.stopPropagation(),o("button")},className:DN,children:P.jsx(h2,{weight:i?"fill":"bold"})}),P.jsx(ZN,{open:W,onOpenChange:z,triggerLabel:"Direction actions",actions:[...ge?[{key:"copy-ref",label:"Copy ref",detail:ge,icon:P.jsx(tte,{size:13,weight:"bold"}),onSelect:()=>M({text:ge,copyKind:ke?"direction_ref":"reference"})}]:[],...!ge&&ce?[{key:"copy",label:"Copy description",icon:P.jsx(Eh,{size:13,weight:"bold"}),onSelect:()=>M({text:Coe({label:ae,description:ce}),copyKind:"description"})}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:P.jsx(h2,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...Q?[]:[{key:"rename",label:"Rename",icon:P.jsx(u$,{size:13,weight:"bold"}),onSelect:()=>R(e)},{key:"remove",label:"Remove",icon:P.jsx(y$,{size:13,weight:"bold"}),disabled:q,onSelect:Ae=>{t.kind==="active"?E(t.variant,Ae):t.kind==="past"&&C(t.entry,Ae)}}]]})]})]})},BN=({initial:e,onCommit:t,onCancel:n})=>{const[r,s]=g.useState(e),i=g.useRef(!1),o=g.useCallback(u=>{u&&(u.focus(),u.select())},[]),c=u=>{i.current||(i.current=!0,u?t(r):n())};return P.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(),c(!0)):u.key==="Escape"&&(u.preventDefault(),c(!1))},onBlur:()=>c(!0),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),className:"border-soft-foreground/40 bg-background text-foreground focus:border-soft-foreground w-full rounded border px-1.5 py-0.5 text-sm font-medium outline-hidden transition-colors"})},vT=({label:e})=>P.jsx("span",{className:"bg-muted text-soft-foreground shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:e}),Xoe=({selectedVariant:e,busy:t,onDeploy:n,onDeployCanvas:r,canShare:s,canDeploy:i,canDeployCanvas:o,canvasVariantCount:c,canvasDeployedUrl:u,deployedUrl:d})=>{const f=e?VN(e):!1,p=(t==null?void 0:t.kind)==="deploy"&&t.variantId===(e==null?void 0:e.workItemId),m=(t==null?void 0:t.kind)==="deploy-canvas",v=!i||!f||t!==null,_=o&&c>0,b=p?"Deploying…":d?"Copy link":"Share",E=m?"Sharing…":u?"Copy canvas link":"Share canvas";return P.jsxs("div",{className:"border-surface-2 bg-card flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[P.jsx("div",{className:"min-w-0",children:e?P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"text-foreground truncate text-sm font-medium",children:e.label.trim()||"Untitled direction"}),d?P.jsx("div",{className:"text-soft-foreground text-[11px]",children:"Deployed — share link ready"}):null]}):null}),P.jsx("div",{className:"flex shrink-0 items-center gap-2",children:s?P.jsx(Toe,{primaryLabel:b,primaryIcon:d&&!p?Eh:void 0,primaryAction:()=>{e&&n(e)},isDisabled:v,isDropdownDisabled:t!==null,isLoading:p,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:_?[{label:E,icon:u&&!m?Eh:void 0,onClick:r,isDisabled:t!==null}]:[]}):null})]})},WN=()=>P.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:P.jsxs("span",{className:"min-w-0 flex-1",children:[P.jsxs("span",{className:"flex items-center gap-2",children:[P.jsx(TN,{className:"text-soft-foreground shrink-0 text-sm"}),P.jsx(fg,{className:"h-3.5 w-28"})]}),P.jsx("span",{className:"mt-1.5 flex",children:P.jsx(fg,{className:"h-2.5 w-full max-w-[14rem]"})})]})}),Qoe=({groups:e})=>P.jsx("div",{className:"space-y-0.5",children:e.flatMap(t=>Array.from({length:Math.max(1,t.count)}).map((n,r)=>P.jsx(WN,{},`${t.requestId}-${r}`)))}),Joe=()=>P.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((e,t)=>P.jsx(WN,{},t))}),eae=()=>P.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[P.jsx("div",{className:"text-foreground text-sm",children:"No directions yet"}),P.jsx("div",{className:"text-soft-foreground text-xs",children:"They’ll appear here as they generate."})]}),yT="Try different ways to create a dropdown that feels fluid and dynamic",tae=({isMCPSession:e=!1,mcpEditor:t=null})=>{const[n,r]=g.useState(!1),s=koe(t),i=e?s:"your coding agent",o=()=>{navigator.clipboard.writeText(yT).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return P.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[P.jsx("p",{className:"text-foreground text-sm font-medium",children:"Create your first direction"}),P.jsxs("p",{className:"text-soft-foreground text-xs",children:["Use ",i," to generate directions."]}),P.jsxs("div",{className:"w-full",children:[P.jsx("p",{className:"text-soft-foreground mb-2 text-xs",children:"Here's a sample prompt to use:"}),P.jsxs("div",{className:"border-surface-2 bg-muted relative rounded-md border px-3 py-2.5 pr-9",children:[P.jsxs("p",{className:"text-soft-foreground text-xs leading-snug",children:["“",yT,"”"]}),P.jsx(Rr,{variant:"ghost",size:"icon-compact",onClick:o,"aria-label":"Copy sample prompt",title:"Copy to clipboard",className:"absolute top-1 right-1",children:n?P.jsx(Xee,{"data-testid":"sample-prompt-copied",className:"text-accent-success",weight:"bold"}):P.jsx(Eh,{weight:"bold"})})]})]})]})},nae="Open Rivet",D2="Close Rivet",rae=".",sae=229,iae=/Mac|iPhone|iPad|iPod/,oae={ariaKeyShortcuts:"Meta+.",modifier:"metaKey"},aae={ariaKeyShortcuts:"Control+.",modifier:"ctrlKey"},qx=()=>typeof navigator<"u"&&iae.test(navigator.platform)?oae:aae,lae=e=>{const{modifier:t}=qx();return e.key===rae&&!e.isComposing&&e.keyCode!==sae&&e.metaKey===(t==="metaKey")&&e.ctrlKey===(t==="ctrlKey")&&!e.altKey&&!e.shiftKey},cae="rivet:show-projects",uae=e=>{const t=new URLSearchParams(e),n=t.get("libraryOrigin");if(t.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}},dae=({onClose:e,libraryOrigin:t})=>{const n=Ys(),r=_t(wN),s=_t(Xg),i=uae(window.location.search),o=window.parent!==window&&i!==null,c=(s==null?void 0:s.split(/[\\/]/).filter(Boolean).pop())??"Project";if(!e)return null;let u=r?P.jsx("span",{className:"text-foreground min-w-0 truncate text-sm font-medium",title:r,children:r}):P.jsx("span",{});if(o||t){const f=P.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[P.jsx("li",{className:"shrink-0",children:P.jsx("button",{type:"button",onClick:async()=>{if(o&&i)window.parent.postMessage(cae,i);else{try{const p=await Dt("/api/library/browser-launches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({view:"projects"})});if(!p.ok)throw new Error("The project library could not be opened.");const{url:m}=KW.parse(await p.json());window.location.assign(m)}catch{en.error("Could not open the project library. Please try again.");return}n==null||n.capture("library_view_changed",{view:"projects"})}},className:"text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-foreground rounded px-1 py-1 focus-visible:outline focus-visible:outline-2",children:"Projects"})}),P.jsx("li",{"aria-hidden":!0,className:"text-muted-foreground shrink-0",children:P.jsx(qee,{className:"h-3 w-3"})}),P.jsx("li",{className:"min-w-0",children:P.jsx("span",{"aria-current":"page",title:c,className:"text-foreground block truncate font-medium",children:c})})]});u=P.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:f})}const d=qx();return P.jsxs("div",{className:"border-surface-2 bg-card z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b px-2.5 py-2.5",children:[u,P.jsx(md,{label:D2,side:"bottom",children:P.jsx(Rr,{variant:"ghost",size:"icon-compact",onClick:e,"aria-label":D2,"aria-keyshortcuts":d.ariaKeyShortcuts,className:"shrink-0",children:P.jsx(rte,{weight:"bold"})})})]})},fae=Ve({agentModeAvailable:Rs(),email:ne().optional(),userId:ne().optional(),name:ne().optional(),isMCPSession:Rs(),mcpEditor:ne().nullable(),agentApplyMode:Vt(["embedded","external"]).nullable().optional(),queueAccessToken:ne().nullable().optional(),projectPath:ne(),projectName:ne().optional(),projectId:ne().uuid().nullable().optional(),libraryOrigin:ne().url().nullable()}),KN=async({signal:e})=>{const t=await Dt("/api/config",{signal:e});if(!t.ok)throw new Error(`Failed to fetch config: ${t.statusText}`);return fae.parse(await t.json())},GN=5e3,hae=async({signal:e})=>{const t=await Dt("/api/account",{signal:e});if(!t.ok)throw new Error("Could not load your account.");return qW.parse(await t.json())},pae=e=>({isAuthenticated:e.agentModeAvailable,name:e.name,email:e.email,userId:e.userId}),mae=e=>_o({queryKey:Is.account,queryFn:hae,enabled:e,refetchInterval:GN,retry:!1}),gae=e=>_o({queryKey:Is.rivetConfig,queryFn:KN,select:pae,enabled:e,refetchInterval:GN,retry:!1}),vae=()=>{const e=window.location.pathname.startsWith("/rivet/library"),t=mae(e),n=gae(!e);return e?t:n},pg="rivet_just_signed_in",F2="https://rivet-proxy.onrender.com",yae=e=>{const t=e.toLowerCase();return t.includes("timed out")?"timeout":t.includes("pop-up blocked")?"popup_blocked":t.includes("window was closed")?"popup_closed":t.includes("store session")?"credential_store_failed":"provider_failed"},m_=({outcome:e,authAttemptId:t,startedAt:n,now:r,failureReason:s,entryPoint:i="editor_gate"})=>({event:`visual_editor_auth_${e}`,properties:{auth_attempt_id:t,duration_ms:r-n,entry_point:i,method:"google_oauth",...s?{failure_reason:s}:{}}}),_T=Ls("useLogin"),_ae=2e3,wae=60,wT="Connecting to Google...",bae=`<!doctype html>
|
|
171
|
+
<html lang="en">
|
|
172
|
+
<head>
|
|
173
|
+
<meta charset="utf-8" />
|
|
174
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
175
|
+
<title>${wT}</title>
|
|
176
|
+
<style>
|
|
177
|
+
:root { color-scheme: light dark; }
|
|
178
|
+
body {
|
|
179
|
+
margin: 0;
|
|
180
|
+
min-height: 100vh;
|
|
181
|
+
display: grid;
|
|
182
|
+
place-items: center;
|
|
183
|
+
font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
|
|
184
|
+
background: #111215;
|
|
185
|
+
color: #f3f4f6;
|
|
186
|
+
}
|
|
187
|
+
.panel {
|
|
188
|
+
border: 1px solid rgba(255, 255, 255, 0.16);
|
|
189
|
+
border-radius: 12px;
|
|
190
|
+
padding: 18px 22px;
|
|
191
|
+
background: rgba(255, 255, 255, 0.06);
|
|
192
|
+
font-size: 14px;
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
195
|
+
</head>
|
|
196
|
+
<body>
|
|
197
|
+
<div class="panel">${wT}</div>
|
|
198
|
+
</body>
|
|
199
|
+
</html>`,xae=Ve({success:Rs(),authUrl:ne().optional(),sessionId:ne().optional(),pollSecret:ne().optional(),error:ne().optional(),message:ne().optional()}),Sae=Ve({success:Rs(),token:ne().optional(),refreshToken:ne().optional(),user:Ve({id:ne().optional(),email:ne().optional()}).optional(),error:ne().optional(),message:ne().optional()}),Eae="/api/auth/install-ref",kae=Ve({installRef:ne().nullable()}),Cae=async()=>{try{const e=await fetch(Eae);if(!e.ok)return;const t=kae.safeParse(await e.json());return t.success?t.data.installRef??void 0:void 0}catch{return}},qN=(e="editor_gate",t)=>{const n=Ys(),[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=m_({outcome:"started",authAttemptId:u,entryPoint:e,startedAt:d,now:d});n==null||n.capture(f.event,f.properties);let p=null;try{if(p=window.open("","_blank"),!p)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{p.document.open(),p.document.write(bae),p.document.close()}catch(S){_T.warn("Failed to render loading state in auth popup:",S)}const v=await Cae(),_=await fetch(`${F2}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core",...v?{ref:v}:{}})}),w=xae.safeParse(await _.json());if(!w.success)throw new Error("Invalid Google login response");const b=w.data;if(!_.ok||!b.success||!b.authUrl||!b.sessionId||!b.pollSecret)throw new Error(b.error||b.message||"Failed to start Google login");if(p.closed)throw new Error("Sign-in window was closed before Google login started.");p.location.href=b.authUrl;for(let S=0;S<wae;S+=1){if(p.closed)throw new Error("Sign-in window was closed before authentication completed.");const E=await fetch(`${F2}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:b.sessionId,pollSecret:b.pollSecret})}),C=Sae.safeParse(await E.json());if(!C.success)throw new Error("Invalid Google token response");const R=C.data;if(R.success&&R.token&&((m=R.user)!=null&&m.email)){const T={email:R.user.email,token:R.token,refreshToken:R.refreshToken,userId:R.user.id,...v?{installRef:v}:{}};if(t)await t(T);else if(!(await Dt("/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.");p.close(),window.sessionStorage.setItem(pg,"1");const O=m_({outcome:"completed",authAttemptId:u,entryPoint:e,startedAt:d,now:Date.now()});n==null||n.capture(O.event,O.properties),window.location.reload();return}if(R.error&&R.error!=="Pending")throw new Error(R.error||"Google login failed");await new Promise(T=>setTimeout(T,_ae))}throw new Error("Authentication timed out. Please try again.")}catch(v){p&&!p.closed&&p.close();const _=Ps(v,"Failed to start login flow");_T.warn("Login failed:",_);const w=m_({outcome:"failed",authAttemptId:u,entryPoint:e,startedAt:d,now:Date.now(),failureReason:yae(_)});n==null||n.capture(w.event,w.properties),o(_),s(!1)}},[n,e,t]),isStartingLogin:r,loginError:i}},Pae=Ls("useIntegrations"),Rae=Ve({provider:ne(),status:ne(),externalUsername:ne().nullable(),connectedAt:ne()}),Tae=Ve({integrations:Rt(Rae).optional()}),Aae=Ve({authUrl:ne().min(1).optional(),error:ne().optional()}),Iae="rivet:connect-result",Oae=e=>typeof e=="object"&&e!==null&&e.type===Iae,Mae=un(null),bT=async()=>{const e=await Dt("/api/integrations");if(!e.ok)throw new Error(`Failed to load integrations (${e.status})`);return Tae.parse(await e.json()).integrations??[]},Lae=async e=>{const t=await Dt(`/api/integrations/${e}`,{method:"DELETE"});if(!t.ok){const n=DO.safeParse(await t.json().catch(()=>({})));throw new Error(n.success&&n.data.error||`Could not disconnect ${e}`)}},$ae=()=>{const e=Uh(),[t,n]=YL(Mae),r=_o({queryKey:Is.integrations,queryFn:bT,staleTime:1e4}),s=g.useCallback(async()=>(await e.invalidateQueries({queryKey:Is.integrations,refetchType:"none"}),e.fetchQuery({queryKey:Is.integrations,queryFn:bT})),[e]),i=g.useCallback(async u=>{const d=window.open("","_blank","width=560,height=720");if(!d)throw new Error("Popup blocked. Allow popups to connect.");n(u);try{const f=await Dt(`/api/integrations/${u}/connect`,{method:"POST"}),p=Aae.safeParse(await f.json().catch(()=>({}))),m=p.success?p.data:{};if(!f.ok||!m.authUrl)throw d.close(),new Error(m.error||`Could not connect ${u}`);return d.location.href=m.authUrl,await new Promise(v=>{let _=!1,w=null;const b=async(E,C=!1)=>{if(!_){_=!0,window.removeEventListener("message",S),w&&clearInterval(w);try{const T=(await s()).some(O=>O.provider===u&&O.status==="connected");v(C&&T?"connected":E)}catch{v(E)}}},S=E=>{if(Oae(E.data)&&E.data.provider===u){if(E.data.status==="error"){Pae.warn(`Connect failed for ${u}:`,E.data.message),b("failed");return}b("connected")}};window.addEventListener("message",S),w=setInterval(()=>{d.closed&&b("closed",!0)},500)})}finally{n(null)}},[s,n]),{mutateAsync:o}=sM({mutationFn:Lae,onSuccess:s}),c=g.useCallback(async u=>{n(u);try{await o(u)}finally{n(null)}},[o,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:t,connect:i,disconnect:c,refetch:s}},Wl=({action:e,outcome:t,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${e==="connect"?"connection":"disconnection"}_${t}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),yc=ne().regex(/^[1-9]\d{0,15}$/).refine(e=>Number.isSafeInteger(Number(e))),YN=ne().min(1).max(4096),Yx=e=>{const t=()=>new Error("Use an HTTPS Cosmos profile URL such as https://www.cosmos.so/username");let n;try{n=new URL(e)}catch{throw t()}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 t();let s;try{s=decodeURIComponent(r[0])}catch{throw t()}if(!/^[a-zA-Z0-9_.-]{1,100}$/.test(s)||["e","login","signup","explore","search","collections","settings","api","profile"].includes(s.toLowerCase()))throw t();return{username:s,url:`https://www.cosmos.so/${encodeURIComponent(s)}`}},XN=ne().max(2048).transform((e,t)=>{try{return Yx(e).url}catch(n){return t.addIssue({code:kO.custom,message:Ps(n,"Invalid Cosmos profile URL")}),FI}}),QN=e=>{const t=()=>new Error("Use an HTTPS Cosmos collection URL such as https://www.cosmos.so/owner/collection");let n;try{n=new URL(e)}catch{throw t()}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 t();let s;try{s=r.map(i=>decodeURIComponent(i))}catch{throw t()}if(s.some(i=>!i.length||i.length>300||/[/\\\p{Cc}]/u.test(i)))throw t();return{ownerUsername:s[0],slug:s[1],subcollectionSlug:s[2],url:`https://www.cosmos.so/${s.map(encodeURIComponent).join("/")}`}},Nae=ne().url().refine(e=>{const t=new URL(e);return t.protocol==="https:"&&t.hostname==="cdn.cosmos.so"&&!t.username&&!t.password&&!t.port}),Dae=Ve({id:yc,title:ne().min(1).max(500),url:ne().url().transform(e=>QN(e).url),children:Rt(yc)}),Fae=Ve({id:yc,url:ne().url(),title:ne().max(1e3),text:ne().max(1e5),author:ne().nullable(),owner:ne().nullable(),sourceUrl:ne().url().nullable(),images:Rt(Ve({url:Nae,representation:Vt(["image","video-cover"])})).max(100),unsupportedReason:ne().optional()}),jae=Ve({collection:Dae,elements:Rt(Fae),total:Pn().int().nonnegative(),nextCursor:YN.nullable()});LB("status",[jae.extend({status:id("ok")}),Ve({status:id("error"),message:ne(),reason:Vt(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:Pn().nonnegative().optional()})]);const JN=Ve({id:yc,username:ne().min(1).max(100),title:ne().max(500),url:ne().transform(e=>Yx(e).url)}),Vae=Ve({id:yc,title:ne().min(1).max(500),description:ne().max(1e4).nullable(),url:ne().transform(e=>QN(e).url),total:Pn().int().nonnegative(),parentId:yc.nullable(),children:Rt(yc).max(1e4)});Ve({profile:JN,collections:Rt(Vae),total:Pn().int().nonnegative(),nextCursor:YN.nullable()});const e4=Vt(["pinterest","arena","x"]),zae=Vt(["cosmos","pinterest","arena","x"]),$u=ne().min(1).max(200).regex(/^[a-zA-Z0-9:_-]+$/),t4={"www.cosmos.so":"cosmos","www.pinterest.com":"pinterest","www.are.na":"arena","x.com":"x"},Hae=ne().url().refine(e=>{const t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password&&!t.port&&!t.search&&!t.hash&&e4.safeParse(t4[t.hostname]).success&&/^\/[a-zA-Z0-9_-]+\/?$/.test(t.pathname)},"Use a canonical reference provider profile URL"),Xx=Ve({id:$u,username:ne().min(1).max(100),title:ne().max(500),url:zh([XN,Hae])}).transform(e=>t4[new URL(e.url).hostname]==="cosmos"?JN.parse(e):e),Qx=Ve({id:$u,title:ne().min(1).max(500),description:ne().max(1e4).nullable(),url:ne().url().nullable(),total:Pn().int().nonnegative().nullable(),parentId:$u.nullable(),children:Rt($u).max(1e4)});zh([Ve({url:XN}).strict(),Ve({provider:e4}).strict()]);const Uae=Ve({collections:Rt(Qx),total:Pn().int().nonnegative().nullable(),nextCursor:ne().min(1).max(4096).nullable()});Uae.extend({profile:Xx});const Oh=1e3,Zae=1e4,Bae=Ve({profile:Xx,collections:Rt(Qx).max(Oh),total:Pn().int().nonnegative().max(Oh)}),Wae=Bae.extend({id:ne().uuid(),createdAt:ne().datetime()}),Kae=Ve({collection:Qx,collectionIds:Rt($u).min(1).max(Oh),references:Rt($O.extend({provider:zae})).max(Zae)}),Gae=Ve({discoveryId:ne().uuid(),runtime:Hh,sources:Rt(Kae).min(1).max(Oh),reusableCount:Pn().int().nonnegative()});Gae.extend({id:ne().uuid(),profile:Xx,revision:ne().regex(/^[a-f0-9]{64}$/),createdAt:ne().datetime(),expiresAt:ne().datetime(),approvedAt:ne().datetime().nullable(),jobIds:Rt(ne().uuid())});Ve({discoveryId:ne().uuid(),collectionIds:Rt($u).min(1).max(Oh),runtime:Hh}).strict();Ve({id:ne().uuid(),revision:ne().regex(/^[a-f0-9]{64}$/),isApproved:id(!0)}).strict();Vt(["later","dismiss","reset"]);const Qh=async(e,t,n="GET",r)=>{if(window.location.pathname.startsWith("/rivet/library"))return eK(e,{schema:t,method:n,body:r});const s=await Dt(e.replace(/^\/profile/,"/api/reference-profiles"),{method:n,headers:{"Content-Type":"application/json"},...r!==void 0?{body:JSON.stringify(r)}:{}}),i=await s.text();let o;try{o=JSON.parse(i)}catch{throw new Error(`Reference profile request failed (${s.status})`)}if(!s.ok)throw new Error(o.error??`Request failed (${s.status})`);return o},n4=()=>Qh("/profile",FO),qae=e=>_o({queryKey:Is.cosmosProfile,queryFn:n4,enabled:e}),Yae=e=>Qh("/profile/discoveries",Wae,"POST",{url:e}),Xae=({discoveryId:e,collectionIds:t,runtime:n})=>Qh("/profile/import-plans",jO,"POST",{discoveryId:e,collectionIds:t,runtime:n}),Qae=e=>Qh("/profile",FO,"PATCH",{isEnabled:!0,runtime:e}),Jae=e=>Qh(`/profile/import-plans/${e.id}/imports`,jO,"POST",{revision:e.revision,isApproved:!0}),ele=({isOpen:e,onClose:t,onImported:n})=>{const[r,s]=g.useState(""),[i,o]=g.useState(null),[c,u]=g.useState([]),[d,f]=g.useState(""),[p,m]=g.useState(null),[v,_]=g.useState(null),[w,b]=g.useState(!1),S=g.useRef(0),E=Ys(),C=()=>{S.current+=1,s(""),o(null),u([]),f(""),m(null),_(null),b(!1)},R=()=>{E==null||E.capture("visual_editor_cosmos_modal_closed"),C(),t()},T=async L=>{L.preventDefault(),_(null);let V;try{V=Yx(r.trim()).url}catch(z){_(Ps(z,"Invalid Cosmos profile URL"));return}E==null||E.capture("visual_editor_cosmos_discovery_started");const W=++S.current;b(!0);try{const z=await Yae(V);if(W!==S.current)return;o(z),u([]),E==null||E.capture("visual_editor_cosmos_discovery_completed",{collection_count:z.collections.length})}catch(z){if(W!==S.current)return;_(Ps(z,"Could not find Cosmos profile")),E==null||E.capture("visual_editor_cosmos_discovery_failed")}finally{W===S.current&&b(!1)}},O=async()=>{if(!i||c.length===0||!d)return;_(null),E==null||E.capture("visual_editor_cosmos_plan_started",{collection_count:c.length,runtime:d});const L=++S.current;b(!0);try{const V=await Xae({discoveryId:i.id,collectionIds:c,runtime:d});if(L!==S.current)return;m(V),E==null||E.capture("visual_editor_cosmos_plan_completed",{collection_count:V.collectionCount,reference_count:V.referenceCount})}catch(V){if(L!==S.current)return;_(Ps(V,"Could not prepare import plan")),E==null||E.capture("visual_editor_cosmos_plan_failed")}finally{L===S.current&&b(!1)}},M=async()=>{if(!p||!d)return;_(null),E==null||E.capture("visual_editor_cosmos_import_started",{collection_count:p.collectionCount,reference_count:p.referenceCount});const L=++S.current;b(!0);try{if((await n4()).profile.isEnabled||await Qae(d),await Jae(p),E==null||E.capture("visual_editor_cosmos_import_completed",{reference_count:p.referenceCount}),n(),L!==S.current)return;C(),t()}catch(V){if(E==null||E.capture("visual_editor_cosmos_import_failed"),L!==S.current)return;_(Ps(V,"Could not start Cosmos import"))}finally{L===S.current&&b(!1)}},A=L=>{u(V=>V.includes(L)?V.filter(W=>W!==L):[...V,L]),E==null||E.capture("visual_editor_cosmos_collection_toggled")};return P.jsx(Kg,{open:e,onOpenChange:L=>!L&&R(),children:P.jsxs(qg,{isStacked:!0,className:"max-h-[min(680px,calc(100vh-32px))] w-[min(440px,calc(100vw-32px))] overflow-y-auto",children:[P.jsx(Vx,{onClose:R,children:"Connect Cosmos"}),P.jsxs("div",{className:"space-y-4 p-4",children:[P.jsx(Gg,{className:"text-muted-foreground text-sm",children:"Add public collections from a Cosmos profile to your design references."}),i?null:P.jsxs("form",{onSubmit:L=>void T(L),className:"space-y-4",children:[P.jsx("label",{className:"text-foreground block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),P.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-surface-2 bg-muted text-foreground placeholder:text-soft-foreground hover:border-soft-foreground/50 focus-visible:border-soft-foreground w-full rounded-md border px-3 py-2 text-sm transition-colors focus-visible:outline-hidden motion-reduce:transition-none"}),P.jsx(Rr,{type:"submit",variant:"secondary",disabled:w,children:w?"Finding collections…":"Continue"})]}),i&&!p?P.jsxs("div",{className:"space-y-4",children:[P.jsxs("p",{className:"text-foreground text-sm font-medium",children:["Choose collections from"," ",i.profile.title||i.profile.username]}),P.jsx("div",{className:"border-surface-2 has-[:focus-visible]:border-soft-foreground max-h-60 divide-y overflow-y-auto rounded-md border transition-colors motion-reduce:transition-none",children:i.collections.map(L=>P.jsxs("label",{className:"text-foreground hover:bg-card has-[:focus-visible]:bg-active flex cursor-pointer items-center gap-3 px-3 py-2 text-sm transition-colors motion-reduce:transition-none",children:[P.jsx("input",{type:"checkbox",className:"focus-visible:outline-hidden",checked:c.includes(L.id),disabled:w,onChange:()=>A(L.id)}),P.jsx("span",{className:"min-w-0 flex-1 truncate",children:L.title}),P.jsx("span",{className:"text-soft-foreground text-xs",children:L.total??"—"})]},L.id))}),i.collections.length===0?P.jsx("p",{className:"text-soft-foreground text-sm",children:"No public collections found for this profile."}):null,P.jsxs("label",{className:"text-foreground flex items-center justify-between gap-3 text-sm",children:["Analysis runtime",P.jsxs("select",{value:d,disabled:w,onChange:L=>{const V=L.target.value;f(V),E==null||E.capture("visual_editor_cosmos_runtime_selected",{runtime:V})},className:"border-surface-2 bg-muted hover:border-soft-foreground/50 focus-visible:border-soft-foreground rounded-md border px-2 py-1.5 transition-colors focus-visible:outline-hidden motion-reduce:transition-none",children:[P.jsx("option",{value:"",disabled:!0,children:"Select a runtime"}),P.jsx("option",{value:"codex",children:"Codex"}),P.jsx("option",{value:"claude",children:"Claude"}),P.jsx("option",{value:"cursor",children:"Cursor"})]})]}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Rr,{variant:"secondary",onClick:()=>void O(),disabled:w||c.length===0||!d,children:w?"Preparing plan…":"Review import plan"}),P.jsx(Rr,{variant:"ghost",onClick:()=>{E==null||E.capture("visual_editor_cosmos_profile_changed"),C()},disabled:w,children:"Use another profile"})]})]}):null,p?P.jsxs("div",{className:"space-y-4 text-sm",children:[P.jsxs("p",{className:"text-foreground",children:[p.collectionCount," ",p.collectionCount===1?"collection":"collections"," ·"," ",p.referenceCount," ",p.referenceCount===1?"reference":"references"," ·"," ",p.imageCount," ",p.imageCount===1?"image":"images"]}),P.jsx("p",{className:"text-muted-foreground",children:p.scopeDisclosure}),P.jsx("p",{className:"text-muted-foreground",children:p.usageDisclosure}),P.jsxs("p",{className:"text-soft-foreground text-xs",children:[p.reusableCount," reusable · ",p.unsupportedCount," ","unsupported · runtime: ",d]}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Rr,{variant:"secondary",onClick:()=>void M(),disabled:w,children:w?"Starting import…":"Approve and import"}),P.jsx(Rr,{variant:"ghost",onClick:()=>{E==null||E.capture("visual_editor_cosmos_plan_revised"),m(null)},disabled:w,children:"Change selection"})]})]}):null,v?P.jsx("p",{role:"alert",className:"text-sm text-red-300",children:v}):null]})]})})},xT=Ls("ConnectorsModal"),tle=[{provider:"x",name:"X",iconClassName:"text-foreground",icon:P.jsx(th,{provider:"x"})},{provider:"pinterest",name:"Pinterest",iconClassName:"text-[#e60023]",icon:P.jsx(th,{provider:"pinterest"})},{provider:"arena",name:"Are.na",iconClassName:"text-foreground",icon:P.jsx(th,{provider:"arena"})}],nle={name:"Cosmos",iconClassName:"text-foreground",icon:P.jsx(th,{provider:"cosmos"})},ST=({meta:e,status:t,actionLabel:n,buttonLabel:r,isDisabled:s,isHighlighted:i,onAction:o})=>P.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:[P.jsx("span",{className:`grid h-7 w-7 flex-none place-items-center ${e.iconClassName}`,"aria-hidden":"true",children:e.icon}),P.jsxs("div",{className:"min-w-0 flex-1",children:[P.jsx("span",{className:"text-foreground block text-sm font-medium",children:e.name}),P.jsx("span",{className:"text-soft-foreground block truncate text-xs",children:t})]}),P.jsx(Rr,{variant:"secondary",size:"compact","aria-label":n,onClick:o,disabled:s,className:"w-24 flex-none",children:r})]}),j2=({isOpen:e,onClose:t,context:n="menu",highlightProvider:r=null})=>{var R;const{integrations:s,isLoading:i,error:o,pendingProvider:c,connect:u,disconnect:d}=$ae(),f=Ys(),[p,m]=g.useState(!1),v=qae(e),_=T=>s.find(O=>O.provider===T),w=g.useCallback(T=>{const O=Date.now(),M=Wl({action:"connect",outcome:"started",provider:T,entryPoint:n});f==null||f.capture(M.event,M.properties),u(T).then(A=>{const L=Date.now()-O;if(A==="connected"){const W=Wl({action:"connect",outcome:"completed",provider:T,entryPoint:n,durationMs:L});f==null||f.capture(W.event,W.properties);return}const V=Wl({action:"connect",outcome:"failed",provider:T,entryPoint:n,durationMs:L,failureReason:A==="closed"?"popup_closed":"provider_failed"});f==null||f.capture(V.event,V.properties)}).catch(A=>{const L=Ps(A,"Could not connect."),V=Wl({action:"connect",outcome:"failed",provider:T,entryPoint:n,durationMs:Date.now()-O,failureReason:L.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture(V.event,V.properties),xT.warn(`Connect error for ${T}:`,L),en.error(L)})},[u,n,f]),b=g.useCallback(T=>{const O=Date.now(),M=Wl({action:"disconnect",outcome:"started",provider:T,entryPoint:n});f==null||f.capture(M.event,M.properties),d(T).then(()=>{const A=Wl({action:"disconnect",outcome:"completed",provider:T,entryPoint:n,durationMs:Date.now()-O});f==null||f.capture(A.event,A.properties)}).catch(A=>{const L=Ps(A,"Could not disconnect."),V=Wl({action:"disconnect",outcome:"failed",provider:T,entryPoint:n,durationMs:Date.now()-O,failureReason:"request_failed"});f==null||f.capture(V.event,V.properties),xT.warn(`Disconnect error for ${T}:`,L),en.error(L)})},[n,d,f]),S=n==="onboarding",E=(R=v.data)==null?void 0:R.sources.some(T=>T.provider==="cosmos");let C=E?"Connected":"Not connected";return v.isError&&(C="Status unavailable"),v.isPending&&(C="Checking status…"),P.jsxs(P.Fragment,{children:[P.jsx(Kg,{open:e,onOpenChange:T=>!T&&t(),children:P.jsxs(qg,{className:"w-[min(440px,calc(100vw-32px))]",children:[P.jsx(Vx,{onClose:t,children:"Connect design references"}),P.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[P.jsx(Gg,{className:"text-muted-foreground text-sm",children:"Connect your references to add them to your Rivet library. Rivet can use them to inspire new design directions."}),o?P.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,P.jsxs("ul",{className:"divide-surface-2 divide-y","aria-label":"Design reference services",children:[tle.map(T=>{const O=_(T.provider),M=(O==null?void 0:O.status)==="connected",A=O==null?void 0:O.externalUsername;let L=M?`Connected${A?` as @${A}`:""}`:"Not connected";i&&(L="Checking status…");const V=c===T.provider,W=M?"Disconnect":"Connect";return P.jsx(ST,{meta:T,status:L,actionLabel:`${W} ${T.name}`,buttonLabel:V?`${W}ing…`:W,isDisabled:i||V,isHighlighted:r===T.provider,onAction:()=>M?b(T.provider):w(T.provider)},T.provider)}),P.jsx(ST,{meta:nle,status:C,actionLabel:E?"Add Cosmos profile":"Connect Cosmos",buttonLabel:E?"Add profile":"Connect",isDisabled:!1,isHighlighted:!1,onAction:()=>{f==null||f.capture("visual_editor_cosmos_modal_opened"),m(!0)}})]}),S?P.jsxs("div",{className:"flex items-center justify-between gap-4",children:[P.jsx("p",{className:"text-muted-foreground text-xs",children:"You can always do this later from the account menu."}),P.jsx(Rr,{variant:"secondary",onClick:t,className:"flex-none",children:"Skip for now"})]}):null]})]})}),P.jsx(ele,{isOpen:p,onClose:()=>m(!1),onImported:()=>{v.refetch()}})]})},rle=Ls("SupportTicketModal"),ET=5e3,g_="feedback",sle=e=>{var r;if(!e)return null;const t=(r=e.formErrors)==null?void 0:r[0];if(t)return t;const n=e.fieldErrors??{};for(const s of Object.values(n)){const i=s==null?void 0:s[0];if(i)return i}return null},ile=async e=>{let t;try{const n=BW.safeParse(await e.json());t=n.success?n.data:void 0}catch{t=void 0}if(e.status===400){if(typeof(t==null?void 0:t.details)=="string"&&t.details.trim())return t.details;if(typeof(t==null?void 0:t.details)=="object"&&t.details!==null){const n=sle(t.details);if(n)return n}return"Please check your feedback and try again."}return e.status>=500?typeof(t==null?void 0:t.details)=="string"&&t.details.trim()?t.details:"Could not send feedback right now. Please try again later.":typeof(t==null?void 0:t.error)=="string"&&t.error.trim()?t.error:`HTTP ${e.status}`},ole=({isOpen:e,onClose:t,contactEmail:n})=>{const r=Ys(),[s,i]=g.useState(""),[o,c]=g.useState(!1),u=g.useCallback(()=>{i("")},[]),d=g.useCallback(()=>{o||(u(),t())},[o,t,u]),f=g.useCallback(async()=>{const _=s.trim();if(!(!_||o)){c(!0);try{const w=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,b=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,S=n==null?void 0:n.trim(),E=await Dt("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:g_,message:_,contactEmail:S||void 0,metadata:{posthogSessionId:w??void 0,posthogDistinctId:b??void 0,appVersion:"0.28.2",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!E.ok){const C=await ile(E);throw new Error(C)}r==null||r.capture("support_ticket_submitted",{ticket_type:g_,has_posthog_session_id:!!w}),en.success("Feedback sent",{description:"Thanks for sharing this."}),u(),t()}catch(w){const b=Ps(w,"Failed to send message");r==null||r.capture("support_ticket_submit_failed",{ticket_type:g_,error:b}),rle.error("Failed to submit support ticket:",b),en.error("Could not send feedback",{description:b})}finally{c(!1)}}},[n,o,s,t,r,u]),p=g.useCallback(_=>{_.key==="Enter"&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),f())},[f]),m=ET-s.length,v=o||s.trim().length===0;return P.jsx(Kg,{open:e,onOpenChange:_=>!_&&d(),children:P.jsxs(qg,{className:"w-[440px]",children:[P.jsx(Vx,{onClose:d,isCloseDisabled:o,children:"Send feedback"}),P.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[P.jsx(Gg,{className:"text-muted-foreground text-sm",children:"Tell us what happened or what we can improve."}),P.jsxs("div",{className:"bg-muted rounded-lg outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[P.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:_=>i(_.target.value),onKeyDown:p,maxLength:ET,rows:6,disabled:o,placeholder:"What happened?",className:"text-foreground placeholder-muted-foreground 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"}),P.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[P.jsx("span",{className:"text-muted-foreground text-xs",children:"Context details are included automatically."}),P.jsxs("div",{className:"flex items-center gap-2",children:[m<=500&&P.jsx("span",{className:"text-muted-foreground text-xs",children:m}),P.jsx(Rr,{onClick:f,disabled:v,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",variant:"primary",size:"icon-compact",children:o?P.jsx(gx,{className:"h-5 w-5 animate-spin",weight:"bold"}):P.jsx(Kee,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})},ale=Ls("ProfileAvatar"),r4=(e,t)=>{const n=(e??"").trim();if(n)return n.split(/\s+/).filter(Boolean)[0]??"";const s=((t??"").split("@")[0]??"").split(/[._\-+]/).filter(Boolean)[0]??"";return s?s[0].toUpperCase()+s.slice(1):""},lle=(e,t)=>r4(e,t).charAt(0).toUpperCase(),cle=({className:e="",side:t="bottom",align:n="end"})=>{var W,z,X;const r=vae(),s=((W=r.data)==null?void 0:W.name)??null,i=((z=r.data)==null?void 0:z.email)??null,o=((X=r.data)==null?void 0:X.isAuthenticated)===!0,c=Ys(),{startLogin:u,isStartingLogin:d,loginError:f}=qN("account_menu"),[p,m]=g.useState(!1),[v,_]=g.useState(null),w=g.useRef(null),b=g.useRef(null),[S,E]=g.useState(!1),C=lle(s,i);if(r.isPending)return P.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${e}`.trim(),children:[P.jsx(fg,{className:"h-8 w-8 rounded-full"}),P.jsx(fg,{className:"h-3.5 w-16"})]});const R=r4(s,i),T=(s==null?void 0:s.trim())||null,O=(i==null?void 0:i.trim())||null,M=async()=>{E(!0);try{const Q=await Dt("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!Q.ok)throw new Error(`Logout failed: ${Q.status}`);window.location.pathname.startsWith("/rivet/library")&&HO()}catch(Q){ale.warn("Logout request failed",Q),en.error("Could not log out. Please try again."),E(!1);return}window.location.reload()};let A="Log in";o&&(A=R||"Account"),r.error&&!r.data&&(A="Account unavailable");const L=()=>{var Q;Cd.flushSync(()=>_(null)),(Q=b.current)==null||Q.focus()},V=Q=>{m(Q),c==null||c.capture(`visual_editor_account_menu_${Q?"opened":"closed"}`,{is_authenticated:o})};return P.jsxs(P.Fragment,{children:[P.jsxs(Bx,{isOpen:p,onOpenChange:V,children:[P.jsx(Yg,{asChild:!0,children:P.jsxs("button",{ref:b,type:"button","aria-label":"Account","data-rivet-private":!0,className:`group/account ph-no-capture text-soft-foreground hover:text-foreground focus-visible:text-foreground flex shrink-0 items-center gap-2 outline-hidden transition-colors select-none ${e}`,children:[P.jsx("span",{className:"border-surface-2 bg-muted group-focus-visible/account:border-foreground flex h-8 w-8 items-center justify-center rounded-full border text-xs leading-none font-semibold",children:C||P.jsx(lte,{className:"h-4 w-4",weight:"bold"})}),P.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:A})]})}),P.jsxs(Wx,{"data-rivet-private":!0,className:"ph-no-capture min-w-44",side:t,align:n,onCloseAutoFocus:Q=>{var Y;const H=w.current;H&&(w.current=null,Q.preventDefault(),(Y=b.current)==null||Y.focus(),_(H))},children:[T||O?P.jsxs("div",{className:"border-surface-2 mb-1 border-b px-3 py-2",children:[T?P.jsx("div",{className:"text-foreground truncate text-sm font-medium",children:T}):null,O?P.jsx("div",{className:"text-soft-foreground truncate text-xs",children:O}):null]}):null,P.jsxs(ja,{onSelect:()=>{w.current="connectors"},disabled:!o,children:[P.jsx(ate,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),P.jsxs(ja,{onSelect:()=>{w.current="support"},children:[P.jsx(Yee,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),o?P.jsxs(ja,{onClick:M,disabled:S,children:[P.jsx(ite,{className:"h-3.5 w-3.5",weight:"bold"}),S?"Logging out…":"Log out"]}):null,!o&&!r.error?P.jsxs(ja,{onClick:()=>{u()},disabled:d,children:[P.jsx(ste,{className:"h-3.5 w-3.5",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?P.jsx(ja,{onClick:()=>{r.refetch()},children:"Retry account"}):null,f?P.jsx("p",{role:"alert",className:"text-accent-error max-w-64 px-3 py-2 text-xs",children:f}):null]})]}),v==="connectors"?P.jsx(j2,{isOpen:!0,onClose:L}):null,P.jsx(ole,{isOpen:v==="support",onClose:L,contactEmail:i??void 0})]})},ule=({onClose:e,libraryOrigin:t})=>P.jsxs("div",{className:"bg-background font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[P.jsx(dae,{onClose:e,libraryOrigin:t}),P.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:P.jsx(Zoe,{})}),P.jsx("div",{className:"border-surface-2 bg-card flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:P.jsx(cle,{side:"top",align:"start"})})]}),kT=Ls("useServerConfig"),Mh=[250,500,1e3,2e3,4e3],dle=Mh.length+1,fle=async()=>{var n;const e=await Dt("/api/health");if(!e.ok)throw new Error(`Failed to fetch config: ${e.status}`);const t=await e.json();if(!t.framework)throw new Error("Server did not return framework information");return{userPort:((n=t.ports)==null?void 0:n.userDevServer)||3e3,framework:t.framework}},hle=(e,t)=>e<Mh.length?(kT.warn(`Server config fetch failed (attempt ${e+1}); retrying in ${Mh[e]}ms`,t),!0):(kT.warn("Error fetching server config:",t),Xe==null||Xe.capture("preview_config_load_failed",{message:Ps(t,"unknown_error"),attempts:dle}),!1),ple=e=>Mh[Math.min(e,Mh.length-1)],mle=()=>{const e=_o({queryKey:Is.serverConfig,queryFn:fle,retry:hle,retryDelay:ple,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,networkMode:"always"}),t=e.isFetching&&!e.data,{refetch:n}=e;return{config:e.data??null,isLoading:t,error:e.error&&!t?e.error.message:null,retry:()=>{n()}}},gle="#1C1C20",Fo=[118,118,124],CT=.85,vle=3,yle=.15,Lm=36,_le=4.4,wle=.7,ble=3.5,xle=.8,PT=9,Sle=11,Ele=[1.35,1.12,.95,.85],kle=[0,1.1,2.3,3.1],Cle=[0,.35,.16,.13],Ple=[.9,.5,.4,.35],Kl=3,v_=[[{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}]],$m=e=>{let t=e|0;return t=Math.imul(t^t>>>16,73244475),t=Math.imul(t^t>>>16,73244475),t^=t>>>16,(t>>>0)/4294967296},f0=e=>{const t=Math.min(1,Math.max(0,e));return t*t*(3-2*t)},Gl=(e,t)=>(Math.round(e/t-.5)+.5)*t,Rle=Math.sin(Math.PI/3),RT=(e,t,n,r,s)=>{if(e.beginPath(),t===0)e.arc(n,r,s,0,Math.PI*2);else if(t===1){const i=s*Rle;e.moveTo(n,r-s),e.lineTo(n+i,r+s/2),e.lineTo(n-i,r+s/2),e.closePath()}else{const i=s*.85;e.rect(n-i,r-i,i*2,i*2)}e.fill()},Tle=(e,t,n)=>{let r;if(n.hline){const s=Math.max(n.x1-e,e-n.x2,0),i=Math.abs(t-n.y1);r=Math.hypot(s,i)-PT}else{const s=Math.max(n.x1-e,e-n.x2,0),i=Math.max(n.y1-t,t-n.y2,0);s===0&&i===0?r=-Math.min(e-n.x1,n.x2-e,t-n.y1,n.y2-t):r=Math.hypot(s,i),r=Math.abs(r)-PT}return f0(.5-r/(2*Sle))},s4=({className:e="",trackGlobalLoaderCount:t=!0})=>{const n=Lt(bN),r=g.useRef(null),s=g.useCallback(i=>{var V;if((V=r.current)==null||V.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;t&&n(W=>W+1);const c=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,f=0,p=Lm,m=Lm,v=null,_=null,w=0,b=-1;const S=new Array(33),E=W=>{const z=Math.round(W*32);let X=S[z];if(!X){const Q=z/32,H=Math.round(Fo[0]+(255-Fo[0])*Q),Y=Math.round(Fo[1]+(255-Fo[1])*Q),oe=Math.round(Fo[2]+(255-Fo[2])*Q);X=`rgba(${H}, ${Y}, ${oe}, ${CT})`,S[z]=X}return X},C=W=>{const z=1-.35*W,X=Math.round(Fo[0]*z),Q=Math.round(Fo[1]*z),H=Math.round(Fo[2]*z);return`rgba(${X}, ${Q}, ${H}, ${CT})`},R=W=>{let z=Math.floor(Math.random()*v_.length);z===b&&(z=(z+1)%v_.length),b=z;const X=[0,0,0,0],Q=v_[z].map((D,q)=>{const fe=D.level,ae=X[fe]++,ce=kle[fe]+ae*Cle[fe],he=Ple[fe]+$m(z*131+q*17+5)*.2;if(D.hline){const pe=Gl((D.y??0)*f,m);return{hline:!0,x1:Gl(D.x1*d,p),x2:Gl(D.x2*d,p),y1:pe,y2:pe,level:fe,start:ce,dur:he}}const ke=Gl(D.x1*d,p),ge=Gl((D.y1??0)*f,m);return{hline:!1,x1:ke,y1:ge,x2:Math.max(Gl(D.x2*d,p),ke+p),y2:Math.max(Gl((D.y2??0)*f,m),ge+m),level:fe,start:ce,dur:he}}),H=Q.reduce((D,q)=>Math.max(D,q.start+q.dur),0),Y=u.length,oe=new Float32Array(Y*Kl),U=new Int16Array(Y*Kl).fill(-1),J=new Uint8Array(Y),K=Q[0];for(let D=0;D<Y;D++){const q=u[D];q.x>K.x1&&q.x<K.x2&&q.y>K.y1&&q.y<K.y2&&(J[D]=1);const fe=D*Kl;for(let ae=0;ae<Q.length;ae++){const ce=Tle(q.x,q.y,Q[ae]);if(ce<=.02)continue;let he=fe;for(let ke=fe;ke<fe+Kl;ke++){if(U[ke]===-1){he=ke;break}oe[ke]<oe[he]&&(he=ke)}(U[he]===-1||ce>oe[he])&&(oe[he]=ce,U[he]=ae)}}return{startT:W,buildEnd:H,els:Q,frame:K,cellQ:oe,cellEl:U,inFrame:J}},T=()=>{const W=i.getBoundingClientRect();d=Math.max(1,W.width),f=Math.max(1,W.height);const z=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*z),i.height=Math.round(f*z),o.setTransform(z,0,0,z,0,0);const X=Math.max(8,Math.round(d/Lm)),Q=Math.max(6,Math.round(f/Lm));p=d/X,m=f/Q,u=[];for(let H=0;H<Q;H++){const Y=Q>1?H/(Q-1):.5,oe=_le*(1+wle*.4*(Y*2-1));for(let U=0;U<X;U++){const J=H*8191+U*131+1,K={x:(U+.5)*p,y:(H+.5)*m,size:oe,seed:J,phase:$m(J),kind:0};K.kind=Math.floor($m(J*97)*3),u.push(K)}}_=null,v=null},O=new Float32Array(32),M=W=>{o.fillStyle=gle,o.fillRect(0,0,d,f),v||(v=R(W+.2)),W>=v.startT+v.buildEnd+ble&&(_=v,w=W,v=R(W+.2));let z=0;_&&(z=1-f0((W-w)/xle),z<=0&&(_=null));const X=v;for(let K=0;K<X.els.length;K++){const D=X.els[K];O[K]=f0(Math.min(1,Math.max(0,(W-X.startT-D.start)/D.dur)))}const Q=O[0],H=C(0),Y=C(Q),oe=z>0?C(z):H,U=z>0?C(Math.max(Q,z)):Y,J=u.length;for(let K=0;K<J;K++){const D=u[K];let q=0,fe=0;const ae=K*Kl;for(let Ae=ae;Ae<ae+Kl;Ae++){const Ne=X.cellEl[Ae];if(Ne<0)break;const Et=X.cellQ[Ae]*O[Ne];Et>q&&(q=Et,fe=X.els[Ne].level)}if(_)for(let Ae=ae;Ae<ae+Kl;Ae++){const Ne=_.cellEl[Ae];if(Ne<0)break;const Et=_.cellQ[Ae]*z;Et>q&&(q=Et,fe=_.els[Ne].level)}const ce=W/vle+D.phase,he=Math.floor(ce),ke=ce-he,ge=f0(Math.min(ke,1-ke)/yle),pe=Math.floor($m(D.seed*97+he*7919)*3);pe!==D.kind&&q<.02&&ge<.05&&(D.kind=pe);const Le=Math.max(ge*(1-q),q);if(!(Le<.01))if(q<.02){const Ae=X.inFrame[K]===1,Ne=_?_.inFrame[K]===1:!1;Ae?o.fillStyle=Ne?U:Y:o.fillStyle=Ne?oe:H;const Et=Math.max(Ae?Q:0,Ne?z:0);RT(o,D.kind,D.x,D.y,D.size*Le*(1-.2*Et))}else{o.fillStyle=E(q);const Ae=1+(Ele[fe]-1)*q;RT(o,D.kind,D.x,D.y,D.size*Le*Ae)}}};T();let A=0;if(c)v=R(-100),M(0);else{const W=performance.now(),z=X=>{M((X-W)/1e3),A=requestAnimationFrame(z)};A=requestAnimationFrame(z)}const L=new ResizeObserver(()=>{T(),c&&(v=R(-100),M(0))});L.observe(i),r.current=()=>{cancelAnimationFrame(A),L.disconnect(),t&&n(W=>W-1)}},[t,n]);return P.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${e}`.trim()})},Ale=[["Problem","problem"],["Reason code","reasonCode"],["Rivet detail","reasonDetail"],["Next step","nextStep"],["Rivet version","rivetVersion"],["Node.js version (Rivet runtime)","nodeVersion"],["Direction","directionLabel"],["Direction ref","directionRef"],["Rivet session","sessionId"]],Ile=e=>{var n;const t=[];for(const[r,s]of Ale){const i=(n=e[s])==null?void 0:n.trim();i&&t.push(`${r}: ${i}`)}return t.join(`
|
|
200
|
+
`)},TT={kind:"base"};function AT(e){return e.kind==="base"?"base":`variant:${e.sessionId}:${e.variantId}`}const Ole=async(e=null)=>{if(e)return Mle(e);let t;try{t=await Dt("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(t.status===404||!(t.headers.get("content-type")??"").toLowerCase().includes("application/json"))return Nm();if(!t.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await t.json()}catch{return Nm()}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}:Nm()},i4=async e=>{try{const t=await fetch(e);return{isOk:t.status!==502&&t.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:t.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},Mle=e=>i4(e),Nm=()=>i4("/"),y_=Ls("usePreviewUpstreamHealth"),Lle=500,$le=4e3,Nle=15e3,Dle=3,Fle={completedProbeCount:0,isUpstreamReady:!1,unavailableReason:"upstream_unreachable",isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!1,hasCapturedUnreachable:!1,downSince:null,everReady:!1,consecutiveServerErrors:0,hasFiredPersistentErrorHook:!1,lastUpstreamStatus:null},jle=({history:e,outcome:t,now:n,startedAt:r,firstUnreachableCaptureAfterMs:s})=>{const i=[],{upstreamStatus:o}=t,c=t.isOk&&o!==null&&o>=500;let u=e.consecutiveServerErrors;c&&e.everReady?u+=1:t.isOk&&!c&&(u=0);const d=u>=Dle;let f=e.hasFiredPersistentErrorHook;d&&!f&&o!==null&&(f=!0,i.push({kind:"persistent_server_errors",upstreamStatus:o,consecutiveCount:u}));const p={...e,completedProbeCount:e.completedProbeCount+1,lastUpstreamStatus:o,consecutiveServerErrors:u,hasFiredPersistentErrorHook:f};if(t.isOk&&!d)return e.hasCapturedFirstReady?e.isUpstreamReady||i.push({kind:"restored"}):i.push({kind:"first_ready",readyAfterMs:n-r}),{history:{...p,everReady:p.everReady||!c,hasFiredPersistentErrorHook:p.hasFiredPersistentErrorHook&&c,isUpstreamReady:!0,unavailableReason:null,downSince:null,hasCapturedUnreachable:!1,isFirstUnreachableWindowExceeded:!1,hasCapturedFirstReady:!0},events:i};const m=e.downSince===null,v=e.downSince??n;let _=m?!1:e.hasCapturedUnreachable,w=m?!1:e.isFirstUnreachableWindowExceeded;e.isUpstreamReady&&i.push({kind:"lost",upstreamStatus:o});const b=n-v;return b>=s&&!_&&(_=!0,w=!0,i.push({kind:"first_unreachable",elapsedMs:b,upstreamStatus:o})),{history:{...p,isUpstreamReady:!1,unavailableReason:t.unavailableReason,downSince:v,hasCapturedUnreachable:_,isFirstUnreachableWindowExceeded:w},events:i}},IT=(e,t)=>({id:t,identity:e,startedAt:Date.now()}),Vle=(e,t={})=>{const n=g.useId(),r=t.probeMsWhileDown??Lle,s=t.probeMsWhileUp??$le,i=t.firstUnreachableCaptureAfterMs??Nle,o=t.probePath??null,c=t.skip??!1,u=e!=="static"&&!c,d=Ah(t.onPersistentUpstreamServerErrors),f=u?JSON.stringify([e,o,r,s,i]):null,[p,m]=g.useState(()=>IT(f,0)),v=p.identity===f?p:IT(f,p.id+1);v!==p&&m(v);const[_,w]=g.useState(0),b=g.useRef(null),S=R=>{var T;switch(R.kind){case"persistent_server_errors":Xe==null||Xe.capture("preview_upstream_error_responses",{framework:e,upstream_status:R.upstreamStatus,consecutive_count:R.consecutiveCount}),y_.warn(`Preview upstream is listening but has served ${R.consecutiveCount} consecutive ${R.upstreamStatus} responses`),(T=d.current)==null||T.call(d,{upstreamStatus:R.upstreamStatus,consecutiveCount:R.consecutiveCount});return;case"first_ready":Xe==null||Xe.capture("preview_dev_server_ready",{framework:e,ready_after_ms:R.readyAfterMs});return;case"restored":Xe==null||Xe.capture("preview_upstream_restored",{framework:e});return;case"lost":Xe==null||Xe.capture("preview_upstream_lost",{framework:e,upstream_status:R.upstreamStatus}),w(O=>O+1),y_.warn("Preview upstream became unavailable after it was ready");return;case"first_unreachable":Xe==null||Xe.capture("preview_dev_server_unreachable",{framework:e,elapsed_ms:R.elapsedMs,upstream_status:R.upstreamStatus}),y_.warn("Dev server did not become ready within timeout window");return;default:{const O=R;throw new Error(`Unhandled probe event: ${String(O)}`)}}},E=_o({queryKey:Is.previewUpstreamHealth({instanceId:n,sessionId:v.id,rerunVersion:t.rerunProbeImmediatelyOnVersion??null}),queryFn:async({signal:R})=>{var L;const T=await Ole(o),O=((L=b.current)==null?void 0:L.sessionId)===v.id?b.current.history:Fle;if(R.aborted)return O;const{history:M,events:A}=jle({history:O,outcome:T,now:Date.now(),startedAt:v.startedAt,firstUnreachableCaptureAfterMs:i});return b.current={sessionId:v.id,history:M},A.forEach(S),M},enabled:u,placeholderData:(R,T)=>(T==null?void 0:T.queryKey[1].sessionId)===v.id?R:void 0,refetchInterval:R=>{var T;return(T=R.state.data)!=null&&T.isUpstreamReady?s:r},refetchIntervalInBackground:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,gcTime:0,networkMode:"always"});if(e==="static")return{isUpstreamReady:!0,iframeRemountKey:_,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:null};if(c)return{isUpstreamReady:!1,iframeRemountKey:_,probeStartedAt:null,probeAttemptCount:0,isFirstUnreachableWindowExceeded:!1,initialProbeComplete:!0,unavailableReason:"upstream_unreachable"};const C=E.data;return{isUpstreamReady:(C==null?void 0:C.isUpstreamReady)??!1,iframeRemountKey:_,probeStartedAt:v.startedAt,probeAttemptCount:((C==null?void 0:C.completedProbeCount)??0)+(E.isFetching?1:0),isFirstUnreachableWindowExceeded:(C==null?void 0:C.isFirstUnreachableWindowExceeded)??!1,initialProbeComplete:C!==void 0,unavailableReason:C?C.unavailableReason:"upstream_unreachable"}};function zle(e){return e.enteringSplit&&e.isExistingSession&&e.hasActiveVariantProxy}const o4=e=>{var r;if(typeof window>"u")return"";const t=(r=window.__RIVET_BOOTSTRAP__)==null?void 0:r.previewOrigin;if(t)return t;const n=new URL(window.location.origin);return n.hostname="localhost",n.origin},V2=({agentApplyMode:e,url:t})=>t.startsWith("/")?`${o4()}${t}`:t,Hle="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",Ule=e=>Hle,Zle=Ls("PreviewSurface"),Sf=(e,t)=>e==="about:blank"?"blank":e.includes("/api/variants/")?"static_artifact":t.kind==="variant"?"dev_server":"original",z2=({target:e,src:t,framework:n,remountKey:r,isActive:s=!0})=>{_t(Jg);const i=Ys(),o=g.useRef(!1),c=g.useRef(s),u=g.useCallback(f=>{e.kind==="variant"&&(i==null||i.capture("variants_panel.preview_displayed",{sessionId:e.sessionId,variantId:e.variantId,renderedTarget:"variant",iframeSrcKind:Sf(t,e),framework:n,isReused:f}))},[n,i,t,e]),d=g.useCallback(f=>{f&&(s&&!c.current&&o.current&&u(!0),c.current=s)},[u,s]);return P.jsx("div",{ref:d,className:"relative h-full w-full",children:P.jsx("iframe",{src:t,className:"h-full w-full border-none",title:s?"Project Preview":"Retained Project Preview",tabIndex:s?void 0:-1,sandbox:Ule(),onLoad:()=>{o.current=!0,i==null||i.capture("preview_iframe_loaded",{framework:n,src_kind:Sf(t,e)}),s&&u(!1)},onError:()=>{i==null||i.capture("preview_iframe_load_failed",{framework:n,src_kind:Sf(t,e)}),s&&e.kind==="variant"&&(i==null||i.capture("variants_panel.preview_display_failed",{sessionId:e.sessionId,variantId:e.variantId,renderedTarget:"variant",iframeSrcKind:Sf(t,e),framework:n})),Zle.warn("Preview iframe failed to load",{framework:n,src_kind:Sf(t,e)})}},r)})},Ble=7,Wle=e=>{const t=AT(e.target),n=`${t}:${e.src}`,r=e.src==="about:blank",[s,i]=g.useState(()=>({selectedKey:n,remountKey:e.remountKey,selection:0,frames:r?[]:[{key:n,props:e,lastSelected:0}]}));if(s.selectedKey!==n||s.remountKey!==e.remountKey){const o=s.selection+1,c=s.remountKey!==e.remountKey;let u=s.frames.filter(d=>!c||AT(d.props.target)!==t);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:e,lastSelected:o}],u.length>Ble){const f=u.reduce((p,m)=>m.lastSelected<p.lastSelected?m:p);u=u.filter(p=>p!==f)}}i({selectedKey:n,remountKey:e.remountKey,selection:o,frames:u})}return P.jsxs("div",{className:"relative h-full w-full",children:[s.frames.map(o=>{const c=!r&&o.key===n;return P.jsx("div",{className:"absolute inset-0",style:{visibility:c?"visible":"hidden",pointerEvents:c?"auto":"none"},"aria-hidden":!c,children:P.jsx(z2,{...o.props,isActive:c})},`${o.key}:${o.props.remountKey??""}`)}),r?P.jsx(z2,{...e}):null]})},Kle={surface:"relative flex h-full w-full items-center justify-center bg-background px-6",overlay:"absolute inset-0 z-10 flex items-center justify-center bg-background/90 px-6",page:"relative flex h-screen w-full items-center justify-center bg-background px-6"},Gle={sm:"text-lg font-semibold text-foreground",md:"text-2xl font-semibold text-foreground",lg:"text-3xl font-semibold text-foreground"},qle={neutral:"rounded-md border border-border-strong bg-transparent px-5 py-2 text-sm font-medium text-foreground transition-colors hover:bg-surface-3",ghost:"rounded-md px-5 py-2 text-sm font-medium text-soft-foreground transition-colors hover:text-foreground"},yd=({backdrop:e,media:t,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:c="md",children:u,state:d,role:f="status",busy:p=!1,className:m=""})=>{const v=g.useCallback(w=>{w&&d&&(Xe==null||Xe.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),_=!!(t||n||r||u||s!=null&&s.length);return P.jsxs("div",{ref:v,className:`${Kle[o]} ${m}`.trim(),role:f,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[e?P.jsx("div",{className:"absolute inset-0",children:e}):null,_?P.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[t,n?P.jsx("h2",{className:Gle[c],children:n}):null,r?P.jsx("p",{className:"text-soft-foreground text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?P.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(w=>P.jsx("button",{type:"button",onClick:w.onClick,className:qle[w.variant??"neutral"],children:w.label},w.label))}):null]}):null]})},OT=({loader:e="coalesce",trackGlobalLoaderCount:t,size:n="lg",...r})=>e==="coalesce"?P.jsx(yd,{...r,size:n,busy:!0,backdrop:P.jsx(s4,{trackGlobalLoaderCount:t})}):P.jsx(yd,{...r,size:n,busy:!0,media:P.jsx(gx,{"aria-hidden":!0,className:"text-foreground h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),Yle=({icon:e,...t})=>P.jsx(yd,{...t,tone:"neutral",media:e?P.jsx("div",{className:"text-soft-foreground",children:e}):void 0}),a4=e=>P.jsx(yd,{...e,tone:"error",role:"alert"}),MT="/static/",Xle=e=>{try{return new URL(e,"http://localhost").pathname.endsWith(MT)}catch{return e.endsWith(MT)}},LT="The direction is saved, but Rivet couldn’t prepare its preview.",Qle={spawn_error:{summary:"The direction is saved, but its preview process didn’t start."},exited:{summary:"The direction is saved, but its preview stopped before it was ready."},timeout:{summary:"The direction is saved, but its preview took too long to become ready."},dependency_install_failed:{summary:"The direction is saved, but its dependencies couldn’t be prepared.",nextStep:"Fix the installation error, then retry the preview."},compile_error:{summary:"The direction is saved, but its app couldn’t compile.",nextStep:"Fix the app error, then retry the preview."},missing_dev_script:{summary:"The direction is saved, but Rivet couldn’t find a dev script to preview it."},missing_static_entry:{summary:"The direction is saved, but Rivet couldn’t find an HTML entry to preview it."},idle_timeout:{summary:LT},unknown:{summary:LT}},Jle=e=>e.nextStep?`${e.summary} ${e.nextStep}`:e.summary,ece=e=>({label:"Copy for agent",onClick:()=>void RN({text:e,copyKind:"failure_report"})}),tce=(e,t)=>{if(e.status==="failed"&&e.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:e.errorMessage??e.errorCode,isError:!0};if(e.status==="failed"&&e.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:e.errorMessage??e.errorCode,isError:!0};if(e.status==="failed")return{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:e.errorMessage??e.errorCode,isError:!0};if(e.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(e.status==="succeeded"&&e.previewUnavailable&&e.previewUnavailable.reason!=="idle_timeout"){const n=e.previewUnavailable,r=n.portInUse?"The preview port was already in use.":void 0,s=Qle[n.reason],i="Rivet couldn’t preview this direction";return{state:"preview_unavailable",title:i,description:Jle(s),detail:n.detail??r,isError:!0,agentPastePackage:Ile({problem:`${i}. ${s.summary}`,reasonCode:n.reasonCode,reasonDetail:n.reasonDetail,nextStep:s.nextStep,rivetVersion:"0.28.2",nodeVersion:n.nodeVersion,directionLabel:e.label,directionRef:e.directionRef,sessionId:t})}}return null},nce=({issue:e,retryTarget:t})=>{const n=Ys(),r=g.useRef(!1),[s,i]=g.useState(!1),[o,c]=g.useState(null),u=async()=>{if(!(!t||r.current)){r.current=!0,i(!0),c(null),n==null||n.capture("preview_retry_clicked",{session_id:t.sessionId,variant_id:t.variantId});try{const f=await Dt(`/api/variants/${encodeURIComponent(t.sessionId)}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:t.variantId,retry:!0})});if(!f.ok){const p=ZW.safeParse(await f.json().catch(()=>({})));throw new Error(p.success?p.data.message:"The preview could not restart. Try again.")}}catch(f){c(Ps(f,"The preview could not restart. Try again."))}finally{r.current=!1,i(!1)}}},d=[...t&&!s?[{label:"Retry preview",onClick:()=>void u()}]:[],...e.agentPastePackage?[ece(e.agentPastePackage)]:[]];return P.jsxs(yd,{fill:"overlay",size:"sm",state:e.state,role:e.isError?"alert":"status",tone:e.isError?"error":"neutral",title:e.title,description:e.description,busy:s,actions:d,children:[s?P.jsx("p",{className:"text-muted-foreground text-xs",children:"Starting preview…"}):null,o?P.jsx("p",{className:"text-muted-foreground text-xs",children:o}):null,e.detail?P.jsx("p",{"data-rivet-private":!0,className:"ph-no-capture text-muted-foreground max-h-40 overflow-auto text-xs leading-relaxed break-words whitespace-pre-wrap",children:e.detail}):null]})},rce=({isInteractionDisabled:e=!1,framework:t,userPort:n})=>{var Xt;const r=_t(Xg),s=_t(A2),i=Lt(A2),o=_t(dg),c=Lt(dg),u=_t(Xh),d=_t(Jg),f=_t(I2),p=_t(O2),m=_t(xN),v=_t(SN),_=Lt(O2),w=_t(ml),b=_t(d0),S=Lt(I2),E=u.active&&u.projectContext.kind==="fresh",C=_t(u0),R=u.active?u.variants.find(Me=>Me.workItemId===C&&(Me.status==="pending"||Me.status==="running"||Me.status==="succeeded"&&!Me.preview&&typeof Me.port!="number"&&(!Me.previewUnavailable||Me.previewUnavailable.reason==="idle_timeout")))??null:null,T=u.active&&u.variants.some(Me=>Me.status==="pending"||Me.status==="running"),O=E||T,M=u.active?u.variants.find(Me=>Me.workItemId===C)??null:null,A=u.active&&M?tce(M,u.sessionId):null,L=t==="static"&&o!==null&&Xle(o);g.useEffect(()=>{u.active||S(!1)},[u.active,S]);const V=g.useRef(!1);g.useEffect(()=>{const Me=!!(w!=null&&w.left||w!=null&&w.right),Qe=Me&&!V.current;V.current=Me;const Te=u.active?u.sessionId:null;!Te||!zle({enteringSplit:Qe,isExistingSession:u.active&&u.projectContext.kind==="existing",hasActiveVariantProxy:f&&p!==null})||(S(!1),_(null),i(xt=>xt+1),Dt(`/api/variants/${encodeURIComponent(Te)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,u,f,p,S,_,i]);const z=g.useMemo(()=>{var Nt;if(f||o&&!L||!u.active)return null;const{stage:Me,variants:Qe}=u,Te=Me==="ready"||Me==="degraded",xt=Qe.some(dt=>{var gt,Hn;return((gt=dt.refinement)==null?void 0:gt.status)==="pending"||((Hn=dt.refinement)==null?void 0:Hn.status)==="running"});if(!Te&&!xt)return null;const xe=Qe.find(dt=>{var gt;return dt.status==="succeeded"&&((gt=dt.preview)==null?void 0:gt.kind)==="static_artifact"});return((Nt=xe==null?void 0:xe.preview)==null?void 0:Nt.kind)==="static_artifact"?vc({sessionId:u.sessionId,variant:xe,projectContext:u.projectContext}):null},[L,o,f,u])??o,X=g.useMemo(()=>!u.active||!z?null:u.variants.find(Me=>{var Qe;return((Qe=Me.preview)==null?void 0:Qe.kind)==="static_artifact"&&z.startsWith(Me.preview.url)})??null,[z,u]),Q=g.useMemo(()=>{if((b==null?void 0:b.previewKind)==="static"||(b==null?void 0:b.previewKind)==="dev_server"&&b.previewError||(b==null?void 0:b.previewKind)==="dev_server"&&z&&sT(z))return{kind:"variant",sessionId:b.sessionId,variantId:b.variantId};if(!u.active)return TT;if(X)return{kind:"variant",sessionId:u.sessionId,variantId:X.workItemId};if(z){const Qe=z.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Te=Qe!=null&&Qe[1]?decodeURIComponent(Qe[1]):null,xt=Qe!=null&&Qe[2]?decodeURIComponent(Qe[2]):null;if(Te===u.sessionId&&xt&&u.variants.some(dt=>dt.workItemId===xt))return{kind:"variant",sessionId:u.sessionId,variantId:xt};const xe=z.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Nt=xe!=null&&xe[1]?decodeURIComponent(xe[1]):null;if(Nt&&u.variants.some(dt=>dt.workItemId===Nt))return{kind:"variant",sessionId:u.sessionId,variantId:Nt}}const Me=!!(w!=null&&w.left||w!=null&&w.right);return(!Me||E)&&!z&&f&&p&&u.variants.some(Qe=>Qe.workItemId===p)?{kind:"variant",sessionId:u.sessionId,variantId:p}:(!Me||E)&&!z&&C&&u.variants.some(Qe=>Qe.workItemId===C)?{kind:"variant",sessionId:u.sessionId,variantId:C}:TT},[b,X,u,f,p,z,w,E,C]),H=g.useRef(null);g.useEffect(()=>{var xt,xe,Nt;if(!X||((xt=X.preview)==null?void 0:xt.kind)!=="static_artifact"||((xe=X.refinement)==null?void 0:xe.status)!=="succeeded")return;const Me=`${X.workItemId}:${X.refinement.workItemId}`;if(H.current===Me)return;if(H.current=Me,(Nt=X.previewRoutes)!=null&&Nt.length){i(dt=>dt+1);return}const Qe=X.preview.url.includes("?")?"&":"?",Te=`${X.preview.url}${Qe}refinement=${encodeURIComponent(X.refinement.workItemId)}`;z!==Te&&(c(Te),i(dt=>dt+1))},[z,X,i,c,u]);const Y=z!==null&&sT(z),oe=z!==null&&!Y||E&&!f&&!Y,{isUpstreamReady:U,iframeRemountKey:J,probeAttemptCount:K,initialProbeComplete:D}=Vle(t,{rerunProbeImmediatelyOnVersion:s,probePath:Y?z:null,skip:oe}),[q,fe]=g.useState(()=>m&&U?s:null),[ae,ce]=g.useState(null);m?q!==s&&((ae==null?void 0:ae.remountKey)!==s?ce({remountKey:s,probeAttemptCount:K}):U&&K>ae.probeAttemptCount&&fe(s)):(ae!==null&&ce(null),q!==null&&fe(null));const ke=z!==null&&!Y||U,pe=v||m&&!Y&&q!==s||m&&!ke,Le=`${J}:${s}`,Ae=MN(window.location.pathname),Ne=t==="static"?`/static${Ae??"/"}`:Ae??"/",Et=o4();let dn=null;z&&(dn=V2({agentApplyMode:d,url:z}));const sn=Y&&!ke?"about:blank":dn,kt=R||A||b!=null&&b.previewError||pe?"about:blank":sn??(ke?`${Et}${Ne}`:"about:blank"),Gt=!!R||!!A||!ke&&D;let mn=null;if(b!=null&&b.previewError)mn=P.jsx(yd,{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:P.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed break-words",children:b.previewError})});else if(pe)mn=P.jsx(OT,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(R)mn=P.jsx(OT,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:P.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(A){const Me=u.active&&M&&A.state==="preview_unavailable"&&((Xt=M.previewUnavailable)==null?void 0:Xt.reason)!=="missing_static_entry"?{sessionId:u.sessionId,variantId:M.workItemId}:void 0;mn=P.jsx(nce,{issue:A,retryTarget:Me},M==null?void 0:M.workItemId)}else Gt&&(mn=O?P.jsx(Yle,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):P.jsx(a4,{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 P.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:P.jsxs("div",{className:"relative min-h-0 flex-1",children:[mn,P.jsx(Wle,{target:Q,src:kt,framework:t,remountKey:Le},r)]})})};function $T({side:e,sessionId:t,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const c=_t(ml),u=Lt(ml),d=Ys(),f=_t(Xh),p=_t(Jg),m=g.useRef(!1),v=g.useCallback(()=>{m.current||(m.current=!0,gd({source:i,sessionId:t,variantId:n}))},[i,t,n]),_=g.useCallback(()=>{if(o){u(null);const M=hg("ended",c);d==null||d.capture(M.event,M.properties);return}v();const R={...c};delete R[e];const T=R.left||R.right?R:null;u(T);const O=hg(T?"updated":"ended",T??c);d==null||d.capture(O.event,O.properties)},[o,d,u,e,c,v]),w=g.useMemo(()=>({kind:"variant",sessionId:t,variantId:n}),[t,n]),b=g.useMemo(()=>!f.active||f.sessionId!==t?null:f.variants.find(R=>R.workItemId===n)??null,[t,n,f]),S=g.useMemo(()=>{var T,O,M;let R=r;if(((T=b==null?void 0:b.preview)==null?void 0:T.kind)==="static_artifact"&&((O=b.refinement)==null?void 0:O.status)==="succeeded"){if((M=b.previewRoutes)!=null&&M.length)return V2({agentApplyMode:p,url:vc({sessionId:t,variant:b,projectContext:null})??r});const A=b.preview.url.includes("?")?"&":"?";R=`${b.preview.url}${A}refinement=${encodeURIComponent(b.refinement.workItemId)}`}return V2({agentApplyMode:p,url:R})},[p,b,t,r]),E=((C=b==null?void 0:b.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${b.refinement.workItemId}`:n;return P.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[P.jsxs("div",{className:"variant-split-secondary-toolbar",children:[P.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),P.jsx(md,{label:"Collapse",children:P.jsx(Rr,{variant:"ghost",size:"icon-compact",onClick:_,"aria-label":"Collapse split view",children:P.jsx(b$,{weight:"bold","aria-hidden":!0})})})]}),P.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:P.jsx(z2,{target:w,src:S,framework:"static",remountKey:E})})]})}function sce(){const e=_t(pd),t=_t(Kx);return!e||!t?null:Cd.createPortal(P.jsx("div",{"aria-hidden":"true",className:"border-surface-2 bg-background 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(${t.x+12}px, ${t.y+12}px, 0)`},children:P.jsx("span",{className:"text-foreground truncate text-sm font-medium",children:e.label})}),document.body)}const NT=(e,t)=>{if(!e)return null;const n=e.getBoundingClientRect(),{x:r,y:s}=t;return r<n.left||r>n.right||s<n.top||s>n.bottom?null:r<(n.left+n.right)/2?"left":"right"};function ice(){const e=_t(pd),t=_t(Kx),n=_t(ml),r=Lt(pd),s=Lt(ml),i=Ys(),o=g.useRef(null),[c,u]=g.useState(null),[d,f]=g.useState("hidden");if(!e&&(d!=="hidden"||c!==null)&&(f("hidden"),u(null)),g.useEffect(()=>{if(!e||!t)return;const m=NT(o.current,t);u(v=>v===m?v:m),f(v=>{if(v==="exiting")return v;const _=m!==null?"visible":"hidden";return v===_?v:_})},[e,t]),g.useEffect(()=>{if(!e)return;const m=v=>{const _=NT(o.current,{x:v.clientX,y:v.clientY});if(_&&e.url){const w={sessionId:e.sessionId,variantId:e.variantId,label:e.label,url:e.url,source:e.source},b=n==null?void 0:n[_];b&&(b.sessionId!==w.sessionId||b.variantId!==w.variantId)&&gd(b);const S={...n??{},[_]:w};s(S);const E=hg(n?"updated":"started",S);i==null||i.capture(E.event,E.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else gd(e),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",m),window.addEventListener("pointercancel",m),()=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m)}},[e,i,r,s,n]),!e)return null;const p=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return P.jsxs("div",{ref:o,className:p,"aria-hidden":"true",children:[P.jsx(DT,{side:"left",hovered:c==="left",canDrop:!!e.url,label:e.label}),P.jsx(DT,{side:"right",hovered:c==="right",canDrop:!!e.url,label:e.label})]})}function DT({side:e,hovered:t,canDrop:n,label:r}){return P.jsxs("div",{className:["variant-drop-zone",`is-${e}`,t&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[P.jsxs("div",{className:"variant-drop-zone-inner",children:[P.jsx("div",{className:`variant-drop-zone-icon is-${e}`}),P.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${e} split`:"Split unavailable for this direction"})]}),P.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:P.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),P.jsx("div",{className:"variant-drop-zone-border"})]})}const l4=(e,t,n)=>{var i,o,c;if(!e.active||e.sessionId!==t)return null;const r=e.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:t,variant:r,projectContext:e.projectContext});if(((c=r.refinement)==null?void 0:c.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},FT=(e,t)=>{if(!e)return;const n=l4(t,e.sessionId,e.variantId);return!n||n===e.url?e:{...e,url:n}},oce=()=>P.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-background flex h-full min-h-0 w-full flex-1 flex-col p-3",children:P.jsx("div",{className:"border-surface-2 relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:P.jsx(s4,{trackGlobalLoaderCount:!1})})}),ace=({isLoading:e=!1,isInteractionDisabled:t=!1})=>{const{config:n,retry:r,isLoading:s,error:i}=mle();return s?P.jsx(oce,{}):i||!n?P.jsx(a4,{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:()=>{Xe==null||Xe.capture("preview_config_retry_clicked"),r()}}]}):P.jsx(lce,{isLoading:e,isInteractionDisabled:t,framework:n.framework,userPort:n.userPort})};function lce(e){const t=_t(ml),n=_t(pd),r=_t(Xh),s=_t(dg),i=t==null?void 0:t.left,o=t==null?void 0:t.right,c=g.useMemo(()=>{var T,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const w=(T=i??o)==null?void 0:T.variantId,b=r.variants.filter(M=>{var A;return M.status==="succeeded"&&((A=M.preview)==null?void 0:A.kind)==="static_artifact"&&M.workItemId!==w}),S=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=b.find(M=>{var A;return((A=M.preview)==null?void 0:A.kind)==="static_artifact"&&(M.preview.url===S||vc({sessionId:r.sessionId,variant:M,projectContext:r.projectContext})===s)})??b[0];if(((O=C==null?void 0:C.preview)==null?void 0:O.kind)!=="static_artifact")return;const R=l4(r,r.sessionId,C.workItemId);if(R)return{sessionId:r.sessionId,variantId:C.workItemId,label:C.label,url:R,source:"live"}},[r,i,o,s]),u=FT(i,r)??(o?c:void 0),d=FT(o,r)??(i?c:void 0),f=!i&&!!u,p=!o&&!!d,m=!!(u||d),v=P.jsx(rce,{isInteractionDisabled:e.isInteractionDisabled,framework:e.framework,userPort:e.userPort});return P.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:P.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:[P.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&P.jsx($T,{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}`),P.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&&P.jsx($T,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),P.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),P.jsx(ice,{}),P.jsx(sce,{})]})})}const cce="/assets/google-g-CpxN0HWb.png",c4="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",u4="/assets/rivet-wordmark-orange-CYKVQDmG.svg",uce=({isSigningIn:e,onStartSignIn:t,errorMessage:n=null})=>P.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-[#111215] px-6 py-28 text-white",children:[P.jsx("header",{className:"absolute inset-x-0 top-10 flex justify-center",children:P.jsx("img",{src:u4,alt:"Rivet",className:"h-6 w-auto object-contain"})}),P.jsxs("div",{className:"flex min-h-80 w-full max-w-sm flex-col justify-center rounded-2xl border border-white/10 bg-white/[0.04] p-8 text-center shadow-2xl",children:[P.jsx("img",{src:c4,alt:"","aria-hidden":!0,className:"mx-auto mb-5 size-10 object-contain"}),P.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Sign in"}),P.jsx("p",{className:"mt-1 text-sm leading-6 text-white/60",children:"Welcome to Rivet."}),P.jsx(Rr,{variant:"primary",onClick:t,isLoading:e,className:"mt-7 w-full",children:P.jsxs("span",{className:"flex items-center gap-2",children:[P.jsx("img",{src:cce,alt:"","aria-hidden":!0,className:"size-5 object-contain p-0.5"}),P.jsx("span",{children:e?"Connecting…":"Sign in with Google"})]})}),n?P.jsx("p",{role:"alert",className:"mt-4 text-sm text-red-300",children:n}):null]})]}),dce=({message:e})=>P.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:P.jsxs("div",{className:"flex flex-col items-center gap-10",children:[P.jsx("img",{src:u4,alt:"Rivet",className:"h-8 w-auto object-contain"}),P.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[P.jsx(gx,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),P.jsx("span",{children:e})]})]})}),mg=44,Ef=8,Dm=16,fce=4,jT=-18,hce=.18,pce=[.22,1,.36,1],VT=.92,mce=1,gce=.95,vce=.4,yce=[.19,1,.22,1],__=0,_ce=1,wce=0,bce=0,xce=0,d4=({position:e,viewport:t,boundsLeft:n=0})=>{const r=n+Ef,s=Math.max(r,t.width-mg-Ef),i=Math.max(Ef,t.height-mg-Ef);return{x:Math.min(s,Math.max(r,e.x)),y:Math.min(i,Math.max(Ef,e.y))}},Jx=()=>({width:window.innerWidth,height:window.innerHeight}),Sce=({position:e,boundsLeftPx:t=0})=>d4({position:e,viewport:Jx(),boundsLeft:t}),Ece=()=>{if(typeof window>"u")return{x:Dm,y:Dm};const e=Jx();return{x:e.width-mg-Dm,y:e.height-mg-Dm}},kce=({deltaX:e,deltaY:t})=>Math.hypot(e,t)>=fce,Cce=e=>e.button===void 0||e.button<=xce,zT=e=>{const t=e.nativeEvent;return{x:Number.isFinite(e.clientX)?e.clientX:t.clientX,y:Number.isFinite(e.clientY)?e.clientY:t.clientY}},Pce=({isVisible:e,isPanelOpen:t,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const c=g.useRef(null),u=g.useRef(!1),[d,f]=g.useState(!1),[p,m]=g.useState(!1),[v,_]=g.useState(!1),w=n?!1:{opacity:__,scale:VT,x:jT},b=n?{opacity:__}:{opacity:__,scale:VT,x:jT},S=n?{duration:bce}:{duration:hce,ease:pce,scale:{duration:vce,ease:yce}},E=g.useCallback(()=>{const L=c.current;L&&(u.current=L.hasMoved),c.current=null,f(!1)},[]),C=g.useCallback(L=>{const V=c.current;if(!V)return;const W=zT(L),z=W.x-V.startPointer.x,X=W.y-V.startPointer.y,Q=V.hasMoved||kce({deltaX:z,deltaY:X});c.current={...V,hasMoved:Q},Q&&o(d4({position:{x:V.startPosition.x+z,y:V.startPosition.y+X},viewport:Jx(),boundsLeft:s}))},[o,s]),R=g.useCallback(L=>{if(c.current||!Cce(L))return;const V=zT(L);c.current={startPointer:V,startPosition:r,hasMoved:!1},f(!0)},[r]),T=g.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),O=t?D2:nae,M=qx(),A=!d&&(p||v);return P.jsxs(P.Fragment,{children:[d?P.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:C,onPointerUp:E,onPointerCancel:E,onMouseMove:C,onMouseUp:E}):null,P.jsx(Iu,{children:e?P.jsx(md,{label:O,side:"top",forceOpen:A?void 0:!1,children:P.jsx(Jo.button,{type:"button","aria-label":O,"aria-keyshortcuts":M.ariaKeyShortcuts,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onFocus:L=>_(L.currentTarget.matches(":focus-visible")),onBlur:()=>_(!1),initial:w,animate:{opacity:_ce,scale:mce,x:wce},whileTap:{scale:gce},exit:b,transition:S,onPointerDown:R,onMouseDown:R,onPointerMove:C,onPointerUp:E,onPointerCancel:E,onMouseMove:C,onMouseUp:E,onClick:T,className:`bg-background absolute z-50 flex h-11 w-11 touch-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)] outline-hidden transition-[background-color,border-color,box-shadow] duration-150 select-none hover:bg-[#2a2a2a] focus-visible:border-white/40 focus-visible:bg-[#2a2a2a] ${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:P.jsx("img",{src:c4,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},w_=Ls("useConfig"),Rce=300*1e3,Tce=1800*1e3,Ace=60*1e3,Ice=300*1e3,Oce=()=>{var e;return typeof window>"u"?null:((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.queueAccessToken)??null},Mce=()=>{var e;return typeof window>"u"?null:((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.agentApplyMode)??null},Lce=Ve({featureFlags:Rb(ne(),Ve({isEnabled:Rs()})).optional()}),$ce=async()=>{const e=await Dt("/api/feature-flags");if(!e.ok)throw new Error(`Failed to fetch feature flags: ${e.statusText}`);return Lce.parse(await e.json())},Nce=e=>({...yN,...e??{}}),Dce=()=>{const e=_t(M2),t=Lt(M2),n=Lt(CN),r=Lt(PN),s=Lt(Jg),i=Lt(Eoe),o=Lt(xoe),c=Lt(woe),u=Lt(Qg),d=Lt(_oe),f=Lt(boe),p=g.useCallback(S=>{o(S.agentModeAvailable),f(S.projectId??null),d({name:S.name??null,email:S.email??null}),S.isMCPSession&&n(!0),S.mcpEditor&&r(S.mcpEditor),s(S.agentApplyMode??Mce()??null),i(S.queueAccessToken??Oce())},[s,o,n,r,i,f,d]),m=_o({queryKey:Is.rivetConfig,queryFn:KN,staleTime:Rce,gcTime:Tce}),v=_o({queryKey:Is.featureFlags,queryFn:$ce,staleTime:Ace,gcTime:Ice}),{refetch:_}=m,{refetch:w}=v;g.useLayoutEffect(()=>{m.data&&(p(m.data),u(!1),w_.info("Config loaded:",m.data)),v.data&&(t(Nce(v.data.featureFlags)),c(!0)),m.error&&(c(!0),u(!1),w_.warn("Failed to load config:",m.error.message)),v.error&&(c(!0),w_.warn("Failed to load feature flags:",v.error.message))},[m.data,m.error,v.data,v.error,p,u,t,c]);const b=g.useCallback(async()=>{const[S]=await Promise.all([_(),w()]);return S.data?S.data:null},[_,w]);return{config:m.data??null,featureFlags:e,loading:m.isPending||!m.error&&v.isPending,error:m.error?m.error.message:null,refetchConfig:b}},hu=Ls("useOAuthCallback"),Fce=()=>{const[e,t]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var c,u,d;const i=window.location.hash,o=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){t({isProcessing:!0,isComplete:!1,error:null});try{hu.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),p=f.get("access_token"),m=f.get("refresh_token"),_=new URLSearchParams(o).get("session");if(!p)throw new Error("No access token found in URL");if(!_)throw new Error("No session ID found in URL");hu.info(`Completing OAuth with session: ${_}`);const w=await fetch(`${F2}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:_,accessToken:p,refreshToken:m}),signal:n.signal}),b=await w.json();if(!w.ok||!b.success)throw new Error(b.error||b.message||"Failed to complete authentication");if(hu.info("OAuth authentication completed successfully"),r)return;if(BO({userId:(c=b.user)==null?void 0:c.id,email:(u=b.user)==null?void 0:u.email}),(d=b.user)!=null&&d.email&&p)try{const E=await Dt("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b.user.email,token:p,refreshToken:m,userId:b.user.id}),signal:n.signal});E.ok||hu.warn(`Local auth store returned ${E.status}`)}catch(E){if(r)return;hu.warn("Failed to store auth locally:",E)}if(r)return;window.sessionStorage.setItem(pg,"1");const S=window.location.pathname;window.history.replaceState({},document.title,S),t({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;hu.warn("OAuth callback error:",f),t({isProcessing:!1,isComplete:!1,error:Ps(f,"Unknown error occurred")})}}})(),()=>{r=!0,n.abort()}},[]),e},jce=3e3,Vce=(e,t=Dt)=>{const n=new AbortController;let r;const s={onmessage:null,onerror:null,close:()=>{n.abort(),clearTimeout(r)}},i=async()=>{var c,u,d;let o=!1;try{const f=await t(e,{signal:n.signal,headers:{Accept:"text/event-stream"}});if(o=f.status===401||f.status===403,!f.ok||!f.body)throw await((c=f.body)==null?void 0:c.cancel()),new Error(`Event stream request failed (${f.status}).`);const p=f.body.getReader(),m=new TextDecoder;let v="",_=[];try{for(;!n.signal.aborted;){const w=await p.read();if(w.done)break;v+=m.decode(w.value,{stream:!0});let b=v.indexOf(`
|
|
201
|
+
`);for(;b!==-1;){const S=v.slice(0,b).replace(/\r$/,"");v=v.slice(b+1),S===""?(_.length>0&&!n.signal.aborted&&((u=s.onmessage)==null||u.call(s,{data:_.join(`
|
|
202
|
+
`)})),_=[]):S.startsWith("data:")&&_.push(S.slice(5).replace(/^ /,"")),b=v.indexOf(`
|
|
203
|
+
`)}}}finally{await p.cancel().catch(()=>{}),p.releaseLock()}}catch(f){n.signal.aborted||(d=s.onerror)==null||d.call(s,f)}!n.signal.aborted&&!o&&(r=setTimeout(()=>void i(),jce))};return i(),s},b_=Ls("useAgentVariantsSession"),zce=({enabled:e=!0}={})=>{const t=Lt(Xh),n=Lt(EN),r=Lt(_N),s=Lt(kN),i=g.useRef(null);g.useEffect(()=>{if(n(!1),!e)return;const o=Vce("/api/variants/events");return o.onmessage=c=>{try{const u=JSON.parse(c.data),d=i.current;if(u.active){const p=new Set(u.variants.map(m=>m.requestId).filter(m=>!!m));s(m=>m.filter(_=>!p.has(_.requestId))),u.sessionId!==i.current&&(i.current=u.sessionId,r(!0))}else i.current=null;t(u),n(!0),u.active&&u.sessionId!==d&&Dt(`/api/variants/${u.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(p=>b_.warn("failed to reset preview-port on session switch",p))}catch(u){b_.warn("failed to parse SSE event payload",u)}},o.onerror=c=>{b_.warn("SSE error (auto-reconnects)",c)},()=>{o.close()}},[e,t,n,r,s])},Hce=({name:e,projectPath:t})=>{const n=t==null?void 0:t.split(/[\\/]/).filter(Boolean).pop(),r=(e==null?void 0:e.trim())||n;return r?`${r} — Rivet`:"Rivet"},Uce=e=>(document.title=e,()=>{document.title="Rivet"}),H2=274,gg=395,x_=Math.min(gg,Math.round((H2+gg)/2*1.1)),HT="rivet:panelWidth:v2",Zce=({libraryOrigin:e})=>{const t=_t(bN)>0,[n,r]=YL(_N),s=Ys(),i=UQ(),o=g.useCallback(A=>{const L=!n;s==null||s.capture("editor.ui_toggled",{source:A,isOpen:L}),r(L)},[n,s,r]),[c,u]=g.useState(()=>{if(typeof window>"u")return x_;const A=Number(window.localStorage.getItem(HT));return Number.isFinite(A)&&A>=H2&&A<=gg?A:x_}),[d,f]=g.useState(!1),[p,m]=g.useState(Ece),v=n?c:0,_=n?ug.slow:ug.moderate,[w,b]=g.useState(n);!n&&w&&b(!1);const[S,E]=g.useState(0);v!==S&&(E(v),n&&m(A=>Sce({position:A,boundsLeftPx:c}))),g.useEffect(()=>{window.localStorage.setItem(HT,String(c))},[c]),g.useEffect(()=>{const A=L=>{if(!UL(L.target)){if(lae(L)){L.preventDefault(),o("shortcut");return}L.key!=="Escape"||!n||(L.preventDefault(),r(!1))}};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[n,r,o]);const C=g.useCallback(A=>{A.preventDefault(),A.stopPropagation();const L=A.clientX,V=c;f(!0);const W=X=>{const Q=Math.min(gg,Math.max(H2,V+(X.clientX-L)));u(Q)},z=()=>{window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",z),window.removeEventListener("pointercancel",z),f(!1)};window.addEventListener("pointermove",W),window.addEventListener("pointerup",z),window.addEventListener("pointercancel",z)},[c]),R=g.useCallback(()=>u(x_),[]),T=Fce(),O=_t(Qg);zce({enabled:!O});const M=T.isProcessing?"Completing authentication...":null;return P.jsxs(Jo.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[M!==null?P.jsx("div",{className:"absolute inset-0 z-50",children:P.jsx(dce,{message:M})}):null,P.jsx(ace,{}),P.jsx(P.Fragment,{children:t?null:P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:w?c:0},children:P.jsxs(Jo.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:n?0:-c},transition:i?{duration:0}:_,onAnimationComplete:()=>{n&&b(!0)},style:{width:c,willChange:"transform"},children:[P.jsx(ule,{onClose:()=>r(!1),libraryOrigin:e}),P.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:C,onDoubleClick:R,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:P.jsx("span",{className:`h-full transition-all duration-150 ${d?"bg-soft-foreground w-0.5":"bg-border-strong group-hover/resize:bg-soft-foreground w-px group-hover/resize:w-0.5"}`})})]})}),d&&P.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),P.jsx(Pce,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!i,position:p,dragBoundsLeftPx:v,onPositionChange:m,onToggle:()=>o("click")})]})}),P.jsx(xee,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},U2="rivet_connect_deep_link",Bce=()=>{if(typeof window>"u")return null;const e=new URLSearchParams(window.location.search),t=e.get("connect"),n=t??window.sessionStorage.getItem(U2);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(U2,n),t){e.delete("connect");const r=e.toString();window.history.replaceState(null,document.title,window.location.pathname+(r?`?${r}`:"")+window.location.hash)}return n},Wce=Bce(),Kce=()=>{const[e]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(pg)==="1"),[t,n]=g.useState(!1),[r,s]=g.useState(Wce);g.useEffect(()=>{e&&window.sessionStorage.removeItem(pg)},[e]);const{config:i,refetchConfig:o,loading:c,error:u}=Dce(),d=Lt(Xg);g.useEffect(()=>(d((i==null?void 0:i.projectPath)??null),Uce(Hce({name:i==null?void 0:i.projectName,projectPath:i==null?void 0:i.projectPath}))),[i==null?void 0:i.projectPath,i==null?void 0:i.projectName,d]);const f=Lt(Qg),{startLogin:p,isStartingLogin:m,loginError:v}=qN(),[_,w]=g.useState(!1);pJ(i??void 0),g.useEffect(()=>{i&&Xe.register({source:"visual_editor",surface:"visual_editor"})},[i]);const b=i!=null&&i.agentModeAvailable!==!0,S=g.useCallback(async()=>{w(!0),f(!0);try{await o()}finally{f(!1),w(!1)}},[o,f]);if(!c&&i===null&&!_){const T=u||"Could not load Rivet configuration.";return P.jsx("div",{className:"bg-background flex h-screen items-center justify-center px-6",children:P.jsxs("div",{className:"border-border-strong bg-background w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[P.jsx("p",{className:"text-foreground text-sm font-medium",children:"We could not start Rivet yet."}),P.jsx("p",{className:"text-soft-foreground mt-2 text-xs",children:T}),P.jsx("button",{type:"button",className:"border-border-strong text-foreground hover:bg-background/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{S()},children:"Retry"})]})})}if(b)return P.jsx(uce,{isSigningIn:m,onStartSignIn:()=>{p()},errorMessage:v});const C=(i==null?void 0:i.agentModeAvailable)===!0&&r!==null,R=(i==null?void 0:i.agentModeAvailable)===!0&&e&&!t&&!C;return P.jsxs(P.Fragment,{children:[P.jsx(Zce,{libraryOrigin:(i==null?void 0:i.libraryOrigin)??null}),P.jsx(j2,{context:"onboarding",isOpen:R,onClose:()=>n(!0)}),P.jsx(j2,{context:"menu",isOpen:C,highlightProvider:r,onClose:()=>{window.sessionStorage.removeItem(U2),s(null)}})]})};JD();const Gce=g.lazy(()=>BD(()=>import("./LibraryEntry-B8-RtQpK.js"),[])),eS=window.location.pathname.startsWith("/rivet/library");eS||aJ();const qce=new LK,Yce=()=>P.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:P.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})}),f4=document.getElementById("root");if(!f4)throw new Error("Rivet root element is missing");const Xce=()=>hJ.createRoot(f4).render(P.jsx(Ee.StrictMode,{children:P.jsx(jX,{reducedMotion:"user",children:P.jsx(KQ,{client:Xe,children:P.jsx(JQ,{fallback:P.jsx(Yce,{}),children:P.jsx(lK,{client:qce,children:eS?P.jsx(g.Suspense,{fallback:P.jsx("div",{className:"bg-background h-screen"}),children:P.jsx(Gce,{})}):P.jsx(Kce,{})})})})})})),Qce=async()=>{eS&&await JW(),await aK(),Xce()};Qce();export{Ab as $,Gg as A,Rr as B,en as C,Kg as D,Ps as E,c4 as F,Cd as G,nte as H,Jee as I,UO as J,_o as K,E$ as L,Bx as M,Is as N,Xee as O,nue as P,RK as Q,th as R,xd as S,Eh as T,Ve as U,tue as V,eue as W,Rt as X,Hh as Y,Pn as Z,ne as _,$K as a,Rs as a0,kue as a1,Cue as a2,eK as a3,vae as a4,ir as a5,sM as a6,oue as a7,iue as a8,pJ as a9,mue as aA,wue as aa,Hce as ab,bue as ac,Uce as ad,gx as ae,cle as af,xee as ag,fue as ah,hue as ai,cae as aj,due as ak,lue as al,aue as am,sue as an,rue as ao,cue as ap,uue as aq,vue as ar,gue as as,pue as at,qN as au,uce as av,Dt as aw,DO as ax,QW as ay,XW as az,FK as b,g as c,jK as d,HK as e,VK as f,us as g,UK as h,ZK as i,zK as j,Ys as k,P as l,h2 as m,pr as n,Yg as o,Ln as p,Qee as q,YO as r,Gm as s,Wx as t,Uh as u,ja as v,u$ as w,b$ as x,qg as y,Tie as z};
|
|
204
|
+
//# sourceMappingURL=main-BGCGsyhl.js.map
|